Kaynağa Gözat

Merge branch 'ol_12_30' into 11/24SAAS

lex-xin 3 yıl önce
ebeveyn
işleme
e8e560bd92

+ 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' // 平台员工管理
 ]

Dosya farkı çok büyük olduğundan ihmal edildi
+ 503 - 503
src/store/modules/permission.js


+ 2 - 2
src/views/categroyManager/insideSetting/adminManager.vue

@@ -126,13 +126,13 @@ export default {
           page: this.pageInfo.page,
         },
       };
-      let tagTitle = "新建";
+      let tagTitle = "添加";
       if (row) {
         params.query.id = row.id;
         tagTitle = "修改";
       }
       this.$router.push(params, (route) => {
-        route.meta.title = tagTitle + "系统角色权限";
+        route.meta.title = tagTitle + "系统角色";
       });
     },
   },

+ 43 - 19
src/views/categroyManager/insideSetting/adminOperation.vue

@@ -97,11 +97,13 @@ export default {
       slideCount: 0,
       seachRoleValue: "", //权限搜索字段
       filterIds: [4794, 4743, 3266, 3268, 3306, 3307, 3309, 3784, 4627],
+      isplatform: null,
     };
   },
   mounted() {
     this.onReSet();
     this.init();
+    console.log(this.$route)
   },
   activated() {
     this.onReSet();
@@ -112,6 +114,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,22 +124,25 @@ export default {
       let tempIds = this.$refs.tree.getCheckedKeys();
       let halfIds = this.$refs.tree.getHalfCheckedKeys();
       let allIds = [...tempIds, ...halfIds];
+      let params = {
+        organId: this.organId,
+        roleDesc: this.result.roleDesc,
+        roleName: this.result.roleName,
+        menuIds: allIds,
+      }
+      if (this.isplatform) {
+        params.tenantId = -1;
+      }
       if (this.pageType == "update") {
         roleUpdate({
           id: this.id,
-          organId: this.organId,
-          roleDesc: this.result.roleDesc,
-          roleName: this.result.roleName,
-          menuIds: allIds,
+          ...params
         }).then((res) => {
           this.messageTips("修改", res);
         });
       } else if (this.pageType == "create") {
         roleAdd({
-          organId: this.organId,
-          roleDesc: this.result.roleDesc,
-          roleName: this.result.roleName,
-          menuIds: allIds,
+          ...params
         }).then((res) => {
           this.messageTips("添加", res);
         });
@@ -144,12 +150,19 @@ 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({
-          path: "/adminManager",
-          query: { page: this.page },
-        });
+        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);
       }
@@ -267,12 +280,23 @@ export default {
     },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);
-      this.$router.push({
-        path: "/adminManager",
-        query: {
-          page: this.$route.query.page,
-        },
-      });
+      // this.$router.push({
+      //   path: "/adminManager",
+      //   query: {
+      //     page: this.$route.query.page,
+      //   },
+      // });
+      if (this.isplatform) {
+        this.$router.push({
+          path: "/platformAdminManger",
+          query: { page: this.page },
+        });
+      } else {
+        this.$router.push({
+          path: "/adminManager",
+          query: { page: this.page },
+        });
+      }
     },
     seachRoles() {
       this.$refs.tree.filter(this.seachRoleValue);

+ 2 - 1
src/views/organManager/components/organInfo.vue

@@ -488,7 +488,8 @@ export default {
     }
 
     this.$refs.form.clearValidate();
-    if (this.data&& this.$route.query.type == "create") {
+    console.log(this.data,'data')
+    if (this.data.id&& this.$route.query.type == "create") { 
       this.checkPhone();
       //  验证表单 看看是否有异常
       this.onSubmit();

+ 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: "/platformManager/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>

+ 338 - 0
src/views/platformManager/paltformAdmin/paltformOperation.vue

@@ -0,0 +1,338 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <el-page-header
+        @back="onCancel"
+        :content="(pageType == 'create' ? '添加' : '修改') + '平台角色'"
+      ></el-page-header>
+    </h2>
+    <div class="m-core">
+      <el-form ref="form" label-width="120px" style="width: 500px">
+        <el-form-item label="角色名称" prop="roleName">
+          <el-input v-model.trim="result.roleName"></el-input>
+        </el-form-item>
+        <el-form-item label="角色描述">
+          <el-input type="textarea" v-model.trim="result.roleDesc"></el-input>
+        </el-form-item>
+        <el-form-item label="搜索">
+          <el-input
+            style="width: 210px"
+            v-model.trim="seachRoleValue"
+            clearable
+          ></el-input>
+          <el-button style="margin-left: 10px" type="danger" @click="seachRoles"
+            >搜索</el-button
+          >
+          <!-- <el-button type="primary"
+                     @click="onReSetRole">重置</el-button> -->
+        </el-form-item>
+        <el-form-item label="基本权限">
+          <el-checkbox
+            :indeterminate="isIndeterminate"
+            @change="onCheckAll"
+            v-model.trim="checkAll"
+            >全选</el-checkbox
+          >
+
+          <el-tree
+            :data="data"
+            show-checkbox
+            node-key="id"
+            @check="onTreeCheck"
+            :filter-node-method="filterNode"
+            ref="tree"
+            accordion
+            highlight-current
+            :default-checked-keys="result.menuIds"
+            :props="defaultProps"
+          >
+            <div slot-scope="{ node, data }">
+              {{ node.label }}
+              <el-tag v-if="data.type == 1" effect="dark">按钮</el-tag>
+            </div>
+          </el-tree>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="onSubmit" type="primary"
+            >立即{{ pageType == "create" ? "创建" : "修改" }}</el-button
+          >
+          <el-button @click="onReSet('form')">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+<script>
+import { getUserRole } from "@/api/systemManage";
+import store from "@/store";
+import { getSilder } from "@/api/silder";
+import {
+  roleGetMenus,
+  getRoleInfo,
+  roleUpdate,
+  roleAdd,
+} from "@/api/systemManage";
+export default {
+  name: "adminOperation",
+  data() {
+    return {
+      organId: null,
+      pageType: null,
+      id: null,
+      page: null,
+      isIndeterminate: false,
+      data: [],
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+      result: {
+        roleName: null,
+        roleDesc: null,
+      },
+      checkAll: false,
+      splice: [],
+      silderList: [],
+      allChildIds: [], // 所有子编号
+      slideCount: 0,
+      seachRoleValue: "", //权限搜索字段
+      // filterIds: [4794, 4743, 3266, 3268, 3306, 3307, 3309, 3784, 4627],
+            filterIds: [],
+      isplatform: null,
+    };
+  },
+  mounted() {
+    this.onReSet();
+    this.init();
+    console.log(this.$route)
+  },
+  activated() {
+    this.onReSet();
+    this.init();
+  },
+  methods: {
+    init() {
+      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]);
+      }
+      this.lookSilder();
+    },
+    onSubmit() {
+      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,
+          organId: this.organId,
+          roleDesc: this.result.roleDesc,
+          roleName: this.result.roleName,
+          menuIds: allIds,
+          tenantId,
+        }).then((res) => {
+          this.messageTips("修改", res);
+        });
+      } else if (this.pageType == "create") {
+        roleAdd({
+          organId: this.organId,
+          roleDesc: this.result.roleDesc,
+          roleName: this.result.roleName,
+          menuIds: allIds,
+          tenantId,
+        }).then((res) => {
+          this.messageTips("添加", res);
+        });
+      }
+    },
+    messageTips(title, res) {
+      if (res.code == 200) {
+        this.$message.success(`${title}成功`);
+        this.$store.dispatch("delVisitedViews", this.$route);
+        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);
+      }
+    },
+    async lookSilder() {
+      //  修复反写没有loading request返回的不是Promise await无效
+      getSilder({ hid: 0 }).then(async (silderList) => {
+        let tempData = [];
+        if (silderList.code == 200) {
+          this.silderList = silderList.data;
+          tempData = this.setTableData(silderList.data);
+          this.data = tempData;
+          // console.log(this.data)
+        }
+        // console.log(this.pageType)
+        if (this.pageType == "update") {
+          let roleInfo = await getRoleInfo({ id: this.id });
+          if (roleInfo.code == 200) {
+            let roleData = roleInfo.data;
+            // 是否是全部选中
+            this.checkAll = roleData.menuIds.length >= this.slideCount;
+            // 是否是半选
+            this.isIndeterminate =
+              roleData.menuIds.length > 0 &&
+              roleData.menuIds.length < this.slideCount;
+            let tSplice = this.getParent(roleData.menuIds, tempData);
+            roleData.menuIds = tSplice;
+            this.result = roleData;
+          }
+        } else {
+          this.onReSet();
+        }
+      });
+    },
+    onTreeCheck() {
+      let checkTree = this.$refs.tree.getCheckedKeys();
+      this.checkAll = checkTree.length >= this.slideCount;
+      this.isIndeterminate =
+        checkTree.length > 0 && checkTree.length < this.slideCount;
+    },
+    onCheckAll(val) {
+      if (val) {
+        // 先去掉半选
+        this.isIndeterminate = false;
+        this.$refs.tree.setCheckedNodes(this.data);
+      } else {
+        this.$refs.tree.setCheckedNodes([]);
+      }
+    },
+
+    //递归获取到所有的为子级的ID
+    getParent(checkIds, data) {
+      let removeIds = JSON.parse(JSON.stringify(checkIds));
+      this.getAllChildIds(data);
+      let tempAllChildIds = this.allChildIds;
+      for (let i = checkIds.length; i > 0; i--) {
+        if (!tempAllChildIds.includes(checkIds[i - 1])) {
+          removeIds.splice(i - 1, 1);
+        }
+      }
+      return removeIds;
+    },
+    getAllChildIds(data) {
+      // 获取所有最子集编号
+      let child = this.allChildIds;
+      let tempList = [];
+      data.forEach((item, index) => {
+        let temp = [];
+        if (item.children && item.children.length > 0) {
+          temp = this.getAllChildIds(item.children);
+        } else {
+          child.push(item.id);
+        }
+      });
+    },
+    setTableData(result) {
+      let list = [];
+      list = result.map((res) => {
+        if (!this.filterIds.includes(res.id)) {
+          let tempList = {};
+          tempList = {
+            id: res.id,
+            name: res.name,
+            label: res.name,
+            type: res.type,
+            path: res.path,
+            permission: res.permission,
+            icon: res.icon,
+            parentId: res.parentId,
+          };
+          this.slideCount++;
+          if (res.sysMenus && res.sysMenus.length > 0) {
+            tempList.children = this.setTableData(res.sysMenus);
+          }
+          return tempList;
+        }
+        return null;
+      });
+      let tempList = [];
+      list.forEach((item) => {
+        if (item) {
+          tempList.push(item);
+        }
+      });
+      return tempList;
+    },
+    onReSet() {
+      this.$refs.tree.setCheckedNodes([]);
+      this.result = {
+        roleName: null,
+        roleDesc: null,
+      };
+      this.isIndeterminate = false;
+      this.checkAll = false;
+    },
+    onCancel() {
+      this.$store.dispatch("delVisitedViews", this.$route);
+      // this.$router.push({
+      //   path: "/adminManager",
+      //   query: {
+      //     page: this.$route.query.page,
+      //   },
+      // });
+      if (this.isplatform) {
+        this.$router.push({
+          path: "/platformAdminManger",
+          query: { page: this.page },
+        });
+      } else {
+        this.$router.push({
+          path: "/adminManager",
+          query: { page: this.page },
+        });
+      }
+    },
+    seachRoles() {
+      this.$refs.tree.filter(this.seachRoleValue);
+    },
+    filterNode(value, data) {
+      console.log(data);
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    onReSetRole() {
+      this.seachRoleValue = "";
+      this.data = this.setTableData(this.silderList);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.el-row {
+  margin-top: 40px;
+}
+.el-col {
+  display: flex;
+  align-items: center;
+  margin-bottom: 20px;
+  justify-content: flex-end;
+  margin-right: 50%;
+}
+.el-input-group {
+  width: 200px;
+  margin: 0 20px;
+}
+/deep/.el-tree-node__content {
+  height: 40px !important;
+}
+</style>

+ 1 - 1
src/views/resetTeaming/components/payInfoDetail.vue

@@ -196,7 +196,7 @@
                         <span style="color: #f56c6c; margin-right: 4px">*</span>
                         缴费时间
                         <el-tooltip placement="top" popper-class="mTooltip">
-                          <div slot="content">在时间段内学员才可缴费</div>
+                          <div slot="content">在时间段内学员才可缴费</div>
                           <i
                             class="el-icon-question"
                             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 = {
   /**

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor