From 5e9638fba33dfc282fa975defadfe73ce9c757af Mon Sep 17 00:00:00 2001
From: Esacpe <1113279529@qq.com>
Date: Thu, 10 Jul 2025 18:27:50 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../myControl/components/addBkdx.vue | 37 ++++++++++++++-----
.../myControl/components/addPeo.vue | 2 +-
.../myControl/components/bkryDialod.vue | 12 +-----
3 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/src/views/backOfficeSystem/IntelligentControl/myControl/components/addBkdx.vue b/src/views/backOfficeSystem/IntelligentControl/myControl/components/addBkdx.vue
index 1b1f4bd..04a7637 100644
--- a/src/views/backOfficeSystem/IntelligentControl/myControl/components/addBkdx.vue
+++ b/src/views/backOfficeSystem/IntelligentControl/myControl/components/addBkdx.vue
@@ -17,7 +17,7 @@
-
+
新增
@@ -45,7 +45,7 @@
查看档案
- 删除
+ 删除
@@ -54,7 +54,7 @@
-
+
添加范围模型
@@ -148,7 +148,7 @@
-
+
@@ -174,6 +174,7 @@ const bkqyArr = ref([]); //布控区域
const { proxy } = getCurrentInstance();
const dialogForm = ref(false); //弹窗
const loading = ref(false)
+const addPerson = ref([]) //单独新增的数据
const listQuery = ref({
bkYz:'01',
bkdxList: [],
@@ -216,6 +217,7 @@ const disabled = ref(false)
// 初始化数据
const init = (type,row) => {
if(type == 'add'){
+ tableDate.tableConfiger.haveControls = true;
disabled.value = false;
const userInfo = getItem("userInfo");
listQuery.value.bkfqrXm = userInfo.userName;
@@ -225,8 +227,8 @@ const init = (type,row) => {
}
disabled.value = type == 'add' ? false : true;
dialogForm.value = true;
+ if(row) tableDate.tableConfiger.haveControls = false;
get_bkqy_list(row)
-
};
// 获取布控区域
@@ -251,14 +253,31 @@ const getDataById = (id) =>{
const shangeDx = () =>{
listQuery.value.bkdxList = [];
roleIds.value = [];
+ addPerson.value = []
}
+// 删除数据
+const deleteRow = (row) => {
+ roleIds.value = roleIds.value.filter(id => id != row.id);
+ addPerson.value = addPerson.value.filter(it => it.id != row.id);
+ listQuery.value.bkdxList = listQuery.value.bkdxList.filter(it => it.id != row.id);
+ console.log(row,'====');
+}
+// 单独新增的数据
+const choosedAdd = (item) =>{
+ let obj = { id:item.id, fjZp:item.fjZp, ryXm:item.ryXm, ryXb:item.ryXb, rySfzh:item.rySfzh, ryHjd:item.hjdXz, ryXjd:item.xzdXz, rySjhm:item.ryLxdh, qtXnsf:item.qtXnsf,clCjh:item.clCjh, clCph:item.clCph, qtTzms:item.qtTzms, bqList:item.bqList }
+ addPerson.value.push(obj) ;//缓存的数据
+ if(!listQuery.value.bkdxList) listQuery.value.bkdxList = [];
+ listQuery.value.bkdxList.unshift(obj);
+}
+
// 选择重点人
const choosed = (val) => {
if(listQuery.value.bkDx == '01'){// 人员
- roleIds.value = (val.filter(v => v.id)).map(it=>it.id);
- listQuery.value.bkdxList = val.map(item=>{
- return { fjZp:'', ryXm:item.ryXm, ryXb:item.ryXb, rySfzh:item.rySfzh, ryHjd:item.hjdXz, ryXjd:item.xzdXz, rySjhm:item.ryLxdh, qtXnsf:item.qtXnsf,clCjh:item.clCjh, clCph:item.clCph, qtTzms:'', bqList:item.bqList }
- });
+ roleIds.value = val.map(it=>it.id);
+ let arr = val.map(item=>{
+ return { id:item.id, fjZp:item.fjZp, ryXm:item.ryXm, ryXb:item.ryXb, rySfzh:item.rySfzh, ryHjd:item.hjdXz, ryXjd:item.xzdXz, rySjhm:item.ryLxdh, qtXnsf:item.qtXnsf,clCjh:item.clCjh, clCph:item.clCph, qtTzms:item.qtTzms, bqList:item.bqList }
+ })
+ listQuery.value.bkdxList = [...addPerson.value,...arr];
}else{// 群体
diff --git a/src/views/backOfficeSystem/IntelligentControl/myControl/components/addPeo.vue b/src/views/backOfficeSystem/IntelligentControl/myControl/components/addPeo.vue
index dac6d56..8d09f25 100644
--- a/src/views/backOfficeSystem/IntelligentControl/myControl/components/addPeo.vue
+++ b/src/views/backOfficeSystem/IntelligentControl/myControl/components/addPeo.vue
@@ -54,7 +54,6 @@ const rules = reactive({
xzdXz: [{ required: true, message: "请输入现居住地址", trigger: "blur" }],
})
const init = () =>{
-
showDialog.value = true;
}
@@ -74,6 +73,7 @@ const closeTag = (idx) =>{
const submitForm = () =>{
elform.value.submit((val)=>{
+ val.id = new Date().getTime()
emit('change',val)
showDialog.value = false;
})
diff --git a/src/views/backOfficeSystem/IntelligentControl/myControl/components/bkryDialod.vue b/src/views/backOfficeSystem/IntelligentControl/myControl/components/bkryDialod.vue
index 2ba2d0a..f61759d 100644
--- a/src/views/backOfficeSystem/IntelligentControl/myControl/components/bkryDialod.vue
+++ b/src/views/backOfficeSystem/IntelligentControl/myControl/components/bkryDialod.vue
@@ -140,17 +140,7 @@ const onComfirm = () => {
// 自定义加人
const changeZdy = (val) => {
- const userList = multipleSelectionUser.value;
- let list = [];
- let listId = [];
- userList.forEach((val) => {
- if (listId.indexOf(val.id) == -1) {
- list.push(val);
- listId.push(val.id);
- }
- });
- list.unshift(val)
- emits("choosed", list);
+ emits("choosedAdd", val);
closed();
}
/**