From 9ce7e3a357fadbeddb3132c6ac803f7ac68564ef Mon Sep 17 00:00:00 2001 From: zhengzhou Date: Thu, 13 May 2021 16:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E8=A7=A3=E9=99=A4=E4=BA=92=E9=93=BE?= =?UTF-8?q?=E6=B8=A0=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../link-project-info-modal/index.vue | 236 ++++++++++++++++++ src/views/main_web/index/index.vue | 81 ++++-- src/views/main_web/proj-item.vue | 12 +- src/views/main_web/proj-list.vue | 4 + 4 files changed, 315 insertions(+), 18 deletions(-) create mode 100644 src/components/link-project-info-modal/index.vue diff --git a/src/components/link-project-info-modal/index.vue b/src/components/link-project-info-modal/index.vue new file mode 100644 index 00000000..657729de --- /dev/null +++ b/src/components/link-project-info-modal/index.vue @@ -0,0 +1,236 @@ + + + + + + \ No newline at end of file diff --git a/src/views/main_web/index/index.vue b/src/views/main_web/index/index.vue index f5151462..493ecf77 100644 --- a/src/views/main_web/index/index.vue +++ b/src/views/main_web/index/index.vue @@ -108,7 +108,7 @@ @click.stop="createNewProjectClick" v-if="isUserPerm" >新建项目 - @@ -188,20 +204,24 @@ import { haveAccess, AccessCode } from "@/utils/access"; import * as prjService from "@/services/project"; import Timer from "@/views/main_web/time"; import ProjList from "@/views/main_web/proj-list"; -import IconTriangleCircle from "@/components/icon-triangle-circle"; +// import IconTriangleCircle from "@/components/icon-triangle-circle"; +import LinkProjectInfoModal from '@/components/link-project-info-modal'; import { debounce } from "lodash"; +import { wrapErrorHint } from '@/utils/request'; +import { notify } from '@/utils/tool'; export default { elNew: "#new", //样式ID,用于动画 components: { SearchBar, + LinkProjectInfoModal, // DistWork, // NewProj, // ProjSetting, Timer, AppHeader, ProjList, - IconTriangleCircle, + // IconTriangleCircle, }, data() { const { currentPlatform } = this.$store.state; @@ -228,8 +248,12 @@ export default { homeScrollTop: 0, contentBodyEl: null, //bigbody dom元素 - linkDialogVisible: false, - linkDialogContextData: null, + // linkDialogVisible: false, + // linkDialogContextData: null, + + pickedProject: {}, + linkProjectInfoModalVisible: false, + linkProjectId: undefined, }; }, computed: { @@ -402,12 +426,32 @@ export default { }, /* 互链邀请相关API */ - // 拒绝互链邀请 - async refuseLinkApply() { - const linkData = this.linkDialogContextData; - debugger; - // const res = await this.$fetchApi('projectLinkInvite/refuseProjectLinkInvite', { }); - + // + checkParentProject(projectItem) { + this.pickedProject = projectItem; + this.linkProjectInfoModalVisible = true; + this.linkProjectId = projectItem.ParentProjId; + }, + // 解除互链关系 + severNestProject() { + const pickedProject = this.pickedProject; + this.$confirm( + "解除互链不会影响双方项目的文件数据,解除后将无法进行文件交付,确定解除吗?", + { + confirmButtonText: "解除互链关系", + cancelButtonText: "取消", + type: "danger", + } + ) + .then(async () => { + const res = await this.$fetchApi('project/deleteProjectLink', { folderId: pickedProject.ParentFolderId, nestProjectId: pickedProject.Id }) + wrapErrorHint(res); + if(res.Code !== 0) { return; } + notify.success('互链关系已接触'); + this.linkProjectInfoModalVisible = false; + // this.fetchProjectDetail(); + this.listProjects(); + }); }, }, }; @@ -511,11 +555,11 @@ export default { &-list { padding: 0 32px + 30px; } - >div { + > div { &:first-child { flex: none; height: 30px; - color: #2896E6; + color: #2896e6; line-height: 30px; > span { margin-left: 10px; @@ -534,4 +578,7 @@ export default { } } } +.remove-button { + width: 100%; + } \ No newline at end of file diff --git a/src/views/main_web/proj-item.vue b/src/views/main_web/proj-item.vue index 871d512a..516e1326 100644 --- a/src/views/main_web/proj-item.vue +++ b/src/views/main_web/proj-item.vue @@ -24,7 +24,10 @@ - 删除 + 删除项目 + + + 查看上层互链项目 @@ -92,6 +95,9 @@ export default { manageProj() { this.$router.push("/newproject"); }, + checkParentProject() { + this.$emit('check-parent-project', this.projItem) + }, removeProject() { const projectName = this.projItem.ProjName; // 删除项目后所有文件将被置入回收站中,但您可在回收站操作拷贝转移,确定删除项目? @@ -203,6 +209,7 @@ export default { border-radius: 50%; background-color: #fff; color: #000; + } &_content { @@ -251,6 +258,9 @@ export default { transition: bottom 0.07s ease-in; } +.danger_button { + color: #f56c6c; +} .newprj_icon { width: 52px; height: 20px; diff --git a/src/views/main_web/proj-list.vue b/src/views/main_web/proj-list.vue index 5b444e03..d4cd22c4 100644 --- a/src/views/main_web/proj-list.vue +++ b/src/views/main_web/proj-list.vue @@ -31,6 +31,7 @@ @lookProjDetailClick="lookProjDetailClick(projItem)" @watchAllBtnClick="watchAllBtnClick(projItem, index)" @on-remove="onRemoveProject" + @check-parent-project="checkParentProject" :isUserPerm="isUserPerm" /> @@ -85,6 +86,9 @@ export default { onRemoveProject(projItem) { this.$emit('on-remove', projItem); }, + checkParentProject(projItem) { + this.$emit('check-parent-project', projItem) + }, // 点击了项目管理按钮 lookProjDetailClick(projItem) { this.$emit("lookProjDetailClick", projItem);