Explorar o código

request 修改2

zhuangyunsheng hai 1 ano
pai
achega
3b797f8537
Modificáronse 38 ficheiros con 313 adicións e 456 borrados
  1. 3 5
      src/App.vue
  2. 29 31
      src/api/workflow.js
  3. 4 6
      src/components/ReplyCard/dialog.vue
  4. 7 11
      src/components/ReplyCard/index.vue
  5. 3 5
      src/components/ReplyCard/tree/index.vue
  6. 4 6
      src/components/ReplyCard/tree/item.vue
  7. 3 5
      src/components/Upload/index.vue
  8. 3 9
      src/components/Upload/tableImport.vue
  9. 1 1
      src/layout/components/NavBar/components/MessageReminder.vue
  10. 0 1
      src/layout/components/SideBar/index.vue
  11. 12 16
      src/views/caseShare/dialog.vue
  12. 8 14
      src/views/caseShare/index.vue
  13. 7 9
      src/views/caseShare/strive.vue
  14. 1 2
      src/views/home/index.vue
  15. 5 7
      src/views/manage/policyShare/dialog.vue
  16. 9 16
      src/views/manage/policyShare/form.vue
  17. 5 9
      src/views/manage/policyShare/index.vue
  18. 2 4
      src/views/manage/policyStrive/index.vue
  19. 4 6
      src/views/manage/policyStrive/rewardDialog.vue
  20. 5 10
      src/views/manage/policyStrive/scoreDialog.vue
  21. 15 19
      src/views/myAffairs/case.vue
  22. 2 4
      src/views/myAffairs/component/done.vue
  23. 2 4
      src/views/myAffairs/component/send.vue
  24. 2 4
      src/views/myAffairs/component/toDo.vue
  25. 17 21
      src/views/myAffairs/share.vue
  26. 12 16
      src/views/myAffairs/strive.vue
  27. 13 19
      src/views/policyShare/dialog.vue
  28. 20 31
      src/views/policyShare/index.vue
  29. 2 4
      src/views/policyShare/message/index.vue
  30. 13 19
      src/views/policyStrive/dialog.vue
  31. 11 15
      src/views/policyStrive/explain.vue
  32. 19 27
      src/views/policyStrive/index.vue
  33. 2 4
      src/views/progress/component/share.vue
  34. 2 4
      src/views/publicDomain/index.vue
  35. 2 4
      src/views/publicDomain/link/strive.vue
  36. 39 58
      src/views/system/dataList.vue
  37. 0 1
      src/views/system/menu.vue
  38. 25 29
      src/views/system/role.vue

+ 3 - 5
src/App.vue

@@ -1,9 +1,7 @@
-<script setup>
-const route = useRoute()
-</script>
-
 <template>
-    <router-view />
+    <router-view></router-view>
 </template>
 
+<script setup></script>
+
 <style scoped></style>

+ 29 - 31
src/api/workflow.js

@@ -12,42 +12,40 @@ export default {
                     processInsId
                 }
             }).then(res => {
-                if (res.code == 200) {
-                    const { flow, process } = res.data;
-                    let flows = [];
-                    flow.forEach(item => {
-                        item.class = (!item.endTime && item.historyActivityType !== "candidate") ? "finish" : "";
-                        if (item.historyActivityType === "sequenceFlow") item.class = "lineWarn";
-                        else if (!item.class && item.historyActivityType !== "candidate") item.class = "success";
+                const { flow, process } = res.data;
+                let flows = [];
+                flow.forEach(item => {
+                    item.class = (!item.endTime && item.historyActivityType !== "candidate") ? "finish" : "";
+                    if (item.historyActivityType === "sequenceFlow") item.class = "lineWarn";
+                    else if (!item.class && item.historyActivityType !== "candidate") item.class = "success";
 
-                        if (item.comments && item.comments.find(c => c.action == "AddComment")) {
-                            const { type, fullMessage } = item.comments.find(c => c.action == "AddComment");
-                            if (type == "rollbackComment") {
-                                item.class = "error";
-                                item.desc = "驳回:" + fullMessage;
-                            }
-                            if (type == "comment") {
-                                item.class = "success";
-                                item.desc = "审批:" + fullMessage;
-                            }
+                    if (item.comments && item.comments.find(c => c.action == "AddComment")) {
+                        const { type, fullMessage } = item.comments.find(c => c.action == "AddComment");
+                        if (type == "rollbackComment") {
+                            item.class = "error";
+                            item.desc = "驳回:" + fullMessage;
                         }
+                        if (type == "comment") {
+                            item.class = "success";
+                            item.desc = "审批:" + fullMessage;
+                        }
+                    }
 
-                        const index = flows.findIndex(f => f.historyActivityId === item.historyActivityId)
-                        if (index !== -1) flows.splice(index, 1, item);
-                        else flows.push(item);
-                    });
-                    flows = flows.filter(f => f.class != "lineWarn");
+                    const index = flows.findIndex(f => f.historyActivityId === item.historyActivityId)
+                    if (index !== -1) flows.splice(index, 1, item);
+                    else flows.push(item);
+                });
+                flows = flows.filter(f => f.class != "lineWarn");
 
-                    if (flows[flows.length - 1].historyActivityType != "endEvent") {
-                        flows.push({
-                            class: "",
-                            historyActivityId: "Event_04wbnmn",
-                            historyActivityType: "endEvent"
-                        })
-                    }
+                if (flows[flows.length - 1].historyActivityType != "endEvent") {
+                    flows.push({
+                        class: "",
+                        historyActivityId: "Event_04wbnmn",
+                        historyActivityType: "endEvent"
+                    })
+                }
 
-                    resolve({ process, flows });
-                } else ElMessage.error(res.msg);
+                resolve({ process, flows });
             }).catch(() => reject())
         })
     }

+ 4 - 6
src/components/ReplyCard/dialog.vue

@@ -56,13 +56,11 @@ export default {
             if (!data.replyId) data["replyName"] = null;
 
             this.isSaving = true;
-            API.add(data).then(res => {
+            API.add(data).then(() => {
                 this.isSaving = false;
-                if (res.code === 200) {
-                    ElMessage.success("操作成功");
-                    this.visible = false;
-                    this.$emit("success", this.form.parentId);
-                } else ElMessage.error(res.msg);
+                ElMessage.success("操作成功");
+                this.visible = false;
+                this.$emit("success", this.form.parentId);
             }).catch(() => this.isSaving = false);
         }
     }

+ 7 - 11
src/components/ReplyCard/index.vue

@@ -86,11 +86,9 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.replyData = res.data.records;
-                    this.total = res.data.total;
-                    this.$emit("replySuccess")
-                } else ElMessage.error(res.msg);
+                this.replyData = res.data.records;
+                this.total = res.data.total;
+                this.$emit("replySuccess")
             }).catch(() => this.loading = false);
         },
 
@@ -104,13 +102,11 @@ export default {
                 }
 
                 this.isSaving = true;
-                API.add(data).then(res => {
+                API.add(data).then(() => {
                     this.isSaving = false;
-                    if (res.code === 200) {
-                        ElMessage.success("留言成功");
-                        this.messageContent = null;
-                        this.reloadTree();
-                    } else ElMessage.error(res.msg);
+                    ElMessage.success("留言成功");
+                    this.messageContent = null;
+                    this.reloadTree();
                 }).catch(() => this.isSaving = false);
             }
         },

+ 3 - 5
src/components/ReplyCard/tree/index.vue

@@ -70,11 +70,9 @@ export default {
             this.loading = true;
             API.get({ page: 1, size: this.pageSize, parentId: this.replyData.id, refId: this.replyData.refId, refType: this.replyData.refType }).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.replyData["childrenCount"] = res.data.total;
-                    this.replyData["children"] = res.data.records;
-                    this.$emit("updateCount", res.data.total);
-                } else ElMessage.error(res.msg);
+                this.replyData["childrenCount"] = res.data.total;
+                this.replyData["children"] = res.data.records;
+                this.$emit("updateCount", res.data.total);
             }).catch(() => this.loading = false);
         }
     }

+ 4 - 6
src/components/ReplyCard/tree/item.vue

@@ -66,12 +66,10 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.del({ ids: this.replyItem.id }).then(res => {
-                    if (res.code == 200) {
-                        ElMessage.success("操作成功");
-                        if (this.replyItem.parentId == 0) this.$emit("closeDialog");
-                        else this.$emit("success");
-                    } else ElMessage.error(res.msg);
+                API.del({ ids: this.replyItem.id }).then(() => {
+                    ElMessage.success("操作成功");
+                    if (this.replyItem.parentId == 0) this.$emit("closeDialog");
+                    else this.$emit("success");
                 });
             });
         }

+ 3 - 5
src/components/Upload/index.vue

@@ -105,9 +105,8 @@ export default {
             file.path = res.domain + "/" + res.name;
         },
 
-        error(message) {
+        error() {
             this.$emit("update:isUpload", false);
-            ElNotification.error({ title: "上传文件未成功", message });
         },
 
         beforeRemove({ id, name, fileName }) { // id, name, fileName
@@ -146,9 +145,8 @@ export default {
                 }
             }).then(res => {
                 this.$emit("update:isUpload", false);
-                if (res.code == 200) param.onSuccess({ ...res.data, fileType: param.file.type });
-                else param.onError(res.msg || "未知错误");
-            }).catch(err => param.onError(err));
+                param.onSuccess({ ...res.data, fileType: param.file.type });
+            }).catch(() => param.onError());
         }
     }
 }

+ 3 - 9
src/components/Upload/tableImport.vue

@@ -62,9 +62,8 @@ export default {
             this.$refs.uploader.clearFiles();
         },
 
-        error(message) {
+        error() {
             this.loading && this.loading.close();
-            message && ElNotification.error({ title: "导入文件未成功", message });
         },
 
         request(param) {
@@ -79,13 +78,8 @@ export default {
             data.append(param.filename, param.file);
             
             Folder.up(data).then(upRes => {
-                if (upRes.code == 200) {
-                    this.loading.setText("导入中请等待…");
-                    Folder.import(this.url, upRes.data.link).then(res => {
-                        if (res.code == 200) param.onSuccess(res.data);
-                        else param.onError(res.msg || "未知错误");
-                    }).catch(() => param.onError());
-                } else param.onError(upRes.msg || "未知错误");
+                this.loading.setText("导入中请等待…");
+                Folder.import(this.url, upRes.data.link).then(res => param.onSuccess(res.data)).catch(() => param.onError());
             }).catch(() => param.onError());
         }
     }

+ 1 - 1
src/layout/components/NavBar/components/MessageReminder.vue

@@ -26,7 +26,7 @@ onMounted(() => {
 
 getMessage();
 function getMessage() {
-    API.msg({ isRead: 0, createId: createId.value }).then(res => unReadCount.value = res.code === 200 && res.data.total || 0).catch(() => unReadCount.value = 0);
+    API.msg({ isRead: 0, createId: createId.value }).then(res => unReadCount.value = res.data.total).catch(() => unReadCount.value = 0);
 }
 
 function goTodo() {

+ 0 - 1
src/layout/components/SideBar/index.vue

@@ -3,7 +3,6 @@ import Logo from '../Logo/index.vue'
 import { useSettingStore } from '@/store/settings.js'
 import { usePermissionStore } from '@/store/permission.js'
 import sideBarItem from './sideBarItem.vue'
-import { watchEffect } from 'vue'
 
 const route = useRoute()
 const router = useRouter()

+ 12 - 16
src/views/caseShare/dialog.vue

@@ -154,16 +154,14 @@ export default {
 
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    for (const key in this.form) {
-                        if (key == "policyStrive") {
-                            for (const striveKey in this.form[key]) {
-                                if (striveKey == "fileList") this.form[key][striveKey] = res.data[key][striveKey].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                                else this.form[key][striveKey] = res.data[key][striveKey] || null;
-                            }
-                        } else this.form[key] = res.data[key] || null;
-                    }
-                } else ElMessage.error(res.msg);
+                for (const key in this.form) {
+                    if (key == "policyStrive") {
+                        for (const striveKey in this.form[key]) {
+                            if (striveKey == "fileList") this.form[key][striveKey] = res.data[key][striveKey].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                            else this.form[key][striveKey] = res.data[key][striveKey] || null;
+                        }
+                    } else this.form[key] = res.data[key] || null;
+                }
             });
         },
 
@@ -188,13 +186,11 @@ export default {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
                     this.isSaving = true;
-                    API[mode](this.form).then(res => {
+                    API[mode](this.form).then(() => {
                         this.isSaving = false;
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.$emit("success", mode);
-                        } else ElMessage.error(res.msg);
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.$emit("success", mode);
                     }).catch(() => this.isSaving = false);
                 } else {
                     return false;

+ 8 - 14
src/views/caseShare/index.vue

@@ -176,10 +176,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 
@@ -229,11 +227,9 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.del({ ids: row.id }).then(res => {
-                    if (res.code == 200) {
-                        ElMessage.success("操作成功");
-                        this.reloadTable();
-                    } else ElMessage.error(res.msg);
+                API.del({ ids: row.id }).then(() => {
+                    ElMessage.success("操作成功");
+                    this.reloadTable();
                 });
             });
         },
@@ -244,11 +240,9 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.withdraw(row).then(res => {
-                    if (res.code === 200) {
-                        ElMessage.success("操作成功");
-                        this.reloadTable();
-                    } else ElMessage.error(res.msg);
+                API.withdraw(row).then(() => {
+                    ElMessage.success("操作成功");
+                    this.reloadTable();
                 });
             });
         },

+ 7 - 9
src/views/caseShare/strive.vue

@@ -126,15 +126,13 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-
-                    if (this.striveId) { // 回显
-                        nextTick(() => this.$refs.selectStrive.toggleRowSelection(res.data.records.find(r => r.id == this.striveId)))
-                        this.selectData = Object.assign({}, res.data.records.find(r => r.id == this.striveId));
-                    }
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
+
+                if (this.striveId) { // 回显
+                    nextTick(() => this.$refs.selectStrive.toggleRowSelection(res.data.records.find(r => r.id == this.striveId)))
+                    this.selectData = Object.assign({}, res.data.records.find(r => r.id == this.striveId));
+                }
             }).catch(() => this.loading = false);
         },
 

+ 1 - 2
src/views/home/index.vue

@@ -130,8 +130,7 @@ export default {
             this.loading = true;
             Share.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) this.tableData = res.data.records;
-                else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
             }).catch(() => this.loading = false);
         },
 

+ 5 - 7
src/views/manage/policyShare/dialog.vue

@@ -54,14 +54,12 @@ export default {
             this.$refs.shareForm.$refs.formRef.validate(valid => {
                 if (valid) {
                     this.isSaving = true;
-                    API[mode](this.$refs.shareForm.form).then(res => {
+                    API[mode](this.$refs.shareForm.form).then(() => {
                         this.isSaving = false;
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.fileIsDel = false;
-                            this.$emit("success", mode);
-                        } else ElMessage.error(res.msg);
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.fileIsDel = false;
+                        this.$emit("success", mode);
                     }).catch(() => this.isSaving = false);
                 } else {
                     return false;

+ 9 - 16
src/views/manage/policyShare/form.vue

@@ -179,28 +179,21 @@ export default {
     methods: {
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    this.$emit("formSuccess", res.data);
-                    for (const key in this.form) {
-                        if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                        else if (key == "isInWh") this.form.isInWh = !!res.data[key] && res.data[key] || 0;
-                        else this.form[key] = res.data[key] || null;
-                    }
-                } else {
-                    ElMessage.error(res.msg);
-                    this.$emit("formError");
+                this.$emit("formSuccess", res.data);
+                for (const key in this.form) {
+                    if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                    else if (key == "isInWh") this.form.isInWh = !!res.data[key] && res.data[key] || 0;
+                    else this.form[key] = res.data[key] || null;
                 }
             }).catch(() => this.$emit("formError"));
         },
 
         getUserDept() {
             Common.getUserDept(userInfo.deptId).then(res => {
-                if (res.code === 200) {
-                    this.form.deptId = res.data.deptId;
-                    this.form.deptName = res.data.deptName;
-                    this.form.companyId = res.data.companyId;
-                    this.form.companyName = res.data.companyName;
-                }
+                this.form.deptId = res.data.deptId;
+                this.form.deptName = res.data.deptName;
+                this.form.companyId = res.data.companyId;
+                this.form.companyName = res.data.companyName;
             });
         }
     }

+ 5 - 9
src/views/manage/policyShare/index.vue

@@ -170,10 +170,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 
@@ -210,11 +208,9 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.del({ ids: row.id }).then(res => {
-                    if (res.code == 200) {
-                        ElMessage.success("操作成功");
-                        this.reloadTable();
-                    } else ElMessage.error(res.msg);
+                API.del({ ids: row.id }).then(() => {
+                    ElMessage.success("操作成功");
+                    this.reloadTable();
                 });
             });
         },

+ 2 - 4
src/views/manage/policyStrive/index.vue

@@ -161,10 +161,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 

+ 4 - 6
src/views/manage/policyStrive/rewardDialog.vue

@@ -80,13 +80,11 @@ export default {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
                     this.isSaving = true;
-                    API.updateById({ ...this.form, isReward: 1, partPersonArr: JSON.stringify(this.form.partPerson) }).then(res => {
+                    API.updateById({ ...this.form, isReward: 1, partPersonArr: JSON.stringify(this.form.partPerson) }).then(() => {
                         this.isSaving = false;
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.$emit("success");
-                        } else ElMessage.error(res.msg);
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.$emit("success");
                     }).catch(() => this.isSaving = false);
                 } else {
                     return false;

+ 5 - 10
src/views/manage/policyStrive/scoreDialog.vue

@@ -93,10 +93,7 @@ export default {
                 implementScore: !!this.form.implementScore && this.form.implementScore || 0,
                 promotionScore: !!this.form.promotionScore && this.form.promotionScore || 0,
                 striveScore: !!this.form.striveScore && this.form.striveScore || 0
-            }).then(res => {
-                if (res.code === 200) this.form.rewardScore = res.data != 0 && res.data || null;
-                else this.form.rewardScore = null;
-            }).catch(() => this.form.rewardScore = null);
+            }).then(res => this.form.rewardScore = res.data != 0 && res.data || null).catch(() => this.form.rewardScore = null);
         },
 
         // 表单提交方法
@@ -104,13 +101,11 @@ export default {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
                     this.isSaving = true;
-                    API.updateById({ ...this.form }).then(res => {
+                    API.updateById({ ...this.form }).then(() => {
                         this.isSaving = false;
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.$emit("success");
-                        } else ElMessage.error(res.msg);
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.$emit("success");
                     }).catch(() => this.isSaving = false);
                 } else {
                     return false;

+ 15 - 19
src/views/myAffairs/case.vue

@@ -159,19 +159,17 @@ export default {
 
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    for (const key in this.form) {
-                        if (key == "policyStrive") {
-                            for (const striveKey in this.form[key]) {
-                                if (striveKey == "fileList") this.form[key][striveKey] = res.data[key][striveKey].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                                else this.form[key][striveKey] = res.data[key][striveKey] || null;
-                            }
-                        } else this.form[key] = res.data[key] || null;
-                    }
-                    if (this.mode == "refuse") this.form["comment"] = "不同意";
-
-                    Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => this.form.processDefinitionId = workflowRes.process.processDefinitionId || null);
-                } else ElMessage.error(res.msg);
+                for (const key in this.form) {
+                    if (key == "policyStrive") {
+                        for (const striveKey in this.form[key]) {
+                            if (striveKey == "fileList") this.form[key][striveKey] = res.data[key][striveKey].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                            else this.form[key][striveKey] = res.data[key][striveKey] || null;
+                        }
+                    } else this.form[key] = res.data[key] || null;
+                }
+                if (this.mode == "refuse") this.form["comment"] = "不同意";
+
+                Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => this.form.processDefinitionId = workflowRes.process.processDefinitionId || null);
             });
         },
 
@@ -182,13 +180,11 @@ export default {
 
             Promise.all(promiseArray).then(() => {
                 this.isSaving = true;
-                API[this.mode](this.form).then(res => {
+                API[this.mode](this.form).then(() => {
                     this.isSaving = false;
-                    if (res.code === 200) {
-                        ElMessage.success("操作成功");
-                        this.visible = false;
-                        this.$emit("success");
-                    } else ElMessage.error(res.msg);
+                    ElMessage.success("操作成功");
+                    this.visible = false;
+                    this.$emit("success");
                 }).catch(() => this.isSaving = false);
             }).catch(() => false);
         }

+ 2 - 4
src/views/myAffairs/component/done.vue

@@ -134,10 +134,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
     

+ 2 - 4
src/views/myAffairs/component/send.vue

@@ -57,10 +57,8 @@ export default {
             this.loading = true;
             API.msg(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 

+ 2 - 4
src/views/myAffairs/component/toDo.vue

@@ -127,10 +127,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
     

+ 17 - 21
src/views/myAffairs/share.vue

@@ -193,20 +193,18 @@ export default {
 
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    for (const key in this.form) {
-                        if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                        else if (key == "isInWh") this.form.isInWh = !!res.data[key] && res.data[key] || 0;
-                        else this.form[key] = res.data[key] || null;
-                    }
-                    if (this.mode == "refuse") this.form["comment"] = "不同意";
-
-                    Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => {
-                        const { process, flows } = workflowRes;
-                        this.isLastApprover = flows.findIndex(f => f.historyActivityType == "candidate") == -1;
-                        this.form.processDefinitionId = process.processDefinitionId || null;
-                    });
-                } else ElMessage.error(res.msg);
+                for (const key in this.form) {
+                    if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                    else if (key == "isInWh") this.form.isInWh = !!res.data[key] && res.data[key] || 0;
+                    else this.form[key] = res.data[key] || null;
+                }
+                if (this.mode == "refuse") this.form["comment"] = "不同意";
+
+                Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => {
+                    const { process, flows } = workflowRes;
+                    this.isLastApprover = flows.findIndex(f => f.historyActivityType == "candidate") == -1;
+                    this.form.processDefinitionId = process.processDefinitionId || null;
+                });
             });
         },
   
@@ -217,14 +215,12 @@ export default {
 
             Promise.all(promiseArray).then(() => {
                 this.isSaving = true;
-                API[this.mode](this.form).then(res => {
+                API[this.mode](this.form).then(() => {
                     this.isSaving = false;
-                    if (res.code === 200) {
-                        ElMessage.success("操作成功");
-                        this.visible = false;
-                        this.fileIsDel = false;
-                        this.$emit("success");
-                    } else ElMessage.error(res.msg);
+                    ElMessage.success("操作成功");
+                    this.visible = false;
+                    this.fileIsDel = false;
+                    this.$emit("success");
                 }).catch(() => this.isSaving = false);
             }).catch(() => false);
         }

+ 12 - 16
src/views/myAffairs/strive.vue

@@ -194,15 +194,13 @@ export default {
 
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    for (const key in this.form) {
-                        if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                        else this.form[key] = res.data[key] || null;
-                    }
-                    if (this.mode == "refuse") this.form["comment"] = "不同意";
-
-                    Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => this.form.processDefinitionId = workflowRes.process.processDefinitionId || null);
-                } else ElMessage.error(res.msg);
+                for (const key in this.form) {
+                    if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                    else this.form[key] = res.data[key] || null;
+                }
+                if (this.mode == "refuse") this.form["comment"] = "不同意";
+
+                Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => this.form.processDefinitionId = workflowRes.process.processDefinitionId || null);
             });
         },
 
@@ -213,14 +211,12 @@ export default {
 
             Promise.all(promiseArray).then(() => {
                 this.isSaving = true;
-                API[this.mode](this.form).then(res => {
+                API[this.mode](this.form).then(() => {
                     this.isSaving = false;
-                    if (res.code === 200) {
-                        ElMessage.success("操作成功");
-                        this.visible = false;
-                        this.fileIsDel = false;
-                        this.$emit("success");
-                    } else ElMessage.error(res.msg);
+                    ElMessage.success("操作成功");
+                    this.visible = false;
+                    this.fileIsDel = false;
+                    this.$emit("success");
                 }).catch(() => this.isSaving = false);
             }).catch(() => false);
         }

+ 13 - 19
src/views/policyShare/dialog.vue

@@ -152,23 +152,19 @@ export default {
 
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    for (const key in this.form) {
-                        if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                        else this.form[key] = res.data[key] || null;
-                    }
-                } else ElMessage.error(res.msg);
+                for (const key in this.form) {
+                    if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                    else this.form[key] = res.data[key] || null;
+                }
             });
         },
 
         getUserDept() {
             Common.getUserDept(userInfo.deptId).then(res => {
-                if (res.code === 200) {
-                    this.form.deptId = res.data.deptId;
-                    this.form.deptName = res.data.deptName;
-                    this.form.companyId = res.data.companyId;
-                    this.form.companyName = res.data.companyName;
-                }
+                this.form.deptId = res.data.deptId;
+                this.form.deptName = res.data.deptName;
+                this.form.companyId = res.data.companyId;
+                this.form.companyName = res.data.companyName;
             });
         },
 
@@ -177,14 +173,12 @@ export default {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
                     this.isSaving = true;
-                    API[mode](this.form).then(res => {
+                    API[mode](this.form).then(() => {
                         this.isSaving = false;
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.fileIsDel = false;
-                            this.$emit("success", mode);
-                        } else ElMessage.error(res.msg);
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.fileIsDel = false;
+                        this.$emit("success", mode);
                     }).catch(() => this.isSaving = false);
                 } else {
                     return false;

+ 20 - 31
src/views/policyShare/index.vue

@@ -217,10 +217,7 @@ export default {
         },
 
         getDeptTree() {
-            getMainList().then(res => {
-                if (res.code === 200) this.deptQuery.data = res.data;
-                else ElMessage.error(res.msg);
-            });
+            getMainList().then(res => this.deptQuery.data = res.data);
         },
 
         reloadTable(mode = "add") {
@@ -231,10 +228,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 
@@ -267,19 +262,17 @@ export default {
 
         download_temp() {
             Temp.get({ refType: "policy_share" }).then(res => {
-                if (res.code === 200) {
-                    if (!res.data.records[0]) ElMessage.warning("暂无模版,请联系管理员");
-                    else {
-                        const { templateName, templateUrl } = res.data.records[0];
-                        Folder.download(templateUrl).then(res => {
-                            const a = document.createElement("a");
-                            const blob = new Blob([res.data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
-                            a.download = templateName;
-                            a.href = URL.createObjectURL(blob);
-                            a.click();
-                        });
-                    }
-                }else ElMessage.error(res.msg);
+                if (!res.data.records[0]) ElMessage.warning("暂无模版,请联系管理员");
+                else {
+                    const { templateName, templateUrl } = res.data.records[0];
+                    Folder.download(templateUrl).then(res => {
+                        const a = document.createElement("a");
+                        const blob = new Blob([res.data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
+                        a.download = templateName;
+                        a.href = URL.createObjectURL(blob);
+                        a.click();
+                    });
+                }
             });
         },
 
@@ -310,11 +303,9 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.del({ ids: row.id }).then(res => {
-                    if (res.code == 200) {
-                        ElMessage.success("操作成功");
-                        this.reloadTable();
-                    } else ElMessage.error(res.msg);
+                API.del({ ids: row.id }).then(() => {
+                    ElMessage.success("操作成功");
+                    this.reloadTable();
                 });
             });
         },
@@ -325,11 +316,9 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.withdraw(row).then(res => {
-                    if (res.code === 200) {
-                        ElMessage.success("操作成功");
-                        this.reloadTable();
-                    } else ElMessage.error(res.msg);
+                API.withdraw(row).then(() => {
+                    ElMessage.success("操作成功");
+                    this.reloadTable();
                 });
             });
         },

+ 2 - 4
src/views/policyShare/message/index.vue

@@ -153,10 +153,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 

+ 13 - 19
src/views/policyStrive/dialog.vue

@@ -183,23 +183,19 @@ export default {
 
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    for (const key in this.form) {
-                        if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                        else this.form[key] = res.data[key] || null;
-                    }
-                } else ElMessage.error(res.msg);
+                for (const key in this.form) {
+                    if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                    else this.form[key] = res.data[key] || null;
+                }
             });
         },
 
         getUserDept() {
             Common.getUserDept(userInfo.deptId).then(res => {
-                if (res.code === 200) {
-                    this.form.deptId = res.data.deptId;
-                    this.form.deptName = res.data.deptName;
-                    this.form.companyId = res.data.companyId;
-                    this.form.companyName = res.data.companyName;
-                }
+                this.form.deptId = res.data.deptId;
+                this.form.deptName = res.data.deptName;
+                this.form.companyId = res.data.companyId;
+                this.form.companyName = res.data.companyName;
             });
         },
 
@@ -208,14 +204,12 @@ export default {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
                     this.isSaving = true;
-                    API[mode](this.form).then(res => {
+                    API[mode](this.form).then(() => {
                         this.isSaving = false;
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.fileIsDel = false;
-                            this.$emit("success", mode);
-                        } else ElMessage.error(res.msg);
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.fileIsDel = false;
+                        this.$emit("success", mode);
                     }).catch(() => this.isSaving = false);
                 } else {
                     return false;

+ 11 - 15
src/views/policyStrive/explain.vue

@@ -218,15 +218,13 @@ export default {
 
         setData(id) {
             API.detail(id).then(res => {
-                if (res.code === 200) {
-                    for (const key in this.form) {
-                        if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                        else if (key == "isLand") this.form[key] = !!res.data[key] && res.data[key] || 0;
-                        else if (key == "sjFinishTime") this.form[key] = res.data[key] || moment().format("YYYY-MM-DD");
-                        else if (key == "partPerson") this.form[key] = res.data["partPersonArr"] && JSON.parse(res.data["partPersonArr"]).map(item => item.name).join() || null;
-                        else this.form[key] = res.data[key] || null;
-                    }
-                } else ElMessage.error(res.msg);
+                for (const key in this.form) {
+                    if (key == "fileList") this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                    else if (key == "isLand") this.form[key] = !!res.data[key] && res.data[key] || 0;
+                    else if (key == "sjFinishTime") this.form[key] = res.data[key] || moment().format("YYYY-MM-DD");
+                    else if (key == "partPerson") this.form[key] = res.data["partPersonArr"] && JSON.parse(res.data["partPersonArr"]).map(item => item.name).join() || null;
+                    else this.form[key] = res.data[key] || null;
+                }
             });
         },
 
@@ -236,13 +234,11 @@ export default {
                 if (valid) {
                     this.isSaving = true;
                     const partPersonArr = this.form.partPerson && JSON.stringify(this.form.partPerson.replace(/,/g, ",").split(",").map(name => ({ name }))) || "";
-                    API.updateById({ ...this.form, partPersonArr }).then(res => {
+                    API.updateById({ ...this.form, partPersonArr }).then(() => {
                         this.isSaving = false;
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.$emit("success");
-                        } else ElMessage.error(res.msg);
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.$emit("success");
                     }).catch(() => this.isSaving = false);
                 } else {
                     return false;

+ 19 - 27
src/views/policyStrive/index.vue

@@ -214,10 +214,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 
@@ -234,19 +232,17 @@ export default {
 
         download_temp(refType) {
             Temp.get({ refType }).then(res => {
-                if (res.code === 200) {
-                    if (!res.data.records[0]) ElMessage.warning("暂无模版,请联系管理员");
-                    else {
-                        const { templateName, templateUrl } = res.data.records[0];
-                        Folder.download(templateUrl).then(res => {
-                            const a = document.createElement("a");
-                            const blob = new Blob([res.data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
-                            a.download = templateName;
-                            a.href = URL.createObjectURL(blob);
-                            a.click();
-                        });
-                    }
-                } else ElMessage.error(res.msg);
+                if (!res.data.records[0]) ElMessage.warning("暂无模版,请联系管理员");
+                else {
+                    const { templateName, templateUrl } = res.data.records[0];
+                    Folder.download(templateUrl).then(res => {
+                        const a = document.createElement("a");
+                        const blob = new Blob([res.data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
+                        a.download = templateName;
+                        a.href = URL.createObjectURL(blob);
+                        a.click();
+                    });
+                }
             });
         },
 
@@ -284,11 +280,9 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.del({ ids: row.id }).then(res => {
-                    if (res.code == 200) {
-                        ElMessage.success("操作成功");
-                        this.reloadTable();
-                    } else ElMessage.error(res.msg);
+                API.del({ ids: row.id }).then(() => {
+                    ElMessage.success("操作成功");
+                    this.reloadTable();
                 });
             });
         },
@@ -299,11 +293,9 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API.withdraw(row).then(res => {
-                    if (res.code === 200) {
-                        ElMessage.success("操作成功");
-                        this.reloadTable();
-                    } else ElMessage.error(res.msg);
+                API.withdraw(row).then(() => {
+                    ElMessage.success("操作成功");
+                    this.reloadTable();
                 });
             });
         },

+ 2 - 4
src/views/progress/component/share.vue

@@ -42,10 +42,8 @@ export default {
             this.loading = true;
             API.progress.share(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 

+ 2 - 4
src/views/publicDomain/index.vue

@@ -133,10 +133,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 

+ 2 - 4
src/views/publicDomain/link/strive.vue

@@ -133,10 +133,8 @@ export default {
             this.loading = true;
             API.get(this.params).then(res => {
                 this.loading = false;
-                if (res.code === 200) {
-                    this.tableData = res.data.records;
-                    this.total = res.data.total;
-                } else ElMessage.error(res.msg);
+                this.tableData = res.data.records;
+                this.total = res.data.total;
             }).catch(() => this.loading = false);
         },
 

+ 39 - 58
src/views/system/dataList.vue

@@ -250,24 +250,22 @@ function getList() {
     tableLoading.value = true
     getMainList({ systemCode: 10001 }).then(res => {
         tableLoading.value = false
-        if (res.code === 200) {
-            if (res.data.length && res.data[0].children) {
-                const array = []
-                res.data[0].children.forEach((item) => {
-                    if (item.menuType === 3) {
-                        array.push(item)
-                    }
-                })
-                res.data = array
-            }
-            allTableData.value = res.data || []
-            tableData.value = JSON.parse(JSON.stringify(res.data)).map(item => {
+        if (res.data.length && res.data[0].children) {
+            const array = []
+            res.data[0].children.forEach((item) => {
+                if (item.menuType === 3) {
+                    array.push(item)
+                }
+            })
+            res.data = array
+        }
+        allTableData.value = res.data || []
+        tableData.value = JSON.parse(JSON.stringify(res.data)).map(item => {
                 item.hasChildren = item.children && item.children.length > 0
                 item.children = null
                 item.idList = [item.id]
                 return item
             })
-        }
     }).catch(() => {
         tableLoading.value = false
     })
@@ -275,22 +273,18 @@ function getList() {
 
 function getSubList() {
     getPowerList({ menuId: currentRow.value.id, ...params.value }).then(res => {
-        if (res.code === 200) {
-            powerData.value = res.data.records
-            total.value = res.data.total
-            drawerShow.value = true
-        }
+        powerData.value = res.data.records
+        total.value = res.data.total
+        drawerShow.value = true
     })
 }
 
 function currentChange(e) {
     params.value.page = e
     getPowerList({ menuId: currentRow.value.id, ...params.value }).then(res => {
-        if (res.code === 200) {
-            powerData.value = res.data.records
-            total.value = res.data.total
-            drawerShow.value = true
-        }
+        powerData.value = res.data.records
+        total.value = res.data.total
+        drawerShow.value = true
     })
 }
 
@@ -298,11 +292,9 @@ function editItem(row) {
     console.log(row)
     currentRow.value = row
     getPowerList({ menuId: row.id, current: params.value.page, size: params.value.size }).then(res => {
-        if (res.code === 200) {
-            powerData.value = res.data.records
-            total.value = res.data.total
-            drawerShow.value = true
-        }
+        powerData.value = res.data.records
+        total.value = res.data.total
+        drawerShow.value = true
     })
 }
 
@@ -364,15 +356,13 @@ function submitForm() {
                     ...form.value
                 }
                 scopeUpdate(params).then(res => {
-                    if (res.code === 200) {
-                        ElMessage({
-                            message: '修改成功',
-                            type: 'success'
-                        })
-                        dialogShow.value = false
-                        resetForm()
-                        getSubList()
-                    }
+                    ElMessage({
+                        message: '修改成功',
+                        type: 'success'
+                    })
+                    dialogShow.value = false
+                    resetForm()
+                    getSubList()
                 })
             } else {
                 console.log('新增表单')
@@ -381,15 +371,13 @@ function submitForm() {
                     ...form.value
                 }
                 scopeSave(params).then(res => {
-                    if (res.code === 200) {
-                        ElMessage({
-                            message: '新增成功',
-                            type: 'success'
-                        })
-                        dialogShow.value = false
-                        resetForm()
-                        getSubList()
-                    }
+                    ElMessage({
+                        message: '新增成功',
+                        type: 'success'
+                    })
+                    dialogShow.value = false
+                    resetForm()
+                    getSubList()
                 })
             }
         }
@@ -408,18 +396,11 @@ function deletePower(row) {
         type: 'warning'
     }).then(() => {
         scopeRemove({ ids: row.id }).then(res => {
-            if (res.code === 200) {
-                ElMessage({
-                    message: '删除成功',
-                    type: 'success'
-                })
-                getSubList()
-            } else {
-                ElMessage({
-                    message: res.msg,
-                    type: 'warning'
-                })
-            }
+            ElMessage({
+                message: '删除成功',
+                type: 'success'
+            })
+            getSubList()
         })
     })
 }

+ 0 - 1
src/views/system/menu.vue

@@ -352,7 +352,6 @@ function formatQuery(data) {
             break;
         }
     }
-    console.log(isAccord)
     return isAccord
 }
 

+ 25 - 29
src/views/system/role.vue

@@ -352,38 +352,35 @@ function sendPermissions(row) {
 
     //获取菜单树
     getMenuTree().then(res => {
-        if (res.code === 200) {
-            treeData.value = res.data
-            //获取角色菜单树
-            getRoleMenuTree(row.id).then(resp => {
-                checkedMenuKeys.value = []
-                if (!resp.data.length) {
-                    proxy.$refs["treeRef"] && proxy.$refs["treeRef"].setCheckedNodes(checkedMenuKeys.value, false)
-                    sendShow.value = true
-                } else {
-                    //
-                    let keys = []
-                    for (let li of resp.data) {
-                        keys.push(li.id)
-                    }
-                    // //解决
-                    // //首先拿到 树形数据 所有的最深层的节点
-                    let lastKeys = deepList([], treeData.value[0].children)
-                    // //拿着接口返回的选中的 去所有深层节点查找  取交集  就是 最终选中的
-                    checkedMenuKeys.value = [...new Set(lastKeys)].filter(item => {
-                        return keys.includes(item)
-                    })
-                    sendShow.value = true
+        treeData.value = res.data
+        //获取角色菜单树
+        getRoleMenuTree(row.id).then(resp => {
+            checkedMenuKeys.value = []
+            if (!resp.data.length) {
+                proxy.$refs["treeRef"] && proxy.$refs["treeRef"].setCheckedNodes(checkedMenuKeys.value, false)
+                sendShow.value = true
+            } else {
+                //
+                let keys = []
+                for (let li of resp.data) {
+                    keys.push(li.id)
                 }
-            })
-        }
+                // //解决
+                // //首先拿到 树形数据 所有的最深层的节点
+                let lastKeys = deepList([], treeData.value[0].children)
+                // //拿着接口返回的选中的 去所有深层节点查找  取交集  就是 最终选中的
+                checkedMenuKeys.value = [...new Set(lastKeys)].filter(item => {
+                    return keys.includes(item)
+                })
+                sendShow.value = true
+            }
+        })
     })
 
     // getPortTree().then(res => {
-    //     if (res.code === 200) {
-    //         treeData2.value = res.data
-    //         //获取角色接口菜单树
-    //         getRolePortTree(row.id).then(resp => {
+    //     treeData2.value = res.data
+    //     //获取角色接口菜单树
+    //     getRolePortTree(row.id).then(resp => {
     //             checkedMenuKeys2.value = []
     //             if (!resp.data.length) {
     //                 proxy.$refs["treeRef2"].setCheckedNodes(checkedMenuKeys2.value, false)
@@ -406,7 +403,6 @@ function sendPermissions(row) {
     //                 sendShow.value = true
     //             }
     //         })
-    //     }
     // })
 }