|
|
@@ -6,12 +6,12 @@ meta:
|
|
|
<script lang="ts" setup name="PagesExampleTable">
|
|
|
import type { TabsPaneContext } from 'element-plus'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import ObjectOAMComponent from './components/objectOAM.vue'
|
|
|
-import ObjectOAMRuleComponent from './components/objectOAMRule.vue'
|
|
|
+import ObjectOAMComponent from './components/ObjectOAM.vue'
|
|
|
+import ObjectOAMRuleComponent from './components/ObjectOAMRule.vue'
|
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
|
import { getObjectById } from '@/api/biz/bizObjectApi'
|
|
|
import { deleteObjectOAMById, getObjectOAMById, getObjectOAMByList } from '@/api/biz/bizObjectOAMApi'
|
|
|
-import { getObjectOAMRuleListByOamId } from '@/api/biz/bizObjectOAMRuleApi'
|
|
|
+import { getObjectOAMRuleListByOamId, deleteObjectOAMRuleById } from '@/api/biz/bizObjectOAMRuleApi'
|
|
|
import { oamType, sqlType } from '@/utils/tool'
|
|
|
|
|
|
const settingsStore = useSettingsStore()
|
|
|
@@ -130,6 +130,7 @@ const onTreeNodeClick = (node: TreeNode) => {
|
|
|
if (node.isLeaf) {
|
|
|
state.curOamId = node.oamId
|
|
|
getObjectOAMData()
|
|
|
+ getObjectOAMRuleList()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -162,7 +163,7 @@ const onSuccess = () => {
|
|
|
const activeName = ref('first')
|
|
|
|
|
|
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|
|
- console.log(tab, event)
|
|
|
+ // console.log(tab, event)
|
|
|
}
|
|
|
|
|
|
const objectOAMRuleRef = ref()
|
|
|
@@ -178,8 +179,16 @@ const onObjectOAMRuleEdit = (row: { orId: number }) => {
|
|
|
objectOAMRuleRef.value.showEditModel(bizId, objectId, state.curOamId, row.orId)
|
|
|
}
|
|
|
|
|
|
-const onObjectOAMRuleDelete = (row: { }) => {
|
|
|
-
|
|
|
+const onObjectOAMRuleDelete = (row: { bizId: number; objectId: number; oamId: number; orId: number; ruleTitle: string }) => {
|
|
|
+ const { bizId, objectId, oamId, orId, ruleTitle } = row
|
|
|
+ ElMessageBox.confirm(`确认删除「${ruleTitle}」吗?`, '确认信息').then(async () => {
|
|
|
+ await deleteObjectOAMRuleById(bizId, objectId, oamId, orId)
|
|
|
+ await getObjectOAMRuleList()
|
|
|
+ ElMessage.success({
|
|
|
+ message: '删除成功',
|
|
|
+ center: true,
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
// 返回列表页
|
|
|
function goBack() {
|
|
|
@@ -304,8 +313,13 @@ function goBack() {
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="ruleTitle" label="规则" header-align="center" align="center" width="150" />
|
|
|
+ <el-table-column prop="attrTitle" label="属性" header-align="center" align="center" width="250">
|
|
|
+ <template #default="scope">
|
|
|
+ <span> {{ scope.row.targetAttrTitle }}-{{ scope.row.targetAttrCode }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
+ <el-table-column prop="ruleTitle" label="规则" header-align="center" align="center" width="150" />
|
|
|
|
|
|
<el-table-column label="操作" header-align="center" align="center" width="230">
|
|
|
<template #default="scope">
|