mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-01 07:01:26 +00:00
fix(list): 修复列表克隆的bug
This commit is contained in:
parent
40a8da5e58
commit
70affacfde
@ -44,11 +44,31 @@ export default {
|
|||||||
dataTable() {
|
dataTable() {
|
||||||
return this.$refs.dataTable.$refs.dataTable
|
return this.$refs.dataTable.$refs.dataTable
|
||||||
},
|
},
|
||||||
|
hasCreateAction() {
|
||||||
|
const hasLeftAction = this.headerActions.hasLeftActions
|
||||||
|
if (hasLeftAction === false) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const hasCreate = this.headerActions.hasCreate
|
||||||
|
if (hasCreate === false) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
hasCloneAction() {
|
||||||
|
const hasClone = _.get(this.tableConfig, 'columnsMeta.actions.formatterArgs.hasClone', null)
|
||||||
|
if (hasClone) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.hasCreateAction && hasClone == null) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
iTableConfig() {
|
iTableConfig() {
|
||||||
const config = deepmerge(this.tableConfig, { extraQuery: this.extraQuery })
|
const config = deepmerge(this.tableConfig, { extraQuery: this.extraQuery })
|
||||||
let hasClone = _.get(config, 'columnsMeta.actions.formatterArgs.hasClone', null)
|
this.$log.debug('Header actions', this.headerActions)
|
||||||
hasClone = !!(this.headerActions.hasCreate && hasClone == null)
|
_.set(config, 'columnsMeta.actions.formatterArgs.hasClone', this.hasCloneAction)
|
||||||
_.set(config, 'columnsMeta.actions.formatterArgs.hasClone', hasClone)
|
|
||||||
this.$log.debug('ListTable: iTableConfig change', config)
|
this.$log.debug('ListTable: iTableConfig change', config)
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user