Browse Source

IP地址修改

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

+ 2 - 0
ys_int/src/i18n/lang/en.js

@@ -136,6 +136,8 @@ const lang = {
         temperature: "Temperature",
         initialModulus: "Accumulative Open Frequency",
         theoryCycle: "Theoretical Cycle",
+        changeIp: "Change IP",
+        IPWrong: "IP address format is incorrect",
 	},
 	// 项目管理
     project: {

+ 2 - 0
ys_int/src/i18n/lang/zh.js

@@ -136,6 +136,8 @@ const lang = {
         temperature: "温度",
         initialModulus: "累计开合次数",
         theoryCycle: "理论周期",
+        changeIp: "切换IP",
+        IPWrong: "IP地址格式不正确",
 	},
 	// 项目管理
     project: {

+ 2 - 0
ys_int/src/port.js

@@ -47,6 +47,8 @@ export default {
         modelList: '/mould/modelList', //给项目分配模具获取该公司下的模具列表
         delMold: '/mould/delMould', //删除模具
 
+        changeIp: '/mouldequipment/changeIp',//切换IP
+
         moldDetail: '/mould/detail', //模具详情
         moldFileList: '/mouldfile/list', //获取模具文档
         moldFileListAll: '/mouldfile/allList', //获取全部模具文档

+ 2 - 1
ys_int/src/views/base/allocation.vue

@@ -135,7 +135,8 @@
                     <el-input v-model="newAllocation.equipmentName" autocomplete="off" :placeholder="$t('basic.inputProNum')"></el-input>
                 </el-form-item>
                 <el-form-item :label="$t('project.company')" prop="belongCompanyId">
-                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable :placeholder="$t('project.inputCompany')"  style="width:505px;" :disabled="newAllocation.usage">
+                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable :placeholder="$t('project.inputCompany')"  style="width:505px;">
+                        <!--  :disabled="newAllocation.usage" -->
                         <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>

+ 43 - 1
ys_int/src/views/detection/detection.vue

@@ -17,6 +17,9 @@
                 <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>
 
@@ -77,7 +80,7 @@
                     <span v-else>{{$t('runTest.isMaintain1')}}</span>
                 </template>
             </el-table-column>
-            <el-table-column :label="$t('runTest.process')" align="center" width="85">
+            <el-table-column :label="$t('runTest.process')" align="center" width="200">
                 <template slot-scope="scope">
                     <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">{{$t('base.detail')}}</el-button>
                 </template>
@@ -105,6 +108,7 @@
     export default {
         data() {
             return {
+                user: JSON.parse(sessionStorage.getItem('user')),
                 moulds: [],
                 filters: {
                     name: "",
@@ -175,6 +179,44 @@
                         type: "error"
                     });
                 });
+            },
+
+            //改变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(() => {
+
+                });
             }
         },