houyaf il y a 3 ans
Parent
commit
f55fed649b

+ 4 - 0
src/assets/styles/globals.scss

@@ -121,3 +121,7 @@ body {
 textarea {
   font-family: inherit;
 }
+
+.el-description_label{
+  width: 150px!important;
+}

+ 2 - 2
src/components/LayoutContainer/index.vue

@@ -79,9 +79,9 @@ const enabledRightSide = computed(() => {
   .left-side,
   .right-side,
   .main {
-    --container-padding: 10px;
+    --container-padding: 20px;
 
-    border-radius: 5px;
+    border-radius: 10px;
     height: 100%;
     padding: var(--container-padding);
     background-color: var(--g-app-bg);

+ 266 - 51
src/views/biz/oam/index.vue

@@ -4,7 +4,6 @@ meta:
 </route>
 
 <script lang="ts" setup name="BizObjectOAM">
-import type { TabsPaneContext } from 'element-plus'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import ObjectOAMRuleComponent from '../rule/components/objectOAMRule.vue'
 import ObjectOAMComponent from './components/objectOAM.vue'
@@ -12,7 +11,8 @@ import useSettingsStore from '@/store/modules/settings'
 import { getObjectById } from '@/api/biz/bizObjectApi'
 import { deleteObjectOAMById, getObjectOAMById, getObjectOAMListByObjectId } from '@/api/biz/bizObjectOAMApi'
 import { getObjectOAMRuleListByOamId } from '@/api/biz/bizObjectOAMRuleApi'
-import { oamType, sqlType } from '@/utils/tool'
+import { dataType, oamType, sqlType } from '@/utils/tool'
+import { createObjectOAMParams, deleteObjectOAMParamsById, getObjectOAMParamsListByOamId, updateObjectOAMParams } from '@/api/biz/bizObjectOAMParamsApi'
 
 const settingsStore = useSettingsStore()
 const route = useRoute()
@@ -39,7 +39,6 @@ interface ObjectOAM {
   oamType: number
   oamStatement: string
   oamDesc: string
-
   sqlStatement: string
   sqlSelect: string
   sqlFrom: string
@@ -48,6 +47,21 @@ interface ObjectOAM {
   sqlCount: string
 }
 
+interface ObjectOAMParams {
+  bizId: number
+  objectId: number
+  oamId: number
+  paramsId: number
+  logicalOperator: string
+  compareOperator: string
+  paramsTarget: string
+  paramsValue: string
+  paramsType: number
+  paramsRemark: string
+  sortNo: number
+  isEdit: boolean
+}
+
 const state = reactive({
   loading: false,
   objectTitle: '',
@@ -59,14 +73,15 @@ const state = reactive({
   objectOamRuleList: [],
   treeData: [] as TreeNode[],
   oam: {} as ObjectOAM,
+  params: [] as ObjectOAMParams[],
   dialogState: 1,
   search: {
     bizId,
     objectId,
     keywords: '',
   },
-  params: '',
   result: '',
+  actionType: 0,
 })
 
 const leftTreeRef = ref()
@@ -90,6 +105,16 @@ const getObjectOAMData = async () => {
   }
 }
 
+const getObjectOAMParams = async () => {
+  const curOamId = state.curOamId
+  if (curOamId > 0) {
+    state.loading = true
+    const { data } = await getObjectOAMParamsListByOamId(bizId, objectId, curOamId)
+    state.params = data
+    state.loading = false
+  }
+}
+
 const getObjectOAMRuleList = async () => {
   const curOamId = state.curOamId
   if (curOamId > 0) {
@@ -118,6 +143,7 @@ const getOAMTree = async () => {
       leftTreeRef.value.setCurrentKey(data[0].oamId)
     })
     await getObjectOAMData()
+    await getObjectOAMParams()
     await getObjectOAMRuleList()
   }
 }
@@ -132,6 +158,7 @@ const onTreeNodeClick = async (node: TreeNode) => {
   if (node.isLeaf) {
     state.curOamId = node.oamId
     await getObjectOAMData()
+    await getObjectOAMParams()
     await getObjectOAMRuleList()
   }
 }
@@ -164,13 +191,79 @@ const onSuccess = () => {
 
 const activeName = ref('first')
 
-const handleClick = (tab: TabsPaneContext, event: Event) => {
-  // console.log(tab, event)
+// 查询参数
+const paramsTableRef = ref()
+const paramsTableKey = ref(0)
+
+const logicalOperators = [
+  {
+    label: 'AND',
+    value: 'AND',
+  },
+  {
+    label: 'OR',
+    value: 'OR',
+  },
+  {
+    label: 'NOT',
+    value: 'NOT',
+  },
+]
+
+function onParamsAdd() {
+  state.params.push({
+    bizId,
+    objectId,
+    oamId: state.curOamId,
+    paramsId: 0,
+    logicalOperator: 'AND',
+    paramsTarget: '', // 名称
+    compareOperator: '=', // 代码
+    paramsValue: '',
+    paramsType: 0,
+    paramsRemark: '',
+    sortNo: 0,
+    isEdit: true,
+  })
+  state.actionType = 1
 }
 
-const objectOAMRuleRef = ref()
-const onObjectOAMRuleSearch = () => {
+function onParamsEdit(row: any) {
+  row.isEdit = true
+  state.actionType = 2
+}
+
+async function onParamsDelete(row: any) {
+  const oamId = state.curOamId
+  const paramsId = row.paramsId
+  await deleteObjectOAMParamsById(bizId, objectId, oamId, paramsId)
+  ElMessage.success('删除成功')
+}
+
+function onParamsCancel(row: any, index: number) {
+  row.isEdit = false
+  if (state.actionType === 1) {
+    state.params.splice(index, 1)
+  }
+  state.actionType = 0
+}
 
+async function onParamsSave(row: any) {
+  row.isEdit = false
+  if (state.actionType === 1) {
+    await createObjectOAMParams(row)
+    ElMessage.success('新增成功')
+  }
+  else {
+    await updateObjectOAMParams(row)
+    ElMessage.success('修改成功')
+  }
+}
+
+// 业务规则
+const objectOAMRuleRef = ref()
+const onObjectOAMRuleSearch = async () => {
+  await getObjectOAMRuleList()
 }
 
 const onObjectOAMRuleAdd = () => {
@@ -184,6 +277,7 @@ const onObjectOAMRuleEdit = (row: { orId: number }) => {
 const onObjectOAMRuleDelete = (row: { }) => {
 
 }
+
 // 返回列表页
 function goBack() {
   if (settingsStore.settings.tabbar.enable && settingsStore.settings.tabbar.mergeTabsBy !== 'activeMenu') {
@@ -252,10 +346,11 @@ function goBack() {
         </template>
 
         <div class="container">
-          <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+          <el-tabs v-model="activeName" class="demo-tabs">
             <el-tab-pane label="行为定义" name="first">
               <el-descriptions
                 :title="state.oam.oamTitle"
+                direction="horizontal"
                 :column="1"
                 border
               >
@@ -315,60 +410,180 @@ function goBack() {
                   {{ state.oam.oamDesc }}
                 </el-descriptions-item>
               </el-descriptions>
-            </el-tab-pane>
 
-            <el-tab-pane label="业务规则" name="two">
-              <tool-bar>
-                <template #left>
-                  <h4>业务规则</h4>
-                </template>
+              <div v-if="state.oam && state.oam.sqlType === 1" class="container">
+                <tool-bar>
+                  <template #left>
+                    <h4>查询参数</h4>
+                  </template>
+                  <template #right>
+                    <el-button type="default" @click="onParamsAdd">
+                      <template #icon>
+                        <el-icon>
+                          <svg-icon name="i-ep:plus" />
+                        </el-icon>
+                      </template>
+                    </el-button>
+                  </template>
+                </tool-bar>
+
+                <el-table ref="paramsTableRef" :key="paramsTableKey" :data="state.params" class="list-table" size="small" border stripe highlight-current-row>
+                  <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
+
+                  <el-table-column label="关系" header-align="center" align="center" width="150">
+                    <template #default="scope">
+                      <el-select v-if="scope.row.isEdit" v-model="scope.row.logicalOperator" placeholder="请选择">
+                        <el-option
+                          v-for="item in logicalOperators"
+                          :key="item.value"
+                          :label="item.label"
+                          :value="item.value"
+                        />
+                      </el-select>
+                      <span v-else>{{ scope.row.logicalOperators }}</span>
+                    </template>
+                  </el-table-column>
 
-                <template #right>
-                  <el-input v-model="state.search.keywords" placeholder="请输入名称,支持模糊查询" style="padding-right: 10px;" clearable />
-                  <el-button type="primary" @click="onObjectOAMRuleSearch">
-                    <template #icon>
-                      <el-icon>
-                        <svg-icon name="i-ep:search" />
-                      </el-icon>
+                  <el-table-column label="参数名称" header-align="center" align="center" width="150">
+                    <template #default="scope">
+                      <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsTarget" size="small" />
+                      <span v-else>{{ scope.row.paramsTarget }}</span>
                     </template>
-                  </el-button>
+                  </el-table-column>
 
-                  <el-button type="primary" size="default" @click.stop="onObjectOAMRuleAdd">
-                    <template #icon>
-                      <el-icon>
-                        <svg-icon name="i-ep:plus" />
-                      </el-icon>
+                  <el-table-column label="运算符" header-align="center" align="center" width="120">
+                    <template #default="scope">
+                      <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsOperator" size="small" />
+                      <span v-else>{{ scope.row.paramsOperator }}</span>
                     </template>
-                    业务规则
-                  </el-button>
-                </template>
-              </tool-bar>
+                  </el-table-column>
 
-              <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 label="值" header-align="center" align="center" width="120">
+                    <template #default="scope">
+                      <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsValue" size="small" />
+                      <span v-else>{{ scope.row.paramsValue }}</span>
+                    </template>
+                  </el-table-column>
 
-                <el-table-column prop="objectTitle" label="名称" header-align="center" align="center" width="200">
-                  <template #default="scope">
-                    <el-icon>
-                      <svg-icon name="lucide:clipboard-check" />
-                    </el-icon>
-                    <span> &nbsp;&nbsp;{{ scope.row.objectTitle }}</span>
-                  </template>
-                </el-table-column>
+                  <el-table-column label="类型" header-align="center" align="center" width="120">
+                    <template #default="scope">
+                      <data-type-selector v-if="scope.row.isEdit" v-model="scope.row.paramsType" />
+                      <span v-else>{{ dataType(scope.row.paramsType) }}</span>
+                    </template>
+                  </el-table-column>
+
+                  <el-table-column label="备注">
+                    <template #default="scope">
+                      <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsRemark" size="small" />
+                      <span v-else>{{ scope.row.paramsRemark }}</span>
+                    </template>
+                  </el-table-column>
 
-                <el-table-column prop="ruleTitle" label="规则" header-align="center" align="center" width="150" />
+                  <el-table-column header-align="center" align="center" width="70">
+                    <template #header>
+                      排序
+                    </template>
+                    <template #default>
+                      <el-tag type="info" class="sortable">
+                        <el-icon>
+                          <svg-icon name="i-ep:d-caret" />
+                        </el-icon>
+                      </el-tag>
+                    </template>
+                  </el-table-column>
+
+                  <el-table-column label="操作" width="140" align="center">
+                    <template #default="scope">
+                      <template v-if="scope.row.isEdit">
+                        <el-button type="primary" plain size="small" @click="onParamsSave(scope.row)">
+                          保存
+                        </el-button>
+                        <el-button type="primary" plain size="small" @click="onParamsCancel(scope.row, scope.$index)">
+                          取消
+                        </el-button>
+                      </template>
+                      <template v-else>
+                        <el-button type="primary" plain size="small" @click="onParamsEdit(scope.row)">
+                          编辑
+                        </el-button>
+                        <el-popconfirm title="是否要删除此行?" style="margin-left: 10px;" @confirm="onParamsDelete(scope.row)">
+                          <template #reference>
+                            <el-button type="danger" plain size="small">
+                              删除
+                            </el-button>
+                          </template>
+                        </el-popconfirm>
+                      </template>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </el-tab-pane>
 
-                <el-table-column label="操作" header-align="center" align="center" width="230">
-                  <template #default="scope">
-                    <el-button type="warning" size="small" plain @click="onObjectOAMRuleEdit(scope.row)">
-                      编辑
+            <el-tab-pane label="业务规则" name="two">
+              <div class="container">
+                <tool-bar>
+                  <template #left>
+                    <h4>业务规则</h4>
+                  </template>
+
+                  <template #right>
+                    <el-input v-model="state.search.keywords" placeholder="请输入名称,支持模糊查询" style="padding-right: 10px;" clearable />
+                    <el-button type="primary" @click="onObjectOAMRuleSearch">
+                      <template #icon>
+                        <el-icon>
+                          <svg-icon name="i-ep:search" />
+                        </el-icon>
+                      </template>
                     </el-button>
-                    <el-button type="danger" size="small" plain @click="onObjectOAMRuleDelete(scope.row)">
-                      删除
+
+                    <el-button type="primary" size="default" @click.stop="onObjectOAMRuleAdd">
+                      <template #icon>
+                        <el-icon>
+                          <svg-icon name="i-ep:plus" />
+                        </el-icon>
+                      </template>
+                      业务规则
                     </el-button>
                   </template>
-                </el-table-column>
-              </el-table>
+                </tool-bar>
+
+                <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 prop="objectTitle" label="对象名称" header-align="center" align="center">
+                    <template #default="scope">
+                      <el-icon>
+                        <svg-icon name="uim:box" />
+                      </el-icon>
+                      <span> &nbsp;&nbsp;{{ scope.row.objectTitle }}</span>
+                    </template>
+                  </el-table-column>
+
+                  <el-table-column prop="targetAttrTitle" label="目标属性" header-align="center" align="center">
+                    <template #default="scope">
+                      <span> {{ scope.row.targetAttrTitle }}</span>
+                    </template>
+                  </el-table-column>
+
+                  <el-table-column prop="ruleTitle" label="应用规则" header-align="center" align="center">
+                    <template #default="scope">
+                      <span> {{ scope.row.ruleTitle }}</span>
+                    </template>
+                  </el-table-column>
+
+                  <el-table-column label="操作" header-align="center" align="center" width="230">
+                    <template #default="scope">
+                      <el-button type="warning" size="small" plain @click="onObjectOAMRuleEdit(scope.row)">
+                        编辑
+                      </el-button>
+                      <el-button type="danger" size="small" plain @click="onObjectOAMRuleDelete(scope.row)">
+                        删除
+                      </el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
             </el-tab-pane>
           </el-tabs>
         </div>

+ 6 - 5
src/views/biz/object/index.vue

@@ -5,10 +5,9 @@ meta:
 
 <script lang="ts" setup name="bizObjectDetails">
 import type { TabsPaneContext } from 'element-plus'
-import BizObjectComponent from '@/views/biz/object/components/Object.vue'
-import BizObjectOAMListComponent from '../oam/index.vue'
 import BizObjectAttrListComponent from '../attr/index.vue'
 import BizObjectMappingListComponent from '../mapping/index.vue'
+import BizObjectComponent from '@/views/biz/object/components/Object.vue'
 import { getObjectById } from '@/api/biz/bizObjectApi'
 import useSettingsStore from '@/store/modules/settings'
 
@@ -84,6 +83,7 @@ function goBack() {
   }
 }
 </script>
+
 <template>
   <div class="absolute-container">
     <page-header :title="state.objectData.objectTitle">
@@ -112,6 +112,7 @@ function goBack() {
 
               <el-descriptions-item
                 label-align="right"
+                label-class-name="el-description_label"
                 label="对象类型"
                 width="150px">
                 {{ state.objectData.objectType }}
@@ -119,6 +120,7 @@ function goBack() {
 
               <el-descriptions-item
                 label="代码"
+                label-class-name="el-description_label"
                 width="150px"
                 label-align="right">
                 {{ state.objectData.objectCode }}
@@ -126,6 +128,7 @@ function goBack() {
 
               <el-descriptions-item
                 label-align="right"
+                label-class-name="el-description_label"
                 width="150px"
                 label="说明">
                 {{ state.objectData.comment }}
@@ -153,11 +156,9 @@ function goBack() {
 .el-descriptions {
   margin: 0 10px;
 }
+
 .cell-item {
   display: flex;
   align-items: center;
 }
-::v-deep .el-tabs__content{
-  min-height: 67vh;
-}
 </style>

+ 91 - 93
src/views/biz/params/index.vue

@@ -130,109 +130,107 @@ onMounted(() => {
 </script>
 
 <template>
-  <div class="absolute-container">
-    <div class="container">
-      <tool-bar>
-        <template #left>
-          <h4>对象属性</h4>
-        </template>
-        <template #right>
-          <el-input placeholder="请输入关键词筛选" clearable style="width: 200px;" />
-          <el-button style="margin-left:10px" @click="getData">
-            <template #icon>
-              <el-icon>
-                <svg-icon name="i-ep:search" />
-              </el-icon>
-            </template>
-          </el-button>
+  <div class="container">
+    <tool-bar>
+      <template #left>
+        <h4>对象属性</h4>
+      </template>
+      <template #right>
+        <el-input placeholder="请输入关键词筛选" clearable style="width: 200px;" />
+        <el-button style="margin-left:10px" @click="getData">
+          <template #icon>
+            <el-icon>
+              <svg-icon name="i-ep:search" />
+            </el-icon>
+          </template>
+        </el-button>
 
-          <el-button type="default" @click="onAttrAdd">
-            <template #icon>
-              <el-icon>
-                <svg-icon name="i-ep:plus" />
-              </el-icon>
-            </template>
-          </el-button>
-        </template>
-      </tool-bar>
+        <el-button type="default" @click="onAttrAdd">
+          <template #icon>
+            <el-icon>
+              <svg-icon name="i-ep:plus" />
+            </el-icon>
+          </template>
+        </el-button>
+      </template>
+    </tool-bar>
 
-      <el-table ref="paramsTableRef" :key="paramsTableKey" :data="state.params" class="list-table" size="small" border stripe highlight-current-row>
-        <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
+    <el-table ref="paramsTableRef" :key="paramsTableKey" :data="state.params" class="list-table" size="small" border stripe highlight-current-row>
+      <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
 
-        <el-table-column label="参数名称" header-align="center" align="center" width="150">
-          <template #default="scope">
-            <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsTarget" size="small" />
-            <span v-else>{{ scope.row.paramsTarget }}</span>
-          </template>
-        </el-table-column>
+      <el-table-column label="参数名称" header-align="center" align="center" width="150">
+        <template #default="scope">
+          <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsTarget" size="small" />
+          <span v-else>{{ scope.row.paramsTarget }}</span>
+        </template>
+      </el-table-column>
 
-        <el-table-column label="运算符" header-align="center" align="center" width="120">
-          <template #default="scope">
-            <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsOperator" size="small" />
-            <span v-else>{{ scope.row.paramsOperator }}</span>
-          </template>
-        </el-table-column>
+      <el-table-column label="运算符" header-align="center" align="center" width="120">
+        <template #default="scope">
+          <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsOperator" size="small" />
+          <span v-else>{{ scope.row.paramsOperator }}</span>
+        </template>
+      </el-table-column>
 
-        <el-table-column label="值" header-align="center" align="center" width="120">
-          <template #default="scope">
-            <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsValue" size="small" />
-            <span v-else>{{ scope.row.paramsValue }}</span>
-          </template>
-        </el-table-column>
+      <el-table-column label="值" header-align="center" align="center" width="120">
+        <template #default="scope">
+          <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsValue" size="small" />
+          <span v-else>{{ scope.row.paramsValue }}</span>
+        </template>
+      </el-table-column>
 
-        <el-table-column label="类型" header-align="center" align="center" width="120">
-          <template #default="scope">
-            <data-type-selector v-if="scope.row.isEdit" v-model="scope.row.paramsType" />
-            <span v-else>{{ dataType(scope.row.paramsType) }}</span>
-          </template>
-        </el-table-column>
+      <el-table-column label="类型" header-align="center" align="center" width="120">
+        <template #default="scope">
+          <data-type-selector v-if="scope.row.isEdit" v-model="scope.row.paramsType" />
+          <span v-else>{{ dataType(scope.row.paramsType) }}</span>
+        </template>
+      </el-table-column>
 
-        <el-table-column label="备注">
-          <template #default="scope">
-            <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsRemark" size="small" />
-            <span v-else>{{ scope.row.paramsRemark }}</span>
-          </template>
-        </el-table-column>
+      <el-table-column label="备注">
+        <template #default="scope">
+          <el-input v-if="scope.row.isEdit" v-model="scope.row.paramsRemark" size="small" />
+          <span v-else>{{ scope.row.paramsRemark }}</span>
+        </template>
+      </el-table-column>
 
-        <el-table-column header-align="center" align="center" width="70">
-          <template #header>
-            排序
-          </template>
-          <template #default>
-            <el-tag type="info" class="sortable">
-              <el-icon>
-                <svg-icon name="i-ep:d-caret" />
-              </el-icon>
-            </el-tag>
-          </template>
-        </el-table-column>
+      <el-table-column header-align="center" align="center" width="70">
+        <template #header>
+          排序
+        </template>
+        <template #default>
+          <el-tag type="info" class="sortable">
+            <el-icon>
+              <svg-icon name="i-ep:d-caret" />
+            </el-icon>
+          </el-tag>
+        </template>
+      </el-table-column>
 
-        <el-table-column label="操作" width="140" align="center">
-          <template #default="scope">
-            <template v-if="scope.row.isEdit">
-              <el-button type="primary" plain size="small" @click="onAttrSave(scope.row)">
-                保存
-              </el-button>
-              <el-button type="primary" plain size="small" @click="onAttrCancel(scope.row, scope.$index)">
-                取消
-              </el-button>
-            </template>
-            <template v-else>
-              <el-button type="primary" plain size="small" @click="onAttrEdit(scope.row)">
-                编辑
-              </el-button>
-              <el-popconfirm title="是否要删除此行?" style="margin-left: 10px;" @confirm="onAttrDelete(scope.row)">
-                <template #reference>
-                  <el-button type="danger" plain size="small">
-                    删除
-                  </el-button>
-                </template>
-              </el-popconfirm>
-            </template>
+      <el-table-column label="操作" width="140" align="center">
+        <template #default="scope">
+          <template v-if="scope.row.isEdit">
+            <el-button type="primary" plain size="small" @click="onAttrSave(scope.row)">
+              保存
+            </el-button>
+            <el-button type="primary" plain size="small" @click="onAttrCancel(scope.row, scope.$index)">
+              取消
+            </el-button>
           </template>
-        </el-table-column>
-      </el-table>
-    </div>
+          <template v-else>
+            <el-button type="primary" plain size="small" @click="onAttrEdit(scope.row)">
+              编辑
+            </el-button>
+            <el-popconfirm title="是否要删除此行?" style="margin-left: 10px;" @confirm="onAttrDelete(scope.row)">
+              <template #reference>
+                <el-button type="danger" plain size="small">
+                  删除
+                </el-button>
+              </template>
+            </el-popconfirm>
+          </template>
+        </template>
+      </el-table-column>
+    </el-table>
   </div>
 </template>
 

+ 16 - 92
src/views/biz/rule/index.vue

@@ -1,25 +1,12 @@
-<script lang="ts" setup name="BizObjectOAMRule">
-import BizObjectOAMRuleComponent from './components/ObjectOAMRule.vue'
-import { getObjectOAMRuleListByOamId } from '@/api/biz/bizObjectOAMRuleApi'
-const props = withDefaults(defineProps<{
-  bizId: number
-  objectId: number
-  oamId: number
-}>(), {
-  bizId: 0,
-  objectId: 0,
-  oamId: 0,
-})
+<script lang="ts" setup name="DbTypeIndex">
+import { getBizRuleByList } from '@/api/biz/bizRuleApi'
 
 const state = reactive({
   loading: false,
   // 表格是否自适应高度
   tableAutoHeight: false,
   // 搜索
-  conditions: {
-    bizId: props.bizId,
-    objectId: props.objectId,
-    oamId: props.oamId,
+  search: {
     keywords: '',
   },
   // 列表数据
@@ -27,93 +14,30 @@ const state = reactive({
 })
 
 const getDataList = async () => {
-  const { bizId, objectId, oamId } = state.conditions
-  if (oamId > 0) {
-    state.loading = true
-    const { data } = await getObjectOAMRuleListByOamId(bizId, objectId, oamId)
-    state.dataList = data
-    state.loading = false
-  }
+  state.loading = true
+  const { data } = await getBizRuleByList({})
+  state.dataList = data
+  state.loading = false
 }
 
 onMounted(() => {
-  // getDataList()
+  getDataList()
 })
-
-const bizObjectOAMRuleRef = ref()
-const onObjectOAMRuleSearch = () => {
-
-}
-
-const onObjectOAMRuleAdd = () => {
-  const { bizId, objectId, oamId } = state.conditions
-  bizObjectOAMRuleRef.value.showAddModel(bizId, objectId, oamId)
-}
-
-const onObjectOAMRuleEdit = (row: { ruleId: number }) => {
-  const { bizId, objectId, oamId } = state.conditions
-  bizObjectOAMRuleRef.value.showEditModel(bizId, objectId, oamId)
-}
-
-const onObjectOAMRuleDelete = (row: { }) => {
-
-}
 </script>
 
 <template>
   <div class="absolute-container">
-    <tool-bar>
-      <template #left>
-        <h4>业务规则</h4>
-      </template>
-
-      <template #right>
-        <el-input v-model="state.conditions.keywords" placeholder="请输入名称,支持模糊查询" style="padding-right: 10px;" clearable />
-        <el-button type="primary" @click="onObjectOAMRuleSearch">
-          <template #icon>
-            <el-icon>
-              <svg-icon name="i-ep:search" />
-            </el-icon>
-          </template>
-        </el-button>
-
-        <el-button type="primary" size="default" @click.stop="onObjectOAMRuleAdd">
-          <template #icon>
-            <el-icon>
-              <svg-icon name="i-ep:plus" />
-            </el-icon>
-          </template>
-          业务规则
-        </el-button>
-      </template>
-    </tool-bar>
-
-    <el-table ref="objectRuleTableRef" v-loading="state.loading" class="list-table" :data="state.dataList" border stripe highlight-current-row height="100%">
-      <el-table-column type="index" label="序号" header-align="center" align="center" width="70" />
+    <tool-header title="业务规则" />
 
-      <el-table-column prop="objectTitle" label="名称" header-align="center" align="center" width="200">
-        <template #default="scope">
-          <el-icon>
-            <svg-icon name="lucide:clipboard-check" />
-          </el-icon>
-          <span> &nbsp;&nbsp;{{ scope.row.objectTitle }}</span>
-        </template>
-      </el-table-column>
+    <page-main>
+      <el-table v-loading="state.loading" class="list-table" :data="state.dataList" border stripe highlight-current-row height="100%">
+        <el-table-column type="index" label="序号" width="60" header-align="center" align="center" />
 
-      <el-table-column prop="ruleTitle" label="规则" header-align="center" align="center" width="150" />
+        <el-table-column prop="ruleTitle" label="名称" header-align="center" align="center" width="200" />
 
-      <el-table-column label="操作" header-align="center" align="center" width="230">
-        <template #default="scope">
-          <el-button type="warning" size="small" plain @click="onObjectOAMRuleEdit(scope.row)">
-            编辑
-          </el-button>
-          <el-button type="danger" size="small" plain @click="onObjectOAMRuleDelete(scope.row)">
-            删除
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <BizObjectOAMRuleComponent ref="bizObjectOAMRuleRef" @success="getDataList" />
+        <el-table-column prop="ruleDesc" label="说明" />
+      </el-table>
+    </page-main>
   </div>
 </template>