dedsudiyu vor 11 Monaten
Ursprung
Commit
36519f585c

+ 23 - 16
src/views/systemManagement/publicConfig/basicsConfig.vue

@@ -103,22 +103,29 @@
         let self = this;
         this.$refs["form"].validate(valid => {
           if (valid) {
-            let configValue = {
-              schoolName:this.form.schoolName,
-              circularLogo:this.form.circularLogo,
-              rectangleLogo:this.form.rectangleLogo,
-            }
-            let obj = {
-              id:this.configId,
-              configName: "基础配置",
-              category:2,
-              configKey:1,
-              configValue : JSON.stringify(configValue),
-            }
-            addOrUpdate(obj).then(response => {
-              this.msgSuccess(response.message);
-              this.getConfigByType();
-            });
+            this.$confirm('是否确认提交?', "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(function() {
+            }).then(() => {
+              let configValue = {
+                schoolName:self.form.schoolName,
+                circularLogo:self.form.circularLogo,
+                rectangleLogo:self.form.rectangleLogo,
+              }
+              let obj = {
+                id:self.configId,
+                configName: "基础配置",
+                category:2,
+                configKey:1,
+                configValue : JSON.stringify(configValue),
+              }
+              addOrUpdate(obj).then(response => {
+                self.msgSuccess(response.message);
+                self.getConfigByType();
+              });
+            }).catch(() => {});
           }
         });
       },

+ 36 - 17
src/views/systemManagement/publicConfig/chemicalsConfig.vue

@@ -6,7 +6,7 @@
         <el-form-item label="自动返回时间" prop="backTime">
           <div class="form-flex-box">
             <el-input-number v-model="form.backTime" style="width:150px;"
-                             :controls="false" :min="1" :max="3600">
+                             :controls="false" :min="5" :max="600">
             </el-input-number>
             <p class="form-flex-right-p">秒</p>
           </div>
@@ -16,7 +16,7 @@
         <el-form-item label="自动注销时间" prop="signOutTime">
           <div class="form-flex-box">
             <el-input-number v-model="form.signOutTime" style="width:150px;"
-                             :controls="false" :min="1" :max="3600">
+                             :controls="false" :min="5" :max="600">
             </el-input-number>
             <p class="form-flex-right-p">秒</p>
           </div>
@@ -26,7 +26,7 @@
         <el-form-item label="弹窗关闭时间" prop="offTime">
           <div class="form-flex-box">
             <el-input-number v-model="form.offTime" style="width:150px;"
-                             :controls="false" :min="1" :max="3600">
+                             :controls="false" :min="5" :max="600">
             </el-input-number>
             <p class="form-flex-right-p">秒</p>
           </div>
@@ -67,6 +67,13 @@
   export default {
     name: "publicConfig",
     data() {
+      const timeCheck = (rule, value, callback) => {
+        if (value < this.form.signOutTime && value < this.form.backTime) {
+          callback();
+        } else {
+          callback(new Error("弹窗关闭时间需小于自动返回及自动注销时间"));
+        }
+      };
       return {
         uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
         headers: {
@@ -74,9 +81,9 @@
         },
         configId:null,
         form:{
-          backTime:1,
-          signOutTime:1,
-          offTime:1,
+          backTime:60,
+          signOutTime:120,
+          offTime:30,
           weighHintPicture:"",
         },
         rules: {
@@ -87,7 +94,8 @@
             { required: true, message: "请输入自动注销时间", trigger: "blur" }
           ],
           offTime: [
-            { required: true, message: "请输入弹窗关闭时间", trigger: "blur" }
+            { required: true, message: "请输入弹窗关闭时间", trigger: "blur" },
+            { required: true, message: "弹窗关闭时间需小于自动返回及自动注销时间", validator: timeCheck, trigger: "blur" }
           ],
           weighHintPicture: [
             { required: true, message: "请上传称重示意图", trigger: "blur" }
@@ -109,17 +117,28 @@
         let self = this;
         this.$refs["form"].validate(valid => {
           if (valid) {
-            let obj = {
-              id:this.configId,
-              configName: "化学品终端配置",
-              category:2,
-              configKey:3,
-              configValue : JSON.stringify(this.form),
+            if(self.form.backTime == self.form.signOutTime){
+              self.msgError('自动返回时间与自动注销时间不能重复');
+              return
             }
-            addOrUpdate(obj).then(response => {
-              this.msgSuccess(response.message);
-              this.getConfigByType();
-            });
+            this.$confirm('是否确认提交?', "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(function() {
+            }).then(() => {
+              let obj = {
+                id:self.configId,
+                configName: "化学品终端配置",
+                category:2,
+                configKey:3,
+                configValue : JSON.stringify(self.form),
+              }
+              addOrUpdate(obj).then(response => {
+                self.msgSuccess(response.message);
+                self.getConfigByType();
+              });
+            }).catch(() => {});
           }
         });
       },

+ 41 - 34
src/views/systemManagement/publicConfig/exploitConfig.vue

@@ -311,42 +311,49 @@
     methods: {
       /** 提交按钮 */
       addOrUpdate() {
+        let self = this;
         this.$refs["form"].validate(valid => {
           if (valid) {
-            let configValue = JSON.parse(JSON.stringify(this.form))
-            configValue.mqttExtranetUrl = configValue.mqttExtranetUrl ? Encrypt(configValue.mqttExtranetUrl) : '';
-            configValue.mqttExtranetUser = configValue.mqttExtranetUser ? Encrypt(configValue.mqttExtranetUser) : '';
-            configValue.mqttExtranetPassword = configValue.mqttExtranetPassword ? Encrypt(configValue.mqttExtranetPassword) : '';
-            configValue.mqttIntranetUrl = configValue.mqttIntranetUrl ? Encrypt(configValue.mqttIntranetUrl) : '';
-            configValue.mqttIntranetUser = configValue.mqttIntranetUser ? Encrypt(configValue.mqttIntranetUser) : '';
-            configValue.mqttIntranetPassword = configValue.mqttIntranetPassword ? Encrypt(configValue.mqttIntranetPassword) : '';
-            configValue.secureAccessEnvironment = configValue.secureAccessEnvironment ? Encrypt(configValue.secureAccessEnvironment) : '';
-            configValue.apiVersions = configValue.apiVersions ? Encrypt(configValue.apiVersions) : '';
-            configValue.controlMachinePassword = configValue.controlMachinePassword ? Encrypt(configValue.controlMachinePassword) : '';
-            configValue.fileBrowseEnvironment = configValue.fileBrowseEnvironment ? Encrypt(configValue.fileBrowseEnvironment) : '';
-            configValue.fileBrowseEnvironmentExtranet = configValue.fileBrowseEnvironmentExtranet ? Encrypt(configValue.fileBrowseEnvironmentExtranet) : '';
-            configValue.learnMachinePassword = configValue.learnMachinePassword ? Encrypt(configValue.learnMachinePassword) : '';
-            configValue.cardReaderSerialPort = configValue.cardReaderSerialPort ? Encrypt(configValue.cardReaderSerialPort) : '';
-            configValue.informationBoardPassword = configValue.informationBoardPassword ? Encrypt(configValue.informationBoardPassword) : '';
-            configValue.electronicScaleSerialport = configValue.electronicScaleSerialport ? Encrypt(configValue.electronicScaleSerialport) : '';
-            configValue.rfidSerialport = configValue.rfidSerialport ? Encrypt(configValue.rfidSerialport) : '';
-            configValue.printerSerialport = configValue.printerSerialport ? Encrypt(configValue.printerSerialport) : '';
-            configValue.bluetoothName = configValue.bluetoothName ? Encrypt(configValue.bluetoothName) : '';
-            configValue.faceRecognitionEnvironment = configValue.faceRecognitionEnvironment ? Encrypt(configValue.faceRecognitionEnvironment) : '';
-            configValue.videoRecordingEnvironment = configValue.videoRecordingEnvironment ? Encrypt(configValue.videoRecordingEnvironment) : '';
-            configValue.chemicalRerminalPassword = configValue.chemicalRerminalPassword ? Encrypt(configValue.chemicalRerminalPassword) : '';
-
-            let obj = {
-              id:this.configId,
-              configName: "开发配置",
-              category:2,
-              configKey:5,
-              configValue : JSON.stringify(configValue),
-            }
-            addOrUpdate(obj).then(response => {
-              this.msgSuccess(response.message);
-              this.getConfigByType()
-            });
+            this.$confirm('是否确认提交?', "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(function() {
+            }).then(() => {
+              let configValue = JSON.parse(JSON.stringify(this.form))
+              configValue.mqttExtranetUrl = configValue.mqttExtranetUrl ? Encrypt(configValue.mqttExtranetUrl) : '';
+              configValue.mqttExtranetUser = configValue.mqttExtranetUser ? Encrypt(configValue.mqttExtranetUser) : '';
+              configValue.mqttExtranetPassword = configValue.mqttExtranetPassword ? Encrypt(configValue.mqttExtranetPassword) : '';
+              configValue.mqttIntranetUrl = configValue.mqttIntranetUrl ? Encrypt(configValue.mqttIntranetUrl) : '';
+              configValue.mqttIntranetUser = configValue.mqttIntranetUser ? Encrypt(configValue.mqttIntranetUser) : '';
+              configValue.mqttIntranetPassword = configValue.mqttIntranetPassword ? Encrypt(configValue.mqttIntranetPassword) : '';
+              configValue.secureAccessEnvironment = configValue.secureAccessEnvironment ? Encrypt(configValue.secureAccessEnvironment) : '';
+              configValue.apiVersions = configValue.apiVersions ? Encrypt(configValue.apiVersions) : '';
+              configValue.controlMachinePassword = configValue.controlMachinePassword ? Encrypt(configValue.controlMachinePassword) : '';
+              configValue.fileBrowseEnvironment = configValue.fileBrowseEnvironment ? Encrypt(configValue.fileBrowseEnvironment) : '';
+              configValue.fileBrowseEnvironmentExtranet = configValue.fileBrowseEnvironmentExtranet ? Encrypt(configValue.fileBrowseEnvironmentExtranet) : '';
+              configValue.learnMachinePassword = configValue.learnMachinePassword ? Encrypt(configValue.learnMachinePassword) : '';
+              configValue.cardReaderSerialPort = configValue.cardReaderSerialPort ? Encrypt(configValue.cardReaderSerialPort) : '';
+              configValue.informationBoardPassword = configValue.informationBoardPassword ? Encrypt(configValue.informationBoardPassword) : '';
+              configValue.electronicScaleSerialport = configValue.electronicScaleSerialport ? Encrypt(configValue.electronicScaleSerialport) : '';
+              configValue.rfidSerialport = configValue.rfidSerialport ? Encrypt(configValue.rfidSerialport) : '';
+              configValue.printerSerialport = configValue.printerSerialport ? Encrypt(configValue.printerSerialport) : '';
+              configValue.bluetoothName = configValue.bluetoothName ? Encrypt(configValue.bluetoothName) : '';
+              configValue.faceRecognitionEnvironment = configValue.faceRecognitionEnvironment ? Encrypt(configValue.faceRecognitionEnvironment) : '';
+              configValue.videoRecordingEnvironment = configValue.videoRecordingEnvironment ? Encrypt(configValue.videoRecordingEnvironment) : '';
+              configValue.chemicalRerminalPassword = configValue.chemicalRerminalPassword ? Encrypt(configValue.chemicalRerminalPassword) : '';
+              let obj = {
+                id:self.configId,
+                configName: "开发配置",
+                category:2,
+                configKey:5,
+                configValue : JSON.stringify(configValue),
+              }
+              addOrUpdate(obj).then(response => {
+                self.msgSuccess(response.message);
+                self.getConfigByType()
+              });
+            }).catch(() => {});
           }
         });
       },

+ 19 - 11
src/views/systemManagement/publicConfig/homeConfig.vue

@@ -393,6 +393,7 @@
       },
       //提交&更新
       addOrUpdate(){
+        let self = this;
         if(this.form.skipHomePage){
           if(!this.form.centerButtonList[0]&&
             !this.form.leftButtonList[0]&&
@@ -404,17 +405,24 @@
         }
         this.$refs["form"].validate(valid => {
           if (valid) {
-            let obj = {
-              id:this.configId,
-              configName: "首页配置",
-              category:2,
-              configKey:6,
-              configValue : JSON.stringify(this.form),
-            }
-            addOrUpdate(obj).then(response => {
-              this.getConfigByType();
-              this.msgSuccess(response.message)
-            });
+            this.$confirm('是否确认提交?', "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(function() {
+            }).then(() => {
+              let obj = {
+                id:self.configId,
+                configName: "首页配置",
+                category:2,
+                configKey:6,
+                configValue : JSON.stringify(self.form),
+              }
+              addOrUpdate(obj).then(response => {
+                self.getConfigByType();
+                self.msgSuccess(response.message)
+              });
+            }).catch(() => {});
           }
         })
       },

+ 14 - 21
src/views/systemManagement/publicConfig/index.vue

@@ -10,7 +10,7 @@
         <p :class="pageType == 2 ? 'p-back':''"></p>
       </div>
       <div class="top-button-box" @click="buttonPageType(3)">
-        <p :class="pageType == 3 ? 'p-color':''">一体机</p>
+        <p :class="pageType == 3 ? 'p-color':''">管控一体机</p>
         <p :class="pageType == 3 ? 'p-back':''"></p>
       </div>
       <div class="top-button-box" @click="buttonPageType(4)">
@@ -77,26 +77,19 @@ export default {
     //保存按钮
     addButton(){
       let self = this;
-      this.$confirm('是否确认提交?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(function() {
-      }).then(() => {
-        if(self.pageType == 1){
-          self.$refs.basicsConfig.addOrUpdate();
-        }else if (self.pageType == 2){
-          self.$refs.chemicalsConfig.addOrUpdate();
-        } else if (self.pageType == 3){
-          self.$refs.integrationConfig.addOrUpdate();
-        } else if (self.pageType == 4){
-          self.$refs.programConfig.addOrUpdate();
-        } else if (self.pageType == 5){
-          self.$refs.exploitConfig.addOrUpdate();
-        } else if (self.pageType == 6){
-          self.$refs.homeConfig.addOrUpdate();
-        }
-      }).catch(() => {});
+      if(self.pageType == 1){
+        self.$refs.basicsConfig.addOrUpdate();
+      }else if (self.pageType == 2){
+        self.$refs.chemicalsConfig.addOrUpdate();
+      } else if (self.pageType == 3){
+        self.$refs.integrationConfig.addOrUpdate();
+      } else if (self.pageType == 4){
+        self.$refs.programConfig.addOrUpdate();
+      } else if (self.pageType == 5){
+        self.$refs.exploitConfig.addOrUpdate();
+      } else if (self.pageType == 6){
+        self.$refs.homeConfig.addOrUpdate();
+      }
     },
   }
 }

+ 39 - 32
src/views/systemManagement/publicConfig/integrationConfig.vue

@@ -19,13 +19,13 @@
       </div>
       <div class="form-max-box">
         <el-form-item class="time-input-box" label="自动返回时间:" prop="returnTime">
-          <el-input-number :controls="false" :min="30" :max="600" placeholder="请输入内容" v-model="form.returnTime" style="width:500px;"/>
+          <el-input-number :controls="false" :min="5" :max="600" placeholder="请输入内容" v-model="form.returnTime" style="width:500px;"/>
           <span>秒</span>
         </el-form-item>
       </div>
       <div class="form-max-box">
         <el-form-item class="time-input-box" label="自动注销时间:" prop="logoutTime">
-          <el-input-number :controls="false" :min="30" :max="600" placeholder="请输入内容" v-model="form.logoutTime" style="width:500px;"/>
+          <el-input-number :controls="false" :min="5" :max="600" placeholder="请输入内容" v-model="form.logoutTime" style="width:500px;"/>
           <span>秒</span>
         </el-form-item>
       </div>
@@ -180,40 +180,47 @@ export default {
       let self = this;
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if(this.form.returnTime == this.form.logoutTime){
+          if(self.form.returnTime == self.form.logoutTime){
             this.msgError('自动返回时间与自动注销时间不能重复');
             return
           }
-          let configValue = {
-            videoCover:this.form.videoCover,
-            signMap:this.form.signMap,
-            operationGuide:this.form.operationGuide,
-            isStart:this.form.isStart,
-            returnTime:this.form.returnTime,
-            logoutTime:this.form.logoutTime,
-          };
-          let num = 0;
-          for(let i=0;i<self.form.lotControl.length;i++){
-            if(self.form.lotControl[i] == '-1'){
-              num++
+          this.$confirm('是否确认提交?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            let configValue = {
+              videoCover:self.form.videoCover,
+              signMap:self.form.signMap,
+              operationGuide:self.form.operationGuide,
+              isStart:self.form.isStart,
+              returnTime:self.form.returnTime,
+              logoutTime:self.form.logoutTime,
+            };
+            let num = 0;
+            for(let i=0;i<self.form.lotControl.length;i++){
+              if(self.form.lotControl[i] == '-1'){
+                num++
+              }
             }
-          }
-          if(num == 0){
-            configValue.lotControl = self.form.lotControl+'';
-          }else{
-            configValue.lotControl = '-1';
-          }
-          let obj = {
-            id:this.configId,
-            configName: "一体机配置",
-            category:2,
-            configKey:2,
-            configValue : JSON.stringify(configValue),
-          }
-          addOrUpdate(obj).then(response => {
-            this.msgSuccess(response.message);
-            this.getConfigByType();
-          });
+            if(num == 0){
+              configValue.lotControl = self.form.lotControl+'';
+            }else{
+              configValue.lotControl = '-1';
+            }
+            let obj = {
+              id:self.configId,
+              configName: "一体机配置",
+              category:2,
+              configKey:2,
+              configValue : JSON.stringify(configValue),
+            }
+            addOrUpdate(obj).then(response => {
+              self.msgSuccess(response.message);
+              self.getConfigByType();
+            });
+          }).catch(() => {});
         }
       });
     },

+ 19 - 11
src/views/systemManagement/publicConfig/programConfig.vue

@@ -98,19 +98,27 @@ export default {
   methods: {
     /** 提交按钮 */
     addOrUpdate() {
+      let self = this;
       this.$refs["form"].validate(valid => {
         if (valid) {
-          let obj = {
-            id:this.configId,
-            configName: "小程序配置",
-            category:2,
-            configKey:4,
-            configValue : JSON.stringify(this.form),
-          }
-          addOrUpdate(obj).then(response => {
-            this.msgSuccess(response.message);
-            this.getConfigByType();
-          });
+          this.$confirm('是否确认提交?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            let obj = {
+              id:self.configId,
+              configName: "小程序配置",
+              category:2,
+              configKey:4,
+              configValue : JSON.stringify(self.form),
+            }
+            addOrUpdate(obj).then(response => {
+              self.msgSuccess(response.message);
+              self.getConfigByType();
+            });
+          }).catch(() => {});
         }
       });
     },