xiatian 4 vuotta sitten
vanhempi
commit
c1cbe3a868
2 muutettua tiedostoa jossa 204 lisäystä ja 0 poistoa
  1. 6 0
      src/modules/basic/routes/routes.js
  2. 198 0
      src/modules/basic/view/admin_operate.vue

+ 6 - 0
src/modules/basic/routes/routes.js

@@ -17,6 +17,7 @@ import school_config from "../view/school_config";
 import unimportant_school_config from "../view/unimportant_school_config";
 import sys_notice from "../view/sys_notice";
 import sysLoginRuleList from "../view/sys_login_rule_list";
+import admin_operate from "../view/admin_operate";
 
 export default [
   {
@@ -52,6 +53,11 @@ export default [
         meta: { privilegeCodes: "index_user" },
         component: user
       },
+      {
+        path: "admin_operate", //操作日志
+        meta: { privilegeCodes: "index_admin_operate" },
+        component: admin_operate
+      },
       {
         path: "app_list", //应用列表
         meta: { pageName: "应用列表" },

+ 198 - 0
src/modules/basic/view/admin_operate.vue

@@ -0,0 +1,198 @@
+<template>
+  <section class="content">
+    <div class="box box-info">
+      <div
+        class="box-body"
+        v-loading.body="loading"
+        v-loading.fullscreen="loading"
+        element-loading-text="请稍后..."
+      >
+        <!-- 表单 -->
+        <el-form inline :model="searchForm">
+          <el-form-item label="登录名">
+            <el-input
+              placeholder="请输入登录名"
+              v-model="searchForm.loginName"
+              style="width: 180px"
+            />
+          </el-form-item>
+          <el-form-item label="角色">
+            <el-select
+              clearable
+              v-model="searchForm.roleId"
+              placeholder="请选择"
+              class="input_width"
+            >
+              <el-option
+                v-for="item in roleList4Search"
+                :label="item.roleName"
+                :value="item.roleId"
+                :key="item.roleId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="操作时间">
+            <el-date-picker
+              class="input"
+              v-model="timeRange"
+              type="datetimerange"
+              start-placeholder="开始日期"
+              range-separator="至"
+              end-placeholder="结束日期"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :clearable="false"
+              size="small"
+              @change="changeTimeRange"
+            ></el-date-picker>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-search"
+              @click="handleSearchBtn"
+            >
+              查询
+            </el-button>
+          </el-form-item>
+        </el-form>
+
+        <div class="block-seperator"></div>
+        <!-- 页面列表 -->
+        <el-table :data="tableData" border resizable stripe style="width: 100%">
+          <el-table-column width="120" prop="loginName" label="登录名">
+          </el-table-column>
+          <el-table-column width="120" prop="name" label="姓名">
+          </el-table-column>
+          <el-table-column prop="roles" label="用户角色"> </el-table-column>
+          <el-table-column width="120" prop="operateIp" label="IP地址">
+          </el-table-column>
+          <el-table-column width="200" prop="operate" label="操作">
+          </el-table-column>
+          <el-table-column width="150" prop="operateTime" label="操作时间">
+          </el-table-column>
+        </el-table>
+        <div class="page pull-right">
+          <el-pagination
+            v-if="paginationShow"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="pageSize"
+            :page-sizes="[10, 20, 50, 100, 200, 300]"
+            @size-change="handleSizeChange"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+          />
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+<script>
+import { CORE_API } from "@/constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  name: "Project",
+  data() {
+    return {
+      examList: [],
+      loading: false,
+      paginationShow: false,
+      roleList4Search: [],
+      timeRange: [],
+      searchForm: {
+        startTime: null,
+        endTime: null,
+        loginName: "",
+        roleId: ""
+      },
+      tableData: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 10
+    };
+  },
+  computed: {
+    ...mapState({ user: state => state.user })
+  },
+  methods: {
+    changeTimeRange(e) {
+      if (e && e.length > 0) {
+        this.searchForm.startTime = e[0];
+        this.searchForm.endTime = e[1];
+      } else {
+        this.searchForm.startTime = "";
+        this.searchForm.endTime = "";
+      }
+    },
+    handleSearchBtn() {
+      this.currentPage = 1;
+      this.search();
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.search();
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.search();
+    },
+    //查询
+    search() {
+      this.loading = true;
+      var url =
+        CORE_API +
+        "/adminOperate/page/" +
+        this.currentPage +
+        "/" +
+        this.pageSize;
+      this.$httpWithMsg
+        .get(url, { params: this.searchForm })
+        .then(response => {
+          this.tableData = response.data.list;
+          this.total = response.data.total;
+          this.loading = false;
+
+          this.$nextTick(function() {
+            this.paginationShow = true;
+          });
+          this.getStatus();
+        })
+        .finally(() => (this.loading = false));
+    },
+    init() {
+      this.search();
+
+      var url =
+        CORE_API +
+        "/rolePrivilege/getRoles?includeSuperAdmin=true&rootOrgId=" +
+        this.user.rootOrgId;
+
+      Promise.all([this.$httpWithMsg.post(url)]).then(([resp]) => {
+        this.roleList4Search = resp.data;
+      });
+    }
+  },
+  //初始化查询
+  created() {
+    this.init();
+  }
+};
+</script>
+
+<style scoped>
+.page {
+  margin-top: 10px;
+}
+.pull-length {
+  width: 300px;
+}
+.pull-center {
+  margin-top: 20px;
+}
+.editForm .el-form-item {
+  margin-bottom: 12px;
+}
+</style>