CzRger 1 月之前
父節點
當前提交
befa1e9e6f
共有 3 個文件被更改,包括 17 次插入33 次删除
  1. 10 0
      src/api/modules/manage/home.ts
  2. 1 2
      src/views/manage/home/cloud-g2.vue
  3. 6 31
      src/views/manage/home/index.vue

+ 10 - 0
src/api/modules/manage/home.ts

@@ -0,0 +1,10 @@
+import { handle } from '../../index'
+
+const suffix = 'api'
+
+// 统计查询
+export const searchLogsGetStatistics = (params: any) => handle({
+  url: `/${suffix}/search-logs/getStatistics`,
+  method: 'post',
+  params
+})

+ 1 - 2
src/views/manage/home/cloud-g2.vue

@@ -18,7 +18,7 @@ const state: any = reactive({
 const initChart = () => {
   const data = props.data.map(v => {
     v.value = v.count
-    v.text = v.name
+    v.text = v.keyword
     return v
   })
   if (state.chartChangeData) {
@@ -39,7 +39,6 @@ const initChart = () => {
     .tooltip({
       items: [
         {name: '数量', field: 'count'},
-        {name: '文字长度', field: 'length'},
       ]
     })
     .legend({

+ 6 - 31
src/views/manage/home/index.vue

@@ -20,7 +20,7 @@
       </CusForm>
     </div>
     <div class="__cus-manage_content-main">
-      <div class="cloud">
+      <div class="cloud" v-loading="state.query.loading">
         <cloudG2 :data="state.query.result.data"/>
 <!--        <cloudEcharts :data="state.query.result.data"/>-->
       </div>
@@ -42,6 +42,7 @@ import {getCurrentInstance, onMounted, reactive, ref} from "vue";
 import {useDictionaryStore} from "@/stores";
 import cloudG2 from './cloud-g2.vue'
 import cloudEcharts from './cloud-echarts.vue'
+import {searchLogsGetStatistics} from "@/api/modules/manage/home";
 
 const DictionaryStore = useDictionaryStore()
 const {proxy} = getCurrentInstance()
@@ -103,37 +104,11 @@ const onPage = (pageNum, pageSize) => {
     params.endTime = state.query.formReal.dateArea[1]
   }
   state.query.loading = true
-  setTimeout(() => {
-    state.query.result.total = 100
-    const arr = []
-    for (let i = 0; i < 50; i++) {
-      const str = []
-      for (let k = 0; k < i + 1; k++) {
-        str.push('啊')
-      }
-      arr.push({
-        id: i,
-        name: str.join(''),
-        count: proxy.$util.randomNum(1, 100),
-        startTime: '2020-04-06 12:34:22',
-        endTime: '2023-11-26 03:29:14',
-        username: '张三',
-        length: str.length
-      })
-    }
-    // arr.push({
-    //   id: 1,
-    //   name: '啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊',
-    //   count: 10
-    // })
-    state.query.result.data = arr
+  searchLogsGetStatistics(params).then(res => {
+    state.query.result.total = res.data.totalElements
+    state.query.result.data = res.data.content
     state.query.loading = false
-  }, 1000)
-  // sysIndexFindIndexByPage(proxy.$util.formatGetParam(params)).then(res => {
-  //   state.query.result.total = res.data.totalElements
-  //   state.query.result.data = res.data.content
-  //   state.query.loading = false
-  // })
+  })
 }
 onMounted(() => {
   initDictionary()