feat(ui): attribute association - many-to-many cannot all be multi-value

This commit is contained in:
LH_R
2025-08-15 21:34:01 +08:00
parent 0b1dfa4538
commit bb467030e2
5 changed files with 12 additions and 3 deletions

View File

@@ -230,6 +230,7 @@ const cmdb_en = {
attributeAssociationTip6: 'Cannot be deleted again.',
attributeAssociationTip7: '1. The attribute value types of the source model and target model must be consistent.',
attributeAssociationTip8: '2. One To Many: Source model can select multiple value attributes',
attributeAssociationTip9: '3. Many To Many: Either the source model or the target model can be a multi-valued attribute.',
show: 'show attribute',
setAsShow: 'Set as show attribute',
cancelSetAsShow: 'Cancel show attribute',

View File

@@ -230,6 +230,7 @@ const cmdb_zh = {
attributeAssociationTip6: '不可再删除',
attributeAssociationTip7: '1. 源模型和目标模型的属性值类型必须保持一致',
attributeAssociationTip8: '2. 一对多:源模型可选多值属性',
attributeAssociationTip9: '3. 多对多:源模型和目标模型其中任何一个可为多值属性',
show: '展示属性',
setAsShow: '设置为展示属性',
cancelSetAsShow: '取消设置为展示属性',

View File

@@ -55,6 +55,7 @@
<div>{{ $t('cmdb.ciType.attributeAssociationTip1') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip7') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip8') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip9') }}</div>
</template>
<a><a-icon type="question-circle"/></a>
</a-tooltip>
@@ -228,6 +229,7 @@
<template #extra>
<div>{{ $t('cmdb.ciType.attributeAssociationTip7') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip8') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip9') }}</div>
</template>
<a-row
v-for="item in modalAttrList"
@@ -652,7 +654,8 @@ export default {
const constraintValue = Number(constraint ?? this.form.getFieldValue('constraint'))
if (
(constraintValue === 0 && type === 'child') ||
constraintValue === 1
constraintValue === 1 ||
(constraintValue === 2 && relationAttr?.is_list)
) {
return filterAttrs.filter((attr) => !attr.is_list)
}

View File

@@ -67,6 +67,7 @@
<template #extra>
<div>{{ $t('cmdb.ciType.attributeAssociationTip7') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip8') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip9') }}</div>
</template>
<a-row
v-for="item in modalAttrList"
@@ -387,7 +388,8 @@ export default {
const constraintValue = Number(this.form.getFieldValue('constraint'))
if (
(constraintValue === 0 && type === 'child') ||
constraintValue === 1
constraintValue === 1 ||
(constraintValue === 2 && relationAttr?.is_list)
) {
return filterAttrs.filter((attr) => !attr.is_list)
}

View File

@@ -43,6 +43,7 @@
<div>{{ $t('cmdb.ciType.attributeAssociationTip1') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip7') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip8') }}</div>
<div>{{ $t('cmdb.ciType.attributeAssociationTip9') }}</div>
</template>
<a><a-icon type="question-circle"/></a>
</a-tooltip>
@@ -327,7 +328,8 @@ export default {
const constraintValue = Number(constraint)
if (
(constraintValue === 0 && type === 'child') ||
constraintValue === 1
constraintValue === 1 ||
(constraintValue === 2 && relationAttr?.is_list)
) {
return filterAttrs.filter((attr) => !attr.is_list)
}