Browse Source

平台员工管理

1
Xiao_Mo 3 years ago
parent
commit
df132f58fb

+ 2 - 0
src/router/index.js

@@ -540,6 +540,8 @@ export const asyncRoutes = {
   studentGroupPractice:()=>import('@/views/studentManager/studentGroupPractice'),
   // 团练宝缴费记录
   studentGroupRecord:()=>import('@/views/studentManager/studentGroupRecord'),
+  // 平台员工管理
+  platformAdminManger:()=>import('@/views/platformManager/paltformAdmin'),
 }
 
 export default router

+ 2 - 1
src/router/notKeepAliveList.js

@@ -114,5 +114,6 @@ export default [
   '/business/studentPaySet',
   '/staffPlatManager',
   '/infoOAMananger',
-  '/tenantApply'
+  '/tenantApply',
+  '/platformAdminManger' // 平台员工管理
 ]

+ 18 - 2
src/views/categroyManager/insideSetting/adminOperation.vue

@@ -97,6 +97,7 @@ export default {
       slideCount: 0,
       seachRoleValue: "", //权限搜索字段
       filterIds: [4794, 4743, 3266, 3268, 3306, 3307, 3309, 3784, 4627],
+      isplatform:null
     };
   },
   mounted() {
@@ -112,6 +113,7 @@ export default {
       this.pageType = this.$route.query.type;
       this.id = this.$route.query.id;
       this.page = this.$route.query.page;
+      this.isplatform =  this.$route.query.isplatform
       if (this.pageType == "create") {
         this.$refs.tree.setCheckedKeys([4229]);
       }
@@ -121,6 +123,10 @@ export default {
       let tempIds = this.$refs.tree.getCheckedKeys();
       let halfIds = this.$refs.tree.getHalfCheckedKeys();
       let allIds = [...tempIds, ...halfIds];
+      let tenantId = null
+      if(this.isplatform){
+        tenantId = -1
+      }
       if (this.pageType == "update") {
         roleUpdate({
           id: this.id,
@@ -128,6 +134,7 @@ export default {
           roleDesc: this.result.roleDesc,
           roleName: this.result.roleName,
           menuIds: allIds,
+          tenantId
         }).then((res) => {
           this.messageTips("修改", res);
         });
@@ -137,6 +144,7 @@ export default {
           roleDesc: this.result.roleDesc,
           roleName: this.result.roleName,
           menuIds: allIds,
+          tenantId
         }).then((res) => {
           this.messageTips("添加", res);
         });
@@ -144,12 +152,20 @@ export default {
     },
     messageTips(title, res) {
       if (res.code == 200) {
-        this.$message.success("修改成功");
+        this.$message.success(`${title}成功`);
         this.$store.dispatch("delVisitedViews", this.$route);
-        this.$router.push({
+        if(this.isplatform){
+            this.$router.push({
+          path: "/platformAdminManger",
+          query: { page: this.page },
+        });
+        }else{
+            this.$router.push({
           path: "/adminManager",
           query: { page: this.page },
         });
+        }
+      
       } else {
         this.$message.error(res.msg);
       }

+ 148 - 0
src/views/platformManager/paltformAdmin/index.vue

@@ -0,0 +1,148 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>
+      平台角色管理
+    </h2>
+
+    <div class="m-core">
+      <save-form
+        :inline="true"
+        ref="searchForm"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item prop="search">
+          <el-input
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="search"
+            placeholder="请输入角色类型"
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <el-button
+        style="margin-bottom: 20px"
+        type="primary"
+        v-permission="'role/add'"
+        @click="onAdminOperation('create')"
+        icon="el-icon-plus"
+        >添加</el-button
+      >
+      <!-- 列表 -->
+      <div class="tableWrap">
+        <el-table :data="tableList" header-cell-class-name="headerName">
+          <el-table-column align="center" prop="roleName" label="角色类型">
+          </el-table-column>
+          <el-table-column align="center" prop="roleDesc" label="角色描述">
+          </el-table-column>
+          <el-table-column align="center" label="操作">
+            <template slot-scope="scope">
+              <el-button
+                @click="onAdminOperation('update', scope.row)"
+                v-permission="'role/update'"
+                type="text"
+                >修改</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          :total.sync="pageInfo.total"
+          :page.sync="pageInfo.page"
+          :limit.sync="pageInfo.limit"
+          :page-sizes="pageInfo.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import pagination from "@/components/Pagination/index";
+import { roleQueryPage } from "@/api/systemManage";
+export default {
+  name: "adminManager",
+  components: { pagination },
+  data() {
+    return {
+      tableList: [],
+      searchForm:{
+        search:''
+      },
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
+  },
+  created() {
+    this.init();
+  },
+  activated() {
+    this.init();
+  },
+  mounted() {},
+  methods: {
+    search() {
+      this.pageInfo.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.$refs.searchForm.resetFields();
+      this.search();
+    },
+    init() {
+      this.$route.query.page
+        ? (this.pageInfo.page = parseInt(this.$route.query.page))
+        : (this.pageInfo.page = 1);
+      this.getList();
+    },
+    getList() {
+      roleQueryPage({
+        rows: this.pageInfo.limit,
+        page: this.pageInfo.page,
+        ...this.searchForm,
+        tenantId:-1
+      }).then((res) => {
+        if (res.code == 200 && res.data) {
+          this.tableList = res.data.rows;
+          this.pageInfo.total = res.data.total;
+        }
+      });
+    },
+    onAdminOperation(type, row) {
+      let params = {
+        path: "/systemManager/adminOperation",
+        query: {
+          type: type,
+          page: this.pageInfo.page,
+          isplatform:true
+        },
+      };
+      let tagTitle = "新建";
+      if (row) {
+        params.query.id = row.id;
+        tagTitle = "修改";
+      }
+      this.$router.push(params, (route) => {
+        route.meta.title = tagTitle + "系统角色权限";
+      });
+    },
+  },
+};
+</script>
+<style lang="scss">
+.headerName {
+  background-color: #edeef0 !important;
+  color: #444444;
+}
+</style>

+ 2 - 2
vue.config.js

@@ -19,8 +19,8 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'http://192.168.3.251:8000' // 何国威
 // let target = 'http://192.168.3.250:8000' //邹璇
 // let target = 'http://192.168.3.119:8000' //勇哥
-// let target = 'http://dev.dayaedu.com' // 开发环境
-let target = 'https://test.dayaedu.com' //测试环境
+let target = 'http://dev.dayaedu.com' // 开发环境
+// let target = 'https://test.dayaedu.com' //测试环境
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**