Kaynağa Gözat

添加变量联动,权限菜单

yangg 10 ay önce
ebeveyn
işleme
648a2f0729

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-3050636a.eb0956d9.css → dist/static/css/chunk-195db380.eb0956d9.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/app.a60cb318.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/app.b27cc01f.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/chunk-195db380.0b3ff82f.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/chunk-3050636a.7af716c4.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/chunk-48683ed6.e17169a4.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/chunk-4ff485a4.8a808b11.js


+ 0 - 0
dist/static/js/chunk-be124c14.114503d8.js → dist/static/js/chunk-be124c14.dfddbe25.js


+ 1 - 1
src/permission.js

@@ -38,7 +38,7 @@ router.beforeEach(async(to, from, next) => {
           const { roles,authList } = await store.dispatch('user/getInfo')
 
           // generate accessible routes map based on roles
-          const accessRoutes = await store.dispatch('permission/generateRoutes', roles)//roles authList
+          const accessRoutes = await store.dispatch('permission/generateRoutes', authList)//roles authList
 
 
           // dynamically add accessible routes

+ 6 - 6
src/router/index.js

@@ -164,7 +164,7 @@ export const asyncRoutes = [
   {
     path: '/customer',
     component: Layout,
-    type:2,
+    type:4,
     meta: {
       title: '客户管理',
       icon: 'kehu',
@@ -182,7 +182,7 @@ export const asyncRoutes = [
   {
     path: '/product',
     component: Layout,
-    type:3,
+    type:5,
     meta: {
       title: '产品管理',
       icon: 'chanpin',
@@ -219,7 +219,7 @@ export const asyncRoutes = [
   {
     path: '/document',
     component: Layout,
-    type:4,
+    type:10,
     meta: {
       title: '文档管理',
       icon: 'wendang'
@@ -299,7 +299,7 @@ export const asyncRoutes = [
   {
     path: '/system',
     component: Layout,
-    type:5,
+    type:21,
     meta: {
       title: '系统设置',
       icon: 'xitong',
@@ -364,11 +364,11 @@ const saveRoute=(route)=>{
       });
     });
   })
-  autoSaveAuth({data:JSON.stringify(routes)})
+ /*  autoSaveAuth({data:JSON.stringify(routes)}) */
 }
 saveRoute([...asyncRoutes]);
 const createRouter = () => new Router({
-  mode: 'history', // require service support
+  mode: 'hash', // require service support
   scrollBehavior: () => ({ y: 0 }),
   routes: constantRoutes
 })

+ 14 - 15
src/store/modules/permission.js

@@ -45,31 +45,30 @@ const mutations = {
 }
 
 const actions = {
-  generateRoutes({ commit }, roles) {//authList roles
+  generateRoutes({ commit }, authList) {//authList roles
     return new Promise(resolve => {
-      let accessedRoutes
+      /* let accessedRoutes
       if (roles.includes('admin')) {
         accessedRoutes = asyncRoutes || []
       } else {
         accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
-      }
-      /* let accessedRoutes=[];
-      if(authList!=undefined){
-
-       let tempRoutes=asyncRoutes.filter(o=>{
-          return authList.filter(u=>u.type==o.type).length>0;
-       });
-        tempRoutes=tempRoutes.map((res)=>{
-          if(res.children.length>0){
-              res.children=res.children.filter(o=>authList.filter(u=>u.code==o.name).length>0);
+      } */
+      let accessedRoutes=[];
+      if (authList != undefined) {
+        let tempRoutes = asyncRoutes.filter(o => {
+          return authList.filter(u => u.parent_id == o.type).length > 0;
+        });
+        tempRoutes = tempRoutes.map((res) => {
+          if (res.children && res.children.length > 0) { // 检查 res.children 是否存在
+            res.children = res.children.filter(o => authList.filter(u => u.code == o.name).length > 0);
           }
           return res;
         });
 
-        console.log("tempRoutes",tempRoutes);
-        accessedRoutes=tempRoutes;
+        console.log("tempRoutes", tempRoutes);
+        accessedRoutes = tempRoutes;
         accessedRoutes.push({ path: '*', redirect: '/404', hidden: true });
-      } */
+      }
       commit('SET_ROUTES', accessedRoutes)
       console.log(accessedRoutes);
       resolve(accessedRoutes)

+ 1 - 1
src/views/document/com/components/Attribute/attributeVar/index.vue

@@ -218,7 +218,7 @@
           status: 5,
         });
         if (res.status != 200) return;
-        _this.categoryList = res.data.dataList;
+        _this.categoryList = res.data.dataList ||[];
         for (var i = 0; i < _this.categoryList.length; i++) {
           _this.categoryList[i].dataList = await _this.getTemplateList(
             _this.categoryList[i].id

+ 2 - 2
src/views/document/com/components/Attribute/index.vue

@@ -218,7 +218,8 @@ export default {
         status: 5,
       });
       if (res.status != 200) return;
-      _this.categoryList = res.data.dataList;
+      /* _this.categoryList = res.data.dataList; */
+      _this.categoryList = res.data.dataList || [];
       for (var i = 0; i < _this.categoryList.length; i++) {
         _this.categoryList[i].dataList = await _this.getTemplateList(
           _this.categoryList[i].id
@@ -284,7 +285,6 @@ export default {
         status: 5,
       });
       if (res.status != 200) return [];
-
       let dataList = res.data.dataList.map((item) => {
         item.attrs = JSON.parse(item.attrs);
         return item;

+ 13 - 1
src/views/document/com/components/Variable/index.vue

@@ -68,7 +68,7 @@
 
   export default{
     name:"searchParams",
-    emits:['onPicked'],
+    emits:['onPicked',"onData"],
     directives: { elDragDialog },
     components:{
       dataInfo,
@@ -87,7 +87,19 @@
         },
         immediate: true,
         deep: true
+      },
+      dataList: {
+        handler(newVal, oldVal) {
+          newVal.forEach((item, index) => {
+            if (JSON.stringify(item) !== JSON.stringify(oldVal[index])) {
+              this.$emit('onData',item)
+            }
+          });
+          // Add any additional logic you need here
+        },
+        deep: true
       }
+      /* onData */
     },
     data(){
       return{

+ 7 - 2
src/views/document/com/menus.vue

@@ -22,7 +22,7 @@
       </el-dialog>
 
       <el-dialog  :visible.sync="showVariable" append-to-body v-el-drag-dialog  width="800px" custom-class="prod-verify" :title="insertTitle">
-          <Variable :type="type" @onPicked="onPickedVariable"></Variable>
+          <Variable :type="type" @onPicked="onPickedVariable" @onData="btnbianl"></Variable>
       </el-dialog>
 
 
@@ -52,7 +52,7 @@
 
   export default{
     name:"menus",
-    emits:["onEvents"],
+    emits:["onEvents","onVariable"],
     components:{
       Formula,Variable,sourceData,sourceAi,sourceEs
     },
@@ -161,6 +161,11 @@
     },
 
     methods:{
+      /* 变量变动 */
+      btnbianl(e){
+        this.$emit("onVariable",e)
+      },
+
       /* 插入ai */
       onPickedAi(e){
         let _this=this;

+ 5 - 3
src/views/document/create.vue

@@ -154,7 +154,7 @@
 
       <div class="editor-main">
         <div class="menus-box">
-          <menus @onEvents="onInsert"></menus>
+          <menus @onEvents="onInsert" @onVariable="uptadeVariable"></menus>
         </div>
         <div class="editor-box" ref="tabHtml" v-loading="loading">
           <editor
@@ -405,11 +405,13 @@ export default {
       this.showView = 1;
     },
     /* 更新变量 */
-    uptadeVariable(){
+    uptadeVariable(value){
       for (const item of this.coms) {
         for (const el of item.attrs) {
           if (el.type === "variable") {
-            console.log(el);
+            if(el.data.id==value.id){
+              el.content=value.value
+            }
           }
         }
       }

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