| | |
| | | <!-- 卡口名称 --> |
| | | <div class="device-item"> |
| | | <div class="item-left"> |
| | | <el-form-item label="卡口名称:" prop="name"> |
| | | <el-input v-model="bayonet.name" placeholder="请填写卡口名称"></el-input> |
| | | <el-form-item label="卡口名称:" prop="bayonetName"> |
| | | <el-input v-model="bayonet.bayonetName" placeholder="请填写卡口名称"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-right"></div> |
| | |
| | | <!-- 所属区域 --> |
| | | <div class="device-item"> |
| | | <div class="item-left"> |
| | | <el-form-item label="所属区域:" prop="belong_area"> |
| | | <el-input v-model="bayonet.belong_area" placeholder="请填写区域名称"></el-input> |
| | | <el-form-item label="所属区域:" prop="belongArea"> |
| | | <el-input v-model="bayonet.belongArea" placeholder="请填写区域名称"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-right"></div> |
| | |
| | | data() { |
| | | return { |
| | | bayonet: { |
| | | name: '', |
| | | bayonetName: '', |
| | | latitude: '', |
| | | longitude: '', |
| | | belong_area: '', |
| | | belongArea: '', |
| | | ipAddress: '', |
| | | port: '', |
| | | frontEndType: '', |
| | |
| | | description: '' |
| | | }, |
| | | rules: { |
| | | name: [{ required: true, trigger: 'blur', message: '请填写卡口名称' }], |
| | | bayonetName: [{ required: true, trigger: 'blur', message: '请填写卡口名称' }], |
| | | latitude: [{ required: true, trigger: ['blur', 'change'], message: '请填写纬度位置' }], |
| | | longitude: [{ required: true, trigger: ['blur', 'change'], message: '请填写经度位置' }], |
| | | belong_area: [{ required: true, trigger: ['blur', 'change'], message: '请填写区域名称' }], |
| | | belongArea: [{ required: true, trigger: ['blur', 'change'], message: '请填写区域名称' }], |
| | | ipAddress: [{ required: true, trigger: ['blur', 'change'], message: '请填写域名或者IP' }], |
| | | port: [{ required: true, trigger: ['blur', 'change'], message: '请输入端口号' }], |
| | | frontEndType: [{ required: true, trigger: ['blur', 'change'], message: '请输入前端类型' }], |
| | |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | this.bayonet = deepClone(this.originalBayonet); |
| | | }, |
| | | |
| | | methods: { |
| | | onSubmit() { |
| | | this.$refs.device.validate(valid => { |
| | | if (valid) { |
| | | const copyBayonet = deepClone(this.bayonet); |
| | | delete copyBayonet.id; |
| | | copyBayonet.longitude = Number(copyBayonet.longitude); |
| | | copyBayonet.latitude = Number(copyBayonet.latitude); |
| | | copyBayonet.inOutCityType = Number(copyBayonet.inOutCityType); |
| | | if (!this.isEdit) { |
| | | bayonet.addBayonet(this.bayonet) |
| | | .then(() => { |