Vue.component('vi-title', {
props: ['title'],
template: `
`
})
Vue.component('vi-title2', {
props: ['title'],
template: `
`
})
Vue.component('vi-table-state', {
props: ['state'],
template: `
{{ state.stateName }}
`
})
Vue.component('more', {
props: {more: {type: Boolean, default: false}},
template: `
{{ more ? '收起' : '展开' }}
`,
model: {
prop: 'more',
event: 'change'
}
})
Vue.component('table-tool', {
props: {
label: {type: String},
app: {}
},
data() {
return {
checkedFields: [],
columns: [],
}
},
methods: {
tableSizeChange(command) {
const {size} = command
this.app.tableSizeChange(size)
},
columnChange() {
this.app.columnChange(this.columns.filter(v => this.checkedFields.includes(v.prop)))
},
getColumns() {
const {tableColumns} = this.app
if (!tableColumns) {
return
}
this.columns = tableColumns
this.checkedFields = this.columns.filter(v => v.checked !== 0).map(v => v.prop)
this.columnChange()
},
},
created() {
this.getColumns()
},
template: `
`,
})