From 15e017eda5d5e71218034b975a39025f8c2609f2 Mon Sep 17 00:00:00 2001
From: dearlin <1261008090@qq.com>
Date: Mon, 26 Feb 2024 16:42:30 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE=E5=9B=BE?=
=?UTF-8?q?=E5=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/request/map_settings.js | 3 +-
src/views/enterprise_management/user/add.vue | 4 +-
.../layer_settings/components/add.vue | 55 +++++++++++++++++++
3 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/src/request/map_settings.js b/src/request/map_settings.js
index a19aa2e..1bc157f 100644
--- a/src/request/map_settings.js
+++ b/src/request/map_settings.js
@@ -30,4 +30,5 @@ export const getPathPlanningList = (params) =>
export const setPathPlanningDelete = (params) =>
post("/positAlarm/coordinateLine/batchDelete", params); // 路径规划删除
export const setPositioning = (params) =>
- post("/videomanager/setPositioning", params); // 摆放摄像头
+ post("/videomanager/setPositioning", params); // 摆放摄像头
+export const setLayAdd = (params) => post("/positAlarm/save", params); // 新建图层
diff --git a/src/views/enterprise_management/user/add.vue b/src/views/enterprise_management/user/add.vue
index d5f60f4..bc2ea8d 100644
--- a/src/views/enterprise_management/user/add.vue
+++ b/src/views/enterprise_management/user/add.vue
@@ -529,10 +529,10 @@ const rules = {
{ required: true, message: "请选择入职日期", trigger: "change" },
],
CARDNO: [
- { required: false, message: "请输入定位卡号(4位纯数字)", trigger: "blur" },
+ { required: false, message: "请输入定位卡号", trigger: "blur" },
{
pattern: /^-?[0-9]\d*$/,
- message: "请输入正确的定位卡号(4位纯数字)",
+ message: "请输入正确的定位卡号",
trigger: "blur",
},
],
diff --git a/src/views/map_settings/layer_settings/components/add.vue b/src/views/map_settings/layer_settings/components/add.vue
index 58964b5..64b19d6 100644
--- a/src/views/map_settings/layer_settings/components/add.vue
+++ b/src/views/map_settings/layer_settings/components/add.vue
@@ -4,6 +4,29 @@
:title="type === 'add' ? '新增' : '修改'"
:on-close="fnClose"
>
+
+
+
+
+
+
+
+
+
+
+
+
关闭
保存
@@ -15,6 +38,10 @@
import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import { ElMessage } from "element-plus";
+import MapTools from "@/components/map_tools";
+import { reactive, ref } from "vue";
+import { setLayAdd } from "@/request/map_settings.js";
+import useFormValidate from "@/assets/js/useFormValidate.js";
const props = defineProps({
visible: {
@@ -28,14 +55,42 @@ const props = defineProps({
default: "",
},
});
+const data = reactive({
+ form: {
+ layName: "",
+ layGroup: "",
+ floor: "",
+ },
+});
+const formRef = ref(null);
const emits = defineEmits(["update:visible", "get-data"]);
+const rules = {
+ layName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
+ layGroup: [{ required: true, message: "分组不能为空", trigger: "blur" }],
+ floor: [{ required: true, message: "楼层不能为空", trigger: "blur" }],
+};
const { visible } = useVModels(props, emits);
const fnClose = () => {
+ positions.value = [];
+ modUuid.value = "";
+ formRef.value.resetFields();
visible.value = false;
};
+const positions = ref([]);
+const modUuid = ref("");
const fnSubmit = debounce(
1000,
async () => {
+ await useFormValidate(formRef);
+ if (positions.value.length === 0 || modUuid.value === "") {
+ ElMessage.error("未选择建筑,或者未扎点");
+ return;
+ }
+ await setLayAdd({
+ ...data.form,
+ list: JSON.stringify(positions.value),
+ modUuid: modUuid.value,
+ });
ElMessage.success("保存成功");
fnClose();
emits("get-data");