mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
perf: json many to many
This commit is contained in:
@@ -68,8 +68,12 @@ export default {
|
||||
const url = setUrlParam(this.attr.el.url, 'ids', this.cellValue.join(','))
|
||||
const data = await this.$axios.get(url) || []
|
||||
if (data.length > 0) {
|
||||
const displayField = this.attr.el.displayField || 'name'
|
||||
this.value = data.map(item => item[displayField]).join(', ')
|
||||
if (this.attr.name === 'labels') {
|
||||
this.value = data.map(item => `${item.name}:${item.value}`).join(', ')
|
||||
} else {
|
||||
const displayField = this.attr.el.displayField || 'name'
|
||||
this.value = data.map(item => item[displayField]).join(', ')
|
||||
}
|
||||
}
|
||||
} else if (this.attr.type === 'select') {
|
||||
const options = this.attr.el.options || []
|
||||
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
this.showLabelSearch = true
|
||||
return
|
||||
}
|
||||
this.labelValue = [[label.name, label.value]]
|
||||
this.labelValue = [...this.labelValue, [label.name, label.value]]
|
||||
this.getLabelOptions()
|
||||
setTimeout(() => {
|
||||
this.showLabelSearch = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<DataActions
|
||||
v-if="hasLeftActions"
|
||||
v-if="hasLeftActions && iActions.length > 0"
|
||||
:actions="iActions"
|
||||
class="header-action"
|
||||
v-bind="$attrs"
|
||||
@@ -188,6 +188,9 @@ export default {
|
||||
return this.selectedRows.length > 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$emit('init-actions-done', this.iActions)
|
||||
},
|
||||
methods: {
|
||||
handleCreate() {
|
||||
let route
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
class="left-side"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
@init-actions-done="handleActionsDone"
|
||||
/>
|
||||
<RightSide
|
||||
v-if="hasRightActions"
|
||||
@@ -99,7 +100,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
foldSearch: false
|
||||
foldSearch: false,
|
||||
iHasLeftActions: this.hasLeftActions
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -119,7 +121,7 @@ export default {
|
||||
return ''
|
||||
},
|
||||
searchClass() {
|
||||
return this.hasLeftActions ? 'right' : 'left'
|
||||
return this.iHasLeftActions ? 'right' : 'left'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -138,6 +140,9 @@ export default {
|
||||
},
|
||||
handleLabelSearchShowChange(val) {
|
||||
this.foldSearch = val
|
||||
},
|
||||
handleActionsDone(actions) {
|
||||
this.iHasLeftActions = actions.filter(i => i && i.has !== false).length > 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ export default {
|
||||
this.selectedRows = val
|
||||
},
|
||||
reloadTable() {
|
||||
this.dataTable.getList()
|
||||
this.dataTable?.getList()
|
||||
},
|
||||
search(attrs) {
|
||||
this.$log.debug('ListTable: search table', attrs)
|
||||
|
||||
Reference in New Issue
Block a user