Commit 35724433 by liimin

合并代码

2 parents 15f7b168 552338de
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
if (this.deviceNum === value && this.deviceName === this.editForm.deviceName) { if (this.deviceNum === value && this.deviceName === this.editForm.deviceName) {
const res = await isExistApi({ deviceNum: value, deviceName: this.editForm.deviceName, stationCode: this.editForm.stationCode }) const res = await isExistApi({ deviceNum: value, deviceName: this.editForm.deviceName, stationCode: this.editForm.stationCode })
// console.log(res) // console.log(res)
res ? callback(new Error(rule.message)) : callback() res.deviceNum ? callback(new Error(rule.message)) : callback()
} }
}, },
......
...@@ -282,7 +282,7 @@ export default { ...@@ -282,7 +282,7 @@ export default {
params.method = 'fims.device.import'// params.method params.method = 'fims.device.import'// params.method
// console.log(params) // console.log(params)
params = sign(params, noSignAttr) params = sign(params, noSignAttr)
axios.post('http://192.168.3.191:8944/router', qs.stringify({ axios.post(process.env.VUE_APP_API, qs.stringify({
...params ...params
}), }),
{ {
......
...@@ -3,7 +3,7 @@ import { constants } from 'fs'; ...@@ -3,7 +3,7 @@ import { constants } from 'fs';
<template> <template>
<div> <div>
<el-dialog <el-dialog
:title="!editForm.subsystemCode ? '添加子系统' : '编辑子系统'" :title="title"
:visible.sync="isVisible" :visible.sync="isVisible"
:before-close="handleClose" :before-close="handleClose"
> >
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
data () { data () {
return { return {
disabled: false, disabled: false,
title: '添加子系统',
rules: { rules: {
subsystemCode: [ subsystemCode: [
{ required: true, message: '请输入子系统编号', trigger: 'blur' }, { required: true, message: '请输入子系统编号', trigger: 'blur' },
...@@ -118,6 +119,7 @@ export default { ...@@ -118,6 +119,7 @@ export default {
watch: { watch: {
isVisible (val) { isVisible (val) {
this.disabled = !!this.editForm.subsystemCode this.disabled = !!this.editForm.subsystemCode
this.title = !this.editForm.subsystemCode ? '添加子系统' : '编辑子系统'
this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields() this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
} }
}, },
...@@ -126,7 +128,7 @@ export default { ...@@ -126,7 +128,7 @@ export default {
async isCodeExist (rule, value, callback) { async isCodeExist (rule, value, callback) {
if (this.editForm.trafficCode) { if (this.editForm.trafficCode) {
const res = await isExistApi({ subsystemCode: value, trafficCode: this.editForm.trafficCode }) const res = await isExistApi({ subsystemCode: value, trafficCode: this.editForm.trafficCode })
res ? callback(new Error(rule.message)) : callback() res.subsystemCode ? callback(new Error(rule.message)) : callback()
} }
}, },
......
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
methods: { methods: {
async isCodeExist (rule, value, callback) { async isCodeExist (rule, value, callback) {
const res = await isExistApi({ trafficCode: value }) const res = await isExistApi({ trafficCode: value })
res ? callback(new Error(rule.message)) : callback() res.trafficCode ? callback(new Error(rule.message)) : callback()
}, },
handleClose () { handleClose () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!