diff --git a/src/api/correlationEquipment/index.js b/src/api/correlationEquipment/index.js
index 00a86a1..6898d4b 100644
--- a/src/api/correlationEquipment/index.js
+++ b/src/api/correlationEquipment/index.js
@@ -47,4 +47,36 @@ export function addVideoList(params) {
method: 'get',
params
})
+}
+// 新增智能感应
+export function addPerceptionList(params) {
+ return request({
+ url: '/safety/tbDevicePerceptionInfo/insert',
+ method: 'get',
+ params
+ })
+}
+// 修改智能感应
+export function changePerceptionList(params) {
+ return request({
+ url: '/safety/tbDevicePerceptionInfo/update',
+ method: 'post',
+ params
+ })
+}
+// 导出视频监控
+export function exportVideo(params) {
+ return request({
+ url: '/safety/tbDeviceVideoInfo/export',
+ method: 'post',
+ params
+ })
+}
+// 导出智能感应
+export function exportPerception(params) {
+ return request({
+ url: '/safety/tbDevicePerceptionInfo/export',
+ method: 'post',
+ params
+ })
}
\ No newline at end of file
diff --git a/src/views/systemManagement/correlationEquipment/components/addPerceptionDialog.vue b/src/views/systemManagement/correlationEquipment/components/addPerceptionDialog.vue
index a425cba..60efde6 100644
--- a/src/views/systemManagement/correlationEquipment/components/addPerceptionDialog.vue
+++ b/src/views/systemManagement/correlationEquipment/components/addPerceptionDialog.vue
@@ -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"
>
-
+
-
-
+
@@ -46,13 +43,14 @@
-
+
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
-
+
@@ -169,11 +202,10 @@
@@ -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;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/views/systemManagement/correlationEquipment/components/addVideoDialog.vue b/src/views/systemManagement/correlationEquipment/components/addVideoDialog.vue
index a62c97d..b16d9fb 100644
--- a/src/views/systemManagement/correlationEquipment/components/addVideoDialog.vue
+++ b/src/views/systemManagement/correlationEquipment/components/addVideoDialog.vue
@@ -4,6 +4,7 @@
class="dialog"
:title="dialogTitle"
:visible.sync="visible"
+ @close="close()"
:close-on-click-modal="false"
width="970px"
>
@@ -32,6 +33,8 @@
+
+
diff --git a/src/views/systemManagement/correlationEquipment/components/deriveDialog.vue b/src/views/systemManagement/correlationEquipment/components/deriveDialog.vue
index 2c40e90..4396340 100644
--- a/src/views/systemManagement/correlationEquipment/components/deriveDialog.vue
+++ b/src/views/systemManagement/correlationEquipment/components/deriveDialog.vue
@@ -18,8 +18,15 @@