feat: asset详细视图 基本功能实现
This commit is contained in:
@@ -8,12 +8,62 @@ export default {
|
||||
},
|
||||
tableId: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
detailViewRightObj: {},
|
||||
orderByFa: {}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
orderBy: '',
|
||||
orderType: 'ascending',
|
||||
renderFirst: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
detailViewRightShow (item) {
|
||||
this.$emit('detailViewRightShow', item)
|
||||
},
|
||||
orderTypeChange () {
|
||||
if (this.orderType === 'ascending') {
|
||||
this.orderType = 'descending'
|
||||
} else {
|
||||
this.orderType = 'ascending'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
orderByFa: {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
console.log(n)
|
||||
const index = n.indexOf('-')
|
||||
this.renderFirst = false
|
||||
if (index !== -1) {
|
||||
this.orderBy = n.slice(index + 1)
|
||||
this.orderType = 'descending'
|
||||
} else {
|
||||
this.orderBy = n
|
||||
this.orderType = 'ascending'
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.renderFirst = true
|
||||
})
|
||||
}
|
||||
},
|
||||
orderBy: {
|
||||
handler (n) {
|
||||
console.log(n)
|
||||
if (this.renderFirst) {
|
||||
this.$emit('orderDetail', this.orderBy, this.orderType)
|
||||
}
|
||||
}
|
||||
},
|
||||
orderType: {
|
||||
handler (n) {
|
||||
if (this.renderFirst) {
|
||||
this.$emit('orderDetail', this.orderBy, n)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user