Browse Source

IP地址修改

sunyadv 5 năm trước cách đây
mục cha
commit
6ff10ef40b

+ 40 - 0
ys_int/src/views/base/allocation.vue

@@ -32,6 +32,9 @@
                 <el-form-item style="float: right;">
                     <el-button type="primary" @click="showAllocation">{{$t('base.add')}}</el-button>
                 </el-form-item>
+                <el-form-item style="float:right;" v-if="user.parentId == 0">
+					<el-button type="primary" @click="showChangeIp()">{{$t('runTest.changeIp')}}</el-button>
+				</el-form-item>
                 <!-- <el-form-item style="float: right;">
                     <el-button type="primary" @click="issued">{{$t('base.issued')}}</el-button>
                 </el-form-item> -->
@@ -677,6 +680,43 @@
                         });
                     });
                 }
+            },
+
+            //改变ip
+            showChangeIp() {
+                this.$prompt('', this.$t('runTest.changeIp'), {
+                    confirmButtonText: this.$t('el.datepicker.confirm'),
+                    cancelButtonText: this.$t('el.datepicker.cancel'),
+                    inputPattern: /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?):([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{4}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
+                    inputErrorMessage: this.$t('runTest.IPWrong')
+                }).then(({ value }) => {
+                    var ip = value.split(':')[0] , port = value.split(':')[1];
+                    this.http.post( this.port.mold.changeIp , {
+                        "ip": ip,
+                        "port": port,
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                type: 'success',
+                                message: this.$t('prompt.success')
+                            });
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }).catch(() => {
+
+                });
             }
         },
         created() {

+ 0 - 41
ys_int/src/views/detection/detection.vue

@@ -17,9 +17,6 @@
                 <el-form-item>
                     <el-button type="primary" @click="getMoulds(filters.name)">{{$t('base.query')}}</el-button>
                 </el-form-item>
-                <el-form-item style="float:right;" v-if="user.subordinateType == 0 && user.parentId == 1">
-					<el-button type="primary" @click="showChangeIp()">{{$t('runTest.changeIp')}}</el-button>
-				</el-form-item>
             </el-form>
         </el-col>
 
@@ -180,44 +177,6 @@
                     });
                 });
             },
-
-            //改变ip
-            showChangeIp() {
-                this.$prompt('', this.$t('runTest.changeIp'), {
-                    confirmButtonText: this.$t('el.datepicker.confirm'),
-                    cancelButtonText: this.$t('el.datepicker.cancel'),
-                    inputPattern: /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?):([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{4}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
-                    inputErrorMessage: this.$t('runTest.IPWrong')
-                }).then(({ value }) => {
-                    var ip = value.split(':')[0] , port = value.split(':')[1];
-                    this.http.post( this.port.mold.changeIp , {
-                        "ip": ip,
-                        "port": port,
-                    },
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                type: 'success',
-                                message: this.$t('prompt.success')
-                            });
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
-                        this.listLoading = false;
-                        this.$message({
-                            message: error,
-                            type: "error"
-                        });
-                    });
-                }).catch(() => {
-
-                });
-            }
         },
 
         created() {

+ 1 - 1
ys_int/src/views/mold/moldDetail.vue

@@ -51,7 +51,7 @@
                 </el-col> -->
                 <el-col :span="6" class="detail">
                     {{$t('mold.initialR')}}:
-                    <span class="info">{{moldDetail.runTimes==null?'':moldDetail.runTimes.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
+                    <span class="info">{{(moldDetail.runTimes==null?0:moldDetail.runTimes + moldDetail.initialModulus).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
                 </el-col>
                 <el-col :span="6" class="detail">
                     {{$t('mold.life')}}:

+ 1 - 1
ys_int/src/views/mold/moldList.vue

@@ -54,7 +54,7 @@
             </el-table-column> -->
             <el-table-column prop="runTimes" :label="$t('mold.initialR')" width="100" align="center" sortable>
                 <template slot-scope="scope">
-                    {{scope.row.runTimes.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}
+                    {{(scope.row.runTimes==null?0:scope.row.runTimes + scope.row.initialModulus).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}
                 </template>
             </el-table-column>
             <el-table-column prop="settingLife" :label="$t('mold.life')" width="100" align="center" sortable>