取消
审核不通过
From 05adafd9e85432609ead0f2cc7e018e118019923 Mon Sep 17 00:00:00 2001
From: mk <2403457699@qq.com>
Date: Thu, 9 Mar 2023 16:54:57 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=94=99=E4=BA=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/modules/workSys/articleTag/edit.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/views/modules/workSys/articleTag/edit.vue b/src/views/modules/workSys/articleTag/edit.vue
index 7ef2b7397..c2bf1c85f 100644
--- a/src/views/modules/workSys/articleTag/edit.vue
+++ b/src/views/modules/workSys/articleTag/edit.vue
@@ -117,8 +117,9 @@ export default {
":" +
row.agencyList[0].orgIdPath.split(":")[1];
}
- } else if(row.agencyList.length == 0){
+ } else if(row.agencyList.length == 1){
this.endLoading();
+ console.log('走到这了吗');
this.formData.agencyId = row.agencyList[0].agencyId;
this.formData.orgIdPath = row.agencyList[0].orgIdPath;
}
From 1869377bf2eca622ecb03224d67c9b7426749943 Mon Sep 17 00:00:00 2001
From: mk <2403457699@qq.com>
Date: Thu, 9 Mar 2023 16:59:59 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E5=86=8D=E5=8A=A0=E4=B8=80=E4=B8=AA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/modules/workSys/articleTag/edit.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/views/modules/workSys/articleTag/edit.vue b/src/views/modules/workSys/articleTag/edit.vue
index c2bf1c85f..3dfd76d76 100644
--- a/src/views/modules/workSys/articleTag/edit.vue
+++ b/src/views/modules/workSys/articleTag/edit.vue
@@ -119,9 +119,10 @@ export default {
}
} else if(row.agencyList.length == 1){
this.endLoading();
- console.log('走到这了吗');
this.formData.agencyId = row.agencyList[0].agencyId;
this.formData.orgIdPath = row.agencyList[0].orgIdPath;
+ }else{
+ return
}
} else {
}
From f389a01fee6f92a489671344e01ef448947f74fa Mon Sep 17 00:00:00 2001
From: mk <2403457699@qq.com>
Date: Thu, 9 Mar 2023 22:47:45 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=8C=83=E5=9B=B4?=
=?UTF-8?q?=E5=A4=9A=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/modules/workSys/articleTag/edit.vue | 113 +++++++-----------
1 file changed, 41 insertions(+), 72 deletions(-)
diff --git a/src/views/modules/workSys/articleTag/edit.vue b/src/views/modules/workSys/articleTag/edit.vue
index 3dfd76d76..25f49d911 100644
--- a/src/views/modules/workSys/articleTag/edit.vue
+++ b/src/views/modules/workSys/articleTag/edit.vue
@@ -24,7 +24,6 @@
>
-
@@ -54,7 +53,6 @@
取 消
import { Loading } from "element-ui"; // 引入Loading服务
import { requestPost, requestGet } from "@/js/dai/request";
-
+import nextTick from "dai-js/tools/nextTick";
let loading; // 加载动画
export default {
data() {
@@ -76,11 +74,12 @@ export default {
formType: "add", //表单操作类型 add新增,edit编辑,detail详情
btnDisable: false,
orgOptions: [],
- agencyIdArray: [],
tagId: "",
+ sarr: [],
+ targetObj: {},
formData: {
tagName: "",
- agencyId: "",
+ agencyId: [],
orgIdPath: "",
},
formDatam: [],
@@ -105,24 +104,17 @@ export default {
this.startLoading();
this.formType = type;
if (type != "add") {
+ console.log(this.formData);
this.formData.tagName = row.tagName;
this.tagId = row.id;
- if (row.agencyList.length > 1) {
- this.formData.agencyId = row.agencyList[0].pid;
- if (row.agencyList[0].orgIdPath.split(":").length == 2) {
- this.formData.orgIdPath = row.agencyList[0].orgIdPath.split(":")[0];
- } else {
- this.formData.orgIdPath =
- row.agencyList[0].orgIdPath.split(":")[0] +
- ":" +
- row.agencyList[0].orgIdPath.split(":")[1];
+ this.formData.agencyId = [];
+
+ if (row.agencyList.length >= 1) {
+ for (let i in row.agencyList) {
+ this.formData.agencyId.push(row.agencyList[i].agencyId);
}
- } else if(row.agencyList.length == 1){
+ } else {
this.endLoading();
- this.formData.agencyId = row.agencyList[0].agencyId;
- this.formData.orgIdPath = row.agencyList[0].orgIdPath;
- }else{
- return
}
} else {
}
@@ -139,64 +131,26 @@ export default {
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.options = [];
- this.agencyIdArray.length = [];
this.orgOptions.push(data);
} else {
this.$message.error(msg);
}
this.dataListLoading = false;
},
- deepTree(arr) {
- if (Array.isArray(arr)) {
- return arr.map((item) => {
- return {
- ...item,
- subAgencyList:
- (item.subAgencyList.length > 0 &&
- this.deepTree(item.subAgencyList)) ||
- null,
- };
- });
- }
- },
- cascaderClick() {
- let obj = this.$refs["cascaderUnit"].getCheckedNodes()[0].data;
- this.formDatam = [];
- if (obj) {
- if (obj.level === "street") {
- for (let i in obj.subAgencyList) {
- this.formDatam.push({
- agencyId: obj.subAgencyList[i].agencyId,
- orgIdPath: obj.subAgencyList[i].orgIdPath,
- pid: obj.subAgencyList[i].pid,
- agencyName: obj.subAgencyList[i].agencyName,
- });
- }
- console.log(this.formDatam);
- } else if (obj.level === "district") {
- for (let i in obj.subAgencyList) {
- if (obj.subAgencyList[i].subAgencyList != null) {
- for (let j in obj.subAgencyList[i].subAgencyList) {
- this.formDatam.push({
- agencyId:obj.subAgencyList[i].subAgencyList[j].agencyId,
- orgIdPath:obj.subAgencyList[i].subAgencyList[j].orgIdPath,
- pid: obj.subAgencyList[i].pid,
- agencyName: obj.subAgencyList[i].subAgencyList[j].agencyName,
- });
- }
- }
+
+
+ getLastItem(list, vals, key) {
+ let LIST = list || [];
+ for (let item of LIST) {
+ // console.log(item[key]);
+ for (let i of vals) {
+ if (item[key] === i) {
+ this.sarr.push(item);
+ break;
+ } else {
+ this.getLastItem(item.subAgencyList, vals, key);
}
- console.log(this.formDatam);
- } else if (obj.level === "community") {
- this.formDatam.push({
- agencyId: obj.agencyId,
- orgIdPath: obj.orgIdPath,
- agencyName: obj.agencyName,
- pid: obj.pid
- });
}
- } else {
- this.formDatam = [];
}
},
handleComfirm() {
@@ -210,6 +164,21 @@ export default {
},
async addNat() {
+ this.newArr = [];
+ this.formDatam = [];
+ const map = new Map();
+ this.getLastItem(this.orgOptions, this.formData.agencyId, "agencyId");
+ this.newArr = this.sarr.filter(
+ (v) => !map.has(v.agencyId) && map.set(v.agencyId, 1)
+ );
+ for (let i in this.newArr) {
+ this.formDatam.push({
+ agencyId: this.newArr[i].agencyId,
+ orgIdPath: this.newArr[i].orgIdPath,
+ pid: this.newArr[i].pid,
+ agencyName: this.newArr[i].agencyName,
+ });
+ }
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;