瀏覽代碼

参数设置页面接口

suxinf 4 年之前
父節點
當前提交
cb7605ed9b

+ 146 - 8
src/views/parameter/CommonParam.vue

@@ -6,40 +6,178 @@
         <div class="left">
           <p>仅支持</p>
           <p class="num" v-if="!editFlag">{{ timeLimit }}</p>
-          <input type="text" v-model="timeLimit" v-else />
+          <input type="text" v-model="timeLimitModal" v-else />
           <p>个月内上传的资料进行反馈</p>
         </div>
         <p class="edit" @click="edit">{{ editFlag ? "确定" : "编辑" }}</p>
       </div>
     </div>
-    <div class="button">
+    <!-- <div class="button">
       <div class="current_button" @click="submit" style="margin: 0">保存</div>
-    </div>
+    </div> -->
+    <TipModal
+      :tipFlag="tipModalFlag"
+      :tipText="tipModalText"
+      @close_tip_modal="closeTipModal"
+    />
   </div>
 </template>
 
 <script>
+import TipModal from "../../components/TipModal";
 export default {
+  components: {
+    TipModal,
+  },
   data() {
     return {
-      timeLimit: 5,
+      timeLimitModal: 0,
+      timeLimit: 0,
+      recordNum: 0,
       editFlag: false,
+      dictList: [],
+      dictId: "",
+      tipModalFlag: false,
+      tipModalText: ''
     };
   },
   methods: {
     submit: function () {
-      let timeLimit = +this.timeLimit;
-      if (timeLimit <= 0) {
+      let timeLimitModal = +this.timeLimitModal;
+      if(this.recordNum == timeLimitModal) {
+        return
+      }
+      if (timeLimitModal <= 0) {
         alert("请填写大于零的整数");
-      } else if (Math.ceil(timeLimit) !== timeLimit) {
+      } else if (Math.ceil(timeLimitModal) !== timeLimitModal) {
         alert("请填写大于零的整数");
       } else {
-        console.log(timeLimit);
+        this.updataDict(timeLimitModal).then(() => {
+          this.getDateList();
+          this.tipModalFlag = true,
+          this.tipModalText = '修改成功!'
+        });
       }
     },
     edit: function () {
+      if (this.editFlag) {
+        this.submit();
+      } else {
+        this.timeLimitModal = this.timeLimit;
+      }
       this.editFlag = !this.editFlag;
     },
+    closeTipModal: function () {
+      this.tipModalFlag = false;
+    },
+    // 获取内容分类、媒体平台、常用参数接口的标识,再调接口时需要用到
+    selectSysDataDictList: function () {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          method: "post",
+          url: "/sys/dataDict/selectSysDataDictList",
+          data: {},
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              this.dictList = res.data.data;
+              resolve();
+            } else {
+              console.log(res);
+              reject();
+            }
+          })
+          .catch((err) => {
+            console.log(err);
+            reject();
+          });
+      });
+    },
+    // 获取列表数据   接口
+    getDateList: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/dataDict/selectSysDataDictPage",
+        data: {
+          dictCode: this.dictList[0]["dictCode"],
+          parentId: this.dictList[0]["id"],
+        },
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.dictId = res.data.data[0]["id"];
+            this.timeLimit = res.data.data[0]["dictName"];
+            this.recordNum = this.timeLimit;
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    // 编辑  接口
+    updataDict: function (newName) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/updateSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: newName,
+            id: this.dictId,
+            parentId: this.dictList[0]["id"],
+            dictCode: this.dictList[0]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              resolve();
+            } else {
+              alert("编辑失败,请重试");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("编辑失败,请重试");
+            reject(err);
+          });
+      });
+    },
+    // 新增  接口
+    addList: function (name) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/addSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: name,
+            parentId: this.dictList[0]["id"],
+            dictCode: this.dictList[0]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              resolve();
+            } else {
+              alert("新增失败,请重试1");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("新增失败,请重试2");
+            reject(err);
+          });
+      });
+    },
+  },
+  created() {
+    this.selectSysDataDictList()
+      .then(() => {
+        this.getDateList();
+      })
+      .catch((err) => {
+        console.log(err);
+      });
   },
 };
 </script>

+ 204 - 77
src/views/parameter/ContentCategory1.vue

@@ -1,41 +1,41 @@
 <template>
   <div>
-  <div class="car_series">
-    <div class="count">
-      <button @click="showModal">新增类别</button>
-      <Count :sum='sum'></Count>
+    <div class="car_series">
+      <div class="count">
+        <button @click="showModal">新增类别</button>
+        <Count :sum="sum"></Count>
+      </div>
+      <div class="table">
+        <Table
+          :tableData="tableData"
+          @edit="edit"
+          @delet_data="deleteData"
+          :pageSize="sum"
+        ></Table>
+      </div>
+      <div class="page">
+        <Tablepage
+          :totalPage="totalPage"
+          :currentPage="currentPage"
+          @change_page="changePage"
+          @jump_page="jumpPage"
+        ></Tablepage>
+      </div>
+      <div class="modal" v-if="modalFlag">
+        <Modal
+          :modalFlag="modalFlag"
+          @submit="submit"
+          @hide_modal="showModal"
+        ></Modal>
+      </div>
     </div>
-    <div class="table">
-      <Table
-        :tableData='tableData'
-        @edit='edit'
-        @delet_data='deleteData'
-        :pageSize='sum'
-      ></Table>
-    </div>
-    <div class="page">
-      <Tablepage
-        :totalPage='totalPage'
-        :currentPage='currentPage'
-        @change_page='changePage'
-        @jump_page='jumpPage'
-      ></Tablepage>
-    </div>
-    <div class="modal" v-if="modalFlag">
-      <Modal
-        :modalFlag='modalFlag'
-        @submit='submit'
-        @hide_modal='showModal'
-      ></Modal>
-    </div>
-  </div>
   </div>
 </template>
 
 <script>
-import Count from '../../components/Count';
-import Tablepage from '../../components/TablePage';
-import Table from './components/ContentCategory1/Table';
+import Count from "../../components/Count";
+import Tablepage from "../../components/TablePage";
+import Table from "./components/ContentCategory1/Table";
 import Modal from "./components/ContentCategory1/Modal";
 
 export default {
@@ -43,39 +43,42 @@ export default {
     Count,
     Table,
     Tablepage,
-    Modal
+    Modal,
   },
   data() {
     return {
-      sum: 60, // 一共有多少条数据
+      sum: 0, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       currentPage: 1,
-      tableData: [],
-      getDate: [{title: '服务', str: '123'},{title: '产品', str: '124'},{title: '品牌', str: '125'},],
-      functionData: [],
+      tableData: [
+        { title: "服务", str: "123" },
+        { title: "产品", str: "124" },
+        { title: "品牌", str: "125" },
+      ],
       modalFlag: false, // 控制模态框展示
-    }
+      dictList: [],
+    };
   },
-  computed:{
+  computed: {
     // 表格总页数
     totalPage() {
-      return Math.ceil(this.sum/this.pageSize);
+      return Math.ceil(this.sum / this.pageSize);
     },
     // 获取路由参数
     queryTag() {
-      console.log (111, this.$route.query);
-      return (this.$route.query && this.$route.query.tag) ? 0 : 1
-    }
+      console.log(111, this.$route.query);
+      return this.$route.query && this.$route.query.tag ? 0 : 1;
+    },
   },
   methods: {
     // 获取某一页面的数据,展示在表格
-    changePage: function(page) {
+    changePage: function (page) {
       this.currentPage = page;
       console.log(page);
     },
     // 点击上一页,下一页,首页,尾页
-    jumpPage: function(item) {
-      switch(item) {
+    jumpPage: function (item) {
+      switch (item) {
         case 1:
           this.currentPage = 1;
           break;
@@ -91,56 +94,180 @@ export default {
       }
       console.log(this.currentPage);
     },
-    // 获取数据
-    getData: function() {
-      this.tableData = [];
-      this.functionData = [];
-      this.getDate.forEach( (element) => {
-        this.tableData.push(
-          {
-            title: element.title
-          }
-        );
-        this.functionData.push(
-          {
-            str: element.str
-          }
-        )
-      });
-    },
     // 展示、隐藏模态框
-    showModal: function() {
+    showModal: function () {
       this.modalFlag = !this.modalFlag;
     },
     // 点击编辑
-    edit (index, newName) {
-      console.log(this.functionData[index].str, newName);
+    edit(index, newName) {
+      this.updataDict(newName, index).then(() => {
+        this.getDateList();
+      });
     },
     // 点击删除
-    deleteData (index) {
-      console.log('删除', this.functionData[index].str)
+    deleteData(index) {
+      this.deleteDict(index).then(() => {
+        this.getDateList();
+      });
     },
     // 新增车型模态框 保存
-    submit: function(name) {
-        console.log('保存', name);
-        this.modalFlag = false;
+    submit: function (name) {
+      this.addList(name).then(() => {
+        this.getDateList();
+      });
+      this.modalFlag = false;
+    },
+    // 获取内容分类、媒体平台、常用参数接口的标识,再调接口时需要用到
+    selectSysDataDictList: function () {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          method: "post",
+          url: "/sys/dataDict/selectSysDataDictList",
+          data: {},
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              this.dictList = res.data.data;
+              resolve();
+            } else {
+              console.log(res);
+              reject();
+            }
+          })
+          .catch((err) => {
+            console.log(err);
+            reject();
+          });
+      });
+    },
+    // 获取列表数据   接口
+    getDateList: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/dataDict/selectSysDataDictPage",
+        data: {
+          dictCode: this.dictList[1]["dictCode"],
+          parentId: this.dictList[1]["id"],
+        },
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.tableData = res.data.data;
+            this.sum = res.data.count;
+            console.log(res);
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    // 新增
+    addList: function (name) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/addSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: name,
+            parentId: this.dictList[1]["id"],
+            dictCode: this.dictList[1]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("新增失败,请重试1");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("新增失败,请重试2");
+            reject(err);
+          });
+      });
+    },
+    // 编辑
+    updataDict: function (newName, index) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/updateSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: newName,
+            id: this.tableData[index]["id"],
+            parentId: this.dictList[1]["id"],
+            dictCode: this.dictList[1]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("编辑失败,请重试");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("编辑失败,请重试");
+            reject(err);
+          });
+      });
+    },
+    // 删除   接口
+    deleteDict: function (index) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/deleteSysDataDictInfo",
+          method: "post",
+          data: {
+            id: this.tableData[index]["id"],
+            parentId: this.dictList[1]["id"],
+            // dictCode: this.dictList[1]['dictCode'],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("删除失败,请重试");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("删除失败,请重试");
+            reject(err);
+          });
+      });
     },
   },
-  mounted() {
-    this.getData();
-  }
-}
+  created() {
+    this.selectSysDataDictList()
+      .then(() => {
+        this.getDateList();
+        console.log(this.dictList);
+      })
+      .catch((err) => {
+        console.log(err);
+      });
+  },
+};
 </script>
 
 <style scoped lang="less">
-.car_series{
-  .count{
+.car_series {
+  .count {
     height: 40px;
     width: 100%;
     display: flex;
     justify-content: space-between;
     align-items: center;
-    button{
+    button {
       width: 86px;
       height: 30px;
       position: relative;

+ 149 - 29
src/views/parameter/ContentCategory2.vue

@@ -47,20 +47,12 @@ export default {
   },
   data() {
     return {
-      sum: 100, // 一共有多少条数据
+      sum: 0, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       currentPage: 1,
       tableData: [],
-      getDate: [
-        { title: "活动", str: "123" },
-        { title: "节日", str: "124" },
-        { title: "热点", str: "125" },
-        { title: "促销", str: "125" },
-        { title: "用车", str: "125" },
-        { title: "维保", str: "125" }
-      ],
-      functionData: [],
       modalFlag: false, // 控制模态框展示
+      dictList: []
     };
   },
   computed: {
@@ -98,39 +90,167 @@ export default {
       }
       console.log(this.currentPage);
     },
-    // 获取数据
-    getData: function () {
-      this.tableData = [];
-      this.functionData = [];
-      this.getDate.forEach((element) => {
-        this.tableData.push({
-          title: element.title,
-        });
-        this.functionData.push({
-          str: element.str,
-        });
-      });
-    },
     // 展示、隐藏模态框
     showModal: function () {
       this.modalFlag = !this.modalFlag;
     },
     // 点击编辑
     edit(index, newName) {
-      console.log(this.functionData[index].str, newName);
+      this.updataDict(newName, index).then(() => {
+        this.getDateList();
+      });
     },
     // 点击删除
     deleteData(index) {
-      console.log("删除", this.functionData[index].str);
+      this.deleteDict(index).then(() => {
+        this.getDateList();
+      });
     },
-    // 新增车型模态框 保存
+    // 新增分类模态框 保存
     submit: function (name) {
-      console.log("保存", name);
+      this.addList(name).then(() => {
+        this.getDateList();
+      });
       this.modalFlag = false;
     },
+    // 获取内容分类、媒体平台、常用参数接口的标识,再调接口时需要用到
+    selectSysDataDictList: function () {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          method: "post",
+          url: "/sys/dataDict/selectSysDataDictList",
+          data: {},
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              this.dictList = res.data.data;
+              resolve();
+            } else {
+              console.log(res);
+              reject();
+            }
+          })
+          .catch((err) => {
+            console.log(err);
+            reject();
+          });
+      });
+    },
+    // 获取列表数据   接口
+    getDateList: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/dataDict/selectSysDataDictPage",
+        data: {
+          dictCode: this.dictList[2]["dictCode"],
+          parentId: this.dictList[2]["id"],
+        },
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.tableData = res.data.data;
+            this.sum = res.data.count;
+            console.log(res);
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    // 新增  接口
+    addList: function (name) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/addSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: name,
+            parentId: this.dictList[2]["id"],
+            dictCode: this.dictList[2]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("新增失败,请重试1");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("新增失败,请重试2");
+            reject(err);
+          });
+      });
+    },
+    // 编辑  接口
+    updataDict: function (newName, index) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/updateSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: newName,
+            id: this.tableData[index]["id"],
+            parentId: this.dictList[2]["id"],
+            dictCode: this.dictList[2]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("编辑失败,请重试");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("编辑失败,请重试");
+            reject(err);
+          });
+      });
+    },
+    // 删除   接口
+    deleteDict: function (index) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/deleteSysDataDictInfo",
+          method: "post",
+          data: {
+            id: this.tableData[index]["id"],
+            parentId: this.dictList[2]["id"],
+            dictCode: this.dictList[2]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("删除失败,请重试");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("删除失败,请重试");
+            reject(err);
+          });
+      });
+    },
   },
-  mounted() {
-    this.getData();
+  created() {
+    this.selectSysDataDictList()
+      .then(() => {
+        this.getDateList();
+        console.log(this.dictList);
+      })
+      .catch((err) => {
+        console.log(err);
+      });
   },
 };
 </script>

+ 150 - 30
src/views/parameter/MediaPlatform.vue

@@ -50,16 +50,9 @@ export default {
       sum: 100, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       currentPage: 1,
-      tableData: [],
-      getDate: [
-        { title: "微信公众号", str: "123", deletFlag: true },
-        { title: "微信服务号", str: "124", deletFlag: false },
-        { title: "抖音", str: "125", deletFlag: true },
-        { title: "今日头条", str: "125", deletFlag: false },
-        { title: "微信视频号", str: "125" }
-      ],
-      functionData: [],
+      tableData: [{ title: "微信公众号", str: "123", deletFlag: true }],
       modalFlag: false, // 控制模态框展示
+      dictList: [],
     };
   },
   computed: {
@@ -97,43 +90,170 @@ export default {
       }
       console.log(this.currentPage);
     },
-    // 获取数据
-    getData: function () {
-      this.tableData = [];
-      this.functionData = [];
-      this.getDate.forEach((element) => {
-        this.tableData.push({
-          title: element.title,
-          deletFlag: element.deletFlag
-        });
-        this.functionData.push({
-          str: element.str,
-        });
-      });
-    },
+
     // 展示、隐藏模态框
     showModal: function () {
       this.modalFlag = !this.modalFlag;
     },
     // 点击编辑
     edit(index, newName) {
-      console.log(this.functionData[index].str, newName);
+      this.updataDict(newName, index).then(() => {
+        this.getDateList();
+      });
     },
     // 点击删除
-    deleteData(index, flag) {
-      console.log("删除", this.functionData[index].str);
-      if(flag) {
-        alert('删除成功');
-      }
+    deleteData(index) {
+      this.deleteDict(index).then(() => {
+        this.getDateList();
+        alert("删除成功");
+      });
     },
     // 新增车型模态框 保存
     submit: function (name) {
       console.log("保存", name);
+      this.addList(name).then(() => {
+        this.getDateList();
+      });
       this.modalFlag = false;
     },
+    // 获取内容分类、媒体平台、常用参数接口的标识,再调接口时需要用到
+    selectSysDataDictList: function () {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          method: "post",
+          url: "/sys/dataDict/selectSysDataDictList",
+          data: {},
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              this.dictList = res.data.data;
+              resolve();
+            } else {
+              console.log(res);
+              reject();
+            }
+          })
+          .catch((err) => {
+            console.log(err);
+            reject();
+          });
+      });
+    },
+    // 获取列表数据   接口
+    getDateList: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/dataDict/selectSysDataDictPage",
+        data: {
+          dictCode: this.dictList[3]["dictCode"],
+          parentId: this.dictList[3]["id"],
+        },
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.tableData = res.data.data;
+            this.sum = res.data.count;
+            console.log(res);
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    // 新增  接口
+    addList: function (name) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/addSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: name,
+            parentId: this.dictList[3]["id"],
+            dictCode: this.dictList[3]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("新增失败,请重试1");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("新增失败,请重试2");
+            reject(err);
+          });
+      });
+    },
+    // 编辑  接口
+    updataDict: function (newName, index) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/updateSysDataDictInfo",
+          method: "post",
+          data: {
+            dictName: newName,
+            id: this.tableData[index]["id"],
+            parentId: this.dictList[3]["id"],
+            dictCode: this.dictList[3]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("编辑失败,请重试");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("编辑失败,请重试");
+            reject(err);
+          });
+      });
+    },
+    // 删除   接口
+    deleteDict: function (index) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/sys/dataDict/deleteSysDataDictInfo",
+          method: "post",
+          data: {
+            id: this.tableData[index]["id"],
+            parentId: this.dictList[3]["id"],
+            dictCode: this.dictList[3]["dictCode"],
+          },
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res);
+              resolve();
+            } else {
+              alert("删除失败,请重试");
+              console.log(res);
+            }
+          })
+          .catch((err) => {
+            alert("删除失败,请重试");
+            reject(err);
+          });
+      });
+    },
   },
   mounted() {
-    this.getData();
+    this.selectSysDataDictList()
+      .then(() => {
+        this.getDateList();
+        console.log(this.dictList);
+      })
+      .catch((err) => {
+        console.log(err);
+      });
   },
 };
 </script>

+ 28 - 21
src/views/parameter/ParameterIndex.vue

@@ -3,14 +3,20 @@
     <div class="parameter_tag">
       <div
         class="tag"
-        v-for="(tag, index) in tagslist" :key="index"
-        :class="{selected: '/parameterIndex/' + tag.path === childRouter}"
+        v-for="(tag, index) in tagslist"
+        :key="index"
+        :class="{ selected: '/parameterIndex/' + tag.path === childRouter }"
       >
-        <router-link :to="'/parameterIndex/' + tag.path" tag="li" class="title">{{tag.title}}</router-link>
+        <router-link
+          :to="'/parameterIndex/' + tag.path"
+          tag="li"
+          class="title"
+          >{{ tag.title }}</router-link
+        >
       </div>
     </div>
     <div class="parameter_table">
-      <router-view/>
+      <router-view />
     </div>
   </div>
 </template>
@@ -18,48 +24,49 @@
 <script>
 import { TAG } from "./routerConfig";
 export default {
-  components:{
-  },
+  components: {},
   data() {
     return {
-      tagslist: TAG
-    }
+      tagslist: TAG,
+      dictList: [],
+    };
   },
   computed: {
-    childRouter: function() {
-      return this.$route.path
-    }
+    childRouter: function () {
+      return this.$route.path;
+    },
   },
   methods: {
   },
-  mounted() {
-  }
-}
+  mounted() {},
+  created() {
+  },
+};
 </script>
 
 <style scoped lang="less">
-.parameter_index{
-  .parameter_tag{
+.parameter_index {
+  .parameter_tag {
     display: flex;
     justify-content: space-around;
     border: 1px solid #ccc;
     padding: 10px;
-    .tag{
+    .tag {
       width: 90px;
       height: 30px;
       background-color: #848484;
       line-height: 30px;
       text-align: center;
       border-radius: 5px;
-      &:hover{
+      &:hover {
         cursor: pointer;
       }
-      li{
+      li {
         color: #fff;
       }
     }
-    .selected{
-      background-color: #0056A0;
+    .selected {
+      background-color: #0056a0;
     }
   }
 }

+ 4 - 4
src/views/parameter/components/ContentCategory1/Table.vue

@@ -14,12 +14,12 @@
           :class="{ table_gray: index % 2 === 0 }"
         >
           <td style="width: 50%">
-            <p v-if="!editFlag[index]">{{ obj.title }}</p>
+            <p v-if="!editFlag[index]">{{ obj.dictName }}</p>
             <input
               type="text"
               v-model="newName"
               v-else
-              :placeholder="obj.title"
+              :placeholder="obj.dictName"
             />
           </td>
           <td style="width: 50%" class="operation">
@@ -69,7 +69,7 @@ export default {
   methods: {
     edit: function (i) {
       this.getEditArr(); // 确保只有一个在编辑
-      this.newName = this.tableData[i] && this.tableData[i].title;
+      this.newName = this.tableData[i] && this.tableData[i].dictName;
       console.log(this.newName);
       this.editFlag.splice(i, 1, true);
     },
@@ -77,7 +77,7 @@ export default {
     submitEdit: function (i) {
       if (!this.newName) {
         alert("姓名不能为空");
-      } else if (this.newName === this.tableData[i].title) {
+      } else if (this.newName === this.tableData[i].dictName) {
         this.newName = ""; // 没有改
       } else {
         this.$emit("edit", i, this.newName);

+ 5 - 5
src/views/parameter/components/ContentCategory2/Table.vue

@@ -14,12 +14,12 @@
           :class="{ table_gray: index % 2 === 0 }"
         >
           <td style="width: 50%">
-            <p v-if="!editFlag[index]">{{ obj.title }}</p>
+            <p v-if="!editFlag[index]">{{ obj.dictName }}</p>
             <input
               type="text"
               v-model="newName"
               v-else
-              :placeholder="obj.title"
+              :placeholder="obj.dictName"
             />
           </td>
           <td style="width: 50%" class="operation">
@@ -69,15 +69,15 @@ export default {
   methods: {
     edit: function (i) {
       this.getEditArr(); // 确保只有一个在编辑
-      this.newName = this.tableData[i] && this.tableData[i].title;
+      this.newName = this.tableData[i] && this.tableData[i].dictName;
       console.log(this.newName);
       this.editFlag.splice(i, 1, true);
     },
     // 确认编辑
     submitEdit: function (i) {
       if (!this.newName) {
-        alert("姓名不能为空");
-      } else if (this.newName === this.tableData[i].title) {
+        alert("不能编辑为空");
+      } else if (this.newName === this.tableData[i].dictName) {
         this.newName = ""; // 没有改
       } else {
         this.$emit("edit", i, this.newName);

+ 19 - 23
src/views/parameter/components/MediaPlatform/Table.vue

@@ -14,12 +14,12 @@
           :class="{ table_gray: index % 2 === 0 }"
         >
           <td style="width: 50%">
-            <p v-if="!editFlag[index]">{{ obj.title }}</p>
+            <p v-if="!editFlag[index]">{{ obj.dictName }}</p>
             <input
               type="text"
               v-model="newName"
               v-else
-              :placeholder="obj.title"
+              :placeholder="obj.dictName"
             />
           </td>
           <td style="width: 50%" class="operation">
@@ -30,11 +30,11 @@
         </tr>
       </tbody>
     </table>
-    <DeleteModal
+    <!-- <DeleteModal
       @detlet_data="detletData"
       @hide_modal="closeModal"
       :modalFlag="deleteModalFlag"
-    ></DeleteModal>
+    ></DeleteModal> -->
     <DeleteTip
       :modalFlag="deleteTipFlag"
       @detlet_data="DeleteFunction"
@@ -45,7 +45,7 @@
 
 <script>
 import DeleteTip from "./DeleteModal"; // 如果平台下已有经销商账号信息,需要给出错误提示
-import DeleteModal from "../DeleteModal";
+// import DeleteModal from "../DeleteModal";
 export default {
   props: {
     // 表数据
@@ -62,12 +62,12 @@ export default {
     },
   },
   components: {
-    DeleteModal,
+    // DeleteModal,
     DeleteTip
   },
   data() {
     return {
-      deleteModalFlag: false,
+      // deleteModalFlag: false,
       index: 0,
       editFlag: [],
       newName: "", // 编辑之后的值
@@ -77,15 +77,14 @@ export default {
   methods: {
     edit: function (i) {
       this.getEditArr(); // 确保只有一个在编辑
-      this.newName = this.tableData[i] && this.tableData[i].title;
-      console.log(this.newName);
+      this.newName = this.tableData[i] && this.tableData[i].dictName;
       this.editFlag.splice(i, 1, true);
     },
     // 确认编辑
     submitEdit: function (i) {
       if (!this.newName) {
-        alert("姓名不能为空");
-      } else if (this.newName === this.tableData[i].title) {
+        alert("平台名称不能为空");
+      } else if (this.newName === this.tableData[i].dictName) {
         this.newName = ""; // 没有改
       } else {
         this.$emit("edit", i, this.newName);
@@ -93,28 +92,25 @@ export default {
       this.newName = "";
       this.editFlag.splice(i, 1, false);
     },
-    // 点击删除,展示模态框
+    // 点击删除,展示提醒模态框
     showModal: function (i) {
-      if(this.tableData[i] && this.tableData[i].deletFlag) {
         this.deleteTipFlag = true;
-      } else {
-        this.deleteModalFlag = true;
         this.index = i;
-      }
-    },
-    // 模态框确认删除
-    detletData: function () {
-      this.deleteModalFlag = false;
-      this.$emit("delet_data", this.index);
     },
+    // // 模态框确认删除
+    // detletData: function () {
+    //   // this.deleteTipFlag = false;
+    //   this.deleteModalFlag = false;
+    //   // this.$emit("delet_data", this.index);
+    // },
     // 确认删除带有经销商账号信息的数据
     DeleteFunction: function() {
         this.deleteTipFlag = false;
-        this.$emit("delet_data", this.index, true);
+        this.$emit("delet_data", this.index);
     },
     // 删除模态框取消
     closeModal: function () {
-      this.deleteModalFlag = false;
+      // this.deleteModalFlag = false;
       this.deleteTipFlag = false;
     },
     // 生成点击编辑按钮所用额flag,