houyaf 3 жил өмнө
parent
commit
aa2e9c8f41

+ 5 - 5
src/api/api/apiLogApi.ts

@@ -5,7 +5,7 @@ import apiRequest from '@/network/http/apiRequest'
  * @param data
  * @returns
  */
-export function getApiReqByPage(data: any) {
+export function getApiLogByPage(data: any) {
   return apiRequest({
     url: '/api/log/page',
     method: 'GET',
@@ -18,7 +18,7 @@ export function getApiReqByPage(data: any) {
  * @param data
  * @returns
  */
-export function getApiReqByList(data: any) {
+export function getApiLogByList(data: any) {
   return apiRequest({
     url: '/api/log',
     method: 'GET',
@@ -31,7 +31,7 @@ export function getApiReqByList(data: any) {
  * @param reqId
  * @returns
  */
-export function getApiReqById(reqId: number) {
+export function getApiLogById(reqId: number) {
   return apiRequest({
     url: `/api/log/${reqId}`,
     method: 'GET',
@@ -43,9 +43,9 @@ export function getApiReqById(reqId: number) {
  * @param reqId
  * @returns
  */
-export function deleteApiReqById(reqId: number) {
+export function deleteApiLogById(reqId: number) {
   return apiRequest({
-    url: `/paas/api/request/${reqId}`,
+    url: `/api/log/${reqId}`,
     method: 'DELETE',
   })
 }

+ 0 - 64
src/api/api/apiModuleApi.ts

@@ -1,64 +0,0 @@
-import apiRequest from '@/network/http/apiRequest'
-
-/**
- * 获取Module列表
- * @param data
- * @returns
- */
-export function getModuleByList(data: any) {
-  return apiRequest({
-    url: '/api/module',
-    method: 'GET',
-    params: data,
-  })
-}
-
-/**
- * 根据Id获取Module
- * @param moduleId
- * @returns
- */
-export function getModuleById(moduleId: number) {
-  return apiRequest({
-    url: `/api/module/${moduleId}`,
-    method: 'GET',
-  })
-}
-
-/**
- * 添加Module
- * @param data
- * @returns
- */
-export function createModule(data: any) {
-  return apiRequest({
-    url: '/api/module/add',
-    method: 'POST',
-    data,
-  })
-}
-
-/**
- * 更新Module
- * @param data
- * @returns
- */
-export function updateModule(data: any) {
-  return apiRequest({
-    url: '/api/module/update',
-    method: 'PUT',
-    data,
-  })
-}
-
-/**
- * 删除Module
- * @param moduleId
- * @returns
- */
-export function deleteModuleById(moduleId: number) {
-  return apiRequest({
-    url: `/api/module/${moduleId}`,
-    method: 'DELETE',
-  })
-}

+ 0 - 1
src/views/api/api/index.vue

@@ -52,7 +52,6 @@ const state = reactive({
 })
 
 const leftTreeRef = ref()
-const ModuleRef = ref()
 const getApiData = async () => {
   const curBizId = state.curBizId
   const curObjectId = state.curObjectId

+ 43 - 52
src/views/api/log/index.vue

@@ -1,99 +1,90 @@
 <script lang="ts" setup>
 import { ElMessage, ElMessageBox } from 'element-plus'
-import { deleteApiReqById, getApiReqByPage } from '@/api/api/apiLogApi'
-import { getModuleByList } from '@/api/api/apiModuleApi'
+import { deleteApiLogById, getApiLogByPage } from '@/api/api/apiLogApi'
 const { pagination, getParams, onSizeChange, onCurrentChange } = usePagination()
 
 interface TreeNode {
   label: string
   isLeaf: boolean
-  moduleId: number
+  value: number
+  bizId: number
+  objectId: number
   children?: TreeNode[]
 }
 
+interface ApiLog {
+  bizId: number
+  objectId: number
+  oamId: number
+  apiId: number
+  apiMethod: number
+  apiType: number
+  apiTitle: string
+  apiCode: string
+  apiDesc: string
+  apiParams: string
+  status: number
+}
+
 const state = reactive({
   loading: false,
-  curModuleId: 0,
+  keywords: '',
   treeData: [] as TreeNode[],
-  reqList: [],
+  curBizId: 0,
+  curObjectId: 0,
+  apiList: [] as ApiLog[],
+  dialogState: 1,
   search: {
+    bizId: 0,
+    objectId: 0,
     keywords: '',
   },
 })
 
-const leftTreeRef = ref()
-const ModuleRef = ref()
-
 // 查询日志列表
-const getReqData = async () => {
-  const params = getParams()
-  params.moduleId = state.curModuleId
-  params.keywords = state.search.keywords
-  state.loading = true
-  const { data } = await getApiReqByPage(params)
-  state.reqList = data.data
-  state.loading = false
-}
-
-const getModuleData = async () => {
-  const { data } = await getModuleByList('')
-  const children: TreeNode[] = []
-  data.forEach((item: any) => {
-    return children.push({
-      label: item.moduleTitle,
-      moduleId: item.moduleId,
-      isLeaf: true,
-    })
-  })
-  state.treeData = [
-    {
-      label: '功能模块',
-      isLeaf: false,
-      moduleId: -1,
-      children,
-    },
-  ]
-
-  if (data && data.length > 0) {
-    state.curModuleId = data[0].moduleId
-    nextTick(() => {
-      leftTreeRef.value.setCurrentKey(data[0].moduleId)
-    })
-    await getReqData()
+const leftTreeRef = ref()
+const getApiLogData = async () => {
+  const curBizId = state.curBizId
+  const curObjectId = state.curObjectId
+  if (curBizId > 0 && curObjectId > 0) {
+    state.loading = true
+    const { data } = await getApiLogByPage(state.search)
+    state.apiList = data
+    state.loading = false
   }
 }
 
 // 每页数量切换
 function sizeChange(size: number) {
-  onSizeChange(size).then(() => getReqData())
+  onSizeChange(size).then(() => getApiLogData())
 }
 
 // 当前页码切换(翻页)
 function currentChange(page = 1) {
-  onCurrentChange(page).then(() => getReqData())
+  onCurrentChange(page).then(() => getApiLogData())
 }
 // 查询
 const onSearch = () => {
-  getReqData()
+  getApiLogData()
 }
 
 onMounted(() => {
-  getModuleData()
+  getApiLogData()
 })
 
 // 模块选择
 const onTreeNodeClick = (node: TreeNode) => {
   if (node.isLeaf) {
-    state.curModuleId = node.moduleId
-    getReqData()
+    state.search.objectId = node.objectId
+    getApiLogData()
   }
 }
 
 // 删除日志
 const onReqDel = async (data: { apiTitle: any; reqId: number }) => {
   ElMessageBox.confirm('确认删除吗?', '确认信息').then(async () => {
-    await deleteApiReqById(data.reqId)
-    await getReqData()
+    await deleteApiLogById(data.reqId)
+    await getApiLogData()
     ElMessage.success({
       message: '删除成功',
       center: true,
@@ -141,7 +132,7 @@ const onReqDel = async (data: { apiTitle: any; reqId: number }) => {
             </template>
           </tool-bar>
 
-          <el-table ref="apiReqTableRef" v-loading="state.loading" class="list-table" :data="state.reqList" border stripe highlight-current-row>
+          <el-table ref="apiReqTableRef" v-loading="state.loading" class="list-table" :data="state.dataList" border stripe highlight-current-row>
             <el-table-column type="index" align="center" label="序号" width="60" />
 
             <el-table-column align="center" width="100" label="接口名称" prop="apiTitle" />

+ 13 - 6
src/views/biz/oam/index.vue

@@ -352,6 +352,7 @@ function goBack() {
                 :title="state.oam.oamTitle"
                 direction="horizontal"
                 :column="1"
+                size="small"
                 border
               >
                 <template #extra>
@@ -414,7 +415,7 @@ function goBack() {
               <div v-if="state.oam && state.oam.sqlType === 1" class="container">
                 <tool-bar>
                   <template #left>
-                    <h4>查询参数</h4>
+                    <h5>查询条件参数</h5>
                   </template>
                   <template #right>
                     <el-button type="default" @click="onParamsAdd">
@@ -430,7 +431,7 @@ function goBack() {
                 <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">
+                  <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
@@ -440,7 +441,7 @@ function goBack() {
                           :value="item.value"
                         />
                       </el-select>
-                      <span v-else>{{ scope.row.logicalOperators }}</span>
+                      <span v-else>{{ scope.row.logicalOperator }}</span>
                     </template>
                   </el-table-column>
 
@@ -453,8 +454,8 @@ function goBack() {
 
                   <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>
+                      <el-input v-if="scope.row.isEdit" v-model="scope.row.compareOperator" size="small" />
+                      <span v-else>{{ scope.row.compareOperator }}</span>
                     </template>
                   </el-table-column>
 
@@ -548,7 +549,13 @@ function goBack() {
                   </template>
                 </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
+                  ref="objectRuleTableRef"
+                  v-loading="state.loading"
+                  size="small"
+                  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">

+ 1 - 1
src/views/biz/object/index.vue

@@ -104,7 +104,7 @@ function goBack() {
             <el-descriptions
               :title="state.objectData.objectTitle"
               :column="1"
-              :size="size"
+              size="small"
               border>
               <template #extra>
                 <el-button type="primary" @click="onObjectEdit">编辑</el-button>