zhangjie 2 éve
szülő
commit
99571493f0

+ 12 - 6
src/modules/base/views/PrintPlanPushManage.vue

@@ -125,6 +125,11 @@
       :ids="curSelectedPlanIds"
       @modified="mergePushed"
     ></print-plan-batch-push-dialog>
+    <!-- DataSyncDialog -->
+    <data-sync-dialog
+      ref="DataSyncDialog"
+      sync-type="EXAM_PUSH"
+    ></data-sync-dialog>
   </div>
 </template>
 
@@ -132,10 +137,11 @@
 import { printPlanPushListQuery } from "../api";
 import { examSemesterList } from "../../base/api";
 import PrintPlanBatchPushDialog from "../components/PrintPlanBatchPushDialog.vue";
+import DataSyncDialog from "../../stmms/components/DataSyncDialog.vue";
 
 export default {
   name: "print-plan-push-manage",
-  components: { PrintPlanBatchPushDialog },
+  components: { PrintPlanBatchPushDialog, DataSyncDialog },
   data() {
     return {
       filter: {
@@ -197,10 +203,10 @@ export default {
       this.multipleSelection = val.map(item => item.id);
     },
     toBatchPush() {
-      // if (!this.multipleSelection.length) {
-      //   this.$message.error("请选择要批量推送的印刷计划");
-      //   return;
-      // }
+      if (!this.multipleSelection.length) {
+        this.$message.error("请选择要批量推送的印刷计划");
+        return;
+      }
       this.curSelectedPlanIds = [...this.multipleSelection];
       this.$refs.PrintPlanBatchPushDialog.open();
     },
@@ -212,7 +218,7 @@ export default {
       this.toPage(this.current);
     },
     toResult() {
-      // todo:
+      this.$refs.DataSyncDialog.open();
     }
   }
 };

+ 4 - 0
src/modules/exam/api.js

@@ -272,3 +272,7 @@ export const dataDownloadDetail = id => {
 export const dataBatchDownload = datas => {
   return $post("/api/admin/data/download/download_batch", datas);
 };
+// action-log-manage
+export const actionLogList = datas => {
+  return $postParam("/api/admin/basic/operation_log/query", datas);
+};

+ 6 - 0
src/modules/exam/router.js

@@ -8,6 +8,7 @@ import TaskPaperManage from "./views/TaskPaperManage.vue";
 import DataTaskManage from "./views/DataTaskManage.vue";
 import StatisticsManage from "./views/StatisticsManage.vue";
 import DownloadManage from "./views/DownloadManage.vue";
+import ActionLogManage from "./views/ActionLogManage.vue";
 
 export default [
   {
@@ -54,5 +55,10 @@ export default [
     path: "/exam/download-manage",
     name: "DownloadManage",
     component: DownloadManage
+  },
+  {
+    path: "/exam/download-manage",
+    name: "ActionLogManage",
+    component: ActionLogManage
   }
 ];

+ 148 - 0
src/modules/exam/views/ActionLogManage.vue

@@ -0,0 +1,148 @@
+<template>
+  <div class="action-log-manage">
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" inline>
+        <template v-if="checkPrivilege('condition', 'condition')">
+          <el-form-item label="操作类型:">
+            <el-select
+              v-model="filter.customizedOperationType"
+              placeholder="短信类型"
+              clearable
+            >
+              <el-option
+                v-for="(val, key) in OPERATION_TYPE"
+                :key="key"
+                :value="key"
+                :label="val"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="操作时间:">
+            <el-date-picker
+              v-model="createTime"
+              type="datetimerange"
+              :picker-options="pickerOptions"
+              range-separator="至"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              value-format="timestamp"
+              align="right"
+              unlink-panels
+            >
+            </el-date-picker>
+          </el-form-item>
+        </template>
+        <el-form-item label-width="0px">
+          <el-button
+            v-if="checkPrivilege('button', 'select')"
+            type="primary"
+            @click="toPage(1)"
+            >查询</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <div class="part-box part-box-pad">
+      <el-table ref="TableList" :data="dataList">
+        <el-table-column
+          type="index"
+          label="序号"
+          width="70"
+          :index="indexMethod"
+        ></el-table-column>
+        <el-table-column prop="detail" label="日志内容"> </el-table-column>
+        <el-table-column prop="operatorId" label="操作人ID" width="120">
+        </el-table-column>
+        <el-table-column prop="operatorName" label="操作人姓名">
+        </el-table-column>
+        <el-table-column prop="ip" label="IP"> </el-table-column>
+        <el-table-column prop="customizedOperationTypeName" label="操作类型">
+        </el-table-column>
+        <el-table-column prop="createTime" label="创建时间" width="170">
+          <span slot-scope="scope">
+            {{ scope.row.createTime | timestampFilter }}
+          </span>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total,prev, pager, next"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { actionLogList } from "../api";
+import { enumsByType } from "../../base/api";
+
+import pickerOptions from "@/constants/datePickerOptions";
+
+export default {
+  name: "action-log-manage",
+  data() {
+    return {
+      filter: {
+        customizedOperationType: "",
+        startTime: "",
+        endTime: ""
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      dataList: [],
+      OPERATION_TYPE: {},
+      loading: false,
+      pickerOptions,
+      createTime: []
+    };
+  },
+  async created() {
+    await this.getLogTypes();
+    await this.getList();
+  },
+  methods: {
+    async getLogTypes() {
+      const res = await enumsByType("OPERATION_TYPE_ENUM");
+      const data = res || [];
+      this.OPERATION_TYPE = {};
+      data.forEach(item => {
+        this.OPERATION_TYPE[item.name] = item.desc;
+      });
+    },
+    async getList() {
+      if (!this.checkPrivilege("list", "list")) return;
+
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size
+      };
+      if (this.createTime) {
+        datas.startTime = this.createTime[0];
+        datas.endTime = this.createTime[1];
+      }
+      const data = await actionLogList(datas);
+      this.dataList = data.records.map(item => {
+        item.customizedOperationTypeName = this.OPERATION_TYPE[
+          item.customizedOperationType
+        ];
+        return item;
+      });
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    }
+  }
+};
+</script>

+ 47 - 0
src/modules/stmms/components/DataSyncDialog.vue

@@ -0,0 +1,47 @@
+<template>
+  <el-dialog
+    class="data-sync-dialog page-dialog"
+    :visible.sync="modalIsShow"
+    title="数据同步进度"
+    top="10px"
+    width="1100px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+  >
+    <sync-manage
+      v-if="modalIsShow"
+      none-privilege
+      :sync-type="syncType"
+    ></sync-manage>
+    <div slot="footer"></div>
+  </el-dialog>
+</template>
+
+<script>
+import SyncManage from "../views/SyncManage.vue";
+
+export default {
+  name: "data-sync-dialog",
+  components: {
+    SyncManage
+  },
+  props: {
+    syncType: {
+      type: String,
+      default: ""
+    }
+  },
+  data() {
+    return { modalIsShow: false };
+  },
+  methods: {
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    }
+  }
+};
+</script>

+ 29 - 5
src/modules/stmms/views/SyncManage.vue

@@ -2,9 +2,15 @@
   <div class="sync-manage">
     <div class="part-box part-box-filter part-box-flex">
       <el-form ref="FilterForm" label-position="left" inline>
-        <template v-if="checkPrivilege('condition', 'condition')">
+        <template v-if="checkPriv('condition', 'condition')">
           <el-form-item label="同步类型:">
-            <el-select v-model="filter.type" placeholder="同步类型" clearable>
+            <el-select
+              v-model="filter.type"
+              placeholder="同步类型"
+              clearable
+              :disabled="typeDisabled"
+              style="width:300px"
+            >
               <el-option
                 v-for="(val, key) in STMMS_SYNC_TYPE"
                 :key="key"
@@ -41,7 +47,7 @@
         </template>
         <el-form-item label-width="0px">
           <el-button
-            v-if="checkPrivilege('button', 'select')"
+            v-if="checkPriv('button', 'select')"
             type="primary"
             @click="toPage(1)"
             >查询</el-button
@@ -101,7 +107,7 @@
         >
           <template slot-scope="scope">
             <el-button
-              v-if="scope.row.hasReportFile && checkPrivilege('link', 'export')"
+              v-if="scope.row.hasReportFile && checkPriv('link', 'export')"
               type="text"
               class="btn-primary"
               :disabled="loading"
@@ -143,6 +149,16 @@ import { downloadByUrl } from "@/plugins/download";
 
 export default {
   name: "sync-manage",
+  props: {
+    syncType: {
+      type: String,
+      default: ""
+    },
+    nonePrivilege: {
+      type: Boolean,
+      default: false
+    }
+  },
   data() {
     return {
       STMMS_SYNC_TYPE: {},
@@ -153,6 +169,7 @@ export default {
         type: "",
         status: ""
       },
+      typeDisabled: false,
       current: 1,
       size: this.GLOBAL.pageSize,
       total: 0,
@@ -161,11 +178,18 @@ export default {
     };
   },
   created() {
+    if (this.syncType) {
+      this.filter.type = this.syncType;
+      this.typeDisabled = true;
+    }
     this.getSyncTypes();
     this.getSyncStatus();
     this.getList();
   },
   methods: {
+    checkPriv(type, field) {
+      return this.nonePrivilege || this.checkPrivilege(type, field);
+    },
     async getSyncTypes() {
       const res = await enumsByType("PUSH_TYPE_ENUM");
       const data = res || [];
@@ -183,7 +207,7 @@ export default {
       });
     },
     async getList() {
-      if (!this.checkPrivilege("list", "list")) return;
+      if (!this.checkPriv("list", "list")) return;
 
       const datas = {
         ...this.filter,