谢杰标 2 år sedan
förälder
incheckning
4a64973253

+ 7 - 7
src/api/system/menu.js

@@ -3,7 +3,7 @@ export default {
     //新增菜单
     addsystemmenu(data) {
         return request({
-            url: '/system/menu',
+            url: '/store/system/menu',
             method: 'post',
             data
         })
@@ -11,14 +11,14 @@ export default {
     //删除菜单
     delsystemmenu(data) {
         return request({
-            url: '/system/menu/delete/' + data,
+            url: '/store/system/menu/delete/' + data,
             method: 'post',
         })
     },
     //修改菜单
     editsystemmenu(data) {
         return request({
-            url: '/system/menu/edit',
+            url: '/store/system/menu/edit',
             method: 'post',
             data
         })
@@ -26,7 +26,7 @@ export default {
     //获取菜单列表
     getsystemmenu(data) {
         return request({
-            url: '/system/menu/list',
+            url: '/store/system/menu/list',
             method: 'get',
             params: data
         })
@@ -34,14 +34,14 @@ export default {
     //加载对应角色菜单列表树
     roleMenuTreeselect(data) {
         return request({
-            url: `/system/menu/roleMenuTreeselect/` + data,
+            url: `/store/system/menu/roleMenuTreeselect/` + data,
             method: 'get',
         })
     },
     //获取菜单下拉树列表
     enutreeselect(data) {
         return request({
-            url: `/system/menu/treeselect/`,
+            url: `/store/system/menu/treeselect/`,
             method: 'get',
             params: data
         })
@@ -49,7 +49,7 @@ export default {
     //根据菜单编号获取详细信息
     enutreeselectmenu(data) {
         return request({
-            url: `/system/menu/` + data,
+            url: `/store/system/menu/` + data,
             method: 'get',
         })
     },

+ 8 - 8
src/api/system/roleInfoManagement.js

@@ -3,7 +3,7 @@ export default {
     //新增角色
     addRole(data) {
         return request({
-            url: '/system/role',
+            url: '/store/system/role',
             method: 'post',
             data
         })
@@ -11,7 +11,7 @@ export default {
     //状态修改
     changeStatusRole(data) {
         return request({
-            url: '/system/role/changeStatus',
+            url: '/store/system/role/changeStatus',
             method: 'post',
             data
         })
@@ -19,7 +19,7 @@ export default {
     //修改保存数据权限
     dataScopeRole(data) {
         return request({
-            url: '/system/role/dataScope',
+            url: '/store/system/role/dataScope',
             method: 'post',
             data
         })
@@ -27,15 +27,15 @@ export default {
     //修改保存角色
     editRole(data) {
         return request({
-            url: '/system/role/edit',
+            url: '/store/system/role/edit',
             method: 'post',
             data
         })
     },
     //角色列表
-    obtainRoleList(data) {
+    obtainRoleList(data) {  
         return request({
-            url: '/system/role/list',
+            url: '/store/system/role/list',
             method: 'get',
             params: data
         })
@@ -43,7 +43,7 @@ export default {
     //获取角色选择框列表
     obtainRoleOptionselect(data) {
         return request({
-            url: '/system/role/optionselect',
+            url: '/store/system/role/optionselect',
             method: 'get',
             params: data
         })
@@ -51,7 +51,7 @@ export default {
     //根据角色编号获取详细信息
     obtainRoleId(data) {
         return request({
-            url: `/system/role/` + data,
+            url: `/store/system/role/` + data,
             method: 'get',
         })
     },

+ 0 - 1
src/components/common/container.vue

@@ -49,7 +49,6 @@ export default {
   padding: 16px;
   border-radius: 8px;
   height: 100%;
-  // min-height: calc(100vh - 110px);
   position: relative;
   .contain-title {
     margin-bottom: 20px;

+ 16 - 0
src/components/tableList.vue

@@ -141,6 +141,22 @@
           <span v-else-if="item.scope === 'time'">{{
             numTime(scope.row[item.prop])
           }}</span>
+          <div v-else-if="item.scope === 'isOptions'">
+            <template v-for="(itemt, indext) in item.options">
+              <span
+                :key="indext"
+                v-if="itemt.value === scope.row[item.prop]"
+                :style="itemt.style ? itemt.style : ''"
+                >{{ itemt.label }}
+                <el-button
+                  type="text"
+                  v-if="itemt.click"
+                  @click="backFunc(scope.row)"
+                  >查看</el-button
+                ></span
+              >
+            </template>
+          </div>
           <span v-else-if="item.scope === 'isgzhOpenId'">{{
             scope.row[item.prop] ? "是" : "否"
           }}</span>

+ 146 - 108
src/layout/components/TagsView/index.vue

@@ -1,36 +1,60 @@
 <template>
   <div id="tags-view-container" class="tags-view-container">
-    <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
+    <scroll-pane
+      ref="scrollPane"
+      class="tags-view-wrapper"
+      @scroll="handleScroll"
+    >
       <router-link
         v-for="tag in visitedViews"
         ref="tag"
         :key="tag.path"
-        :class="isActive(tag)?'active':''"
+        :class="isActive(tag) ? 'active' : ''"
         :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
         tag="span"
         class="tags-view-item"
         :style="activeStyle(tag)"
-        @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
-        @contextmenu.prevent.native="openMenu(tag,$event)"
+        @click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
+        @contextmenu.prevent.native="openMenu(tag, $event)"
       >
         {{ tag.title }}
-        <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
+        <span
+          v-if="!isAffix(tag)"
+          class="el-icon-close"
+          @click.prevent.stop="closeSelectedTag(tag)"
+        />
       </router-link>
     </scroll-pane>
-    <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
-      <li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
-      <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前</li>
-      <li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
-      <li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
-      <li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> 关闭右侧</li>
-      <li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 全部关闭</li>
+    <ul
+      v-show="visible"
+      :style="{ left: left + 'px', top: top + 'px' }"
+      class="contextmenu"
+    >
+      <li @click="refreshSelectedTag(selectedTag)">
+        <i class="el-icon-refresh-right"></i> 刷新页面
+      </li>
+      <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">
+        <i class="el-icon-close"></i> 关闭当前
+      </li>
+      <li @click="closeOthersTags">
+        <i class="el-icon-circle-close"></i> 关闭其他
+      </li>
+      <li v-if="!isFirstView()" @click="closeLeftTags">
+        <i class="el-icon-back"></i> 关闭左侧
+      </li>
+      <li v-if="!isLastView()" @click="closeRightTags">
+        <i class="el-icon-right"></i> 关闭右侧
+      </li>
+      <li @click="closeAllTags(selectedTag)">
+        <i class="el-icon-circle-close"></i> 全部关闭
+      </li>
     </ul>
   </div>
 </template>
 
 <script>
-import ScrollPane from './ScrollPane'
-import path from 'path'
+import ScrollPane from "./ScrollPane";
+import path from "path";
 
 export default {
   components: { ScrollPane },
@@ -40,202 +64,216 @@ export default {
       top: 0,
       left: 0,
       selectedTag: {},
-      affixTags: []
-    }
+      affixTags: [],
+    };
   },
   computed: {
     visitedViews() {
-      return this.$store.state.tagsView.visitedViews
+      return this.$store.state.tagsView.visitedViews;
     },
     routes() {
-      return this.$store.state.permission.routes
+      return this.$store.state.permission.routes;
     },
     theme() {
       return this.$store.state.settings.theme;
-    }
+    },
   },
   watch: {
     $route() {
-      this.addTags()
-      this.moveToCurrentTag()
+      this.addTags();
+      this.moveToCurrentTag();
     },
     visible(value) {
       if (value) {
-        document.body.addEventListener('click', this.closeMenu)
+        document.body.addEventListener("click", this.closeMenu);
       } else {
-        document.body.removeEventListener('click', this.closeMenu)
+        document.body.removeEventListener("click", this.closeMenu);
       }
-    }
+    },
   },
   mounted() {
-    this.initTags()
-    this.addTags()
+    this.initTags();
+    this.addTags();
   },
   methods: {
     isActive(route) {
-      return route.path === this.$route.path
+      return route.path === this.$route.path;
     },
     activeStyle(tag) {
       if (!this.isActive(tag)) return {};
       return {
         "background-color": this.theme,
-        "border-color": this.theme
+        "border-color": this.theme,
       };
     },
     isAffix(tag) {
-      return tag.meta && tag.meta.affix
+      return tag.meta && tag.meta.affix;
     },
     isFirstView() {
       try {
-        return this.selectedTag.fullPath === this.visitedViews[1].fullPath || this.selectedTag.fullPath === '/index'
+        return (
+          this.selectedTag.fullPath === this.visitedViews[1].fullPath ||
+          this.selectedTag.fullPath === "/index"
+        );
       } catch (err) {
-        return false
+        return false;
       }
     },
     isLastView() {
       try {
-        return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
+        return (
+          this.selectedTag.fullPath ===
+          this.visitedViews[this.visitedViews.length - 1].fullPath
+        );
       } catch (err) {
-        return false
+        return false;
       }
     },
-    filterAffixTags(routes, basePath = '/') {
-      let tags = []
-      routes.forEach(route => {
+    filterAffixTags(routes, basePath = "/") {
+      let tags = [];
+      routes.forEach((route) => {
         if (route.meta && route.meta.affix) {
-          const tagPath = path.resolve(basePath, route.path)
+          const tagPath = path.resolve(basePath, route.path);
           tags.push({
             fullPath: tagPath,
             path: tagPath,
             name: route.name,
-            meta: { ...route.meta }
-          })
+            meta: { ...route.meta },
+          });
         }
         if (route.children) {
-          const tempTags = this.filterAffixTags(route.children, route.path)
+          const tempTags = this.filterAffixTags(route.children, route.path);
           if (tempTags.length >= 1) {
-            tags = [...tags, ...tempTags]
+            tags = [...tags, ...tempTags];
           }
         }
-      })
-      return tags
+      });
+      return tags;
     },
     initTags() {
-      const affixTags = this.affixTags = this.filterAffixTags(this.routes)
+      const affixTags = (this.affixTags = this.filterAffixTags(this.routes));
       for (const tag of affixTags) {
         // Must have tag name
         if (tag.name) {
-          this.$store.dispatch('tagsView/addVisitedView', tag)
+          this.$store.dispatch("tagsView/addVisitedView", tag);
         }
       }
     },
     addTags() {
-      const { name } = this.$route
+      const { name } = this.$route;
       if (name) {
-        this.$store.dispatch('tagsView/addView', this.$route)
+        this.$store.dispatch("tagsView/addView", this.$route);
       }
-      return false
+      return false;
     },
     moveToCurrentTag() {
-      const tags = this.$refs.tag
+      const tags = this.$refs.tag;
       this.$nextTick(() => {
         for (const tag of tags) {
           if (tag.to.path === this.$route.path) {
-            this.$refs.scrollPane.moveToTarget(tag)
+            this.$refs.scrollPane.moveToTarget(tag);
             // when query is different then update
             if (tag.to.fullPath !== this.$route.fullPath) {
-              this.$store.dispatch('tagsView/updateVisitedView', this.$route)
+              this.$store.dispatch("tagsView/updateVisitedView", this.$route);
             }
-            break
+            break;
           }
         }
-      })
+      });
     },
     refreshSelectedTag(view) {
-      this.$store.dispatch('tagsView/delCachedView', view).then(() => {
-        const { fullPath } = view
+      this.$store.dispatch("tagsView/delCachedView", view).then(() => {
+        const { fullPath } = view;
         this.$nextTick(() => {
           this.$router.replace({
-            path: '/redirect' + fullPath
-          })
-        })
-      })
+            path: "/redirect" + fullPath,
+          });
+        });
+      });
     },
     closeSelectedTag(view) {
-      this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
-        if (this.isActive(view)) {
-          this.toLastView(visitedViews, view)
-        }
-      })
+      this.$store
+        .dispatch("tagsView/delView", view)
+        .then(({ visitedViews }) => {
+          if (this.isActive(view)) {
+            this.toLastView(visitedViews, view);
+          }
+        });
     },
     closeRightTags() {
-      this.$store.dispatch('tagsView/delRightTags', this.selectedTag).then(visitedViews => {
-        if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
-          this.toLastView(visitedViews)
-        }
-      })
+      this.$store
+        .dispatch("tagsView/delRightTags", this.selectedTag)
+        .then((visitedViews) => {
+          if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {
+            this.toLastView(visitedViews);
+          }
+        });
     },
     closeLeftTags() {
-      this.$store.dispatch('tagsView/delLeftTags', this.selectedTag).then(visitedViews => {
-        if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
-          this.toLastView(visitedViews)
-        }
-      })
+      this.$store
+        .dispatch("tagsView/delLeftTags", this.selectedTag)
+        .then((visitedViews) => {
+          if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {
+            this.toLastView(visitedViews);
+          }
+        });
     },
     closeOthersTags() {
-      this.$router.push(this.selectedTag).catch(()=>{});
-      this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => {
-        this.moveToCurrentTag()
-      })
+      this.$router.push(this.selectedTag).catch(() => {});
+      this.$store
+        .dispatch("tagsView/delOthersViews", this.selectedTag)
+        .then(() => {
+          this.moveToCurrentTag();
+        });
     },
     closeAllTags(view) {
-      this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => {
-        if (this.affixTags.some(tag => tag.path === this.$route.path)) {
-          return
+      this.$store.dispatch("tagsView/delAllViews").then(({ visitedViews }) => {
+        if (this.affixTags.some((tag) => tag.path === this.$route.path)) {
+          return;
         }
-        this.toLastView(visitedViews, view)
-      })
+        this.toLastView(visitedViews, view);
+      });
     },
     toLastView(visitedViews, view) {
-      const latestView = visitedViews.slice(-1)[0]
+      const latestView = visitedViews.slice(-1)[0];
       if (latestView) {
-        this.$router.push(latestView.fullPath)
+        this.$router.push(latestView.fullPath);
       } else {
         // now the default is to redirect to the home page if there is no tags-view,
         // you can adjust it according to your needs.
-        if (view.name === 'Dashboard') {
+        if (view.name === "Dashboard") {
           // to reload home page
-          this.$router.replace({ path: '/redirect' + view.fullPath })
+          this.$router.replace({ path: "/redirect" + view.fullPath });
         } else {
-          this.$router.push('/')
+          this.$router.push("/");
         }
       }
     },
     openMenu(tag, e) {
-      const menuMinWidth = 105
-      const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
-      const offsetWidth = this.$el.offsetWidth // container width
-      const maxLeft = offsetWidth - menuMinWidth // left boundary
-      const left = e.clientX - offsetLeft + 15 // 15: margin right
+      const menuMinWidth = 105;
+      const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left
+      const offsetWidth = this.$el.offsetWidth; // container width
+      const maxLeft = offsetWidth - menuMinWidth; // left boundary
+      const left = e.clientX - offsetLeft + 15; // 15: margin right
 
       if (left > maxLeft) {
-        this.left = maxLeft
+        this.left = maxLeft;
       } else {
-        this.left = left
+        this.left = left;
       }
 
-      this.top = e.clientY
-      this.visible = true
-      this.selectedTag = tag
+      this.top = e.clientY;
+      this.visible = true;
+      this.selectedTag = tag;
     },
     closeMenu() {
-      this.visible = false
+      this.visible = false;
     },
     handleScroll() {
-      this.closeMenu()
-    }
-  }
-}
+      this.closeMenu();
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -244,7 +282,7 @@ export default {
   width: 100%;
   background: #fff;
   border-bottom: 1px solid #d8dce5;
-  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
+  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
   .tags-view-wrapper {
     .tags-view-item {
       display: inline-block;
@@ -270,7 +308,7 @@ export default {
         color: #fff;
         border-color: #42b983;
         &::before {
-          content: '';
+          content: "";
           background: #fff;
           display: inline-block;
           width: 8px;
@@ -293,7 +331,7 @@ export default {
     font-size: 12px;
     font-weight: 400;
     color: #333;
-    box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
+    box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
     li {
       margin: 0;
       padding: 7px 16px;
@@ -316,10 +354,10 @@ export default {
       vertical-align: 2px;
       border-radius: 50%;
       text-align: center;
-      transition: all .3s cubic-bezier(.645, .045, .355, 1);
+      transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
       transform-origin: 100% 50%;
       &:before {
-        transform: scale(.6);
+        transform: scale(0.6);
         display: inline-block;
         vertical-align: -3px;
       }

+ 36 - 33
src/permission.js

@@ -1,57 +1,60 @@
-import router from './router'
-import store from './store'
-import { MessageBox, Message } from 'element-ui'
-import NProgress from 'nprogress'
-import 'nprogress/nprogress.css'
-import methods from '@/utils/methodsTool';
-import { getToken } from '@/utils/auth'
-import $api from "@/api/api"
+import router from "./router";
+import store from "./store";
+import { MessageBox, Message } from "element-ui";
+import NProgress from "nprogress";
+import "nprogress/nprogress.css";
+import methods from "@/utils/methodsTool";
+import { getToken } from "@/utils/auth";
+import $api from "@/api/api";
 
-NProgress.configure({ showSpinner: false })
+NProgress.configure({ showSpinner: false });
 
-const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
+const whiteList = ["/login", "/auth-redirect", "/bind", "/register"];
 
 router.beforeEach((to, from, next) => {
   if (to.path !== from.path) {
     NProgress.start();
   }
   if (getToken()) {
-    to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
+    to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
     /* has token*/
-    if (to.path === '/login') {
-      next({ path: '/' })
-      NProgress.done()
+    if (to.path === "/login") {
+      next({ path: "/" });
+      NProgress.done();
     } else {
       if (store.getters.roles.length === 0) {
         // 判断当前用户是否已拉取完user_info信息
-        store.dispatch('GetInfo').then(() => {
-          store.dispatch('GenerateRoutes').then(accessRoutes => {
-            // 根据roles权限生成可访问的路由表
-            router.addRoutes(accessRoutes) // 动态添加可访问路由表
-            next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
+        store
+          .dispatch("GetInfo")
+          .then(() => {
+            store.dispatch("GenerateRoutes").then((accessRoutes) => {
+              // 根据roles权限生成可访问的路由表
+              router.addRoutes(accessRoutes); // 动态添加可访问路由表
+              next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
+            });
           })
-        }).catch(err => {
-          store.dispatch('LogOut').then(() => {
-            Message.error(err)
-            next({ path: '/' })
-          })
-        })
+          .catch((err) => {
+            store.dispatch("LogOut").then(() => {
+              Message.error(err);
+              next({ path: "/" });
+            });
+          });
       } else {
-        console.log("to:",to)
-        next()
+        console.log("to:", to);
+        next();
       }
     }
   } else {
     // 没有token
     if (whiteList.indexOf(to.path) !== -1) {
       // 在免登录白名单,直接进入
-      next()
+      next();
     } else {
-      next(`/login`)
-      NProgress.done()
+      next(`/login`);
+      NProgress.done();
     }
   }
-})
+});
 router.afterEach(() => {
-  NProgress.done()
-})
+  NProgress.done();
+});

+ 0 - 51
src/router/index.js

@@ -72,57 +72,6 @@ export const constantRoutes = [
       },
     ],
   },
-  {
-    path: "",
-    component: Layout,
-    redirect: "index",
-    children: [
-      {
-        path: "record",
-        component: (resolve) =>
-          require(["@/views/writeOffMag/record"], resolve),
-        name: "record",
-        meta: { title: "核销管理", icon: "dashboard", affix: true },
-      },
-      {
-        path: "/memberMag",
-        component: (resolve) => require(["@/views/memberMag/index"], resolve),
-        name: "memberMag",
-        meta: { title: "会员管理", icon: "dashboard", affix: true },
-      },
-      {
-        path: "/strikeBalance",
-        component: (resolve) =>
-          require(["@/views/strikeBalanceMag/index"], resolve),
-        name: "strikeBalance",
-        meta: { title: "冲账管理", icon: "dashboard", affix: true },
-      },
-      {
-        path: "/staffMag",
-        component: (resolve) => require(["@/views/staffMag/index"], resolve),
-        name: "staffMag",
-        meta: { title: "店员管理", icon: "dashboard", affix: true },
-      },
-      {
-        path: "/classify",
-        component: (resolve) => require(["@/views/goodsMag/classify"], resolve),
-        name: "classify",
-        meta: { title: "商品分类", icon: "dashboard", affix: true },
-      },
-      {
-        path: "/goodsMag",
-        component: (resolve) => require(["@/views/goodsMag/index"], resolve),
-        name: "goodsMag",
-        meta: { title: "商品管理", icon: "dashboard", affix: true },
-      },
-      {
-        path: "/report",
-        component: (resolve) => require(["@/views/report/index"], resolve),
-        name: "report",
-        meta: { title: "数据报表", icon: "dashboard", affix: true },
-      },
-    ],
-  },
 ];
 
 export default new Router({

+ 21 - 1
src/store/modules/permission.js

@@ -61,11 +61,31 @@ const permission = {
       return new Promise((resolve) => {
         // 向后端请求路由数据
         getRouters().then((res) => {
+          res.data.forEach((item, i) => {
+            if (!item.children) {
+              res.data[i] = {
+                meta: "",
+                path: "",
+                redirect: "/redirect",
+                component: "Layout",
+                alwaysShow: false,
+                children: [
+                  {
+                    name: item.name,
+                    path: item.path.substr(1),
+                    component: item.component,
+                    hidden: false,
+                    noChildren: true,
+                    meta: item.meta,
+                  },
+                ],
+              };
+            }
+          });
           const sdata = JSON.parse(JSON.stringify(res.data));
           const rdata = JSON.parse(JSON.stringify(res.data));
           const sidebarRoutes = filterAsyncRouter(sdata);
           const rewriteRoutes = filterAsyncRouter(rdata, false, true);
-          console.log("rewriteRoutes", rewriteRoutes);
           commit("SET_ROUTES", rewriteRoutes);
           commit("SET_SIDEBAR_ROUTERS", constantRoutes.concat(sidebarRoutes));
           commit("SET_DEFAULT_ROUTES", sidebarRoutes);

+ 73 - 63
src/store/modules/user.js

@@ -1,107 +1,117 @@
-import { login, logout, getInfo } from '@/api/login'
-import { getToken, setToken, removeToken } from '@/utils/auth'
+import { login, logout, getInfo } from "@/api/login";
+import { getToken, setToken, removeToken } from "@/utils/auth";
 import methods from "@/utils/methodsTool";
-import { encrypt } from '@/utils/jsencrypt'
+import { encrypt } from "@/utils/jsencrypt";
 
 const user = {
   state: {
     token: getToken(),
-    name: '',
-    avatar: '',
+    name: "",
+    avatar: "",
     roles: [],
     permissions: [],
-    userId: ''
+    userId: "",
   },
 
   mutations: {
     SET_TOKEN: (state, token) => {
-      state.token = token
+      state.token = token;
     },
     SET_NAME: (state, name) => {
-      state.name = name
+      state.name = name;
     },
     SET_AVATAR: (state, avatar) => {
-      state.avatar = avatar
+      state.avatar = avatar;
     },
     SET_ROLES: (state, roles) => {
-      state.roles = roles
+      state.roles = roles;
     },
     SET_PERMISSIONS: (state, permissions) => {
-      state.permissions = permissions
+      state.permissions = permissions;
     },
     SET_USERID: (state, userId) => {
-      state.userId = userId
+      state.userId = userId;
     },
   },
 
   actions: {
     // 登录
     Login({ commit }, userInfo) {
-      const username = userInfo.username.trim()
-      const password = encrypt(userInfo.password)
+      const username = userInfo.username.trim();
+      const password = encrypt(userInfo.password);
       // const password = userInfo.password
-      const code = userInfo.code
-      const uuid = userInfo.uuid
-      const phonenumber = userInfo.phonenumber
-      const smsCode = userInfo.smsCode
+      const code = userInfo.code;
+      const uuid = userInfo.uuid;
+      const phonenumber = userInfo.phonenumber;
+      const smsCode = userInfo.smsCode;
       return new Promise((resolve, reject) => {
-        login(username, password, code, uuid, phonenumber, smsCode).then(res => {
-          setToken(res.token)
-          commit('SET_TOKEN', res.token)
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
+        login(username, password, code, uuid, phonenumber, smsCode)
+          .then((res) => {
+            setToken(res.token);
+            commit("SET_TOKEN", res.token);
+            resolve();
+          })
+          .catch((error) => {
+            reject(error);
+          });
+      });
     },
 
     // 获取用户信息
     GetInfo({ commit, state }) {
       return new Promise((resolve, reject) => {
-        getInfo().then(result => {
-          const res = result.data
-          const user = res.user
-          const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : methods.getUrl() + user.avatar;
-          if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
-            commit('SET_ROLES', res.roles)
-            commit('SET_PERMISSIONS', res.permissions)
-          } else {
-            commit('SET_ROLES', ['ROLE_DEFAULT'])
-          }
-          commit('SET_NAME', user.userName)
-          commit('SET_AVATAR', avatar)
-          commit('SET_USERID', user.userId)
-          resolve(res)
-        }).catch(error => {
-          reject(error)
-        })
-      })
+        getInfo()
+          .then((result) => {
+            const res = result.data;
+            const user = res.user;
+            const avatar =
+              user.avatar == ""
+                ? require("@/assets/images/profile.jpg")
+                : methods.getUrl() + user.avatar;
+            if (res.roles && res.roles.length > 0) {
+              // 验证返回的roles是否是一个非空数组
+              commit("SET_ROLES", res.roles);
+              commit("SET_PERMISSIONS", res.permissions);
+            } else {
+              commit("SET_ROLES", ["ROLE_DEFAULT"]);
+            }
+            commit("SET_NAME", user.userName);
+            commit("SET_AVATAR", avatar);
+            commit("SET_USERID", user.userId);
+            resolve(res);
+          })
+          .catch((error) => {
+            reject(error);
+          });
+      });
     },
 
     // 退出系统
     LogOut({ commit, state }) {
       return new Promise((resolve, reject) => {
-        logout(state.token).then(() => {
-          commit('SET_TOKEN', '')
-          commit('SET_ROLES', [])
-          commit('SET_PERMISSIONS', [])
-          removeToken()
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
+        logout(state.token)
+          .then(() => {
+            commit("SET_TOKEN", "");
+            commit("SET_ROLES", []);
+            commit("SET_PERMISSIONS", []);
+            removeToken();
+            resolve();
+          })
+          .catch((error) => {
+            reject(error);
+          });
+      });
     },
 
     // 前端 登出
     FedLogOut({ commit }) {
-      return new Promise(resolve => {
-        commit('SET_TOKEN', '')
-        removeToken()
-        resolve()
-      })
-    }
-  }
-}
+      return new Promise((resolve) => {
+        commit("SET_TOKEN", "");
+        removeToken();
+        resolve();
+      });
+    },
+  },
+};
 
-export default user
+export default user;

+ 3 - 2
src/utils/request.js

@@ -9,7 +9,7 @@ import methods from "@/utils/methodsTool";
 axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
 // 创建axios实例
 // export const baseURL = process.env.VUE_APP_BASE_API
-export const baseURL = "http://192.168.1.222:7077/";
+export const baseURL = "http://192.168.1.7:7088/";
 export const BASE_IMG_URL = process.env.VUE_APP_IMG_API;
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
@@ -20,10 +20,11 @@ const service = axios.create({
 // request拦截器
 service.interceptors.request.use(
   (config) => {
+    config.headers["TenantId"] = "1"
     // 是否需要设置 token
     const isToken = (config.headers || {}).isToken === false;
     if (getToken() && !isToken) {
-      config.headers["AuthorizationToken"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
+      config.headers["AuthorizationToken"] = "Store " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
     }
     // 转换时间戳
     if (config.isProce) {

+ 1 - 1
src/views/components/index/payContain.vue

@@ -66,7 +66,7 @@
       </div>
     </div>
 
-    <el-button type="danger">危险按钮1</el-button>
+    <el-button type="danger">立即收款</el-button>
   </container>
 </template>
 

+ 29 - 0
src/views/storeMag/index.vue

@@ -0,0 +1,29 @@
+<template>
+    <div>
+        1414141
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'SaasMemberIndex',
+
+    data() {
+        return {
+            
+        };
+    },
+
+    mounted() {
+        
+    },
+
+    methods: {
+        
+    },
+};
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 86 - 162
src/views/systemManagement/roleManagement/index.vue

@@ -1,7 +1,11 @@
 <template>
-  <div id="roleManagement">
+  <container title="角色管理">
     <!-- <search-box :formList="formList" @search="search" @init="init" /> -->
+    <template v-slot:btn>
+      <el-button type="primary" @click="addClick(undefined)">添加</el-button>
+    </template>
     <table-list
+      style="margin-top: 40px"
       :tableSets="tableSet"
       :tableData="tableData"
       :navText="navText"
@@ -25,6 +29,7 @@
       @handleSizeChange="handleSizeChange"
       @handleCurrentChange="handleCurrentChange"
     />
+
     <el-dialog
       @closed="loadingClose"
       :visible.sync="dialogVisible"
@@ -41,134 +46,78 @@
         </div>
       </div>
       <div>
-        <el-row :gutter="10">
-          <el-form
-            label-position="right"
-            label-width="100px"
-            :model="listData"
-            :rules="rules"
-            ref="listData"
-            ><el-col
-              :span="12"
-              v-for="(items, indexs) in listitem"
-              :key="indexs"
+        <el-form
+          label-position="right"
+          label-width="100px"
+          :model="listData"
+          :rules="rules"
+          ref="listData"
+        >
+          <el-form-item
+            v-for="(items, indexs) in listitem"
+            :key="indexs"
+            :label="items.label"
+            :prop="items.prop"
+          >
+            <el-radio-group
+              v-if="items.scope === 'status'"
+              v-model="listData[items.prop]"
             >
-              <el-form-item :label="items.label" :prop="items.prop">
-                <el-radio-group
-                  v-if="items.scope === 'status'"
-                  v-model="listData[items.prop]"
-                >
-                  <el-radio
-                    v-for="(item, index) in items.options"
-                    :key="index"
-                    :label="item.value"
-                    :disabled="statusPop === 2"
-                    >{{ item.label }}</el-radio
-                  >
-                </el-radio-group>
-                <div v-else-if="items.scope === 'tree'">
-                  <el-checkbox
-                    v-model="menuExpand"
-                    @change="handleCheckedTreeExpand($event, 'menu')"
-                    >展开/折叠</el-checkbox
-                  >
-                  <el-checkbox
-                    v-model="menuNodeAll"
-                    @change="handleCheckedTreeNodeAll($event, 'menu')"
-                    >全选/全不选</el-checkbox
-                  >
-                  <!-- <el-checkbox
+              <el-radio
+                v-for="(item, index) in items.options"
+                :key="index"
+                :label="item.value"
+                :disabled="statusPop === 2"
+                >{{ item.label }}</el-radio
+              >
+            </el-radio-group>
+            <div v-else-if="items.scope === 'tree'">
+              <el-checkbox
+                v-model="menuExpand"
+                @change="handleCheckedTreeExpand($event, 'menu')"
+                >展开/折叠</el-checkbox
+              >
+              <el-checkbox
+                v-model="menuNodeAll"
+                @change="handleCheckedTreeNodeAll($event, 'menu')"
+                >全选/全不选</el-checkbox
+              >
+              <!-- <el-checkbox
                 v-model="listData.menuCheckStrictly"
                 @change="handleCheckedTreeConnect($event, 'menu')"
                 >父子联动</el-checkbox
               > -->
-                  <el-tree
-                    class="tree-border"
-                    :data="menuOptions"
-                    show-checkbox
-                    ref="menu"
-                    node-key="id"
-                    empty-text="加载中,请稍后"
-                    :props="defaultProps"
-                  ></el-tree>
-                </div>
-                <div v-else-if="items.scope === 'treeInfo'">
-                  <el-checkbox
-                    v-model="menuExpandInfo"
-                    @change="handleCheckedTreeExpandInfo($event, 'info')"
-                    >展开/折叠</el-checkbox
-                  >
-                  <el-checkbox
-                    v-model="menuNodeAllInfo"
-                    @change="handleCheckedTreeNodeAllInfo($event, 'info')"
-                    >全选/全不选</el-checkbox
-                  >
-                  <!-- <el-checkbox
-                v-model="listData.menuCheckStrictly"
-                @change="handleCheckedTreeConnect($event, 'menu')"
-                >父子联动</el-checkbox
-              > -->
-                  <!-- :check-strictly="!listData.menuCheckStrictly"👇 -->
-                  <div style="position: relative">
-                    <el-tooltip
-                      effect="light"
-                      class="item"
-                      placement="bottom-start"
-                    >
-                      <div slot="content">
-                        适用模块: <br />1.工作台
-                        <br />2.商品管理(课程查询列表)
-                        <br />3.网课学习管理(班级管理、学时审核管理、学员资料变更、学员推送数据、学习账号标记、学习学时记录)
-                        <br />4.资料审核管理(填写资料审核)
-                        <br />5.考试管理(报考数据)
-                      </div>
-                      <i
-                        class="el-icon-warning-outline"
-                        style="
-                          position: absolute;
-                          font-size: 24px;
-                          font-weight: bold;
-                          color: red;
-                          top: 0px;
-                          left: -31px;
-                          z-index: 9;
-                        "
-                      ></i>
-                    </el-tooltip>
-                    <el-tree
-                      class="tree-border"
-                      :data="menuOptionsInfo"
-                      show-checkbox
-                      ref="info"
-                      node-key="onlyId"
-                      empty-text="加载中,请稍后"
-                      :props="defaultProps"
-                    >
-                    </el-tree>
-                  </div>
-                </div>
-                <el-input
-                  :disabled="statusPop === 2"
-                  v-else-if="items.scope === 'textarea'"
-                  type="textarea"
-                  v-model="listData[items.prop]"
-                ></el-input>
-                <el-input-number
-                  style="width: 100%"
-                  :disabled="statusPop === 2"
-                  v-else-if="items.scope === 'numberIndex'"
-                  v-model="listData[items.prop]"
-                  controls-position="right"
-                  :min="0"
-                  :max="99"
-                ></el-input-number>
-                <el-input
-                  :disabled="statusPop === 2"
-                  v-else
-                  v-model="listData[items.prop]"
-                ></el-input>
-              </el-form-item> </el-col></el-form
-        ></el-row>
+              <el-tree
+                class="tree-border"
+                :data="menuOptions"
+                show-checkbox
+                ref="menu"
+                node-key="id"
+                empty-text="加载中,请稍后"
+                :props="defaultProps"
+              ></el-tree>
+            </div>
+            <el-input
+              :disabled="statusPop === 2"
+              v-else-if="items.scope === 'textarea'"
+              type="textarea"
+              v-model="listData[items.prop]"
+            ></el-input>
+            <el-input-number
+              style="width: 100%"
+              :disabled="statusPop === 2"
+              v-else-if="items.scope === 'numberIndex'"
+              v-model="listData[items.prop]"
+              controls-position="right"
+              :min="0"
+              :max="99"
+            ></el-input-number>
+            <el-input
+              :disabled="statusPop === 2"
+              v-else
+              v-model="listData[items.prop]"
+            ></el-input> </el-form-item
+        ></el-form>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="close">取 消</el-button>
@@ -181,7 +130,7 @@
         >
       </span>
     </el-dialog>
-  </div>
+  </container>
 </template>
 
 <script>
@@ -242,33 +191,37 @@ export default {
         {
           label: "角色编号",
           prop: "roleId",
-          hidden: true,
         },
         {
           label: "角色名称",
           prop: "roleName",
-          hidden: true,
         },
         {
           label: "权限字符",
           prop: "roleKey",
-          hidden: true,
         },
         {
           label: "显示顺序",
           prop: "roleSort",
-          hidden: true,
         },
         {
           label: "状态",
           prop: "status",
-          hidden: true,
-          scope: "status",
+          scope: "isOptions",
+          options: [
+            {
+              label: "启用",
+              value: "1",
+            },
+            {
+              label: "关闭",
+              value: "0",
+            },
+          ],
         },
         {
           label: "创建时间",
           prop: "createTime",
-          hidden: true,
         },
       ],
       tableData: [], //表单数据
@@ -284,7 +237,6 @@ export default {
         label: "label",
       },
       menuOptions: [], //菜单列表
-      menuOptionsInfo: [], //数据池列表
       // 弹窗字段
       listitem: [
         {
@@ -320,11 +272,6 @@ export default {
           prop: "menuIds",
           scope: "tree",
         },
-        {
-          label: "数据池权限",
-          prop: "keys",
-          scope: "treeInfo",
-        },
         {
           label: "备注",
           prop: "remark",
@@ -505,11 +452,6 @@ export default {
     rulesTableSumbit() {
       this.disabledBtn = true;
       this.listData.menuIds = this.getMenuAllCheckedKeys();
-      this.listData.businessIds = this.getMenuAllCheckedKeysInfo();
-      if (!this.listData.businessIds.length) {
-        this.disabledBtn = false;
-        return this.$message.error("请勾选数据池");
-      }
       var data = this.listData;
       if (this.statusPop === 1) {
         this.$api
@@ -554,11 +496,10 @@ export default {
         roleName: undefined,
         roleKey: undefined,
         roleSort: 0,
-        status: "",
+        status: "1",
         menuIds: [],
         deptIds: [],
         menuCheckStrictly: true,
-        deptCheckStrictly: true,
         remark: undefined,
       };
     },
@@ -597,22 +538,6 @@ export default {
         this.$refs.menu[0].setCheckedNodes(value ? this.menuOptions : []);
       }
     },
-    // 数据池树权限(展开/折叠)
-    handleCheckedTreeExpandInfo(value, type) {
-      if (type == "info") {
-        let treeList = this.menuOptionsInfo;
-        for (let i = 0; i < treeList.length; i++) {
-          this.$refs.info[0].store.nodesMap[treeList[i].onlyId].expanded =
-            value;
-        }
-      }
-    },
-    // 数据池树权限(全选/全不选)
-    handleCheckedTreeNodeAllInfo(value, type) {
-      if (type == "info") {
-        this.$refs.info[0].setCheckedNodes(value ? this.menuOptionsInfo : []);
-      }
-    },
     // 树权限(父子联动)
     handleCheckedTreeConnect(value, type) {
       if (type == "menu") {
@@ -755,4 +680,3 @@ export default {
   border-radius: 4px;
 }
 </style>
-

+ 15 - 41
src/views/systemSettings/menu/index.vue

@@ -1,5 +1,8 @@
 <template>
-  <div class="app-container">
+  <container title="数据报表">
+    <template v-slot:btn>
+      <el-button type="primary" @click="handleAdd">新增</el-button>
+    </template>
     <el-form
       :model="queryParams"
       ref="queryForm"
@@ -44,22 +47,6 @@
       </el-form-item>
     </el-form>
 
-    <el-row :gutter="10" class="mb8" style="display: flex; align-item: center">
-      <el-button
-        type="primary"
-        plain
-        icon="el-icon-plus"
-        size="mini"
-        style="margin-right: 10px"
-        @click="handleAdd"
-        >新增</el-button
-      >
-      <right-toolbar
-        :showSearch.sync="showSearch"
-        @queryTable="getList"
-      ></right-toolbar>
-    </el-row>
-
     <el-table
       v-loading="loading"
       :data="menuList"
@@ -278,7 +265,7 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-  </div>
+  </container>
 </template>
 
 <script>
@@ -304,9 +291,15 @@ export default {
       // 是否显示弹出层
       open: false,
       // 显示状态数据字典
-      visibleOptions: [],
+      visibleOptions: [
+        { dictLabel: "显示", dictValue: "0" },
+        { dictLabel: "隐藏", dictValue: "1" },
+      ],
       // 菜单状态数据字典
-      statusOptions: [],
+      statusOptions: [
+        { dictLabel: "正常", dictValue: "1" },
+        { dictLabel: "停用", dictValue: "0" },
+      ],
       // 查询参数
       queryParams: {
         menuName: undefined,
@@ -333,14 +326,6 @@ export default {
   },
   created() {
     this.getList();
-    this.$api.obtaindictdata({ dictType: "sys_show_hide" }).then((response) => {
-      this.visibleOptions = response.rows;
-    });
-    this.$api
-      .obtaindictdata({ dictType: "sys_normal_disable" })
-      .then((response) => {
-        this.statusOptions = response.rows;
-      });
   },
   methods: {
     // 选择图标
@@ -388,24 +373,13 @@ export default {
         this.menuOptions.push(menu);
       });
     },
-    // 显示状态字典翻译
-    visibleFormat(row, column) {
-      if (row.menuType == "F") {
-        return "";
-      }
-      console.log(
-        "this.visibleOptions, row.visible",
-        this.visibleOptions,
-        row.visible
-      );
-      return this.selectDictLabel(this.visibleOptions, row.visible);
-    },
     // 菜单状态字典翻译
     statusFormat(row, column) {
       if (row.menuType == "F") {
         return "";
       }
-      return this.selectDictLabel(this.statusOptions, row.status);
+      return this.statusOptions.find((e) => e.dictValue == row.status)
+        .dictLabel;
     },
     // 取消按钮
     cancel() {