ZZ 1 月之前
父節點
當前提交
225fb22508
共有 2 個文件被更改,包括 88 次插入28 次删除
  1. 3 3
      mer_mer_admin/src/views/product/creatProduct/index.vue
  2. 85 25
      mer_plat_admin/src/components/Category/edit.vue

+ 3 - 3
mer_mer_admin/src/views/product/creatProduct/index.vue

@@ -862,9 +862,9 @@ export default {
             pid: e.pid,
             isShow: e.isShow,
           };
-          if (!e.childList && (e.level === 1 || e.level === 2)) {
-            e_new = { ...e_new, disabled: true };
-          }
+          // if (!e.childList && (e.level === 1 || e.level === 2)) {
+          //   e_new = { ...e_new, disabled: true };
+          // }
           if (e.childList) {
             const childList = this.addDisabled(e.childList);
             e_new = { ...e_new, childList: childList };

+ 85 - 25
mer_plat_admin/src/components/Category/edit.vue

@@ -1,14 +1,25 @@
 <template>
   <div>
-    <el-form ref="editPram" :model="editPram" label-width="80px">
+    <el-form
+      ref="editPram"
+      :model="editPram"
+      label-width="80px"
+    >
       <el-form-item
         label="分类名称:"
         prop="name"
         :rules="[{ required: true, message: '请输入分类名称', trigger: ['blur', 'change'] }]"
       >
-        <el-input v-model.trim="editPram.name" :maxlength="biztype.value === 1 ? 8 : 20" placeholder="分类名称" />
+        <el-input
+          v-model.trim="editPram.name"
+          :maxlength="biztype.value === 1 ? 8 : 20"
+          placeholder="分类名称"
+        />
       </el-form-item>
-      <el-form-item label="父级:" v-if="biztype.value !== 2">
+      <el-form-item
+        label="父级:"
+        v-if="biztype.value !== 2"
+      >
         <el-cascader
           v-model="editPram.pid"
           :disabled="isCreate === 1"
@@ -21,24 +32,70 @@
         />
       </el-form-item>
       <el-form-item label="分类图标:">
-        <div class="upLoadPicBox" @click="modalPicTap(false)">
-          <div v-if="editPram.icon" class="pictrue">
+        <div
+          class="upLoadPicBox"
+          @click="modalPicTap(false)"
+        >
+          <div
+            v-if="editPram.icon"
+            class="pictrue"
+          >
             <img :src="editPram.icon" />
           </div>
-          <div v-else class="upLoad">
+          <div
+            v-else
+            class="upLoad"
+          >
             <i class="el-icon-camera cameraIconfont" />
           </div>
           <div class="from-tips">建议尺寸(180*180)</div>
         </div>
       </el-form-item>
-      <el-form-item class="mb30" label="排序:">
-        <el-input-number v-model.trim="editPram.sort" :min="0" />
+      <el-form-item
+        label="是否高亮:"
+        prop="isHighLight"
+      >
+        <el-switch
+          v-model.trim="editPram.isHighLight"
+          active-text="是"
+          inactive-text="否"
+        >
+        </el-switch>
       </el-form-item>
-      <el-form-item label="扩展字段" v-if="biztype.value !== 1 && biztype.value !== 3 && biztype.value !== 5">
-        <el-input v-model.trim="editPram.extra" type="textarea" placeholder="扩展字段" />
+      <el-form-item
+        label="链接地址:"
+        prop="link"
+      >
+        <el-input
+          v-model.trim="editPram.link"
+          :maxlength="biztype.value === 1 ? 8 : 20"
+          placeholder="链接地址"
+        />
+      </el-form-item>
+      <el-form-item
+        class="mb30"
+        label="排序:"
+      >
+        <el-input-number
+          v-model.trim="editPram.sort"
+          :min="0"
+        />
+      </el-form-item>
+      <el-form-item
+        label="扩展字段"
+        v-if="biztype.value !== 1 && biztype.value !== 3 && biztype.value !== 5"
+      >
+        <el-input
+          v-model.trim="editPram.extra"
+          type="textarea"
+          placeholder="扩展字段"
+        />
       </el-form-item>
     </el-form>
-    <div slot="footer" class="dialog-footer-inner">
+    <div
+      slot="footer"
+      class="dialog-footer-inner"
+    >
       <el-button @click="close">取消</el-button>
       <el-button
         type="primary"
@@ -54,8 +111,7 @@
           'platform:category:update',
           'platform:category:save',
         ]"
-        >确定</el-button
-      >
+      >确定</el-button>
     </div>
   </div>
 </template>
@@ -94,7 +150,7 @@ export default {
       type: Array,
     },
   },
-  data() {
+  data () {
     return {
       loadingBtn: false,
       constants: this.$constants,
@@ -103,6 +159,8 @@ export default {
         name: null,
         pid: null,
         sort: 0,
+        link: '',
+        isHighLight: false,
         // status: true,
         type: this.biztype.value,
         url: null,
@@ -119,22 +177,22 @@ export default {
       parentOptions: [],
     };
   },
-  mounted() {
+  mounted () {
     this.initEditData();
   },
   methods: {
-    handleChange() {
+    handleChange () {
       this.prent.level = this.$refs['cascader'].getCheckedNodes()[0].level;
     },
     // 点击图标
-    addIcon() {
+    addIcon () {
       const _this = this;
       _this.$modalIcon(function (icon) {
         _this.editPram.icon = icon;
       });
     },
     // 点击商品图
-    modalPicTap(multiple) {
+    modalPicTap (multiple) {
       const _this = this;
       const attr = [];
       this.$modalUpload(
@@ -146,13 +204,13 @@ export default {
         'store',
       );
     },
-    close() {
+    close () {
       this.$emit('hideEditDialog');
     },
-    initEditData() {
+    initEditData () {
       this.parentOptions = [...this.allTreeList];
       this.addTreeListLabelForCasCard(this.parentOptions, 'child');
-      const { icon, name, pid, sort, type, id, url, level } = this.editData;
+      const { icon, name, pid, sort, type, id, url, level, isHighLight, link } = this.editData;
       if (this.isCreate === 1) {
         this.editPram.icon = icon;
         this.editPram.name = name;
@@ -162,18 +220,20 @@ export default {
         this.editPram.url = url;
         this.editPram.id = id;
         this.editPram.level = level;
+        this.editPram.isHighLight = isHighLight;
+        this.editPram.link = link;
       } else {
         this.editPram.pid = this.prent.id;
         this.editPram.type = this.biztype.value;
         this.editPram.level = parseInt(this.prent.level) + 1;
       }
     },
-    addTreeListLabelForCasCard(arr, child) {
+    addTreeListLabelForCasCard (arr, child) {
       arr.forEach((item) => {
         this.treeListCheckLevelLT3ForDisabled(item.children);
       });
     },
-    treeListCheckLevelLT3ForDisabled(children) {
+    treeListCheckLevelLT3ForDisabled (children) {
       if (!children) return;
       children.forEach((j) => {
         if (j.level >= 3) {
@@ -181,13 +241,13 @@ export default {
         } else this.treeListCheckLevelLT3ForDisabled(j.children);
       });
     },
-    handlerSubmit(formName) {
+    handlerSubmit (formName) {
       this.$refs[formName].validate((valid) => {
         if (!valid) return;
         this.handlerSaveOrUpdate(this.isCreate === 0);
       });
     },
-    handlerSaveOrUpdate(isSave) {
+    handlerSaveOrUpdate (isSave) {
       if (isSave) {
         // this.editPram.pid = this.prent.id
         this.loadingBtn = true;