diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue
index 952e4d8..b4ae78e 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue
@@ -10,7 +10,10 @@
{{ valueTypeMap[property.value_type] }}
-
@@ -47,7 +50,7 @@
-
+
@@ -56,7 +59,7 @@
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue
index 3275e67..8bb5dfc 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue
@@ -25,47 +25,71 @@
class="ops-button-primary"
>分组
-
-
+ {
+ $refs.attributeStore.open()
+ }
+ "
+ >属性库
- 导入
-
- 导出
+
+
+
+
+
+ 导入
+
+
+
+
+
+ 导出
+
+
+
+
@@ -185,8 +209,12 @@
- 正序
- 倒序
+
+ 正序
+
+
+ 倒序
+
@@ -230,6 +258,7 @@
+
@@ -257,6 +286,7 @@ import IconArea from './iconArea.vue'
import SplitPane from '@/components/SplitPane'
import CMDBGrant from '../../components/cmdbGrant'
import { ops_move_icon as OpsMoveIcon } from '@/core/icons'
+import AttributeStore from './attributeStore.vue'
export default {
name: 'CITypes',
@@ -270,6 +300,7 @@ export default {
IconArea,
SplitPane,
OpsMoveIcon,
+ AttributeStore,
},
data() {
return {
@@ -589,7 +620,6 @@ export default {
}
},
async handleChangeCITypes(e, g) {
- console.log(111, g)
if (g.id && g.id !== -1) {
putCITypeGroupByGId(g.id, { name: g.name, type_ids: g.ci_types.map((i) => i.id) })
.then(() => {
@@ -613,7 +643,6 @@ export default {
const { type_id } = await createCIType(data).catch(() => {
this.loading = false
})
- console.log(111)
this.$message.success(`添加成功`)
if (this.selectGroup && this.selectGroup.id && this.selectGroup.id !== -1) {
const ids = this.selectGroup.ci_types.map((i) => i.id)
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/newCiTypeAttrModal.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/newCiTypeAttrModal.vue
index 46dcb1e..33981da 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/newCiTypeAttrModal.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/newCiTypeAttrModal.vue
@@ -91,13 +91,8 @@ export default {
})
},
},
- beforeMount() {
- this.loadTotalAttrs()
- },
methods: {
async handleSubmit(isCloseModal = true) {
- console.log(this.targetKeys)
-
if (this.activeKey === '2') {
if (this.targetKeys.length) {
this.confirmLoading = true
@@ -125,6 +120,7 @@ export default {
this.visible = true
this.currentGroup = group
this.activeKey = '1'
+ this.loadTotalAttrs()
this.$nextTick(() => {
this.$refs.createNewAttribute.checkCanDefineComputed()
})
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/triggerForm.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/triggerForm.vue
index 9125d6d..5c84d13 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/triggerForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/triggerForm.vue
@@ -90,7 +90,12 @@ export default {
)
},
},
- inject: ['refresh'],
+ inject: {
+ refresh: {
+ from: 'refresh',
+ default: null,
+ },
+ },
methods: {
createFromTriggerTable(canAddTriggerAttr) {
this.visible = true
@@ -163,7 +168,9 @@ export default {
await addTrigger(this.CITypeId, params)
}
this.handleCancel()
- this.refresh()
+ if (this.refresh) {
+ this.refresh()
+ }
}
})
},
@@ -176,7 +183,9 @@ export default {
deleteTrigger(that.CITypeId, that.triggerId).then(() => {
that.$message.success('删除成功!')
that.handleCancel()
- that.refresh()
+ if (that.refresh) {
+ that.refresh()
+ }
})
},
})
diff --git a/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue b/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue
index bb7c360..437167a 100644
--- a/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue
@@ -1,65 +1,63 @@
-
-
- 新增关系
-
-
-
-
-
- {{
- CIType.alias || CIType.name
- }}
-
-
-
-
-
- {{ CIType.alias || CIType.name }}
-
-
-
+
+
新增关系
+
+
+
+
+
+ {{
+ CIType.alias || CIType.name
+ }}
+
+
+
+
+
+ {{ CIType.alias || CIType.name }}
+
+
+
-
-
- {{
- relationType.name
- }}
-
-
+
+
+ {{
+ relationType.name
+ }}
+
+
-
-
- 一对多
- 一对一
- 多对多
-
-
-
-
-
+
+
+ 一对多
+ 一对一
+ 多对多
+
+
+
+
@@ -110,16 +108,13 @@ export default {
},
mounted() {
const _currentId = localStorage.getItem('ops_cityps_currentId')
- console.log(_currentId)
if (_currentId) {
this.currentId = _currentId
}
searchResourceType({ page_size: 9999, app_id: 'cmdb' }).then((res) => {
- console.log('searchResourceType', res)
this.resource_type = { groups: res.groups, id2perms: res.id2perms }
})
this.loadCITypes(!_currentId)
- console.log(this.CITypeId)
},
computed: {
currentCId() {
@@ -168,7 +163,6 @@ export default {
},
getCITypes() {
getCITypes().then((res) => {
- console.log('getCITypes', res.ci_types)
this.CITypes = res.ci_types
})
},
@@ -196,9 +190,6 @@ export default {
e.preventDefault()
this.form.validateFields((err, values) => {
if (!err) {
- // eslint-disable-next-line no-console
- console.log('Received values of form: ', values)
-
createRelation(values.source_ci_type_id, values.ci_type_id, values.relation_type_id, values.constraint).then(
(res) => {
this.$message.success(`添加成功`)
@@ -215,8 +206,6 @@ export default {
this.$refs.table.refresh()
},
handleDelete(record) {
- console.log(record)
-
deleteRelation(record.source_ci_type_id, record.id).then((res) => {
this.$message.success(`删除成功!`)
@@ -236,4 +225,12 @@ export default {
}
-
+
diff --git a/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue b/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
index ca6e1e5..05901e3 100644
--- a/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
+++ b/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
@@ -1,12 +1,13 @@