mirror of https://github.com/veops/cmdb.git
fix:is_list edit bug (#312)
* feat(ui):auth setting * fix:is_list edit bug
This commit is contained in:
parent
c89ebf6518
commit
faeb9a04f9
|
@ -108,7 +108,7 @@
|
|||
<span>{{ col.title }}</span>
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="col.is_choice || col.is_password" #edit="{ row }">
|
||||
<template v-if="col.is_choice || col.is_password || col.is_list" #edit="{ row }">
|
||||
<vxe-input v-if="col.is_password" v-model="passwordValue[col.field]" />
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||
|
@ -145,6 +145,18 @@
|
|||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||
:style="{ width: '100%', height: '32px' }"
|
||||
v-model="row[col.field]"
|
||||
placeholder="请选择"
|
||||
v-else-if="col.is_list"
|
||||
:showArrow="false"
|
||||
mode="tags"
|
||||
class="ci-table-edit-select"
|
||||
allowClear
|
||||
>
|
||||
</a-select>
|
||||
</template>
|
||||
<template
|
||||
v-if="col.value_type === '6' || col.is_link || col.is_password || col.is_choice"
|
||||
|
|
|
@ -59,6 +59,9 @@
|
|||
{{ ci[attr.name] }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else-if="attr.is_list">
|
||||
<span> {{ ci[attr.name].join(',') }}</span>
|
||||
</template>
|
||||
<template v-else>{{ getName(ci[attr.name]) }}</template>
|
||||
</span>
|
||||
<template v-else>
|
||||
|
@ -75,7 +78,6 @@
|
|||
placeholder="请选择"
|
||||
v-if="attr.is_choice"
|
||||
:mode="attr.is_list ? 'multiple' : 'default'"
|
||||
:multiple="attr.is_list"
|
||||
showSearch
|
||||
allowClear
|
||||
size="small"
|
||||
|
@ -103,6 +105,23 @@
|
|||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-select
|
||||
:style="{ width: '100%' }"
|
||||
v-decorator="[
|
||||
attr.name,
|
||||
{
|
||||
rules: [{ required: attr.is_required }],
|
||||
},
|
||||
]"
|
||||
placeholder="请选择"
|
||||
v-else-if="attr.is_list"
|
||||
mode="tags"
|
||||
showSearch
|
||||
allowClear
|
||||
size="small"
|
||||
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||
>
|
||||
</a-select>
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-decorator="[
|
||||
|
@ -222,7 +241,7 @@ export default {
|
|||
this.$nextTick(async () => {
|
||||
if (this.attr.is_list && !this.attr.is_choice) {
|
||||
this.form.setFieldsValue({
|
||||
[`${this.attr.name}`]: this.ci[this.attr.name].join(',') || null,
|
||||
[`${this.attr.name}`]: this.ci[this.attr.name]|| null,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
placeholder="请选择"
|
||||
v-if="attr.is_choice"
|
||||
:mode="attr.is_list ? 'multiple' : 'default'"
|
||||
:multiple="attr.is_list"
|
||||
showSearch
|
||||
allowClear
|
||||
>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
:expandedKeys="expandedKeys"
|
||||
>
|
||||
<a-icon slot="switcherIcon" type="down" />
|
||||
<template #title="{ key: treeKey, title,isLeaf }">
|
||||
<template #title="{ key: treeKey, title, isLeaf }">
|
||||
<ContextMenu
|
||||
:title="title"
|
||||
:treeKey="treeKey"
|
||||
|
@ -58,12 +58,8 @@
|
|||
/>
|
||||
<div class="relation-views-right-bar">
|
||||
<a-space>
|
||||
<a-button
|
||||
v-if="isLeaf"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="$refs.create.handleOpen(true, 'create')"
|
||||
>新建</a-button
|
||||
<a-button v-if="isLeaf" type="primary" size="small" @click="$refs.create.handleOpen(true, 'create')"
|
||||
>新建</a-button
|
||||
>
|
||||
|
||||
<div class="ops-list-batch-action" v-if="isLeaf && isShowBatchIcon">
|
||||
|
@ -135,7 +131,7 @@
|
|||
{{ col.title }}</span
|
||||
>
|
||||
</template>
|
||||
<template v-if="col.is_choice || col.is_password" #edit="{ row }">
|
||||
<template v-if="col.is_choice || col.is_password || col.is_list" #edit="{ row }">
|
||||
<vxe-input v-if="col.is_password" v-model="passwordValue[col.field]" />
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||
|
@ -172,6 +168,18 @@
|
|||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||
:style="{ width: '100%', height: '32px' }"
|
||||
v-model="row[col.field]"
|
||||
placeholder="请选择"
|
||||
v-else-if="col.is_list"
|
||||
:showArrow="false"
|
||||
mode="tags"
|
||||
class="ci-table-edit-select"
|
||||
allowClear
|
||||
>
|
||||
</a-select>
|
||||
</template>
|
||||
<template
|
||||
v-if="col.value_type === '6' || col.is_link || col.is_password || col.is_choice"
|
||||
|
@ -483,11 +491,11 @@ export default {
|
|||
},
|
||||
inject: ['reload'],
|
||||
watch: {
|
||||
'$route.path': function(newPath, oldPath) {
|
||||
'$route.path': function (newPath, oldPath) {
|
||||
this.viewId = this.$route.params.viewId
|
||||
this.reload()
|
||||
},
|
||||
pageNo: function(newPage, oldPage) {
|
||||
pageNo: function (newPage, oldPage) {
|
||||
this.loadData({ pageNo: newPage }, undefined, this.sortByTable)
|
||||
},
|
||||
},
|
||||
|
|
|
@ -14,16 +14,12 @@
|
|||
}
|
||||
"
|
||||
class="cmdb-views-header-metadata"
|
||||
><a-icon type="info-circle" />
|
||||
><a-icon type="info-circle" />
|
||||
属性说明
|
||||
</span>
|
||||
</span>
|
||||
<a-button
|
||||
size="small"
|
||||
icon="plus"
|
||||
type="primary"
|
||||
@click="$refs.create.handleOpen(true, 'create')"
|
||||
>新建</a-button
|
||||
<a-button size="small" icon="plus" type="primary" @click="$refs.create.handleOpen(true, 'create')"
|
||||
>新建</a-button
|
||||
>
|
||||
</div>
|
||||
<SplitPane
|
||||
|
@ -193,7 +189,7 @@
|
|||
{{ col.title }}</span
|
||||
>
|
||||
</template>
|
||||
<template v-if="col.is_choice || col.is_password" #edit="{ row }">
|
||||
<template v-if="col.is_choice || col.is_password || col.is_list" #edit="{ row }">
|
||||
<vxe-input v-if="col.is_password" v-model="passwordValue[col.field]" />
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||
|
@ -230,6 +226,18 @@
|
|||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||
:style="{ width: '100%', height: '32px' }"
|
||||
v-model="row[col.field]"
|
||||
placeholder="请选择"
|
||||
v-else-if="col.is_list"
|
||||
:showArrow="false"
|
||||
mode="tags"
|
||||
class="ci-table-edit-select"
|
||||
allowClear
|
||||
>
|
||||
</a-select>
|
||||
</template>
|
||||
<template
|
||||
v-if="col.value_type === '6' || col.is_link || col.is_password || col.is_choice"
|
||||
|
@ -504,7 +512,7 @@ export default {
|
|||
},
|
||||
},
|
||||
watch: {
|
||||
'$route.path': function(newPath, oldPath) {
|
||||
'$route.path': function (newPath, oldPath) {
|
||||
this.newLoad = true
|
||||
this.typeId = this.$route.params.typeId
|
||||
this.initPage()
|
||||
|
@ -972,7 +980,10 @@ export default {
|
|||
const $table = this.$refs['xTable'].getVxetableRef()
|
||||
const data = {}
|
||||
this.columns.forEach((item) => {
|
||||
if (!(item.field in this.initialPasswordValue) && !_.isEqual(row[item.field], this.initialInstanceList[rowIndex][item.field])) {
|
||||
if (
|
||||
!(item.field in this.initialPasswordValue) &&
|
||||
!_.isEqual(row[item.field], this.initialInstanceList[rowIndex][item.field])
|
||||
) {
|
||||
data[item.field] = row[item.field] ?? null
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue