chenrui  3 gadi atpakaļ
vecāks
revīzija
009be57593
1 mainītis faili ar 61 papildinājumiem un 20 dzēšanām
  1. 61 20
      src/views/systemSettings/views/log/index.vue

+ 61 - 20
src/views/systemSettings/views/log/index.vue

@@ -10,29 +10,67 @@
           <el-date-picker v-model="timeEnd" size="small" type="date" placeholder="选择结束日期">
           </el-date-picker>
         </div> -->
-        <el-date-picker v-model="date" size="small" type="daterange" value-format="yyyy-MM-dd" :default-time="['00:00:00', '23:59:59']" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="dateChange">
+        <template>
+          <div class="status flex-wrap">
+            <div class="manageTitle">日志查询</div>
+          </div>
+        </template>
+        <el-date-picker
+          v-model="date"
+          size="small"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          :default-time="['00:00:00', '23:59:59']"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="dateChange"
+        >
         </el-date-picker>
       </div>
       <div class="interfaceLog_head_btn">
-        <Search @getSearchData="getSearchData" :isTitle="false" @clearSearchData="clearSearchData" />
+        <Search
+          @getSearchData="getSearchData"
+          :isTitle="false"
+          @clearSearchData="clearSearchData"
+        />
       </div>
     </div>
     <div class="interfaceLog_content flex-wrap">
-      <el-table v-el-table-infinite-scroll="load" :data="tableData" class="table" border style="width: 100%" @row-click="rowClick" :height="720">
+      <el-table
+        v-el-table-infinite-scroll="load"
+        :data="tableData"
+        class="table"
+        border
+        style="width: 100%"
+        @row-click="rowClick"
+        :height="720"
+      >
         <el-table-column prop="logType" label="日志类型" width="100px">
         </el-table-column>
         <el-table-column prop="logObject" label="日志对象"> </el-table-column>
         <el-table-column prop="logTime" label="日志时间"> </el-table-column>
         <!-- <el-table-column prop="time" label="发生时间">
         </el-table-column> -->
-        <el-table-column prop="logPositionID" label="发生位置" :show-overflow-tooltip="true">
+        <el-table-column
+          prop="logPositionID"
+          label="发生位置"
+          :show-overflow-tooltip="true"
+        >
         </el-table-column>
         <el-table-column label="日志结果" width="100px">
           <template slot-scope="scope">
-            <span :class="scope.row.resultCode == '成功' ? 'success' : 'error'">{{ scope.row.resultCode }}</span>
+            <span
+              :class="scope.row.resultCode == '成功' ? 'success' : 'error'"
+              >{{ scope.row.resultCode }}</span
+            >
           </template>
         </el-table-column>
-        <el-table-column prop="resultDetails" label="日志详情" :show-overflow-tooltip="true">
+        <el-table-column
+          prop="resultDetails"
+          label="日志详情"
+          :show-overflow-tooltip="true"
+        >
         </el-table-column>
       </el-table>
       <div class="interfaceLog_content_progress">
@@ -41,7 +79,10 @@
             <div class="list">
               <div class="list_status"></div>
               <div class="list_title">{{ item.logType }}</div>
-              <div class="list_code" :class="item.resultCode == '成功' ? 'success' : 'error'">
+              <div
+                class="list_code"
+                :class="item.resultCode == '成功' ? 'success' : 'error'"
+              >
                 {{ item.resultCode }}
               </div>
               <div class="list_time">{{ item.logTime }}</div>
@@ -60,7 +101,7 @@ import { Query } from "@/api/dataIntegration";
 export default {
   name: "InterfaceLog",
   components: { Search },
-  data () {
+  data() {
     return {
       timeStart: "",
       timeEnd: "",
@@ -70,26 +111,26 @@ export default {
       keyWords: null,
       preDatas: [],
       page: 0,
-      noMore: false
+      noMore: false,
     };
   },
-  created () {
+  created() {
     this.getNowTime();
   },
   methods: {
-    load () {
+    load() {
       // console.log("分页");
       if (this.noMore) {
         return;
       }
       this.getQuery();
     },
-    resetTable () {
+    resetTable() {
       this.page = 0;
       this.noMore = false;
       this.tableData = [];
     },
-    rowClick (row, column, event) {
+    rowClick(row, column, event) {
       this.preDatas = [];
       if (row.logObject) {
         this.tableData.forEach((item) => {
@@ -101,13 +142,13 @@ export default {
         this.preDatas.push(row);
       }
     },
-    dateChange () {
+    dateChange() {
       if (this.date != null) {
         this.resetTable();
         this.getQuery();
       }
     },
-    getNowTime () {
+    getNowTime() {
       var now = new Date();
       var year = now.getFullYear(); //得到年份
       var month = now.getMonth(); //得到月份
@@ -124,7 +165,7 @@ export default {
       this.getQuery();
     },
     //获取表格数据
-    async getQuery () {
+    async getQuery() {
       try {
         this.loading = true;
         const { code, returnData } = await Query({
@@ -142,22 +183,22 @@ export default {
           this.tableData.push(...returnData.listValues);
           console.log(returnData);
         } else {
-          this.page--
+          this.page--;
           this.loading = false;
           this.$message.error("获取数据失败");
         }
       } catch (error) {
-        this.page--
+        this.page--;
         this.loading = false;
         console.log(error);
       }
     },
-    getSearchData (val) {
+    getSearchData(val) {
       console.log(val);
       this.keyWords = val;
       this.getQuery();
     },
-    clearSearchData () { },
+    clearSearchData() {},
   },
 };
 </script>