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

新增编辑去空格

suxinf 4 éve%!(EXTRA string=óta)
szülő
commit
cf4ddc4d33

+ 3 - 2
src/views/parameter/components/Carseries/CarSeriesModal.vue

@@ -28,8 +28,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.carType) {
-        this.$emit("submit", this.carType);
+      let carType = this.carType.replace(/\s/g,"");
+      if (carType) {
+        this.$emit("submit", carType);
       } else {
         alert ('请输入车系名称');
       }

+ 4 - 3
src/views/parameter/components/Carseries/CarSeriesTable.vue

@@ -77,12 +77,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
         alert("车系不能为空");
-      } else if (this.newName === this.tableData[i].carSeries) {
+      } else if (newName === this.tableData[i].typeName) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);

+ 3 - 2
src/views/parameter/components/Carseries/CarTypeModal.vue

@@ -30,8 +30,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.carType) {
-        this.$emit("submit", this.carType);
+      let carType = this.carType.replace(/\s/g,"");
+      if (carType) {
+        this.$emit("submit", carType);
       } else {
         alert ('请输入车型名称');
       }

+ 4 - 3
src/views/parameter/components/Carseries/CarTypeTable.vue

@@ -73,12 +73,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
         alert("车型不能为空");
-      } else if (this.newName === this.tableData[i].typeName) {
+      } else if (newName === this.tableData[i].typeName) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);

+ 3 - 2
src/views/parameter/components/ContentCategory1/Modal.vue

@@ -30,8 +30,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.name) {
-        this.$emit("submit", this.name);
+      let name = this.name.replace(/\s/g,"");
+      if (name) {
+        this.$emit("submit", name);
       } else {
         alert('请输入类别名称');
       }

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

@@ -75,12 +75,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
-        alert("姓名不能为空");
-      } else if (this.newName === this.tableData[i].dictName) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
+        alert("稿件类别不能为空");
+      } else if (newName === this.tableData[i].dictName) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);

+ 3 - 2
src/views/parameter/components/ContentCategory2/Modal.vue

@@ -30,8 +30,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.name) {
-        this.$emit("submit", this.name);
+      let name = this.name.replace(/\s/g,"");
+      if (name) {
+        this.$emit("submit", name);
       } else {
         alert('请输入类别名称');
       }

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

@@ -75,12 +75,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
-        alert("不能编辑为空值");
-      } else if (this.newName === this.tableData[i].dictName) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
+        alert("类别不能为空");
+      } else if (newName === this.tableData[i].dictName) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);

+ 3 - 2
src/views/parameter/components/Grouping/GroupingModal.vue

@@ -28,8 +28,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.groupName) {
-        this.$emit("submit", this.groupName);
+      let groupName = this.groupName.replace(/\s/g,"");
+      if (groupName) {
+        this.$emit("submit", groupName);
       } else {
         alert('请输入小组名称');
       }

+ 4 - 3
src/views/parameter/components/Grouping/GroupingTable.vue

@@ -76,12 +76,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
         alert("分组名称不能为空");
-      } else if (this.newName === this.tableData[i].groupName) {
+      } else if (newName === this.tableData[i].groupName) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);

+ 3 - 2
src/views/parameter/components/MediaPlatform/Modal.vue

@@ -30,8 +30,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.name) {
-        this.$emit("submit", this.name);
+      let name = this.name.replace(/\s/g,"");
+      if (name) {
+        this.$emit("submit", name);
       } else {
         alert('请输入平台名称');
       }

+ 4 - 3
src/views/parameter/components/MediaPlatform/Table.vue

@@ -82,12 +82,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
         alert("平台名称不能为空");
-      } else if (this.newName === this.tableData[i].dictName) {
+      } else if (newName === this.tableData[i].dictName) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);

+ 3 - 2
src/views/parameter/components/PlatformModule/DetailPageModal.vue

@@ -30,8 +30,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.platName) {
-        this.$emit("submit", this.platName);
+      let platName = this.platName.replace(/\s/g,"");
+      if (platName) {
+        this.$emit("submit", platName);
       } else {
         alert('请输入版块名称');
       }

+ 4 - 3
src/views/parameter/components/PlatformModule/DetailPageTable.vue

@@ -75,12 +75,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
         alert("版块名称不能为空");
-      } else if (this.newName === this.tableData[i].module) {
+      } else if (newName === this.tableData[i].platformName) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);

+ 3 - 2
src/views/parameter/components/PlatformModule/PlatFormModal.vue

@@ -28,8 +28,9 @@ export default {
   },
   methods: {
     submit: function () {
-      if (this.platName) {
-        this.$emit("submit", this.platName);
+      let platName = this.platName.replace(/\s/g,"");
+      if (platName) {
+        this.$emit("submit", platName);
       } else {
         alert('请输入平台名称');
       }

+ 5 - 4
src/views/parameter/components/PlatformModule/PlatformTable.vue

@@ -87,12 +87,13 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-      if (!this.newName) {
-        alert("姓名不能为空");
-      } else if (this.newName === this.tableData[i]["platformName"]) {
+      let newName = this.newName.replace(/\s/g,"");
+      if (!newName) {
+        alert("名称不能为空");
+      } else if (newName === this.tableData[i]["platformName"]) {
         this.newName = ""; // 没有改
       } else {
-        this.$emit("edit", i, this.newName);
+        this.$emit("edit", i, newName);
       }
       this.newName = "";
       this.editFlag.splice(i, 1, false);