|
|
|
@ -9,20 +9,20 @@
|
|
|
|
|
width="970px"
|
|
|
|
|
>
|
|
|
|
|
<div class="form_body">
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules">
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" :disabled="disabled">
|
|
|
|
|
<el-form-item> <p>设备基础信息</p> </el-form-item>
|
|
|
|
|
<el-form-item> </el-form-item>
|
|
|
|
|
<el-form-item label="企业名称" prop="companyName">
|
|
|
|
|
<el-select
|
|
|
|
|
ref="companySelect"
|
|
|
|
|
v-model="form.companyName"
|
|
|
|
|
placeholder="请选择企业"
|
|
|
|
|
@change="company_change"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form_list.company"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.companyName"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:value="item.companyName"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
@ -34,30 +34,32 @@
|
|
|
|
|
<el-form-item label="设备IP" prop="deviceIp">
|
|
|
|
|
<el-input v-model="form.deviceIp"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备大类" prop="deviceVideoParentType">
|
|
|
|
|
<el-form-item label="设备大类" prop="deviceVideoParentTypeCn">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.deviceVideoParentType"
|
|
|
|
|
v-model="form.deviceVideoParentTypeCn"
|
|
|
|
|
placeholder="请选择设备大类"
|
|
|
|
|
@change="parent_change"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form_list.parent_type"
|
|
|
|
|
:key="item.dictValue"
|
|
|
|
|
:label="item.dictLabel"
|
|
|
|
|
:value="item.dictValue"
|
|
|
|
|
:value="item.dictLabel"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备小类" prop="deviceVideoSubType">
|
|
|
|
|
<el-form-item label="设备小类" prop="deviceVideoSubTypeCn">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.deviceVideoSubType"
|
|
|
|
|
v-model="form.deviceVideoSubTypeCn"
|
|
|
|
|
placeholder="请选择设备小类"
|
|
|
|
|
@change="son_change"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form_list.son_type"
|
|
|
|
|
:key="item.dictValue"
|
|
|
|
|
:label="item.dictLabel"
|
|
|
|
|
:value="item.dictValue"
|
|
|
|
|
:value="item.dictLabel"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
@ -102,13 +104,17 @@
|
|
|
|
|
<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="orientationCn">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.orientationCn"
|
|
|
|
|
placeholder="请选择设备方位"
|
|
|
|
|
@change="orientation_change"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in form_list.orientation_types"
|
|
|
|
|
v-for="item in form_list.orientation_type"
|
|
|
|
|
:key="item.dictValue"
|
|
|
|
|
:label="item.dictLabel"
|
|
|
|
|
:value="item.dictValue"
|
|
|
|
|
:value="item.dictLabel"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
@ -138,24 +144,36 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form_btn" slot="footer">
|
|
|
|
|
<div v-if="!disabled" class="form_btn" slot="footer">
|
|
|
|
|
<el-button @click="save">保 存</el-button>
|
|
|
|
|
<el-button @click="close">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
commonDict,
|
|
|
|
|
getCompanyList,
|
|
|
|
|
addVideoList,
|
|
|
|
|
changeVideoList,
|
|
|
|
|
} from "@/api/correlationEquipment";
|
|
|
|
|
// import { validateIP } from "@/utils/publicMethod_lxy/validator";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "VideoForm",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
visible: false,
|
|
|
|
|
title: "新建",
|
|
|
|
|
form: {
|
|
|
|
|
companyId: "",
|
|
|
|
|
companyName: "",
|
|
|
|
|
deviceName: "",
|
|
|
|
|
deviceIp: "",
|
|
|
|
|
deviceVideoParentType: "",
|
|
|
|
|
deviceVideoParentTypeCn: "",
|
|
|
|
|
deviceVideoSubType: "",
|
|
|
|
|
deviceVideoSubTypeCn: "",
|
|
|
|
|
account: "",
|
|
|
|
|
password: "",
|
|
|
|
|
gbsChannelNo: "",
|
|
|
|
@ -169,6 +187,7 @@ export default {
|
|
|
|
|
deviceHeight: "",
|
|
|
|
|
u3dHeight: "",
|
|
|
|
|
orientation: "",
|
|
|
|
|
orientationCn: "",
|
|
|
|
|
deviceAddress: "",
|
|
|
|
|
deviceBrand: "",
|
|
|
|
|
manufactor: "",
|
|
|
|
@ -181,8 +200,10 @@ export default {
|
|
|
|
|
company: [],
|
|
|
|
|
parent_type: [],
|
|
|
|
|
son_type: [],
|
|
|
|
|
orientation_types: [],
|
|
|
|
|
orientation_type: [],
|
|
|
|
|
},
|
|
|
|
|
num: "", // 判断是新增修改等何种形式进入表单
|
|
|
|
|
disabled: false, // 详情时表单禁选
|
|
|
|
|
rules: {
|
|
|
|
|
companyName: [
|
|
|
|
|
{ required: true, message: "请选择企业", trigger: "change" },
|
|
|
|
@ -191,25 +212,69 @@ export default {
|
|
|
|
|
{ required: true, message: "请填写设备名称", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
deviceIp: [
|
|
|
|
|
{ required: true, message: "请填写设备ip", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请填写正确的设备ip",
|
|
|
|
|
pattern:
|
|
|
|
|
/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/,
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
deviceVideoParentType: [
|
|
|
|
|
deviceVideoParentTypeCn: [
|
|
|
|
|
{ required: true, message: "请选择设备大类", trigger: "change" },
|
|
|
|
|
],
|
|
|
|
|
deviceVideoSubType: [
|
|
|
|
|
deviceVideoSubTypeCn: [
|
|
|
|
|
{ required: true, message: "请选择设备小类", trigger: "change" },
|
|
|
|
|
],
|
|
|
|
|
gbsChannelNo: [
|
|
|
|
|
{ required: true, message: "请输入通道编码", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入20位通道编码",
|
|
|
|
|
pattern: /^[0-9]{20}$/,
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
gbsNvrNo: [
|
|
|
|
|
{ required: true, message: "请输入NVR编码", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入20位NVR编码",
|
|
|
|
|
pattern: /^[0-9]{20}$/,
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
longitude: [
|
|
|
|
|
{ required: true, message: "请输入设备经度", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
pattern:
|
|
|
|
|
/^(\-|\+)?(((\d|[1-9]\d|1[0-7]\d|0{1,3})\.\d{0,6})|(\d|[1-9]\d|1[0-7]\d|0{1,3})|180\.0{0,6}|180)$/, // eslint-disable-line
|
|
|
|
|
message: "请输入设备经度 -180~180(保留小数点后六位)",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
latitude: [
|
|
|
|
|
{ required: true, message: "请输入设备经度", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
pattern:
|
|
|
|
|
/^(\-|\+)?([0-8]?\d{1}\.\d{0,6}|90\.0{0,6}|[0-8]?\d{1}|90)$/, // eslint-disable-line
|
|
|
|
|
message: "请输入设备纬度 -90~90(保留小数点后六位)",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
u3dLongitude: [
|
|
|
|
|
{
|
|
|
|
|
pattern:
|
|
|
|
|
/^(\-|\+)?(((\d|[1-9]\d|1[0-7]\d|0{1,3})\.\d{0,6})|(\d|[1-9]\d|1[0-7]\d|0{1,3})|180\.0{0,6}|180)$/, // eslint-disable-line
|
|
|
|
|
message: "请输入u3d经度 -180~180(保留小数点后六位)",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
u3dLatitude: [
|
|
|
|
|
{
|
|
|
|
|
pattern:
|
|
|
|
|
/^(\-|\+)?([0-8]?\d{1}\.\d{0,6}|90\.0{0,6}|[0-8]?\d{1}|90)$/, // eslint-disable-line
|
|
|
|
|
message: "请输入u3d设备纬度 -90~90(保留小数点后六位)",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
deviceAddress: [
|
|
|
|
|
{ required: true, message: "请输入安装位置", trigger: "blur" },
|
|
|
|
@ -218,15 +283,121 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
open() {
|
|
|
|
|
async open(num, row) {
|
|
|
|
|
this.visible = true;
|
|
|
|
|
this.num = num;
|
|
|
|
|
await this.obtain_select_list(); // 请求下拉
|
|
|
|
|
if (num === "1") {
|
|
|
|
|
this.title = "新建";
|
|
|
|
|
this.disabled = false;
|
|
|
|
|
this.form = {
|
|
|
|
|
companyId: "",
|
|
|
|
|
companyName: "",
|
|
|
|
|
deviceName: "",
|
|
|
|
|
deviceIp: "",
|
|
|
|
|
deviceVideoParentType: "",
|
|
|
|
|
deviceVideoParentTypeCn: "",
|
|
|
|
|
deviceVideoSubType: "",
|
|
|
|
|
deviceVideoSubTypeCn: "",
|
|
|
|
|
account: "",
|
|
|
|
|
password: "",
|
|
|
|
|
gbsChannelNo: "",
|
|
|
|
|
gbsNvrNo: "",
|
|
|
|
|
channelNo: "",
|
|
|
|
|
rtspAddress: "",
|
|
|
|
|
longitude: "",
|
|
|
|
|
latitude: "",
|
|
|
|
|
u3dLongitude: "",
|
|
|
|
|
u3dLatitude: "",
|
|
|
|
|
deviceHeight: "",
|
|
|
|
|
u3dHeight: "",
|
|
|
|
|
orientation: "",
|
|
|
|
|
orientationCn: "",
|
|
|
|
|
deviceAddress: "",
|
|
|
|
|
deviceBrand: "",
|
|
|
|
|
manufactor: "",
|
|
|
|
|
manufactorPhone: "",
|
|
|
|
|
deviceSn: "",
|
|
|
|
|
deviceMac: "",
|
|
|
|
|
devicePort: "",
|
|
|
|
|
};
|
|
|
|
|
} else if (num === "5") {
|
|
|
|
|
this.title = "修改";
|
|
|
|
|
this.form = Object.assign(this.form, row);
|
|
|
|
|
this.disabled = false;
|
|
|
|
|
console.log("trrr", this.form);
|
|
|
|
|
} else if (num === '6') {
|
|
|
|
|
this.title = "详情"
|
|
|
|
|
this.form = Object.assign(this.form, row);
|
|
|
|
|
this.disabled = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 请求本表单下拉list
|
|
|
|
|
obtain_select_list() {
|
|
|
|
|
// 请求企业名称下拉
|
|
|
|
|
getCompanyList().then((res) => {
|
|
|
|
|
this.form_list.company = res.data;
|
|
|
|
|
console.log("this.form_list.company", this.form_list.company);
|
|
|
|
|
});
|
|
|
|
|
// 请求设备大类下拉
|
|
|
|
|
commonDict({ dictType: "device_perception_sub_type" }).then((res) => {
|
|
|
|
|
this.form_list.parent_type = res.data;
|
|
|
|
|
});
|
|
|
|
|
// 请求设备小类下拉
|
|
|
|
|
commonDict({ dictType: "device_video_sub_type" }).then((res) => {
|
|
|
|
|
this.form_list.son_type = res.data;
|
|
|
|
|
});
|
|
|
|
|
// 请求设备方位下拉
|
|
|
|
|
commonDict({ dictType: "orientation" }).then((res) => {
|
|
|
|
|
this.form_list.orientation_type = res.data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 选中企业下拉
|
|
|
|
|
company_change(val) {
|
|
|
|
|
this.form.companyId = this.form_list.company.find(
|
|
|
|
|
(item) => item.companyName === val
|
|
|
|
|
).id;
|
|
|
|
|
},
|
|
|
|
|
// 选中大类下拉
|
|
|
|
|
parent_change(val) {
|
|
|
|
|
this.form.deviceVideoParentType = this.form_list.parent_type.find(
|
|
|
|
|
(item) => item.dictLabel === val
|
|
|
|
|
).dictValue;
|
|
|
|
|
},
|
|
|
|
|
// 选中小类下拉
|
|
|
|
|
son_change(val) {
|
|
|
|
|
this.form.deviceVideoSubType = this.form_list.son_type.find(
|
|
|
|
|
(item) => item.dictLabel === val
|
|
|
|
|
).dictValue;
|
|
|
|
|
},
|
|
|
|
|
// 选中方向下拉
|
|
|
|
|
orientation_change(val) {
|
|
|
|
|
this.form.orientation = this.form_list.orientation_type.find(
|
|
|
|
|
(item) => item.dictLabel === val
|
|
|
|
|
).dictValue;
|
|
|
|
|
},
|
|
|
|
|
save() {
|
|
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
console.log('submit');
|
|
|
|
|
console.log("this.form_a", this.form); // 传给后台的表单数据
|
|
|
|
|
if (this.num === "1") {
|
|
|
|
|
addVideoList(this.form).then((res) => {
|
|
|
|
|
this.visible = false;
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.$message.success("新建数据成功");
|
|
|
|
|
// 新建数据成功后,表格刷新
|
|
|
|
|
this.$emit("refresh_video");
|
|
|
|
|
});
|
|
|
|
|
} else if (this.num === "5") {
|
|
|
|
|
changeVideoList(this.form).then((res) => {
|
|
|
|
|
this.visible = false;
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.$message.success("修改数据成功");
|
|
|
|
|
this.$emit("refresh_video");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning('请填入必填项')
|
|
|
|
|
this.$message.warning("请填入必填项");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|