|
|
|
@ -14,9 +14,9 @@
|
|
|
|
|
:rules="rules"
|
|
|
|
|
:model="formInfo"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="线路名称:" prop="lineid">
|
|
|
|
|
<el-form-item label="线路名称:" prop="lineId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formInfo.lineid"
|
|
|
|
|
v-model="formInfo.lineId"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="getTowerchange"
|
|
|
|
|
>
|
|
|
|
@ -29,8 +29,8 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="杆塔名称:" prop="towerid">
|
|
|
|
|
<el-select v-model="formInfo.towerid" placeholder="请选择">
|
|
|
|
|
<el-form-item label="杆塔名称:" prop="towerId">
|
|
|
|
|
<el-select v-model="formInfo.towerId" placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in toweridOptions"
|
|
|
|
|
:key="item.id"
|
|
|
|
@ -40,8 +40,8 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="装置ID:" prop="cmdid">
|
|
|
|
|
<el-input v-model="formInfo.cmdid" autocomplete="on"></el-input>
|
|
|
|
|
<el-form-item label="装置ID:" prop="cmdId">
|
|
|
|
|
<el-input v-model="formInfo.cmdId" autocomplete="on"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="装置名称:" prop="equipName">
|
|
|
|
|
<el-input v-model="formInfo.equipName" auto-complete="on"></el-input>
|
|
|
|
@ -54,12 +54,12 @@
|
|
|
|
|
<div class="addchannel" ref="channelBoxref">
|
|
|
|
|
<div
|
|
|
|
|
class="channelBoxadd"
|
|
|
|
|
v-for="(channellist, index) in formInfo.list"
|
|
|
|
|
v-for="(val, index) in formInfo.channelId"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="通道号:">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="channellist.channelVal"
|
|
|
|
|
v-model="val.id"
|
|
|
|
|
placeholder="请选择通道号"
|
|
|
|
|
@change="changeHandle"
|
|
|
|
|
>
|
|
|
|
@ -73,7 +73,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="通道名称:">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="channellist.nickname"
|
|
|
|
|
v-model="val.alias"
|
|
|
|
|
placeholder="请输入通道名称"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -82,20 +82,20 @@
|
|
|
|
|
v-if="index !== 0"
|
|
|
|
|
type="danger"
|
|
|
|
|
icon="el-icon-minus"
|
|
|
|
|
@click="deleteModule(channellist, index)"
|
|
|
|
|
@click="deleteModule(val, index)"
|
|
|
|
|
></el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="addModule()"
|
|
|
|
|
v-if="index + 1 == formInfo.list.length"
|
|
|
|
|
v-if="index + 1 == formInfo.channelId.length"
|
|
|
|
|
></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <el-form-item label="通道(可多选):" prop="channelVal">
|
|
|
|
|
<!-- <el-form-item label="通道(可多选):" prop="id">
|
|
|
|
|
<el-checkbox-group
|
|
|
|
|
class="channelBox"
|
|
|
|
|
v-model="formInfo.channelVal"
|
|
|
|
|
v-model="formInfo.id"
|
|
|
|
|
v-if="channelOptions.length > 0"
|
|
|
|
|
>
|
|
|
|
|
<el-checkbox
|
|
|
|
@ -151,7 +151,7 @@ export default {
|
|
|
|
|
lineOptions: [], //线路
|
|
|
|
|
toweridOptions: [], //杆塔
|
|
|
|
|
rules: {
|
|
|
|
|
cmdid: [
|
|
|
|
|
cmdId: [
|
|
|
|
|
{ required: true, message: "请输入装置ID", trigger: "blur" },
|
|
|
|
|
{ validator: validCmid, trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
@ -170,38 +170,33 @@ export default {
|
|
|
|
|
this.getChannel();
|
|
|
|
|
if (val == null) {
|
|
|
|
|
return (this.formInfo = {
|
|
|
|
|
lineid: [],
|
|
|
|
|
towerid: [],
|
|
|
|
|
cmdid: "",
|
|
|
|
|
equipName: "",
|
|
|
|
|
sim: "",
|
|
|
|
|
list: [
|
|
|
|
|
lineId: '',
|
|
|
|
|
towerId: '',
|
|
|
|
|
cmdId: '',
|
|
|
|
|
equipName: '',
|
|
|
|
|
sim: '',
|
|
|
|
|
channelId: [
|
|
|
|
|
{
|
|
|
|
|
channelVal: '',
|
|
|
|
|
nickname: "",
|
|
|
|
|
id: '',
|
|
|
|
|
alias: '',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.formInfo = val;
|
|
|
|
|
// let channelnr = [];
|
|
|
|
|
// val.list.forEach((item) => {
|
|
|
|
|
// channelnr.push(item.id);
|
|
|
|
|
// });
|
|
|
|
|
// this.$set(this.formInfo, "channelVal", channelnr);
|
|
|
|
|
},
|
|
|
|
|
//通道号值改变
|
|
|
|
|
changeHandle(){
|
|
|
|
|
this.filterOption = this.channelOptions.filter(val => !this.formInfo.list.some(item => item.channelVal === val.id))
|
|
|
|
|
this.filterOption = this.channelOptions.filter(val => !this.formInfo.channelId.some(item => item.id === val.id))
|
|
|
|
|
},
|
|
|
|
|
//新增一行
|
|
|
|
|
addModule() {
|
|
|
|
|
//新增一行
|
|
|
|
|
this.formInfo.list.push({
|
|
|
|
|
channelVal: '',
|
|
|
|
|
nickname: "",
|
|
|
|
|
this.formInfo.channelId.push({
|
|
|
|
|
id: '',
|
|
|
|
|
alias: "",
|
|
|
|
|
});
|
|
|
|
|
this.filterOption = this.channelOptions.filter(val => !this.formInfo.list.some(item => item.channelVal === val.id))
|
|
|
|
|
this.filterOption = this.channelOptions.filter(val => !this.formInfo.channelId.some(item => item.id === val.id))
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
console.log(this.$refs.channelBoxref);
|
|
|
|
|
if (this.$refs.channelBoxref) {
|
|
|
|
@ -213,26 +208,27 @@ export default {
|
|
|
|
|
//删除一行
|
|
|
|
|
deleteModule(item, index) {
|
|
|
|
|
console.log(item, index);
|
|
|
|
|
const itemList = this.formInfo.list.indexOf(item);
|
|
|
|
|
const itemList = this.formInfo.channelId.indexOf(item);
|
|
|
|
|
if (itemList !== -1) {
|
|
|
|
|
this.formInfo.list.splice(index, 1);
|
|
|
|
|
this.formInfo.channelId.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
this.filterOption = this.channelOptions.filter(val => !this.formInfo.list.some(item => item.channelVal === val.id))
|
|
|
|
|
this.filterOption = this.channelOptions.filter(val => !this.formInfo.channelId.some(item => item.id === val.id))
|
|
|
|
|
},
|
|
|
|
|
// 保存确定操作
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs.formgrapInfo.validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.photoDialogTitle == "新增") {
|
|
|
|
|
this.formInfo = {
|
|
|
|
|
channelid: this.formInfo.channelVal,
|
|
|
|
|
cmdid: this.formInfo.cmdid,
|
|
|
|
|
lineid: this.formInfo.lineid,
|
|
|
|
|
equipName: this.formInfo.equipName,
|
|
|
|
|
sim: this.formInfo.sim,
|
|
|
|
|
displayName: this.formInfo.cmdid,
|
|
|
|
|
towerid: this.formInfo.towerid,
|
|
|
|
|
};
|
|
|
|
|
// this.formInfo = {
|
|
|
|
|
// lineId: this.formInfo.lineId,
|
|
|
|
|
// towerId: this.formInfo.towerId,
|
|
|
|
|
// cmdId: this.formInfo.cmdId,
|
|
|
|
|
// equipName: this.formInfo.equipName,
|
|
|
|
|
// sim: this.formInfo.sim,
|
|
|
|
|
// channelId: this.formInfo.channelId,
|
|
|
|
|
// displayName: this.formInfo.cmdId,
|
|
|
|
|
// };
|
|
|
|
|
this.$set(this.formInfo,'displayName',this.formInfo.cmdId)
|
|
|
|
|
addTerminalJoggle(this.formInfo)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.isShow = false;
|
|
|
|
@ -251,16 +247,6 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.formInfo = {
|
|
|
|
|
channelid: this.formInfo.channelVal,
|
|
|
|
|
cmdid: this.formInfo.cmdid,
|
|
|
|
|
lineid: this.formInfo.lineid,
|
|
|
|
|
equipName: this.formInfo.equipName,
|
|
|
|
|
sim: this.formInfo.sim,
|
|
|
|
|
displayName: this.formInfo.cmdid,
|
|
|
|
|
towerid: this.formInfo.towerid,
|
|
|
|
|
id: this.formInfo.id,
|
|
|
|
|
};
|
|
|
|
|
updateTerminalJoggle(this.formInfo)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.isShow = false;
|
|
|
|
@ -283,12 +269,12 @@ export default {
|
|
|
|
|
this.lineOptions = res.data.list;
|
|
|
|
|
if (res.data.list.length == 0) {
|
|
|
|
|
this.lineOptions = [];
|
|
|
|
|
this.formInfo.lineid = "";
|
|
|
|
|
this.formInfo.lineId = "";
|
|
|
|
|
} else {
|
|
|
|
|
this.lineOptions = res.data.list;
|
|
|
|
|
if (this.photoDialogTitle == "新增") {
|
|
|
|
|
// this.formInfo.lineid = res.data.list[0].id;
|
|
|
|
|
this.$set(this.formInfo, "lineid", res.data.list[0].id);
|
|
|
|
|
// this.formInfo.lineId = res.data.list[0].id;
|
|
|
|
|
this.$set(this.formInfo, "lineId", res.data.list[0].id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// this.dyOptions = res.data.list;
|
|
|
|
@ -298,16 +284,16 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//获取所有杆塔
|
|
|
|
|
getTower() {
|
|
|
|
|
getLineAndGtInfo({ type: 2, id: this.formInfo.lineid })
|
|
|
|
|
getLineAndGtInfo({ type: 2, id: this.formInfo.lineId })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.data.list.length == 0) {
|
|
|
|
|
this.toweridOptions = [];
|
|
|
|
|
this.formInfo.towerid = "";
|
|
|
|
|
this.formInfo.towerId = "";
|
|
|
|
|
} else {
|
|
|
|
|
this.toweridOptions = res.data.list;
|
|
|
|
|
if (this.photoDialogTitle == "新增" || this.photoDialogtype == 1) {
|
|
|
|
|
// this.formInfo.towerid = res.data.list[0].id;
|
|
|
|
|
this.$set(this.formInfo, "towerid", res.data.list[0].id);
|
|
|
|
|
// this.formInfo.towerId = res.data.list[0].id;
|
|
|
|
|
this.$set(this.formInfo, "towerId", res.data.list[0].id);
|
|
|
|
|
this.photoDialogtype = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -326,7 +312,7 @@ export default {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.channelOptions = res.data.list;
|
|
|
|
|
this.filterOption = res.data.list;
|
|
|
|
|
this.formInfo.list[0].channelVal = this.filterOption[0].id;
|
|
|
|
|
this.formInfo.channelId[0].id = this.filterOption[0].id;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {});
|
|
|
|
|
},
|
|
|
|
|