Browse Source

improve: 装修问题处理

From-wh 2 years ago
parent
commit
0e3b376df9

+ 6 - 5
template/admin/src/components/diyComponents/c_txt_list.vue

@@ -115,24 +115,25 @@ export default {
     },
     addHotTxt() {
       let val = {
-        children: [
+        chiild: [
           {
             max: 20,
             pla: '选填,不超过四个字',
             title: '标题',
-            val: 'CRMEB v4.2.2 正式发布',
+            val: '',
           },
           {
             max: 99,
             pla: '选填',
             title: '链接',
-            val: '链接',
+            val: '',
           },
         ],
       };
       if (this.name == 'newList') {
-        let obj = JSON.parse(JSON.stringify(this.datas[this.name].list[this.datas[this.name].list.length - 1]));
-        this.datas[this.name].list.push(obj);
+        let arrs = this.datas[this.name].list[this.datas[this.name].list.length - 1];
+        let obj = arrs ? JSON.parse(JSON.stringify(arrs)) : '';
+        this.datas[this.name].list.push(obj || val);
         return;
       }
       if (this.datas[this.name].list.length == 0) {

+ 3 - 2
template/admin/src/pages/setting/devise/diyIndex.vue

@@ -477,9 +477,10 @@ export default {
     log(evt) {
       // 中间拖拽排序
       if (evt.moved) {
-        if (evt.moved.element.name == 'search_box') {
+        if (evt.moved.element.name == 'search_box' || evt.moved.element.name == 'nav_bar') {
           return this.$Message.warning('该组件禁止拖拽');
         }
+        
         // if (evt.moved.element.name == "nav_bar") {
         //     return this.$Message.warning("该组件禁止拖拽");
         // }
@@ -542,7 +543,7 @@ export default {
           return;
         }
       }
-      if (item.name == 'search_box') {
+      if (item.name == 'search_box' || item.name == 'nav_bar') {
         return this.$Message.warning('该组件禁止移动');
       }
       // if (item.name == "nav_bar") {

+ 4 - 3
template/admin/src/pages/setting/devise/index.vue

@@ -207,7 +207,7 @@ export default {
   components: {
     footPage,
     html2canvas,
-    draggable: vuedraggable
+    draggable: vuedraggable,
   },
   filters: {
     filterTxt(val) {
@@ -402,7 +402,7 @@ export default {
     log(evt) {
       // 中间拖拽排序
       if (evt.moved) {
-        if (evt.moved.element.name == 'search_box') {
+        if (evt.moved.element.name == 'search_box' || evt.moved.element.name == 'nav_bar') {
           return this.$Message.warning('该组件禁止拖拽');
         }
         // if (evt.moved.element.name == "nav_bar") {
@@ -467,9 +467,10 @@ export default {
           return;
         }
       }
-      if (item.name == 'search_box') {
+      if (item.name == 'search_box' || item.name == 'nav_bar') {
         return this.$Message.warning('该组件禁止移动');
       }
+      console.log(item);
       // if (item.name == "nav_bar") {
       //     return this.$Message.warning("该组件禁止移动");
       // }