Forráskód Böngészése

调整模块列表

yangg 10 hónapja
szülő
commit
9785d208da

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/index.html


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/css/chunk-354638c4.a5bdf00d.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/css/chunk-3b1696d4.ce959b8e.css


+ 1 - 0
dist/static/css/chunk-458af7b3.930e9e5b.css

@@ -0,0 +1 @@
+.project-search[data-v-18d44586]{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px;font-size:12px}.listClass[data-v-18d44586]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/css/chunk-96aac5cc.e3c3364c.css


+ 0 - 1
dist/static/css/chunk-cd1f0158.162e8a99.css

@@ -1 +0,0 @@
-.project-search[data-v-0116246d]{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px;font-size:12px}

+ 1 - 0
dist/static/css/chunk-d90be7d8.1b9b8d87.css

@@ -0,0 +1 @@
+.search-list-form[data-v-05923cdc]{padding:20px}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/app.ae15f383.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/app.c4e64ffb.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/chunk-354638c4.e67f4c41.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/chunk-3b1696d4.1b47d009.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/chunk-41c59fa7.eb553f1a.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/chunk-458af7b3.1bb339c3.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/chunk-96aac5cc.ae0a98bd.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/chunk-cd1f0158.78f25a6b.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/static/js/chunk-d90be7d8.d1d439fb.js


+ 19 - 10
src/views/document/com/editor.vue

@@ -29,7 +29,7 @@
                   <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                     <el-form-item label="模块分类:">
                       <!-- 此处需要处理为只有admin账号可编辑 -->
-                      <el-cascader
+                      <!--  <el-cascader
                         v-if="showCategorySelect(it)"
                         v-model="it.category_id"
                         clearable
@@ -39,7 +39,7 @@
                         @change="onChangeCategory(it)"
                         placeholder="请选择模块分类"
                       />
-                      <!-- {{ $store.state.user }} -->
+                     {{ $store.state.user }} -->
                       <!-- <el-select
                         v-if="showCategorySelect(it)"
                         v-model="it.category_id"
@@ -53,10 +53,9 @@
                           :label="item.name"
                           :value="item.id"
                         />
-                      </el-select> -->
+                      </el-select>  v-else-->
 
                       <span
-                        v-else
                         @click="enableSelect(it)"
                         style="cursor: pointer"
                         >{{ getCategory(it.category_id) }}</span
@@ -65,14 +64,13 @@
                   </el-col>
                   <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                     <el-form-item label="模块名称:">
-                      <el-input
+                     <!--  <el-input
                         v-if="showCategoryName(it)"
                         class="input-item"
                         v-model="it.name"
                         placeholder="请填写模块名称"
-                      />
+                      />v-else -->
                       <span
-                        v-else
                         @click="enableName(it)"
                         style="cursor: pointer"
                         >{{ it.name }}</span
@@ -139,6 +137,7 @@
                         >
                         </el-button>
                         <el-tooltip
+                        v-if="!templateId"
                           class="item"
                           effect="dark"
                           content="删除"
@@ -314,6 +313,7 @@ export default {
   mounted() {
     this.initCategoryList();
     this.type = this.$route.query.type;
+    this.templateId=this.$route.query.templateId;
   },
   methods: {
     showCategoryName(item) {
@@ -370,13 +370,22 @@ export default {
       let _this = this;
       /* e.category_id='1' */
       let data = JSON.parse(JSON.stringify(e));
+      console.log(data);
       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[e.category_id.length - 1];
+      // 检查 category_id 是否为数组
+      if (Array.isArray(e.category_id)) {
+        // 如果是数组,取最后一个元素作为 category_id
+        data.category_id = e.category_id[e.category_id.length - 1];
+      } else {
+        // 如果不是数组,直接赋值
+        data.category_id = e.category_id;
+      }
+
       if (data.id == undefined || this.saveAs) {
         createTemplate(data).then((res) => {
           if (res.status != 200) return;
@@ -443,8 +452,8 @@ export default {
       return rootItems;
     },
     onChangeCategory(item, value) {
-      /* const selectedId = value[value.length - 1];
-      item.category_id=selectedId */
+      const selectedId = value[value.length - 1];
+      item.category_id = selectedId;
       // You can now use the selected ID as needed
     },
     //更新产品属性

+ 284 - 215
src/views/document/com/menus.vue

@@ -1,254 +1,323 @@
 <template>
   <div class="com-menus">
-      <div class="menus-out">
-          <div class="group-item" v-for="(it,index) in menus" :key="index" :class="'group-item'+index">
-              <div class="items-name" >{{it.name}}</div>
-              <div class="menus">
-                <template v-for="(item,itemIndex) in it.subMenus" >
-                  <div class="menu" @click="onClickMenus(item)">
-                    <div class="icon">
-                       <svg-icon v-if="item.icon!=''" className="svg-style" size="120" :icon-class="item.icon"/>
-                    </div>
-                    <div class="menu-name">{{item.name}}</div>
-                  </div>
-                </template>
+    <div class="menus-out">
+      <div
+        class="group-item"
+        v-for="(it, index) in menus"
+        :key="index"
+        :class="'group-item' + index"
+      >
+        <div class="items-name">{{ it.name }}</div>
+        <div class="menus">
+          <template v-for="(item, itemIndex) in it.subMenus">
+            <div
+              :key="itemIndex"
+              class="menu"
+              @click="onClickMenus(item)"
+              :class="{ disabled: item.key === 'article' && type === 'module' }"
+            >
+              <div class="icon">
+                <svg-icon
+                  v-if="item.icon != ''"
+                  className="svg-style"
+                  size="120"
+                  :icon-class="item.icon"
+                />
               </div>
-          </div>
+              <div class="menu-name">{{ item.name }}</div>
+            </div>
+          </template>
+        </div>
       </div>
+    </div>
 
+    <el-dialog
+      :visible.sync="showFormula"
+      append-to-body
+      v-el-drag-dialog
+      width="300"
+      :close-on-click-modal="false"
+      custom-class="prod-verify"
+      title="选择公式"
+    >
+      <Formula @onPicked="onPickedFormula" :comList="comArr"></Formula>
+    </el-dialog>
 
-      <el-dialog  :visible.sync="showFormula" append-to-body v-el-drag-dialog  width="300" :close-on-click-modal="false" custom-class="prod-verify" title="选择公式">
-          <Formula @onPicked="onPickedFormula" :comList="comArr"></Formula>
-      </el-dialog>
+    <el-dialog
+      :visible.sync="showVariable"
+      append-to-body
+      v-el-drag-dialog
+      width="800px"
+      :close-on-click-modal="false"
+      custom-class="prod-verify"
+      :title="insertTitle"
+    >
+      <Variable
+        :type="type"
+        @onPicked="onPickedVariable"
+        @onData="btnbianl"
+      ></Variable>
+    </el-dialog>
 
-      <el-dialog  :visible.sync="showVariable" append-to-body v-el-drag-dialog  width="800px" :close-on-click-modal="false" custom-class="prod-verify" :title="insertTitle">
-          <Variable :type="type" @onPicked="onPickedVariable" @onData="btnbianl"></Variable>
-      </el-dialog>
-
-
-      <el-dialog  :visible.sync="showSourceData" append-to-body v-el-drag-dialog  width="300" :close-on-click-modal="false" custom-class="prod-verify" title="选择源数据">
-          <sourceData  @onPicked="onPickedTab"></sourceData>
-      </el-dialog>
-      <!-- 插入ai -->
-      <el-dialog  :visible.sync="showSourceAi" append-to-body v-el-drag-dialog  width="300" :close-on-click-modal="false" custom-class="prod-verify" title="选择AI">
-          <sourceAi  @onPicked="onPickedAi"></sourceAi>
-      </el-dialog>
-
-       <!-- ai -->
-       <el-dialog  :visible.sync="showSourceEs" append-to-body v-el-drag-dialog  width="300" :close-on-click-modal="false" custom-class="prod-verify" title="AI随笔">
-          <sourceEs  @onPicked="onPickedAi"></sourceEs>
-      </el-dialog>
+    <el-dialog
+      :visible.sync="showSourceData"
+      append-to-body
+      v-el-drag-dialog
+      width="300"
+      :close-on-click-modal="false"
+      custom-class="prod-verify"
+      title="选择源数据"
+    >
+      <sourceData @onPicked="onPickedTab"></sourceData>
+    </el-dialog>
+    <!-- 插入ai -->
+    <el-dialog
+      :visible.sync="showSourceAi"
+      append-to-body
+      v-el-drag-dialog
+      width="300"
+      :close-on-click-modal="false"
+      custom-class="prod-verify"
+      title="选择AI"
+    >
+      <sourceAi @onPicked="onPickedAi"></sourceAi>
+    </el-dialog>
 
+    <!-- ai -->
+    <el-dialog
+      :visible.sync="showSourceEs"
+      append-to-body
+      v-el-drag-dialog
+      width="300"
+      :close-on-click-modal="false"
+      custom-class="prod-verify"
+      title="AI随笔"
+    >
+      <sourceEs @onPicked="onPickedAi"></sourceEs>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-  import Formula from "./components/Formula";
-  import sourceData from "./components/SourceData";
-  import sourceAi from "./components/sourceAi/index.vue";
-  import sourceEs from "./components/sourceEs/index.vue";
-  import Variable from "./components/Variable"
-  import elDragDialog from '@/directive/el-drag-dialog'
+import Formula from "./components/Formula";
+import sourceData from "./components/SourceData";
+import sourceAi from "./components/sourceAi/index.vue";
+import sourceEs from "./components/sourceEs/index.vue";
+import Variable from "./components/Variable";
+import elDragDialog from "@/directive/el-drag-dialog";
 
-  export default{
-    name:"menus",
-    emits:["onEvents","onVariable"],
-    components:{
-      Formula,Variable,sourceData,sourceAi,sourceEs
-    },
-    directives: { elDragDialog },
-    props:{
-      comArr:{
-        type:Array,
-        default:[]
-      }
+export default {
+  name: "menus",
+  emits: ["onEvents", "onVariable"],
+  components: {
+    Formula,
+    Variable,
+    sourceData,
+    sourceAi,
+    sourceEs,
+  },
+  directives: { elDragDialog },
+  props: {
+    comArr: {
+      type: Array,
+      default: [],
     },
-    data(){
-      return{
-        showFormula:false,
-        showVariable:false,
-        showSourceData:false,
-        showSourceAi:false,
-        showSourceEs:false,
-        type:null,
-        insertTitle:'插入变量',
-        menus:[
-          {
-            name:'插入',
-            subMenus:[
-              // {
-              //   key:"template",
-              //   name:"空白模板",
-              //   icon:"insertTemplate",
-              // },
-              {
-                key:"article",
-                name:"图文",
-                icon:"insertArticle",
-              },
+  },
+  data() {
+    return {
+      showFormula: false,
+      showVariable: false,
+      showSourceData: false,
+      showSourceAi: false,
+      showSourceEs: false,
+      type: null,
+      insertTitle: "插入变量",
+      menus: [
+        {
+          name: "插入",
+          subMenus: [
+            // {
+            //   key:"template",
+            //   name:"空白模板",
+            //   icon:"insertTemplate",
+            // },
+            {
+              key: "article",
+              name: "图文",
+              icon: "insertArticle",
+              disabled: () => this.type === "module",
+            },
 
-              /* {
+            /* {
                 key:"SourceData",
                 name:"源数据",
                 icon:"sourceData",
               }, */
-              {
-                key:"formual",
-                name:"公式",
-                icon:"insertFormula",
-              },
+            {
+              key: "formual",
+              name: "公式",
+              icon: "insertFormula",
+            },
 
-              {
-                key:"variable",
-                name:"变量",
-                icon:"insertParams",
-              },
-              {
-                key:"constant",
-                name:"常量",
-                icon:"constant",
-              },
-              {
-                key:"attr",
-                name:"属性",
-                icon:"attr",
-              },
-              {
-                key:"Directory",
-                name:"目录",
-                icon:"subject",
-              },
-              {
-                key:"InsertNull",
-                name:"插入空值",
-                icon:"insertTemplate",
-              },
-              /* {
+            {
+              key: "variable",
+              name: "变量",
+              icon: "insertParams",
+            },
+            {
+              key: "constant",
+              name: "常量",
+              icon: "constant",
+            },
+            {
+              key: "attr",
+              name: "属性",
+              icon: "attr",
+            },
+            {
+              key: "Directory",
+              name: "目录",
+              icon: "subject",
+            },
+            {
+              key: "InsertNull",
+              name: "插入空值",
+              icon: "insertTemplate",
+            },
+            /* {
                 key:"pager",
                 name:"分页",
                 icon:"insertPage",
               }, */
-              {
-                key:"ai",
-                name:"AI模块",
-                icon:"AI",
-              },
-             /*  {
+            {
+              key: "ai",
+              name: "AI模块",
+              icon: "AI",
+            },
+            /*  {
                 key:"aiEs",
                 name:"AI随笔",
                 icon:"form",
               }, */
-            ]
-          },
-          // {
-          //   name:'设置',
-          //   subMenus:[
+          ],
+        },
+        // {
+        //   name:'设置',
+        //   subMenus:[
 
-          //     {
-          //       key:"headerAndTop",
-          //       name:"页眉页脚",
-          //       icon:"insertPager",
-          //     },
+        //     {
+        //       key:"headerAndTop",
+        //       name:"页眉页脚",
+        //       icon:"insertPager",
+        //     },
 
-              // {
-              //   key:"auth",
-              //   name:"权限",
-              //   icon:"insertAuth",
-              // },
-              // {
-              //   key:"fav",
-              //   name:"收藏",
-              //   icon:"insertFav",
-              // },
-              // {
-              //   key:"share",
-              //   name:"分享",
-              //   icon:"insertShare",
-              // },
-          //   ]
-          // }
-        ]
-      }
+        // {
+        //   key:"auth",
+        //   name:"权限",
+        //   icon:"insertAuth",
+        // },
+        // {
+        //   key:"fav",
+        //   name:"收藏",
+        //   icon:"insertFav",
+        // },
+        // {
+        //   key:"share",
+        //   name:"分享",
+        //   icon:"insertShare",
+        // },
+        //   ]
+        // }
+      ],
+    };
+  },
+  mounted() {
+    this.type = this.$route.query.type;
+  },
+  methods: {
+    /* 变量变动 */
+    btnbianl(e) {
+      this.$emit("onVariable", e);
     },
 
-    methods:{
-      /* 变量变动 */
-      btnbianl(e){
-        this.$emit("onVariable",e)
-      },
-
-      /* 插入ai */
-      onPickedAi(e){
-        let _this=this;
-        let item={
-            type:"insert",
-            key:'ai',
-            content:e,
-        }
-        this.$emit("onEvents",item);
-        this.showSourceAi=false;
-      },
-      //选取公式
+    /* 插入ai */
+    onPickedAi(e) {
+      let _this = this;
+      let item = {
+        type: "insert",
+        key: "ai",
+        content: e,
+      };
+      this.$emit("onEvents", item);
+      this.showSourceAi = false;
+    },
+    //选取公式
 
-      onPickedTab(e){
-        let _this=this;
-        let item={
-            type:"insert",
-            key:'sourceData',
-            content:e,
-        }
-        this.$emit("onEvents",item);
-        this.showSourceData=false;
-      },
-      onPickedFormula(e){
-        let _this=this;
-        let item={
-            type:"insert",
-            key:'formual',
-            content:e,
-        }
-        this.$emit("onEvents",item);
-        console.log(item);
-        this.showFormula=false;
-      },
-      onPickedVariable(e){
-        let _this=this;
-        let item={
-            type:"insert",
-            key:e.type==2?'constant':'variable',
-            content:e,
+    onPickedTab(e) {
+      let _this = this;
+      let item = {
+        type: "insert",
+        key: "sourceData",
+        content: e,
+      };
+      this.$emit("onEvents", item);
+      this.showSourceData = false;
+    },
+    onPickedFormula(e) {
+      let _this = this;
+      let item = {
+        type: "insert",
+        key: "formual",
+        content: e,
+      };
+      this.$emit("onEvents", item);
+      console.log(item);
+      this.showFormula = false;
+    },
+    onPickedVariable(e) {
+      let _this = this;
+      let item = {
+        type: "insert",
+        key: e.type == 2 ? "constant" : "variable",
+        content: e,
+      };
+      this.$emit("onEvents", item);
+      this.showVariable = false;
+    },
+    onClickMenus(e) {
+      if (e.disabled && e.disabled()) {
+        return;
+      }
+      e.type = "insert";
+      if (e.key == "formual") {
+        this.showFormula = true;
+      } else if (e.key == "SourceData") {
+        this.showSourceData = true;
+      } else if (e.key == "variable" || e.key == "constant") {
+        if (e.key == "variable") {
+          this.type = 1;
+          this.insertTitle = "插入变量";
+        } else {
+          this.type = 2;
+          this.insertTitle = "插入常量";
         }
-        this.$emit("onEvents",item);
-        this.showVariable=false;
-      },
-      onClickMenus(e){
-          e.type="insert";
-          if(e.key=="formual"){
-              this.showFormula=true;
-          }else if(e.key=="SourceData"){
-              this.showSourceData=true;
-          }else if(e.key=="variable"||e.key=='constant'){
-            if(e.key=="variable"){
-              this.type=1;
-              this.insertTitle="插入变量";
-            }else{
-              this.type=2;
-              this.insertTitle="插入常量";
-            }
-            this.showVariable=true;
-          }else if(e.key=="ai"){
-            this.showSourceAi=true
-          }else if(e.key=="aiEs"){
-            this.showSourceEs=true
-          }else{
-              this.$emit("onEvents",e);
-          }
+        this.showVariable = true;
+      } else if (e.key == "ai") {
+        this.showSourceAi = true;
+      } else if (e.key == "aiEs") {
+        this.showSourceEs = true;
+      } else {
+        this.$emit("onEvents", e);
       }
-
-    }
-  }
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-@import './menus.scss';
+@import "./menus.scss";
+.menu.disabled {
+  opacity: 0.5;
+  cursor: not-allowed;
+}
 </style>

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

@@ -101,7 +101,7 @@
                 <el-collapse-item
                   title="模版列表"
                   name="-2"
-                  v-if="showView == 0 && type !== 'document'"
+                  v-if="showView == 0"
                 >
                   <div
                     v-for="(it, index) in templateList"
@@ -431,6 +431,7 @@
             <span class="name">模版属性</span>
           </div>
           <div
+          v-if="type!=='module'"
             class="item"
             @click="onSetActiveIndex(9998)"
             :class="comIndex == 9998 ? 'active-item' : ''"
@@ -1157,6 +1158,7 @@ export default {
               : res.data.name + "-轻良实业";
           res.data.attrs = JSON.parse(res.data.attrs);
           _this.coms = [res.data];
+          console.log(_this.coms);
         })
         .catch(() => {});
     },

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott