|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
class="dialog"
|
|
|
|
|
:title="dialogTitle"
|
|
|
|
|
:visible.sync="visible"
|
|
|
|
|
@close="close()"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
width="970px"
|
|
|
|
|
>
|
|
|
|
@ -18,13 +19,10 @@
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="企业名称" prop="companyName">
|
|
|
|
|
<el-select
|
|
|
|
|
ref="companySelect"
|
|
|
|
|
v-model="form.companyName"
|
|
|
|
|
placeholder="请选择企业"
|
|
|
|
|
>
|
|
|
|
|
<el-select v-model="form.companyName" placeholder="请选择企业">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form.company"
|
|
|
|
|
v-for="item in list.company"
|
|
|
|
|
@click.native="companyNameselected(item.companyName, item.id)"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.companyName"
|
|
|
|
|
:value="item.id"
|
|
|
|
@ -32,8 +30,7 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item> </el-form-item>
|
|
|
|
|
<el-form-item label="设备名称" prop="deviceName">
|
|
|
|
|
<el-input v-model="form.deviceName"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -46,13 +43,14 @@
|
|
|
|
|
<el-form-item label="登录密码" prop="password">
|
|
|
|
|
<el-input v-model="form.password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备大类" prop="deviceVideoParentType">
|
|
|
|
|
<el-form-item label="设备大类" prop="devicePerceptionParentTypeCn">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.deviceVideoParentType"
|
|
|
|
|
v-model="form.devicePerceptionParentTypeCn"
|
|
|
|
|
placeholder="请选择设备大类"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form.perception_type"
|
|
|
|
|
v-for="item in list.perception_type"
|
|
|
|
|
@click.native="parent_selected(item.dictLabel,item.dictValue)"
|
|
|
|
|
:key="item.dictValue"
|
|
|
|
|
:label="item.dictLabel"
|
|
|
|
|
:value="item.dictValue"
|
|
|
|
@ -60,13 +58,30 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备小类" prop="deviceVideoSubType">
|
|
|
|
|
<el-form-item label="是否卡口" prop="isDoorwayVideoCn">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.deviceVideoSubType"
|
|
|
|
|
ref="isDoorwayVideoCn"
|
|
|
|
|
v-model="form.isDoorwayVideoCn"
|
|
|
|
|
placeholder="请选择是否卡口"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in list.isDoorwayVideoList"
|
|
|
|
|
@click.native="isDoorselected(item.id)"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备小类" prop="devicePerceptionSubTypeCn">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.devicePerceptionSubTypeCn"
|
|
|
|
|
placeholder="请选择设备小类"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form.video_type"
|
|
|
|
|
v-for="item in list.video_type"
|
|
|
|
|
@click.native="perception_selected(item.dictLabel,item.dictValue)"
|
|
|
|
|
:key="item.dictValue"
|
|
|
|
|
:label="item.dictLabel"
|
|
|
|
|
:value="item.dictValue"
|
|
|
|
@ -126,10 +141,24 @@
|
|
|
|
|
<el-form-item label="U3D高度" prop="u3dHeight">
|
|
|
|
|
<el-input v-model="form.u3dHeight"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备方位" prop="orientation">
|
|
|
|
|
<el-select v-model="form.orientation" placeholder="请选择设备方位">
|
|
|
|
|
<el-form-item label="进出方向" prop="directionCn">
|
|
|
|
|
<el-select v-model="form.directionCn" placeholder="请选择进出方向">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form.orientation_types"
|
|
|
|
|
v-for="item in list.directionList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.label"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备方位" prop="orientationCn">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.orientationCn"
|
|
|
|
|
placeholder="请选择设备方位"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in list.orientation_types"
|
|
|
|
|
:key="item.dictValue"
|
|
|
|
|
:label="item.dictLabel"
|
|
|
|
|
:value="item.dictValue"
|
|
|
|
@ -137,7 +166,11 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="安装位置" prop="deviceAddress">
|
|
|
|
|
<el-form-item
|
|
|
|
|
label="安装位置"
|
|
|
|
|
prop="deviceAddress"
|
|
|
|
|
class="deviceAddress_text"
|
|
|
|
|
>
|
|
|
|
|
<el-input v-model="form.deviceAddress"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
@ -169,11 +202,10 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button
|
|
|
|
|
@click="
|
|
|
|
|
saveFormData('equipmentForm', 'videoForm', 'addressForm', 'otherForm')
|
|
|
|
|
"
|
|
|
|
|
@click="saveFormData('equipmentForm', 'videoForm', 'addressForm')"
|
|
|
|
|
>保 存</el-button
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-button @click="save()"></el-button> -->
|
|
|
|
|
<el-button @click="close()">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
@ -182,27 +214,43 @@
|
|
|
|
|
import {
|
|
|
|
|
commonDict,
|
|
|
|
|
getCompanyList,
|
|
|
|
|
addVideoList,
|
|
|
|
|
addPerceptionList,
|
|
|
|
|
changePerceptionList,
|
|
|
|
|
} from "@/api/correlationEquipment";
|
|
|
|
|
import { debounce } from "@/utils/publicMethod_lxy/debounce.js";
|
|
|
|
|
// import { debounce } from "@/utils/publicMethod_lxy/debounce.js";
|
|
|
|
|
export default {
|
|
|
|
|
name: "addVideoDialog",
|
|
|
|
|
name: "addPerceptionDialog",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
visible: false,
|
|
|
|
|
dialogTitle: "新建",
|
|
|
|
|
dialogTitle: "",
|
|
|
|
|
list: {
|
|
|
|
|
company: [],
|
|
|
|
|
video_type: [],
|
|
|
|
|
perception_type: [],
|
|
|
|
|
isDoorwayVideoList: [
|
|
|
|
|
{ label: "是", id: "1" },
|
|
|
|
|
{ label: "否", id: "2" },
|
|
|
|
|
],
|
|
|
|
|
directionList: [
|
|
|
|
|
{ label: "进", id: "1" },
|
|
|
|
|
{ label: "出", id: "2" },
|
|
|
|
|
],
|
|
|
|
|
orientation_types: [],
|
|
|
|
|
},
|
|
|
|
|
form: {
|
|
|
|
|
// 设备基础信息表单
|
|
|
|
|
companyId: "",
|
|
|
|
|
companyName: "",
|
|
|
|
|
company: [],
|
|
|
|
|
deviceName: "",
|
|
|
|
|
deviceIp: "",
|
|
|
|
|
deviceVideoParentType: "",
|
|
|
|
|
deviceParentType: "", // 大类
|
|
|
|
|
video_type: [],
|
|
|
|
|
deviceVideoSubType: "", // 小类
|
|
|
|
|
perception_type: [],
|
|
|
|
|
// deviceVideoParentType: "",
|
|
|
|
|
devicePerceptionSubType: "", // 小类码值
|
|
|
|
|
devicePerceptionSubTypeCn: "", // 小类
|
|
|
|
|
devicePerceptionParentType: "", // 大类码值
|
|
|
|
|
devicePerceptionParentTypeCn: "", // 大类
|
|
|
|
|
isDoorwayVideoCn: "",
|
|
|
|
|
isDoorwayVideo: "",
|
|
|
|
|
account: "",
|
|
|
|
|
password: "",
|
|
|
|
|
// 视频通道信息表单
|
|
|
|
@ -217,8 +265,9 @@ export default {
|
|
|
|
|
u3dLatitude: "",
|
|
|
|
|
deviceHeight: "",
|
|
|
|
|
u3dHeight: "",
|
|
|
|
|
directionCn: "",
|
|
|
|
|
orientation: "",
|
|
|
|
|
orientation_types: [],
|
|
|
|
|
orientationCn: "",
|
|
|
|
|
deviceAddress: "",
|
|
|
|
|
// 设备其他信息表单
|
|
|
|
|
deviceBrand: "",
|
|
|
|
@ -227,8 +276,6 @@ export default {
|
|
|
|
|
deviceSn: "",
|
|
|
|
|
deviceMac: "",
|
|
|
|
|
devicePort: "",
|
|
|
|
|
isDoorwayVideo: "",
|
|
|
|
|
isShowVideo: "",
|
|
|
|
|
},
|
|
|
|
|
disabled: false, // 表单是否禁用
|
|
|
|
|
rules: {
|
|
|
|
@ -241,10 +288,10 @@ export default {
|
|
|
|
|
deviceIp: [
|
|
|
|
|
{ required: true, message: "请填写设备ip", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
deviceVideoParentType: [
|
|
|
|
|
devicePerceptionParentTypeCn: [
|
|
|
|
|
{ required: true, message: "请选择设备大类", trigger: "change" },
|
|
|
|
|
],
|
|
|
|
|
deviceVideoSubType: [
|
|
|
|
|
devicePerceptionSubTypeCn: [
|
|
|
|
|
{ required: true, message: "请选择设备小类", trigger: "change" },
|
|
|
|
|
],
|
|
|
|
|
gbsChannelNo: [
|
|
|
|
@ -265,64 +312,77 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// 请求设备小类下拉
|
|
|
|
|
const params = {
|
|
|
|
|
dictType: "device_video_sub_type",
|
|
|
|
|
};
|
|
|
|
|
commonDict(params).then((res) => {
|
|
|
|
|
this.form.video_type = res.data;
|
|
|
|
|
});
|
|
|
|
|
const val = {
|
|
|
|
|
dictType: "device_perception_sub_type",
|
|
|
|
|
};
|
|
|
|
|
// 请求设备大类下拉
|
|
|
|
|
commonDict(val).then((res) => {
|
|
|
|
|
this.form.perception_type = res.data;
|
|
|
|
|
});
|
|
|
|
|
// 请求设备方位下拉
|
|
|
|
|
const param_op = {
|
|
|
|
|
dictType: "orientation",
|
|
|
|
|
};
|
|
|
|
|
commonDict(param_op).then((res) => {
|
|
|
|
|
this.form.orientation_types = res.data;
|
|
|
|
|
});
|
|
|
|
|
// 请求企业名称下拉
|
|
|
|
|
getCompanyList().then((res) => {
|
|
|
|
|
this.form.company = res.data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
|
methods: {
|
|
|
|
|
open(num, row) {
|
|
|
|
|
this.visible = true;
|
|
|
|
|
if (num === "1") {
|
|
|
|
|
this.dialogTitle = "新建";
|
|
|
|
|
this.disabled = false;
|
|
|
|
|
} else if (num === "2") {
|
|
|
|
|
this.dialogTitle = "编辑";
|
|
|
|
|
this.form = row;
|
|
|
|
|
this.disabled = false;
|
|
|
|
|
console.log("row12345", row);
|
|
|
|
|
} else if (num === "5") {
|
|
|
|
|
this.dialogTitle = "详情";
|
|
|
|
|
this.form = row;
|
|
|
|
|
this.disabled = true;
|
|
|
|
|
}
|
|
|
|
|
this.visible = true;
|
|
|
|
|
// 请求设备小类下拉
|
|
|
|
|
const params = {
|
|
|
|
|
dictType: "device_video_sub_type",
|
|
|
|
|
};
|
|
|
|
|
commonDict(params).then((res) => {
|
|
|
|
|
this.list.video_type = res.data;
|
|
|
|
|
});
|
|
|
|
|
// 请求设备大类下拉
|
|
|
|
|
const val = {
|
|
|
|
|
dictType: "device_perception_sub_type",
|
|
|
|
|
};
|
|
|
|
|
commonDict(val).then((res) => {
|
|
|
|
|
this.list.perception_type = res.data;
|
|
|
|
|
});
|
|
|
|
|
// 请求设备方位下拉
|
|
|
|
|
const param_op = {
|
|
|
|
|
dictType: "orientation",
|
|
|
|
|
};
|
|
|
|
|
commonDict(param_op).then((res) => {
|
|
|
|
|
this.list.orientation_types = res.data;
|
|
|
|
|
});
|
|
|
|
|
// 请求企业名称下拉
|
|
|
|
|
getCompanyList().then((res) => {
|
|
|
|
|
this.list.company = res.data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
isDoorselected(value) {
|
|
|
|
|
this.form.isDoorwayVideo = value; // 是否卡口下拉码值
|
|
|
|
|
},
|
|
|
|
|
companyNameselected(name, value) {
|
|
|
|
|
this.form.companyName = name;
|
|
|
|
|
this.form.companyId = value; // 公司下拉码值
|
|
|
|
|
},
|
|
|
|
|
parent_selected(label,value) {
|
|
|
|
|
this.form.devicePerceptionParentTypeCn = label
|
|
|
|
|
this.form.devicePerceptionParentType = value; // 大类下拉码值
|
|
|
|
|
console.log("this.form3333", this.form);
|
|
|
|
|
},
|
|
|
|
|
perception_selected(label,value) {
|
|
|
|
|
this.form.devicePerceptionSubTypeCn = label
|
|
|
|
|
this.form.devicePerceptionSubType = value; // 小类下拉码值
|
|
|
|
|
console.log("this.form2222", this.form);
|
|
|
|
|
},
|
|
|
|
|
// 表单验证必填
|
|
|
|
|
saveFormData: debounce(function (formName1, formName2, formName3) {
|
|
|
|
|
this.$refs[formName1].validate((valid1) => {
|
|
|
|
|
if (valid1) {
|
|
|
|
|
this.$refs[formName2].validate((valid2) => {
|
|
|
|
|
if (valid2) {
|
|
|
|
|
this.$refs[formName3].validate((valid3) => {
|
|
|
|
|
if (valid3) {
|
|
|
|
|
delete this.form.company;
|
|
|
|
|
delete this.form.video_type;
|
|
|
|
|
delete this.form.perception_type;
|
|
|
|
|
delete this.form.orientation_types;
|
|
|
|
|
this.form.companyId = this.$refs.companySelect.selected.value; // 企业对应id
|
|
|
|
|
const params = this.form;
|
|
|
|
|
console.log("this.form", this.form);
|
|
|
|
|
if (this.dialogTitle === "新建") {
|
|
|
|
|
addVideoList(params)
|
|
|
|
|
saveFormData(formName1,formName2,formName3) {
|
|
|
|
|
if (this.dialogTitle === "新建") {
|
|
|
|
|
this.$refs[formName1].validate((valid1) => {
|
|
|
|
|
if (valid1) {
|
|
|
|
|
this.$refs[formName2].validate((valid2) => {
|
|
|
|
|
if (valid2) {
|
|
|
|
|
this.$refs[formName3].validate((valid3) => {
|
|
|
|
|
if (valid3) {
|
|
|
|
|
const params = this.form;
|
|
|
|
|
addPerceptionList(params)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.visible = false;
|
|
|
|
|
this.$message({
|
|
|
|
@ -334,31 +394,64 @@ export default {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
}); // 视频通道信息必填验证
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
}); // 视频通道信息必填验证
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
}); // 设备基础必填验证
|
|
|
|
|
}, 300),
|
|
|
|
|
}); // 视频通道信息必填验证
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
}); // 视频通道信息必填验证
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
}); // 设备基础必填验证
|
|
|
|
|
} else if (this.dialogTitle === "编辑") {
|
|
|
|
|
this.$refs[formName1].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.$refs[formName2].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.$refs[formName3].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
console.log('this.form123', JSON.stringify(this.form))
|
|
|
|
|
console.log('this.form124', JSON.parse(JSON.stringify(this.form)))
|
|
|
|
|
changePerceptionList(JSON.parse(JSON.stringify(this.form)))
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
console.log('this.form125', JSON.parse(JSON.stringify(this.form)))
|
|
|
|
|
this.visible = false;
|
|
|
|
|
this.$message.success("编辑成功");
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
this.$message.warning("编辑失败");
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
}); // 视频通道信息必填验证
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
}); // 视频通道信息必填验证
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// save() {
|
|
|
|
|
// console.log('this.form7777',this.form);
|
|
|
|
|
// },
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
close() {
|
|
|
|
|
this.visible = false;
|
|
|
|
|
// 重置表单
|
|
|
|
|
// 设备基础信息表单重置
|
|
|
|
|
this.$refs['equipmentForm'].resetFields()
|
|
|
|
|
this.$refs["equipmentForm"].resetFields();
|
|
|
|
|
// 视频通道信息表单重置
|
|
|
|
|
this.$refs['videoForm'].resetFields()
|
|
|
|
|
// 设备位置信息表单重置
|
|
|
|
|
this.$refs['addressForm'].resetFields()
|
|
|
|
|
this.$refs["videoForm"].resetFields();
|
|
|
|
|
// 设备位置信息表单重置
|
|
|
|
|
this.$refs["addressForm"].resetFields();
|
|
|
|
|
// 设备其他信息表单重置
|
|
|
|
|
this.$refs['otherForm'].resetFields()
|
|
|
|
|
this.$refs["otherForm"].resetFields();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
@ -477,5 +570,13 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.el-form-item.deviceAddress_text {
|
|
|
|
|
width: 900px !important;
|
|
|
|
|
.el-form-item__content {
|
|
|
|
|
.el-input__inner {
|
|
|
|
|
width: 750px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|