yangg 10 luni în urmă
părinte
comite
095914ec3d
61 a modificat fișierele cu 669 adăugiri și 476 ștergeri
  1. 0 0
      dist/index.html
  2. 0 0
      dist/static/css/chunk-055f43c8.e30e9787.css
  3. 0 0
      dist/static/css/chunk-1f0b1ccb.7131743c.css
  4. 0 0
      dist/static/css/chunk-26be6d70.379f563b.css
  5. 0 1
      dist/static/css/chunk-3b70738c.6712b828.css
  6. 0 1
      dist/static/css/chunk-3f426cd0.d1f21e34.css
  7. 0 0
      dist/static/css/chunk-4139ed56.cf6b7d77.css
  8. 0 0
      dist/static/css/chunk-467147c8.6f8877c6.css
  9. 0 0
      dist/static/css/chunk-56c89a2a.7131743c.css
  10. 0 1
      dist/static/css/chunk-573495bd.641e9b71.css
  11. 0 0
      dist/static/css/chunk-5f297ed0.775a21e3.css
  12. 0 0
      dist/static/css/chunk-6da0c47d.10d1a104.css
  13. 0 1
      dist/static/css/chunk-708c45dc.b27c668a.css
  14. 0 1
      dist/static/css/chunk-77bc8fb9.b27c668a.css
  15. 0 0
      dist/static/css/chunk-c1cc09ba.e30e9787.css
  16. 0 0
      dist/static/js/app.657bc14b.js
  17. 0 0
      dist/static/js/chunk-009235a2.113ddd24.js
  18. 0 0
      dist/static/js/chunk-055f43c8.3d478033.js
  19. 0 0
      dist/static/js/chunk-1f0b1ccb.2ca204d7.js
  20. 0 0
      dist/static/js/chunk-26be6d70.2328c6db.js
  21. 0 0
      dist/static/js/chunk-2cd5b760.2ea87097.js
  22. 0 0
      dist/static/js/chunk-2d22d9b8.77252a61.js
  23. 0 0
      dist/static/js/chunk-2e2daf97.f614f231.js
  24. 0 0
      dist/static/js/chunk-3b70738c.d211d2a4.js
  25. 0 0
      dist/static/js/chunk-3f426cd0.e6e7ea90.js
  26. 0 0
      dist/static/js/chunk-4139ed56.2d9727a0.js
  27. 0 0
      dist/static/js/chunk-467147c8.09c88f63.js
  28. 0 0
      dist/static/js/chunk-48922aa8.86234cc0.js
  29. 0 0
      dist/static/js/chunk-52f685c2.bb500ab1.js
  30. 0 0
      dist/static/js/chunk-56c89a2a.78a49871.js
  31. 0 0
      dist/static/js/chunk-573495bd.b3899352.js
  32. 0 0
      dist/static/js/chunk-5f297ed0.0b78b3e4.js
  33. 0 0
      dist/static/js/chunk-6da0c47d.43e1c747.js
  34. 0 1
      dist/static/js/chunk-708c45dc.c7c33b76.js
  35. 0 0
      dist/static/js/chunk-708ed3f2.460746e3.js
  36. 0 1
      dist/static/js/chunk-77bc8fb9.a5a01d31.js
  37. 0 0
      dist/static/js/chunk-c1cc09ba.1f0ad88d.js
  38. 0 0
      dist/static/js/chunk-db653464.31f4ca97.js
  39. 0 0
      dist/static/js/chunk-db653464.e37e0185.js
  40. 0 0
      dist/static/js/chunk-dd5a1060.5d693f0e.js
  41. 8 0
      src/api/AdminRole.js
  42. 9 0
      src/api/admin.js
  43. 2 4
      src/router/index.js
  44. 5 5
      src/views/document/com/components/Attribute/Directory/index.vue
  45. 2 2
      src/views/document/com/components/Formula/index.vue
  46. 1 0
      src/views/document/com/components/TextArea/index.vue
  47. 13 3
      src/views/document/com/components/Variable/dataInfo.vue
  48. 1 0
      src/views/document/com/components/Variable/index.vue
  49. 195 1
      src/views/document/com/editor.vue
  50. 2 2
      src/views/document/com/menus.vue
  51. 3 3
      src/views/document/components/dataList.vue
  52. 3 3
      src/views/document/components/dataSearch.vue
  53. 4 3
      src/views/document/create.scss
  54. 52 24
      src/views/document/create.vue
  55. 2 2
      src/views/document/temList/components/dataList.vue
  56. 3 3
      src/views/document/temList/components/dataSearch.vue
  57. 2 2
      src/views/login/index.vue
  58. 247 310
      src/views/role/components/dataInfo.vue
  59. 3 1
      src/views/template/category/components/dataList.vue
  60. 7 7
      src/views/template/components/dataList.vue
  61. 105 94
      src/views/template/components/dataSearch.vue

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-0d6cec32.e30e9787.css → dist/static/css/chunk-055f43c8.e30e9787.css


+ 0 - 0
dist/static/css/chunk-009235a2.7131743c.css → dist/static/css/chunk-1f0b1ccb.7131743c.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/css/chunk-26be6d70.379f563b.css


+ 0 - 1
dist/static/css/chunk-3b70738c.6712b828.css

@@ -1 +0,0 @@
-.sub-imgs[data-v-2c6b7984]{padding:0;margin:0}.sub-imgs li[data-v-2c6b7984]{float:left;margin-right:10px;width:100px;height:100px;list-style:none}.data-search[data-v-01f60281]{padding:20px 10px 0 10px}.el-dialog__body[data-v-01f60281]{padding:10px}.data-list .btns,.data-list .page-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.data-list .page-info{margin-top:10px}.data-list .page-info .opt{width:50%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.data-list .page-info .opt .pick{width:100px}.data-list .page-info .opt .section{margin-left:10px}.data-list .page-info .page-data{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%}.data-list .page-info .page-data .page-item{width:100%}.data-list .page-info .page-data .page-opt{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.project-search{padding:30px;font-size:12px}

+ 0 - 1
dist/static/css/chunk-3f426cd0.d1f21e34.css

@@ -1 +0,0 @@
-.com-data-view{width:100%;min-height:90vh;position:relative}.com-data-view .btn-save{position:fixed;right:10px;bottom:50px;z-index:9999!important}.el-dialog__body{padding:0 10px!important}

+ 0 - 0
dist/static/css/chunk-2cd5b760.cf6b7d77.css → dist/static/css/chunk-4139ed56.cf6b7d77.css


+ 0 - 0
dist/static/css/chunk-dd5a1060.6f8877c6.css → dist/static/css/chunk-467147c8.6f8877c6.css


+ 0 - 0
dist/static/css/chunk-2e2daf97.7131743c.css → dist/static/css/chunk-56c89a2a.7131743c.css


+ 0 - 1
dist/static/css/chunk-573495bd.641e9b71.css

@@ -1 +0,0 @@
-.sub-imgs{padding:0;margin:0}.sub-imgs li{float:left;margin-right:10px;width:100px;height:100px;list-style:none}.data-search{padding:20px 10px 0 10px}.com-data-view{width:100%;min-height:500px;position:relative}.el-dialog__body{padding:0 10px!important}.data-list .btns,.data-list .page-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.data-list .page-info{margin-top:10px}.data-list .page-info .opt{width:50%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.data-list .page-info .opt .pick{width:100px}.data-list .page-info .opt .section{margin-left:10px}.data-list .page-info .page-data{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%}.data-list .page-info .page-data .page-item{width:100%}.data-list .page-info .page-data .page-opt{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}

+ 0 - 0
dist/static/css/chunk-78acfbee.775a21e3.css → dist/static/css/chunk-5f297ed0.775a21e3.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/css/chunk-6da0c47d.10d1a104.css


+ 0 - 1
dist/static/css/chunk-708c45dc.b27c668a.css

@@ -1 +0,0 @@
-.project-search{padding:30px;font-size:12px}

+ 0 - 1
dist/static/css/chunk-77bc8fb9.b27c668a.css

@@ -1 +0,0 @@
-.project-search{padding:30px;font-size:12px}

+ 0 - 0
dist/static/css/chunk-708ed3f2.e30e9787.css → dist/static/css/chunk-c1cc09ba.e30e9787.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/app.657bc14b.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-009235a2.113ddd24.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-055f43c8.3d478033.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-1f0b1ccb.2ca204d7.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-26be6d70.2328c6db.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-2cd5b760.2ea87097.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-2d22d9b8.77252a61.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-2e2daf97.f614f231.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-3b70738c.d211d2a4.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-3f426cd0.e6e7ea90.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-4139ed56.2d9727a0.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-467147c8.09c88f63.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-48922aa8.86234cc0.js


+ 0 - 0
dist/static/js/chunk-52f685c2.b41f970d.js → dist/static/js/chunk-52f685c2.bb500ab1.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-56c89a2a.78a49871.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-573495bd.b3899352.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-5f297ed0.0b78b3e4.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-6da0c47d.43e1c747.js


+ 0 - 1
dist/static/js/chunk-708c45dc.c7c33b76.js

@@ -1 +0,0 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-708c45dc"],{"0b8b":function(t,a,d){},d5ae:function(t,a,d){"use strict";d.r(a);var n=function(){var t=this,a=t.$createElement,d=t._self._c||a;return d("div",{staticClass:"project-search"},[d("dataInfo",{attrs:{dataId:t.dataId}})],1)},e=[],s=d("ae6b"),c={components:{dataInfo:s["a"]},data:function(){return{dataId:0}},mounted:function(){var t=this;t.dataId=t.$route.query.id,isNaN(this.dataId)&&(this.dataId=0),this.dataId=parseInt(this.dataId)},methods:{}},i=c,o=(d("d8aa"),d("2877")),u=Object(o["a"])(i,n,e,!1,null,null,null);a["default"]=u.exports},d8aa:function(t,a,d){"use strict";d("0b8b")}}]);

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-708ed3f2.460746e3.js


+ 0 - 1
dist/static/js/chunk-77bc8fb9.a5a01d31.js

@@ -1 +0,0 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77bc8fb9"],{"2b73":function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"project-search"},[a("dataSearch",{attrs:{allowCreate:t.checkAuth("/source/data/create")},on:{bindSetQuery:t.setQuery}}),a("dataList",{attrs:{queryForm:t.queryForm,allowEdit:t.checkAuth("/source/data/update"),allowDelete:t.checkAuth("/source/data/delete")}})],1)},c=[],u=a("5530"),n=(a("4de4"),a("d3b7"),a("2f62")),o=a("ae6b"),s={components:{dataSearch:o["c"],dataList:o["b"]},data:function(){return{queryForm:{page:1,pageSize:10,code:"",name:"",status:""}}},computed:Object(u["a"])({},Object(n["b"])(["roleInfo","authList"])),methods:{checkAuth:function(t){var e=this.authList.filter((function(e){return 999==e.parent_id&&e.path==t}));return!(e.length>0)},setQuery:function(t){this.queryForm=t}}},d=s,i=(a("2d22"),a("2877")),h=Object(i["a"])(d,r,c,!1,null,null,null);e["default"]=h.exports},"2d22":function(t,e,a){"use strict";a("941d")},"941d":function(t,e,a){}}]);

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-c1cc09ba.1f0ad88d.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-db653464.31f4ca97.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-db653464.e37e0185.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-dd5a1060.5d693f0e.js


+ 8 - 0
src/api/AdminRole.js

@@ -47,6 +47,14 @@ export function deleteAdminRole(data) {
   })
 }
 
+/* 权限 */
+export function selectPermissions(data) {
+  return request({
+    url: '/permissions/selectPermissions',
+    method: 'post',
+    data
+  })
+}
 
 
 

+ 9 - 0
src/api/admin.js

@@ -61,3 +61,12 @@ export function deleteAdmin(data) {
     data
   })
 }
+
+/* 获取权限 */
+export function selectUserOperation(data) {
+  return request({
+    url: '/user/selectUserOperation',
+    method: 'post',
+    data
+  })
+}

+ 2 - 4
src/router/index.js

@@ -265,15 +265,13 @@ export const asyncRoutes = [
 
 
 
-      {
+      /* {
         path: 'dataCenter/index',
         component: () => import('@/views/dataCenter/search'),
         name: 'dataCenter',
         meta: { title: '原始数据', noCache: true,roles: ['admin'] }
       },
 
-
-
       {
         path: 'dataCenter/create',
         component: () => import('@/views/dataCenter/create'),
@@ -293,7 +291,7 @@ export const asyncRoutes = [
         component: () => import('@/views/dataCenter/category/search'),
         name: 'dataCenterCategorySearch',
         meta: { title: '原始数据分类', noCache: true,roles: ['admin'] }
-      },
+      }, */
     ]
   },
   {

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

@@ -1,9 +1,9 @@
 <template>
   <div class="com-directory" v-if="coms != null && coms.length > 0 && size > 0">
     <el-form class="dirceForm">
-      <template v-for="(sub) in coms">
-        <template v-for="(item,index) in sub.attrs">
-          <el-form-item :key="index" v-if="item.type=='Directory'" :label="item.id "><!-- + ' (引用名:[' + item.id + '])' -->
+      <template v-for="(sub,itIndex) in coms"  >
+        <template v-for="(item,itemIndex) in sub.attrs">
+          <el-form-item :key="'item-' + itIndex + '-' + itemIndex"  v-if="item.type=='Directory'" :label="item.id "><!-- + ' (引用名:[' + item.id + '])' -->
             <el-input type="textarea" v-model="item.content"></el-input>
           </el-form-item>
         </template>
@@ -12,11 +12,11 @@
     </el-form>
     <div class="com-title">目录信息</div>
     <div class="com-items">
-      <template v-for="(it) in coms">
+      <template v-for="(it,itIndex) in coms" >
         <template
           v-for="(item, itemIndex) in it.attrs"  
         >
-          <div class="com-item" :key="itemIndex" v-if="item.type == 'Directory'">
+          <div class="com-item" :key="'item-' + itIndex + '-' + itemIndex" v-if="item.type == 'Directory'">
             <div class="icon"><svg-icon icon-class="directory" /></div>
             <div class="name">
               {{ item.content != "" ? item.content : item.name }}

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

@@ -121,8 +121,8 @@
        searchFormula(_this.queryForm).then(res=>{
          if(res.status!=200)return;
          _this.dataList=res.data.dataList;
-         _this.recordCount=res.data.recordCount;
-         _this.pageTotal=res.data.pageTotal;
+         _this.recordCount=res.data.totalPage;
+         _this.pageTotal=res.data.totalRecord;
        })
      },
      //修改分页

+ 1 - 0
src/views/document/com/components/TextArea/index.vue

@@ -161,6 +161,7 @@ export default {
               i +
               '" class="text-input-box">';
             for (var l = 0; l < dataItem.length; l++) {
+              console.log(dataItem);
               if (item.content == dataItem[l]) {
                 selectHtml +=
                   '<option value="' +

+ 13 - 3
src/views/document/com/components/Variable/dataInfo.vue

@@ -31,11 +31,17 @@
         </el-form-item>
         <el-form-item
           label="取值:"
-          v-if="dataForm.value_type == 1 || dataForm.value_type == 2"
+          v-if="dataForm.value_type == 1"
           prop="value"
         >
           <el-input v-model="dataForm.value"></el-input>
         </el-form-item>
+        <el-form-item
+          label="取值:"
+          v-if="dataForm.value_type == 2"
+        >
+          <el-input v-model="dataForm.value"></el-input>
+        </el-form-item>
         <el-form-item
           label="取值:"
           v-if="dataForm.value_type == 3"
@@ -193,7 +199,7 @@ export default {
         value_type: 1,
         value_item: " ",
         intro: "",
-        status: "",
+        status: 5,
       },
       statusOptions: [
         {
@@ -230,8 +236,9 @@ export default {
     },
     //保存更新
     btnSave(e) {
+      debugger
       let _this = this;
-      _this.$refs.creatRef.validate((valid) => {
+      _this.$refs.dataFormRef.validate((valid) => {
         if (valid) {
           if (_this.dataForm.value_type == 1) {
             _this.dataForm.value_item = _this.dataForm.value;
@@ -243,6 +250,7 @@ export default {
             _this.dataForm.value = percentage;
           }
           _this.dataForm.code = _this.dataForm.name;
+          console.log(_this.dataForm);
           if (_this.dataForm.id > 0) {
             updateParams(_this.dataForm).then((res) => {
               if (res.status != 200) return;
@@ -267,6 +275,8 @@ export default {
             });
           }
           _this.$emit("onClose");
+        }else{
+          console.log('错误');
         }
       });
     },

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

@@ -126,6 +126,7 @@
       append-to-body
       v-el-drag-dialog
       width="300"
+      :close-on-click-modal="false"
       custom-class="prod-verify"
       :title="title"
       @closed="handleDialogClosed"

+ 195 - 1
src/views/document/com/editor.vue

@@ -22,6 +22,83 @@
             <div class="drag-handle" draggable>
               <svg-icon icon-class="drag" />
             </div>
+            <!-- :options="categoryList":props="props" -->
+            <div style="padding: 10px 0">
+              <el-form label-position="left" class="inline-form">
+                <el-row>
+                  <el-col :span="7">
+                    <el-form-item label="模块分类:">
+                      <!-- 此处需要处理为只有admin账号可编辑 -->
+                      <!-- <el-cascader
+                        v-model="it.category_id"
+                        clearable
+                        :options="categoryList"
+                        :props="props"
+                        :show-all-levels="false"
+                        @change="onChangeCategory"
+                        placeholder="请选择模块分类"
+                      /> -->
+                      <!-- {{ $store.state.user }} -->
+                      <el-select
+                        v-if="$store.state.user.id == 2"
+                        v-model="it.category_id"
+                        placeholder="请选择模块分类"
+                        size="large"
+                        style="width: 80%"
+                      >
+                        <el-option
+                          v-for="item in categoryList"
+                          :key="item.id"
+                          :label="item.name"
+                          :value="item.id"
+                        />
+                      </el-select>
+                      <span v-else>{{ getCategory(it.category_id) }}</span>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6">
+                    <el-form-item label="模块名称:">
+                      <el-input
+                        v-if="$store.state.user.id == 2"
+                        class="input-item"
+                        v-model="it.name"
+                        placeholder="请填写模块名称"
+                      />
+                      <span v-else>{{ it.name }}</span>
+                    </el-form-item> </el-col
+                  ><el-col :span="6">
+                    <el-form-item label="模块描述:">
+                      <el-input
+                        v-if="$store.state.user.id == 2"
+                        class="input-item"
+                        v-model="it.intro"
+                        placeholder="请填写模块介绍"
+                      />
+                      <span v-else>{{ it.intro }}</span>
+                    </el-form-item></el-col
+                  >
+                  <el-col :span="4">
+                    <el-form-item v-if="$store.state.user.id == 2">
+                      <div class="btn-save">
+                        <el-button
+                          type="primary"
+                          size="mini"
+                          @click="onSaveTemplate(it)"
+                          >保存模块</el-button
+                        >
+                        <el-button
+                          type="primary"
+                          size="mini"
+                          @click="onSaveAs(it)"
+                          v-if="it.id > 0"
+                          >另存为</el-button
+                        ><!--  -->
+                      </div>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </el-form>
+            </div>
             <div class="main" @click="onSetActive(index)">
               <component
                 :is="it.type"
@@ -75,6 +152,7 @@ import draggable from "vuedraggable";
 import Table from "./components/Table";
 import TextArea from "./components/TextArea";
 import Empty from "./components/Empty";
+import { getAllList, createTemplate, updateTemplate } from "@/api/template";
 export default {
   name: "editor",
   emits: [
@@ -120,6 +198,7 @@ export default {
       handler(val) {
         if (val == null) return;
         this.comList = JSON.parse(JSON.stringify(val));
+        console.log(this.comList);
       },
       immediate: true, //立即执行
       deep: true,
@@ -142,10 +221,98 @@ export default {
       operation: "",
       id: 0,
       comList: [],
+      categoryList: [],
+      props: {
+        value: "id",
+        label: "name",
+        children: "children",
+        checkStrictly: true,
+      },
+      saveAs: false,
     };
   },
-
+  mounted() {
+    this.initCategoryList();
+    console.log(this.$store.state.user);
+  },
   methods: {
+    /* 获取分类名称 */
+    getCategory(item) {
+      return this.categoryList.find((el) => el.id === item)?.name || "";
+    },
+    onSaveAs(e) {
+      this.saveAs = true;
+      this.onSaveTemplate(e);
+    },
+    /* 保存模块 */
+    onSaveTemplate(e) {
+      let _this = this;
+      /* e.category_id='1' */
+      let data = JSON.parse(JSON.stringify(e));
+      if (data.category) {
+        delete data.category;
+      }
+      data.attrs = JSON.stringify(data.attrs);
+      data.code = data.name;
+      data.status = 5;
+      data.category_id = e.category_id;
+      if (data.id == undefined || this.saveAs) {
+        createTemplate(data).then((res) => {
+          if (res.status != 200) return;
+          data.id = res.data;
+          e.id = res.data;
+          _this.$alert("模板信息保存成功");
+          _this.$emit("onRefresh");
+          this.saveAs = false;
+        });
+      } else {
+        updateTemplate(data).then((res) => {
+          if (res.status != 200) return;
+          _this.$alert("模板信息更新成功");
+          _this.$emit("onRefresh");
+        });
+      }
+    },
+    /* 获取模块分类 */
+    //获取模板分类信息
+    async initCategoryList() {
+      let _this = this;
+      let res = await getAllList();
+      this.categoryList = res.data; //this.processDataForCascader(res.data);
+    },
+    processDataForCascader(data) {
+      console.log("Raw data:", data); // 调试原始数据
+      const idMap = new Map();
+      const rootItems = [];
+
+      // First pass: create a map of all items
+      data.forEach((item) => {
+        const processedItem = { ...item, children: [] };
+        idMap.set(item.id, processedItem);
+      });
+
+      // Second pass: build the tree structure
+      data.forEach((item) => {
+        if (item.parent_id === "0" || item.parent_id === 0) {
+          rootItems.push(idMap.get(item.id));
+        } else {
+          const parent = idMap.get(parseInt(item.parent_id));
+          if (parent) {
+            parent.children.push(idMap.get(item.id));
+          } else {
+            console.warn(
+              `Parent with id ${item.parent_id} not found for item:`,
+              item
+            );
+            rootItems.push(idMap.get(item.id)); // 如果找不到父项,作为根项添加
+          }
+        }
+      });
+
+      console.log("Processed data:", rootItems); // 调试处理后的数据
+      return rootItems;
+    },
+    onChangeCategory() {},
     //更新产品属性
     onUpdateProdAttr(comIndex, attrIndex, data) {
       this.comList[comIndex].attrs[attrIndex].content = data;
@@ -251,4 +418,31 @@ export default {
     flex-grow: 1;
   }
 }
+.inline-form {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 10px;
+}
+
+.inline-form .el-form-item {
+  display: flex;
+  align-items: center;
+  margin-bottom: 0;
+  flex: 1;
+  min-width: 300px;
+}
+
+.inline-form .el-form-item__label {
+  flex-shrink: 0;
+  width: auto;
+  padding-right: 12px;
+}
+
+.inline-form .el-form-item__content {
+  flex-grow: 1;
+  margin-left: 0 !important;
+}
+.input-item {
+  width: 200px;
+}
 </style>

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

@@ -87,11 +87,11 @@
                 icon:"insertArticle",
               },
 
-              {
+              /* {
                 key:"SourceData",
                 name:"源数据",
                 icon:"sourceData",
-              },
+              }, */
               {
                 key:"formual",
                 name:"公式",

+ 3 - 3
src/views/document/components/dataList.vue

@@ -180,13 +180,13 @@ export default {
 
     //编辑
     btnEdit(e) {
-    /*   let _this = this;
+      let _this = this;
       let a = document.createElement("a");
       a.href = "#/document/create?articleId=" + e; // 使用 hash
       a.target = "_blank";
-      a.click(); */
+      a.click();
 
-       this.$router.push({path:"/document/create",query:{articleId:e}})
+       //this.$router.push({path:"/document/create",query:{articleId:e}})
     },
 
     handleClose() {

+ 3 - 3
src/views/document/components/dataSearch.vue

@@ -99,12 +99,12 @@ export default{
     },
     /* 创建文档 */
     addDocument(){
-      this.$router.push('/document/create');
-     /*  let _this = this;
+      //this.$router.push('/document/create');
+      let _this = this;
       let a = document.createElement("a");
       a.href = "#/document/create"; // 使用 hash
       a.target = "_blank";
-      a.click(); */
+      a.click();
     }
   }
 }

+ 4 - 3
src/views/document/create.scss

@@ -144,13 +144,14 @@
         writing-mode: vertical-rl;
         position: fixed;
         width:60px;
-        right:255px;
+        right:254px;
         top:65px;
         font-size:12px;
         .item{
             background-color: #fff;
-            -webkit-box-shadow: 0 2px 8px 0 rgba(0,0,0,.1);
-            box-shadow: 0 2px 8px 0 rgba(0,0,0,.1);
+            border: 1px solid rgba(0,0,0,.1);
+            /* -webkit-box-shadow: 0 2px 8px 0 rgba(0,0,0,.1);
+            box-shadow: 0 2px 8px 0 rgba(0,0,0,.1); */
             border-radius: 2px;
         /*     width: 94px; */
         letter-spacing: 3px;

+ 52 - 24
src/views/document/create.vue

@@ -11,17 +11,21 @@
         </div>
       </div>
       <div class="right">
-        <el-button type="primary" size="mini" @click="onSaveAs"
+        <el-button
+          type="primary"
+          size="mini"
+          @click="onSaveAs"
+          v-if="type !== 'module'"
           >保存文档</el-button
         ><!-- v-if="docAttr.id > 0" -->
         <el-button
           type="primary"
           size="mini"
           @click="onSave"
-          v-if="docAttr.is_template == 0 && docAttr.id > 0"
+          v-if="docAttr.is_template == 0 && docAttr.id > 0 && type !== 'module'"
           >更新文档</el-button
         >
-        <el-popover placement="bottom" trigger="click">
+        <el-popover placement="bottom" trigger="click" v-if="type !== 'module'">
           <el-button @click="onSaveUpload">保存</el-button>
           <el-button @click="onUpload">更新</el-button>
           <el-button
@@ -40,7 +44,11 @@
           @click="onSaveUpload"
           >保存并更新模版</el-button
         > -->
-        <el-button type="primary" size="mini" @click="onOpenView"
+        <el-button
+          type="primary"
+          size="mini"
+          v-if="type !== 'module'"
+          @click="onOpenView"
           >预览导出
         </el-button>
         <el-button type="primary" size="mini" @click="onClose">
@@ -55,7 +63,7 @@
             <el-input placeholder="搜索文档标题"></el-input>
           </div>
           <div class="new-article">
-            <div v-if="showView == 0">
+            <div v-if="showView == 0 && type !== 'module'">
               <el-collapse v-model="activeNames">
                 <el-collapse-item title="最新文档" name="-1">
                   <div
@@ -154,6 +162,7 @@
         </div>
         <div class="right-sidebarew">
           <div
+            v-if="type !== 'module'"
             class="sidebar-item"
             :class="showView == 0 ? 'active-item' : ''"
             @click="viewDocument"
@@ -204,9 +213,10 @@
       <div class="editor-option">
         <div class="editor-menu">
           <div
+            v-if="type !== 'module'"
             class="item"
-            @click="onSetActiveIndex(9999)"
-            :class="comIndex == 9999 ? 'active-item' : ''"
+            @click="onSetActiveIndexs(3)"
+            :class="docuComIndex == 3 ? 'active-item' : ''"
           >
             <span class="name">文档属性</span>
           </div>
@@ -233,7 +243,7 @@
           </div>
         </div>
 
-        <template v-if="comIndex == 9999">
+        <template v-if="docuComIndex == 3 && type !== 'module'">
           <docAttr :attrs="docAttr"></docAttr>
         </template>
         <template v-if="comIndex == 9998">
@@ -248,7 +258,7 @@
           <Directory :coms="coms" />
         </template>
         <!-- comIndex != 9999 && comIndex != 9998 && comIndex != 9997 AttributeIndex==1-->
-        <template
+        <!-- <template
           v-if="
             comIndex != 9999 &&
             comIndex != 9998 &&
@@ -260,7 +270,7 @@
             :com="coms[comIndex]"
             @onRefresh="initCategoryList"
           ></Attribute>
-        </template>
+        </template> -->
         <template v-if="AttributeIndex == 1">
           <attributeVar
             :com="coms[comIndex]"
@@ -358,7 +368,7 @@ export default {
       categoryList: [],
       //组件相关
       coms: [],
-      comIndex: 0, //当前组件索引
+      comIndex: 9999, //当前组件索引
       showProductAttr: false,
       comList: [],
       //文档属性
@@ -389,6 +399,8 @@ export default {
       value: [],
       AttributeIndex: 0,
       catalogIndex: 0, //目录信息
+      docuComIndex: 3,
+      type: "",
     };
   },
   watch: {
@@ -410,12 +422,15 @@ export default {
   },
 
   async mounted() {
+    this.articleId = this.$route.query.articleId;
+    this.type = this.$route.query.type;
+    if (this.type == "module") {
+      this.showView = 1;
+    }
     let _this = this;
     this.searchArticle();
     await this.initCategoryList();
     await this.initCurrentUser();
-    this.articleId = this.$route.query.articleId;
-
     let templateId = this.$route.query.templateId;
     if (templateId > 0) {
       _this.loadTemplateInfo(templateId);
@@ -763,8 +778,8 @@ export default {
       this.showViewForm = true;
     },
     onClose() {
-      this.$router.back()
-      /* window.close(); */
+      /* this.$router.back(); */
+      window.close();
     },
 
     loadArticle(e) {
@@ -875,39 +890,52 @@ export default {
     onCatalogIndex(e) {
       this.catalogIndex = e;
       if (
-        this.comIndex == 9999 ||
-        this.comIndex == 9998 ||
-        this.AttributeIndex == 1
+        (this.docuComIndex =
+          3 || this.comIndex == 9998 || this.AttributeIndex == 1)
       ) {
         this.comIndex = 0;
         this.AttributeIndex = 0;
+        this.docuComIndex = 0;
       }
       this.$nextTick(() => {
         this.$forceUpdate();
       });
     },
+    onSetActiveIndexs(e) {
+      this.docuComIndex = e;
+      if (
+        this.AttributeIndex == 1 ||
+        this.comIndex == 9998 ||
+        this.catalogIndex == 9997
+      ) {
+        this.catalogIndex = 0;
+        this.AttributeIndex = 0;
+        this.comIndex = 0;
+      }
+    },
     //设置当前索引
     onSetActiveIndex(e) {
       this.comIndex = e;
       if (
-        this.comIndex == 9999 ||
-        this.comIndex == 9998 ||
+        this.AttributeIndex == 1 ||
+        this.docuComIndex == 3 ||
         this.catalogIndex == 9997
       ) {
         this.catalogIndex = 0;
-        this.AttributeIndex = 0;
+
+        this.docuComIndex = 0;
       }
     },
     /* 属性变量 */
     onAttributeIndex(e) {
       this.AttributeIndex = e;
       if (
-        this.comIndex == 9999 ||
-        this.comIndex == 9998 ||
-        this.catalogIndex == 9997
+        (this.docuComIndex =
+          3 || this.comIndex == 9998 || this.catalogIndex == 9997)
       ) {
         this.catalogIndex = 0;
         this.comIndex = 0;
+        this.docuComIndex = 0;
       }
     },
     onSaveAs(e) {

+ 2 - 2
src/views/document/temList/components/dataList.vue

@@ -174,13 +174,13 @@ export default {
 
     //编辑
     btnEdit(e) {
-     /*  let _this = this;
+      let _this = this;
       let a = document.createElement("a");
       a.href = "#/document/create?articleId=" + e;
       a.target = "_blank";
       a.click();
 
-      // _ */this.$router.push({path:"/document/create",query:{articleId:e}})
+       //_this.$router.push({path:"/document/create",query:{articleId:e}})
     },
 
     handleClose() {

+ 3 - 3
src/views/document/temList/components/dataSearch.vue

@@ -99,12 +99,12 @@ export default{
     },
     /* 创建模版 */
     addDocument(){
-      /* let _this = this;
+      let _this = this;
       let a = document.createElement("a");
       a.href = "#/document/create"; // 使用 hash
       a.target = "_blank";
-      a.click(); */
-      this.$router.push('/document/create');
+      a.click();
+      //this.$router.push('/document/create');
     }
   }
 }

+ 2 - 2
src/views/login/index.vue

@@ -131,7 +131,7 @@
                 ref="password"
                 v-model="RetrieveForm.new_password1"
                 :type="passwordType"
-                placeholder=""
+                placeholder="请输入新密码"
                 name="password"
                 tabindex="2"
                 autocomplete="on"
@@ -185,7 +185,7 @@
             >重置密码</el-button
           >
           <div class="tips">
-            <div @click="Retrieve('login')" style="cursor: pointer">去登陆</div>
+            <div @click="Retrieve('login')" style="cursor: pointer">返回登录</div>
           </div>
         </el-form>
       </div>

+ 247 - 310
src/views/role/components/dataInfo.vue

@@ -11,6 +11,7 @@
             placeholder="请选择是否为管理员"
             size="large"
             style="width: 100%"
+            @change="selChange"
           >
             <el-option
               v-for="item in adminOptions"
@@ -20,119 +21,112 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="权限配置:">
-          <div
-            style="
-              width: 100%;
-              height: 150px;
-              overflow: hidden;
-              border: 1px solid #ccc;
-              overflow-y: auto;
-              padding: 10px;
-            "
-          >
-            <el-checkbox
-              v-model="allChecked.nodeTree"
-              @change="handleCheckAllChange('nodeTree')"
-              >全选</el-checkbox
-            >
-            <el-tree
-              ref="nodeTree"
-              style="max-width: 600px"
-              :props="defaultProps"
-              :data="treeData"
-              default-expand-all
-              node-key="value"
-              show-checkbox
-              @check="handleNodeCheck"
-            />
-          </div>
-        </el-form-item>
-
-        <!-- <el-form-item label="模板分类授权:">
-          <div
-            style="
-              width: 100%;
-              height: 150px;
-              overflow: hidden;
-              border: 1px solid #ccc;
-              overflow-y: auto;
-              padding: 10px;
-            "
-          >
-            <el-checkbox
-              v-model="allChecked.templateCate"
-              @change="handleTemplateAllChange('templateCate')"
-              >全选</el-checkbox
-            >
-            <el-tree
-              ref="templateCate"
-              style="max-width: 600px"
-              :props="defaultProps"
-              :data="templateCate"
-              default-expand-all
-              node-key="value"
-              show-checkbox
-              @check="handleTemplateCheck"
-            />
-          </div>
-        </el-form-item>
-        <el-form-item label="文档分类授权:">
-          <div
-            style="
-              width: 100%;
-              height: 150px;
-              overflow: hidden;
-              border: 1px solid #ccc;
-              overflow-y: auto;
-              padding: 10px;
-            "
-          >
-            <el-checkbox
-              v-model="allChecked.docCate"
-              @change="handleDocAllChange('docCate')"
-              >全选</el-checkbox
-            >
-            <el-tree
-              ref="docCate"
-              style="max-width: 600px"
-              :props="defaultProps"
-              :data="documentCate"
-              default-expand-all
-              node-key="value"
-              show-checkbox
-              @check="handleDocCheck"
-            />
-          </div>
-        </el-form-item>
-        <el-form-item label="原始数据分类授权:">
-          <div
-            style="
-              width: 100%;
-              height: 150px;
-              overflow: hidden;
-              border: 1px solid #ccc;
-              overflow-y: auto;
-              padding: 10px;
-            "
-          >
-            <el-checkbox
-              v-model="allChecked.sourceDataTree"
-              @change="handleSourceDataAllChange('sourceDataTree')"
-              >全选</el-checkbox
-            >
-            <el-tree
-              ref="sourceDataTree"
-              style="max-width: 600px"
-              :props="defaultProps"
-              :data="sourceDataCate"
-              default-expand-all
-              node-key="value"
-              show-checkbox
-              @check="handleSourceDataCheck"
-            />
-          </div>
-        </el-form-item> -->
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="权限配置:">
+              <div
+                style="
+                  width: 100%;
+                  height: 300px;
+                  overflow: hidden;
+                  overflow-y: auto;
+                  padding: 10px;
+                "
+              >
+                <el-checkbox
+                  v-model="allChecked.nodeTree"
+                  @change="(val) => handleCheckAllChange('nodeTree', val)"
+                  >全选</el-checkbox
+                >
+                <el-tree
+                  ref="nodeTree"
+                  style="max-width: 600px"
+                  :props="treeProps"
+                  :data="treeData"
+                  default-expand-all
+                  node-key="value"
+                  show-checkbox
+                  @check="handleNodeCheck"
+                />
+              </div>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="模板分类授权:">
+              <div
+                style="
+                  width: 100%;
+                  height: 150px;
+                  overflow: hidden;
+                  overflow-y: auto;
+                  padding: 10px;
+                "
+              >
+                <el-tree
+                  ref="templateCate"
+                  style="max-width: 600px"
+                  :props="defaultProps"
+                  :data="templateCate"
+                  default-expand-all
+                  node-key="id"
+                  :default-checked-keys="defaultCheckedKeys.templateCate"
+                  show-checkbox
+                  @check="handleTemplateCheck"
+                />
+              </div>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="文档分类授权:">
+              <div
+                style="
+                  width: 100%;
+                  height: 150px;
+                  overflow: hidden;
+                  overflow-y: auto;
+                  padding: 10px;
+                "
+              >
+                <el-tree
+                  ref="docCate"
+                  style="max-width: 600px"
+                  :props="defaultProps"
+                  :data="documentCate"
+                  default-expand-all
+                  :default-checked-keys="defaultCheckedKeys.documentCate"
+                  node-key="id"
+                  show-checkbox
+                  @check="handleDocCheck"
+                />
+              </div>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="原始数据分类授权:">
+              <div
+                style="
+                  width: 100%;
+                  height: 150px;
+                  overflow: hidden;
+                  overflow-y: auto;
+                  padding: 10px;
+                "
+              >
+                <el-tree
+                  ref="sourceDataTree"
+                  style="max-width: 600px"
+                  :props="defaultProps"
+                  :data="sourceDataCate"
+                  default-expand-all
+                  node-key="id"
+                  show-checkbox
+                  :default-checked-keys="defaultCheckedKeys.sourceDataCate"
+                  @check="handleSourceDataCheck"
+                />
+              </div>
+            </el-form-item>
+          </el-col>
+        </el-row>
         <el-form-item label="角色状态:">
           <el-select
             v-model="dataForm.status"
@@ -148,6 +142,7 @@
             />
           </el-select>
         </el-form-item>
+
         <el-form-item label="介绍:">
           <el-input type="textarea" v-model="dataForm.intro"></el-input>
         </el-form-item>
@@ -165,6 +160,7 @@ import {
   createAdminRole,
   updateAdminRole,
   getAdminRoleInfo,
+  selectPermissions,
 } from "@/api/AdminRole";
 
 import { searchDocumentCategory } from "@/api/document";
@@ -193,10 +189,14 @@ export default {
   data() {
     return {
       activeName: "base",
-      defaultProps: {
+      treeProps: {
         children: "children",
         label: "label",
       },
+      defaultProps: {
+        children: "children",
+        label: "codename",
+      },
       treeData: [],
       dataForm: {
         id: "",
@@ -235,6 +235,11 @@ export default {
         docCate: false,
         sourceDataTree: false,
       },
+      defaultCheckedKeys: {
+        templateCate: [],
+        documentCate: [],
+        sourceDataTree: [],
+      },
     };
   },
 
@@ -245,75 +250,72 @@ export default {
     this.initSourceDataCate();
   },
   methods: {
+    /* 管理选选择 */
+    selChange(val) {
+      if (val == 1) {
+        this.handleCheckAllChange("nodeTree", true);
+        this.handleTemplateAllChange(true);
+        this.handleSourceDataAllChange(true);
+        this.handleDocumentCateAllChange(true);
+      } else {
+        this.handleCheckAllChange("nodeTree", false);
+        this.handleTemplateAllChange(false);
+        this.handleSourceDataAllChange(false);
+        this.handleDocumentCateAllChange(false);
+      }
+    },
+    handleTemplateAllChange(checked) {
+      const tree = this.$refs.templateCate;
+      if (checked) {
+        this.defaultCheckedKeys.templateCate = [1, 2, 3, 4];
+        tree.setCheckedKeys(this.defaultCheckedKeys.templateCate);
+      } else {
+        this.defaultCheckedKeys.templateCate = [];
+        tree.setCheckedKeys([]);
+      }
+      this.allChecked.templateCate = checked;
+    },
+
     /* 全选原始数据分类 */
-    handleSourceDataAllChange(treeRef) {
-      const tree = this.$refs[treeRef];
-      const data = this.sourceDataCate;
-      tree.setCheckedNodes(
-        this.allChecked[treeRef] ? this.flattenTree(data) : []
-      );
+    handleSourceDataAllChange(checked) {
+      const tree = this.$refs.sourceDataTree;
+      if (checked) {
+        this.defaultCheckedKeys.sourceDataCate = [9, 10, 11, 12];
+        tree.setCheckedKeys(this.defaultCheckedKeys.sourceDataCate);
+      } else {
+        this.defaultCheckedKeys.sourceDataCate = [];
+        tree.setCheckedKeys([]);
+      }
+      this.allChecked.sourceDataTree = checked;
+    },
+
+    handleDocumentCateAllChange(checked) {
+      const tree = this.$refs.docCate;
+      if (checked) {
+        this.defaultCheckedKeys.documentCate = [5, 6, 7, 8];
+        tree.setCheckedKeys(this.defaultCheckedKeys.documentCate);
+      } else {
+        this.defaultCheckedKeys.documentCate = [];
+        tree.setCheckedKeys([]);
+      }
+      this.allChecked.docCate = checked;
     },
 
     handleSourceDataCheck() {
       const tree = this.$refs.sourceDataTree;
+      console.log(tree);
       const checkedCount = tree.getCheckedNodes(true).length;
       const totalCount = this.countAllNodes(this.sourceDataCate);
       this.allChecked.sourceDataTree =
         checkedCount === totalCount && totalCount > 0;
     },
+    /* 原始数据分类 */
     initSourceDataCate() {
       let _this = this;
-      searchSourceDataCategory({ page: 1, pageSize: 9999, status: 5 }).then(
-        (res) => {
-          if (res.status != 200) return;
-          _this.sourceDataCate = res.data.sourcecategories.map((res) => {
-            let item = {
-              id: res.id,
-              label: res.name,
-              name: res.name,
-              children: [
-                {
-                  action: "view",
-                  cateId: res.id,
-                  value: "view-source-data" + res.id,
-                  type: "sourceCate",
-                  isMain: true,
-                  name: "查看",
-                  label: "查看",
-                },
-                {
-                  action: "create",
-                  cateId: res.id,
-                  value: "create-source-data" + res.id,
-                  type: "sourceCate",
-                  isMain: true,
-                  name: "创建",
-                  label: "创建",
-                },
-                {
-                  action: "edit",
-                  cateId: res.id,
-                  value: "edit-source-data" + res.id,
-                  type: "sourceCate",
-                  isMain: true,
-                  name: "编辑",
-                  label: "编辑",
-                },
-                {
-                  action: "delete",
-                  cateId: res.id,
-                  value: "delete-source-data" + res.id,
-                  type: "sourceCate",
-                  isMain: true,
-                  name: "删除",
-                  label: "删除",
-                },
-              ],
-            };
-            return item;
-          });
-        }
-      );
+      selectPermissions({ content_type_id: 3 }).then((res) => {
+        if (res.status !== 200) return;
+        _this.sourceDataCate = res.data;
+      });
     },
     /* 全选文档分类 */
     handleDocAllChange(treeRef) {
@@ -330,68 +332,57 @@ export default {
       const totalCount = this.countAllNodes(this.documentCate);
       this.allChecked.docCate = checkedCount === totalCount && totalCount > 0;
     },
+    /* 文档分类 */
     initDocCategory() {
       let _this = this;
-      searchDocumentCategory({ page: 1, pageSize: 9999, status: 5 }).then(
+      selectPermissions({ content_type_id: 2 }).then((res) => {
+        if (res.status !== 200) return;
+        _this.documentCate = res.data;
+      });
+      /*  searchDocumentCategory({ page: 1, pageSize: 9999, status: 5 }).then(
         (res) => {
           if (res.status != 200) return;
-          _this.documentCate = res.data.dataList.map((res) => {
-            let item = {
-              id: res.id,
-              label: res.name,
-              name: res.name,
-              children: [
-                {
-                  action: "view",
-                  cateId: res.id,
-                  type: "docCate",
-                  value: "view-doc-cate-" + res.id,
-                  isMain: true,
-                  name: "查看",
-                  label: "查看",
-                },
-                {
-                  action: "create",
-                  cateId: res.id,
-                  type: "docCate",
-                  value: "create-doc-cate-" + res.id,
-                  isMain: true,
-                  name: "创建",
-                  label: "创建",
-                },
-                {
-                  action: "edit",
-                  cateId: res.id,
-                  type: "docCateg",
-                  value: "edit-doc-cate-" + res.id,
-                  isMain: true,
-                  name: "编辑",
-                  label: "编辑",
-                },
-                {
-                  action: "delete",
-                  cateId: res.id,
-                  type: "docCateg",
-                  value: "delete-doc-cate-" + res.id,
-                  isMain: true,
-                  name: "删除",
-                  label: "删除",
-                },
-              ],
-            };
-            return item;
-          });
+          _this.documentCate = [
+            {
+              action: "view",
+              type: "docCate",
+              isMain: true,
+              name: "查看",
+              label: "查看",
+            },
+            {
+              action: "create",
+              type: "docCate",
+              isMain: true,
+              name: "创建",
+              label: "创建",
+            },
+            {
+              action: "edit",
+              type: "docCateg",
+              isMain: true,
+              name: "编辑",
+              label: "编辑",
+            },
+            {
+              action: "delete",
+              type: "docCateg",
+              isMain: true,
+              name: "删除",
+              label: "删除",
+            },
+          ]; 
         }
-      );
+      ); */
     },
-    /* 全选模版分类 */
+    /* 全选模版分类 
     handleTemplateAllChange(treeRef) {
       const tree = this.$refs[treeRef];
       const data = this.templateCate;
       tree.setCheckedNodes(
         this.allChecked[treeRef] ? this.flattenTree(data) : []
       );
-    },
+    },*/
 
     handleTemplateCheck() {
       const tree = this.$refs.templateCate;
@@ -421,71 +412,16 @@ export default {
     //初始化模板分类
     initTemplateCate() {
       let _this = this;
-      getAllCategory({}).then((res) => {
-        if (res.status != 200) return;
-        _this.templateCate = res.data.map((item) => {
-          let data = {
-            id: item.parent.id,
-            label: item.parent.name,
-            name: item.parent.name,
-            children: item.children.map((subItem) => {
-              return {
-                id: subItem.id,
-                name: subItem.name,
-                label: subItem.name,
-                children: [
-                  {
-                    action: "view",
-                    cateId: subItem.id,
-                    pCateId: item.parent.id,
-                    isMain: true,
-                    value: "view-template-cate-" + subItem.id,
-                    type: "templateCategory",
-                    name: "查看",
-                    label: "查看",
-                  },
-                  {
-                    action: "create",
-                    cateId: subItem.id,
-                    pCateId: item.parent.id,
-                    isMain: true,
-                    value: "create-template-cate-" + subItem.id,
-                    type: "templateCategory",
-                    name: "创建",
-                    label: "创建",
-                  },
-                  {
-                    action: "edit",
-                    cateId: subItem.id,
-                    pCateId: item.parent.id,
-                    isMain: true,
-                    value: "edit-template-cate-" + subItem.id,
-                    type: "templateCategory",
-                    name: "编辑",
-                    label: "编辑",
-                  },
-                  {
-                    action: "delete",
-                    cateId: subItem.id,
-                    pCateId: item.parent.id,
-                    isMain: true,
-                    value: "delete-template-cate-" + subItem.id,
-                    type: "templateCategory",
-                    name: "删除",
-                    label: "删除",
-                  },
-                ],
-              };
-            }),
-          };
-          return data;
-        });
+      selectPermissions({ content_type_id: 1 }).then((res) => {
+        if (res.status !== 200) return;
+        _this.templateCate = res.data;
       });
     },
     /* 权限配置全选 */
-    handleCheckAllChange(treeRef) {
+    handleCheckAllChange(treeRef, checked = true) {
       const tree = this.$refs[treeRef];
-      tree.setCheckedNodes(this.allChecked[treeRef] ? this.treeData : []);
+      tree.setCheckedNodes(checked ? this.treeData : []);
+      this.allChecked.nodeTree = checked;
     },
 
     handleNodeCheck() {
@@ -586,19 +522,29 @@ export default {
     btnSave(e) {
       let _this = this;
       let items = _this.$refs.nodeTree.getCheckedNodes();
-      /* 
+
       let templateCate = _this.$refs.templateCate.getCheckedNodes();
       let docCate = _this.$refs.docCate.getCheckedNodes();
       let sourceDataTree = _this.$refs.sourceDataTree.getCheckedNodes();
 
-      templateCate = templateCate.filter((o) => o.isMain);
-
-      
+      let operation_id;
+      templateCate = templateCate.map((el) => {
+        operation_id = el.id;
+        return { operation_id: el.id };
+      });
+      docCate = docCate.map((el) => {
+        el.operation_id = el.id;
+        return { operation_id: el.id };
+      });
+      sourceDataTree = sourceDataTree.map((el) => {
+        el.operation_id = el.id;
+        return { operation_id: el.id };
+      });
 
       _this.dataForm.template_cate_auth = JSON.stringify(templateCate);
       _this.dataForm.doc_cate_auth = JSON.stringify(docCate);
       _this.dataForm.source_cate_auth = JSON.stringify(sourceDataTree);
- */ let pickedItem = items.filter((o) => o.sub == true);
+      let pickedItem = items.filter((o) => o.sub == true);
       _this.dataForm.authList = JSON.stringify(pickedItem);
       let data = { ..._this.dataForm };
       data.attrs = JSON.stringify(data.attrs);
@@ -642,44 +588,35 @@ export default {
         } else {
           _this.$refs.nodeTree.setCheckedNodes([]);
         }
-        /* 
+
         let tempCate = res.data.templateCategoryUsers; //JSON.parse();
         if (tempCate.length > 0) {
-          _this.$refs.templateCate.setCheckedNodes(tempCate);
+          _this.$refs.templateCate.setCheckedKeys(
+            tempCate.map((el) => (el.type == 1 ? el.id : ""))
+          );
         } else {
-          _this.$refs.templateCate.setCheckedNodes([]);
+          _this.$refs.templateCate.setCheckedKeys([]);
         }
 
         let sourceCate = res.data.source_cate_auth; //JSON.parse();
         if (sourceCate.length > 0) {
-          let list = sourceCate.flatMap((el) =>
-            el.children.map((e) => {
-              if (e.isMain == "True") {
-                e.isMain = true;
-              }
-              return e;
-            })
+          _this.$refs.sourceDataTree.setCheckedKeys(
+            sourceCate.map((el) => (el.type == 1 ? el.id : ""))
           );
-          _this.$refs.sourceDataTree.setCheckedNodes(list);
         } else {
-          _this.$refs.sourceDataTree.setCheckedNodes([]);
+          _this.$refs.sourceDataTree.setCheckedKeys([]);
         }
 
-        let docCate = res.data.doc_cate_auth; //JSON.parse();
+        // 设置文档分类树的默认选中节点
+        let docCate = res.data.doc_cate_auth;
         if (docCate.length > 0) {
-          let list = docCate.flatMap((el) =>
-            el.children.map((e) => {
-              if (e.isMain == "True") {
-                e.isMain = true;
-              }
-              return e;
-            })
+          _this.$refs.docCate.setCheckedKeys(
+            docCate.map((el) => (el.type == 1 ? el.id : ""))
           );
-          _this.$refs.docCate.setCheckedNodes(list);
         } else {
-          _this.$refs.docCate.setCheckedNodes([]);
+          _this.$refs.docCate.setCheckedKeys([]);
         }
- */
+
         //     _this.$refs.docCate.setCheckedNodes(JSON.parse(res.data.doc_cate_auth));
         //     _this.$refs.sourceDataTree.setCheckedNodes(JSON.parse(res.data.source_cate_auth));
       });

+ 3 - 1
src/views/template/category/components/dataList.vue

@@ -165,6 +165,7 @@ export default {
       let par = {
         id: e,
       };
+      _this.queryForm.name=''
       _this
         .$confirm("您是否确认删除该记录?", "提示", {
           confirmButtonText: "确认",
@@ -172,7 +173,6 @@ export default {
           type: "warning",
         })
         .then((res) => {
-          // console.log("AAA")
           deleteTemplateCategory(par).then((res) => {
             _this.search();
           });
@@ -208,6 +208,8 @@ export default {
         res.data.dataList.map((el) => {
           if (el.child_count > 0) {
             el.hasChildren = true;
+          }else{
+            el.hasChildren = false
           }
         });
         _this.dataList = res.data.dataList;

+ 7 - 7
src/views/template/components/dataList.vue

@@ -5,9 +5,9 @@
       <el-table :data="dataList" style="width: 100%" header-row-class-name="headerBg" empty-text="没有项目信息">
         <el-table-column prop="id" label="ID" align="center" width="80"/>
        <!--  <el-table-column prop="code" label="引用名" align="center" width="180"/> -->
-        <el-table-column prop="name" label="模名称" align="left" min-width="180"/>
-        <el-table-column prop="category.name" label="所属分类" align="left"  width="120"/>
-        <el-table-column prop="createTime" label="创建时间" align="center" width="160"/>
+        <el-table-column prop="name" label="模名称" align="left" min-width="180"/>
+        <el-table-column prop="type_name" label="所属分类" align="left"  width="120"/>
+        <el-table-column prop="create_time" label="创建时间" align="center" width="160"/>
         <el-table-column prop="status" label="模板状态" align="center" width="120">
           <template #default="scope">
               <div v-if="scope.row.status==5">启用</div>
@@ -141,12 +141,12 @@
 
       //编辑
       btnEdit(e){
-       /*  let _this=this;
+        let _this=this;
         var a = document.createElement('a');
-        a.href="#/document/create?templateId="+e
+        a.href="#/document/create?templateId="+e+"&type=module"
         a.target="_blank";
-        a.click(); */
-        this.$router.push({path:"/document/create",query:{templateId:e}})
+        a.click();
+        //this.$router.push({path:"/document/create",query:{templateId:e}})
       },
 
       handleClose(){

+ 105 - 94
src/views/template/components/dataSearch.vue

@@ -1,121 +1,132 @@
 <template>
   <div class="data-search">
     <el-form :inline="true" :model="queryForm" class="demo-form-inline">
+      <el-form-item label="模块名称:">
+        <el-input
+          v-model="queryForm.name"
+          placeholder="请选择模块名称"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="所属分类:">
+        <el-select
+          v-model="queryForm.category_id"
+          clearable
+          class="m-2"
+          placeholder="请选择分类"
+          size="large"
+        >
+          <el-option
+            v-for="item in categoryList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="模块状态:">
+        <el-select
+          v-model="queryForm.status"
+          class="m-2"
+          placeholder="请选择模板块态"
+          size="large"
+        >
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
 
-
-        <el-form-item label="模板名称:">
-          <el-input v-model="queryForm.name" placeholder="请选择模板名称"></el-input>
-        </el-form-item>
-        <el-form-item label="所属分类:">
-          <el-select v-model="queryForm.category_id" clearable class="m-2" placeholder="请选择分类" size="large">
-              <el-option
-                v-for="item in categoryList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              />
-            </el-select>
-        </el-form-item>
-        <el-form-item label="模板状态:">
-          <el-select v-model="queryForm.status" class="m-2" placeholder="请选择模板状态" size="large">
-              <el-option
-                v-for="item in statusOptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              />
-            </el-select>
-        </el-form-item>
-
-        <el-form-item>
-          <el-button type="primary" @click="onSubmit">  <svg-icon icon-class="search"/> 搜索</el-button>
-          <el-button type="success" @click="onCreate" >  <svg-icon icon-class="edit"/> 创建模块</el-button>
-        </el-form-item>
-      </el-form>
-
-
-
-
+      <el-form-item>
+        <el-button type="primary" @click="onSubmit">
+          <svg-icon icon-class="search" /> 搜索</el-button
+        >
+        <el-button type="success" @click="onCreate">
+          <svg-icon icon-class="edit" /> 创建模块</el-button
+        >
+      </el-form-item>
+    </el-form>
   </div>
 </template>
 
 <script>
-import dataInfo from './dataInfo.vue';
-import elDragDialog from '@/directive/el-drag-dialog'
-import {searchTemplateCategory} from "@/api/template"
-export default{
-  components:{
+import dataInfo from "./dataInfo.vue";
+import elDragDialog from "@/directive/el-drag-dialog";
+import { searchTemplateCategory } from "@/api/template";
+export default {
+  components: {
     dataInfo,
   },
   directives: { elDragDialog },
-  props:{
-    queryForm:{
-        type:Object,
-        default:()=>{
-          return {
-             page:1,
-             pageSize:10,
-             name:'',
-             category_id:'',
-             status:'',
-          }
-        }
+  props: {
+    queryForm: {
+      type: Object,
+      default: () => {
+        return {
+          page: 1,
+          pageSize: 10,
+          name: "",
+          category_id: "",
+          status: "",
+        };
+      },
     },
-
   },
-  data(){
-    return{
-        statusOptions:[
-          {
-            value:'',
-            label:"请选择状态"
-          },
-          {
-            value:5,
-            label:'启用'
-          },
-          {
-            value:6,
-            label:"停用"
-          },
-        ],
-        categoryList:[],
-        dialogVisible:false,
-    }
+  data() {
+    return {
+      statusOptions: [
+        {
+          value: "",
+          label: "请选择状态",
+        },
+        {
+          value: 5,
+          label: "启用",
+        },
+        {
+          value: 6,
+          label: "停用",
+        },
+      ],
+      categoryList: [],
+      dialogVisible: false,
+    };
   },
   mounted() {
     this.initCategory();
   },
-  methods:{
-
-
-    initCategory (){
-      let _this=this;
-      searchTemplateCategory({page:1,pageSize:999,status:5}).then(res=>{
-        if(res.status!=200)return;
-        _this.categoryList=res.data.dataList;
-      })
+  methods: {
+    initCategory() {
+      let _this = this;
+      searchTemplateCategory({ page: 1, pageSize: 999, status: 5 }).then(
+        (res) => {
+          if (res.status != 200) return;
+          _this.categoryList = res.data.dataList;
+        }
+      );
     },
-    onCreate(e){
+    onCreate(e) {
       /* this.dialogVisible=true; */
-     /*  const url = this.$router.resolve({ path: 'new' }).href;
+      /*  const url = this.$router.resolve({ path: 'new' }).href;
       window.open(url, '_blank'); */
-      /* let _this=this;
-        var a = document.createElement('a');
-        a.href="#/document/create"
-        a.target="_blank";
-        a.click(); */
-        this.$router.push('/document/create');
+      let _this = this;
+      var a = document.createElement("a");
+      a.href = "#/document/create?type=module";
+      a.target = "_blank";
+      a.click();
+      /* this.$router.push('/document/create'); */
     },
 
     //搜索
-    onSubmit(){
-      this.$emit("bindSetQuery",this.$props.queryForm);
-    }
-  }
-}
+    onSubmit() {
+      this.$emit("bindSetQuery", this.$props.queryForm);
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-@import "./dataSearch.scss"
+@import "./dataSearch.scss";
 </style>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff