zizhong.wang 4 lat temu
rodzic
commit
745a148d2c

+ 11 - 9
src/views/parameter/ContentCategory1.vue

@@ -53,6 +53,7 @@ export default {
       tableData: [],
       modalFlag: false, // 控制模态框展示
       dictList: [],
+      content1Param:{},
     };
   },
   computed: {
@@ -118,7 +119,8 @@ export default {
         })
           .then((res) => {
             if (res.data && res.data.code === 200) {
-              this.dictList = res.data.data;
+              let dataList = res.data.data;
+              dataList.forEach((item)=>{if(item.dictCode === 'content1'){this.content1Param = item}})
               resolve();
             } else {
               console.log(res);
@@ -137,8 +139,8 @@ export default {
         method: "post",
         url: "/sys/dataDict/selectSysDataDictPage",
         data: {
-          dictCode: this.dictList[1]["dictCode"],
-          parentId: this.dictList[1]["id"],
+          dictCode: this.content1Param.dictCode,
+          parentId: this.content1Param.id,
           page,
           rows
         },
@@ -163,8 +165,8 @@ export default {
           method: "post",
           data: {
             dictName: name,
-            parentId: this.dictList[1]["id"],
-            dictCode: this.dictList[1]["dictCode"],
+            parentId: this.content1Param.id,
+            dictCode: this.content1Param.dictCode,
           },
         })
           .then((res) => {
@@ -189,8 +191,8 @@ export default {
           data: {
             dictName: newName,
             id: this.tableData[index]["id"],
-            parentId: this.dictList[1]["id"],
-            dictCode: this.dictList[1]["dictCode"],
+            parentId: this.content1Param.id,
+            dictCode: this.content1Param.dictCode,
           },
         })
           .then((res) => {
@@ -214,8 +216,8 @@ export default {
           method: "post",
           data: {
             id: this.tableData[index]["id"],
-            parentId: this.dictList[1]["id"],
-            // dictCode: this.dictList[1]['dictCode'],
+            parentId: this.content1Param.id,
+            dictCode: this.content1Param.dictCode,
           },
         })
           .then((res) => {

+ 11 - 9
src/views/parameter/ContentCategory2.vue

@@ -53,6 +53,7 @@ export default {
       tableData: [],
       modalFlag: false, // 控制模态框展示
       dictList: [],
+      content2Param:{},
     };
   },
   computed: {
@@ -122,7 +123,8 @@ export default {
         })
           .then((res) => {
             if (res.data && res.data.code === 200) {
-              this.dictList = res.data.data;
+              let dataList = res.data.data;
+              dataList.forEach((item)=>{if(item.dictCode === 'content2'){this.content2Param = item}})
               resolve();
             } else {
               console.log(res);
@@ -141,8 +143,8 @@ export default {
         method: "post",
         url: "/sys/dataDict/selectSysDataDictPage",
         data: {
-          dictCode: this.dictList[2]["dictCode"],
-          parentId: this.dictList[2]["id"],
+          dictCode: this.content2Param.dictCode,
+          parentId: this.content2Param.id,
           page,
           rows,
         },
@@ -167,8 +169,8 @@ export default {
           method: "post",
           data: {
             dictName: name,
-            parentId: this.dictList[2]["id"],
-            dictCode: this.dictList[2]["dictCode"],
+            parentId: this.content2Param.id,
+            dictCode: this.content2Param.dictCode,
           },
         })
           .then((res) => {
@@ -193,8 +195,8 @@ export default {
           data: {
             dictName: newName,
             id: this.tableData[index]["id"],
-            parentId: this.dictList[2]["id"],
-            dictCode: this.dictList[2]["dictCode"],
+            parentId: this.content2Param.id,
+            dictCode: this.content2Param.dictCode,
           },
         })
           .then((res) => {
@@ -218,8 +220,8 @@ export default {
           method: "post",
           data: {
             id: this.tableData[index]["id"],
-            parentId: this.dictList[2]["id"],
-            dictCode: this.dictList[2]["dictCode"],
+            parentId: this.content2Param.id,
+            dictCode: this.content2Param.dictCode,
           },
         })
           .then((res) => {