|
@@ -7,9 +7,11 @@ meta:
|
|
|
import type { TabsPaneContext } from 'element-plus'
|
|
import type { TabsPaneContext } from 'element-plus'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import ObjectOAMComponent from './components/objectOAM.vue'
|
|
import ObjectOAMComponent from './components/objectOAM.vue'
|
|
|
|
|
+import ObjectOAMRuleComponent from './components/objectOAMRule.vue'
|
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
|
import { getObjectById } from '@/api/biz/bizObjectApi'
|
|
import { getObjectById } from '@/api/biz/bizObjectApi'
|
|
|
import { deleteObjectOAMById, getObjectOAMById, getObjectOAMByList } from '@/api/biz/bizObjectOAMApi'
|
|
import { deleteObjectOAMById, getObjectOAMById, getObjectOAMByList } from '@/api/biz/bizObjectOAMApi'
|
|
|
|
|
+import { getObjectOAMRuleListByOamId } from '@/api/biz/bizObjectOAMRuleApi'
|
|
|
import { oamType, sqlType } from '@/utils/tool'
|
|
import { oamType, sqlType } from '@/utils/tool'
|
|
|
|
|
|
|
|
const settingsStore = useSettingsStore()
|
|
const settingsStore = useSettingsStore()
|
|
@@ -53,7 +55,7 @@ const state = reactive({
|
|
|
keywords: '',
|
|
keywords: '',
|
|
|
curOamId: 0,
|
|
curOamId: 0,
|
|
|
oamList: [],
|
|
oamList: [],
|
|
|
- objectRuleList: [],
|
|
|
|
|
|
|
+ objectOamRuleList: [],
|
|
|
treeData: [] as TreeNode[],
|
|
treeData: [] as TreeNode[],
|
|
|
oam: {} as ObjectOAM,
|
|
oam: {} as ObjectOAM,
|
|
|
dialogState: 1,
|
|
dialogState: 1,
|
|
@@ -87,8 +89,19 @@ const getObjectOAMData = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const getObjectOAMRuleList = async () => {
|
|
|
|
|
+ const curOamId = state.curOamId
|
|
|
|
|
+ if (curOamId > 0) {
|
|
|
|
|
+ state.loading = true
|
|
|
|
|
+ const { data } = await getObjectOAMRuleListByOamId(bizId, objectId, curOamId)
|
|
|
|
|
+ state.objectOamRuleList = data
|
|
|
|
|
+ state.loading = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const getOAMTree = async () => {
|
|
const getOAMTree = async () => {
|
|
|
const { data } = await getObjectOAMByList(state.search)
|
|
const { data } = await getObjectOAMByList(state.search)
|
|
|
|
|
+ state.treeData = []
|
|
|
data.forEach((item: any) => {
|
|
data.forEach((item: any) => {
|
|
|
state.treeData.push({
|
|
state.treeData.push({
|
|
|
label: item.oamTitle,
|
|
label: item.oamTitle,
|
|
@@ -103,6 +116,7 @@ const getOAMTree = async () => {
|
|
|
leftTreeRef.value.setCurrentKey(data[0].oamId)
|
|
leftTreeRef.value.setCurrentKey(data[0].oamId)
|
|
|
})
|
|
})
|
|
|
await getObjectOAMData()
|
|
await getObjectOAMData()
|
|
|
|
|
+ await getObjectOAMRuleList()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -128,10 +142,10 @@ const onEditOAM = () => {
|
|
|
objectOAMRef.value.showEditModel(bizId, objectId, state.curOamId)
|
|
objectOAMRef.value.showEditModel(bizId, objectId, state.curOamId)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onDelete = (data: { modelId: number; objectId: number; oamId: number; oamTitle: string }) => {
|
|
|
|
|
- const { modelId, objectId, oamId, oamTitle } = data
|
|
|
|
|
|
|
+const onDeleteOAM = (data: { bizId: number; objectId: number; oamId: number; oamTitle: string }) => {
|
|
|
|
|
+ const { bizId, objectId, oamId, oamTitle } = data
|
|
|
ElMessageBox.confirm(`确认删除「${oamTitle}」吗?`, '确认信息').then(async () => {
|
|
ElMessageBox.confirm(`确认删除「${oamTitle}」吗?`, '确认信息').then(async () => {
|
|
|
- await deleteObjectOAMById(modelId, objectId, oamId)
|
|
|
|
|
|
|
+ await deleteObjectOAMById(bizId, objectId, oamId)
|
|
|
await getOAMTree()
|
|
await getOAMTree()
|
|
|
ElMessage.success({
|
|
ElMessage.success({
|
|
|
message: '删除成功',
|
|
message: '删除成功',
|
|
@@ -151,17 +165,21 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|
|
console.log(tab, event)
|
|
console.log(tab, event)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onObjectRuleSearch = () => {
|
|
|
|
|
|
|
+const objectOAMRuleRef = ref()
|
|
|
|
|
+const onObjectOAMRuleSearch = () => {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onObjectRuleAdd = () => {
|
|
|
|
|
|
|
+const onObjectOAMRuleAdd = () => {
|
|
|
|
|
+ objectOAMRuleRef.value.showAddModel(bizId, objectId, state.curOamId)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onObjectRuleEdit = (row: { }) => {
|
|
|
|
|
|
|
+const onObjectOAMRuleEdit = (row: { orId: number }) => {
|
|
|
|
|
+ objectOAMRuleRef.value.showEditModel(bizId, objectId, state.curOamId, row.orId)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onObjectRuleDelete = (row: { }) => {
|
|
|
|
|
|
|
+const onObjectOAMRuleDelete = (row: { }) => {
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
// 返回列表页
|
|
// 返回列表页
|
|
|
function goBack() {
|
|
function goBack() {
|
|
@@ -255,7 +273,7 @@ function goBack() {
|
|
|
<tool-bar>
|
|
<tool-bar>
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<el-input v-model="state.search.keywords" placeholder="请输入名称,支持模糊查询" style="padding-right: 10px;" clearable />
|
|
<el-input v-model="state.search.keywords" placeholder="请输入名称,支持模糊查询" style="padding-right: 10px;" clearable />
|
|
|
- <el-button type="primary" @click="onObjectRuleSearch">
|
|
|
|
|
|
|
+ <el-button type="primary" @click="onObjectOAMRuleSearch">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<el-icon>
|
|
<el-icon>
|
|
|
<svg-icon name="i-ep:search" />
|
|
<svg-icon name="i-ep:search" />
|
|
@@ -263,18 +281,18 @@ function goBack() {
|
|
|
</template>
|
|
</template>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
- <el-button type="primary" size="default" @click.stop="onObjectRuleAdd">
|
|
|
|
|
|
|
+ <el-button type="primary" size="default" @click.stop="onObjectOAMRuleAdd">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<el-icon>
|
|
<el-icon>
|
|
|
<svg-icon name="i-ep:plus" />
|
|
<svg-icon name="i-ep:plus" />
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</template>
|
|
</template>
|
|
|
- 业务对象
|
|
|
|
|
|
|
+ 业务规则
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</tool-bar>
|
|
</tool-bar>
|
|
|
|
|
|
|
|
- <el-table ref="objectRuleTableRef" v-loading="state.loading" class="list-table" :data="state.objectRuleList" border stripe highlight-current-row height="100%">
|
|
|
|
|
|
|
+ <el-table ref="objectRuleTableRef" v-loading="state.loading" class="list-table" :data="state.objectOamRuleList" border stripe highlight-current-row height="100%">
|
|
|
<el-table-column type="index" label="序号" header-align="center" align="center" width="70" />
|
|
<el-table-column type="index" label="序号" header-align="center" align="center" width="70" />
|
|
|
|
|
|
|
|
<el-table-column prop="objectTitle" label="名称" header-align="center" align="center" width="200">
|
|
<el-table-column prop="objectTitle" label="名称" header-align="center" align="center" width="200">
|
|
@@ -286,16 +304,15 @@ function goBack() {
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <el-table-column prop="objectCode" label="代码" header-align="center" align="center" width="150" />
|
|
|
|
|
|
|
+ <el-table-column prop="ruleTitle" label="规则" header-align="center" align="center" width="150" />
|
|
|
|
|
|
|
|
- <el-table-column prop="comment" label="说明" header-align="center" align="left" />
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" header-align="center" align="center" width="230">
|
|
<el-table-column label="操作" header-align="center" align="center" width="230">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-button type="warning" size="small" plain @click="onObjectRuleEdit(scope.row)">
|
|
|
|
|
|
|
+ <el-button type="warning" size="small" plain @click="onObjectOAMRuleEdit(scope.row)">
|
|
|
编辑
|
|
编辑
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button type="danger" size="small" plain @click="onObjectRuleDelete(scope.row)">
|
|
|
|
|
|
|
+ <el-button type="danger" size="small" plain @click="onObjectOAMRuleDelete(scope.row)">
|
|
|
删除
|
|
删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -307,6 +324,7 @@ function goBack() {
|
|
|
</LayoutContainer>
|
|
</LayoutContainer>
|
|
|
</div>
|
|
</div>
|
|
|
<ObjectOAMComponent ref="objectOAMRef" @success="getOAMTree" />
|
|
<ObjectOAMComponent ref="objectOAMRef" @success="getOAMTree" />
|
|
|
|
|
+ <ObjectOAMRuleComponent ref="objectOAMRuleRef" @success="getObjectOAMRuleList" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|