From 07438fc947c69435c0296346dc0caa0c0a05e2a0 Mon Sep 17 00:00:00 2001 From: wuyize Date: Thu, 7 Jul 2022 21:29:30 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E9=A1=B9=E6=9F=A5=E8=AF=A2=E3=80=81=E6=B7=BB=E5=8A=A0=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/add.svg | 2 + src/assets/icons/edit.svg | 2 + src/components/CreateProjectDialog.vue | 2 +- src/views/OngoingProject.vue | 4 +- src/views/Project.vue | 36 +- src/views/ProjectWorkitem.vue | 505 +++++++++++++++++++++++-- 6 files changed, 517 insertions(+), 34 deletions(-) create mode 100644 src/assets/icons/add.svg create mode 100644 src/assets/icons/edit.svg diff --git a/src/assets/icons/add.svg b/src/assets/icons/add.svg new file mode 100644 index 0000000..4129555 --- /dev/null +++ b/src/assets/icons/add.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/edit.svg b/src/assets/icons/edit.svg new file mode 100644 index 0000000..00da47b --- /dev/null +++ b/src/assets/icons/edit.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/components/CreateProjectDialog.vue b/src/components/CreateProjectDialog.vue index 53793c6..54958ca 100644 --- a/src/components/CreateProjectDialog.vue +++ b/src/components/CreateProjectDialog.vue @@ -372,7 +372,7 @@ export default { method: 'post', data: form }).then(response => { - console.log(response) + //console.log(response) if (response.data.code === 200) { //console.log(response.data.data.records) //that.dialogFormVisible = false diff --git a/src/views/OngoingProject.vue b/src/views/OngoingProject.vue index 1ee29f0..1e2bdfb 100644 --- a/src/views/OngoingProject.vue +++ b/src/views/OngoingProject.vue @@ -23,8 +23,8 @@ diff --git a/src/views/Project.vue b/src/views/Project.vue index 2d3dc8c..f016f8e 100644 --- a/src/views/Project.vue +++ b/src/views/Project.vue @@ -49,7 +49,7 @@ this.$store.state.staff === null ? this.$store.state.staff : this.$store.state.staff.staffFullname }} {{ - staffJob + projectStaffPosition }} @@ -57,7 +57,7 @@ - + @@ -78,7 +78,9 @@ export default { project: { projectName: '' }, - staffJob: '项目经理', + projectGroup: [], + projectStaffPosition: '', + projectAccessLevel: 3, menuDefaultActive: '1', } }, @@ -95,8 +97,20 @@ export default { this.menuDefaultActive = '1'; break } - + const that = this + request({ + url: 'project/' + this.$route.params.projectId+'/group/'+this.$store.state.staff.staffId, + method: 'get', + }).then(response => { + if (response.data.code === 200) { + that.projectStaffPosition = response.data.data.projectStaffPosition + that.projectAccessLevel = response.data.data.projectAccessLevel + } + }).catch(function (error) { + console.log(error) + }) this.getProjectInfo(); + this.getProjectGroup() }, methods: { getProjectInfo() { @@ -113,6 +127,20 @@ export default { console.log(error) }) }, + getProjectGroup() { + const that = this + request({ + url: 'project/' + this.$route.params.projectId+'/group', + method: 'get' + + }).then(response => { + if (response.data.code === 200) { + that.projectGroup = response.data.data + } + }).catch(function (error) { + console.log(error) + }) + }, } } diff --git a/src/views/ProjectWorkitem.vue b/src/views/ProjectWorkitem.vue index d4f6e43..3928cad 100644 --- a/src/views/ProjectWorkitem.vue +++ b/src/views/ProjectWorkitem.vue @@ -12,10 +12,10 @@ ref="tableRef" class="projectTable" row-key="taskId" + @row-click="onRowClick" lazy :load="loadChildren" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" - @row-click="onRowClick" :height="tableHeight" :data="workitems">
-
+
@@ -41,56 +41,489 @@ - - + + - + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From aae647ae90dc76131da45c17d34807d40581ba29 Mon Sep 17 00:00:00 2001 From: wuyize Date: Thu, 7 Jul 2022 22:12:11 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E9=A1=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ProjectWorkitem.vue | 48 ++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/views/ProjectWorkitem.vue b/src/views/ProjectWorkitem.vue index 3928cad..367ab51 100644 --- a/src/views/ProjectWorkitem.vue +++ b/src/views/ProjectWorkitem.vue @@ -4,6 +4,44 @@

工作项

+ + +
+ +
+ +
+ 需求 +
+ +
+ +
+ 任务 +
+ +
+ +
+ 缺陷 +
+
+ + + +
@@ -56,7 +94,7 @@ - + @@ -133,12 +171,12 @@ > - + - + @@ -305,6 +343,8 @@ export default { (this.$store.state.staff&&row.taskHolderId===this.$store.state.staff.staffId)) }, onRowClick(row, column, event) { + if(column.property==="operations") + return this.form = { disabled: !row.editable, statusDisabled: this.statusDisabled(row), From a0a0da23d98c3e38e1b917a1930006d75579b2d6 Mon Sep 17 00:00:00 2001 From: wuyize Date: Thu, 7 Jul 2022 23:39:26 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E9=A1=B9=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/delete.svg | 2 + src/assets/icons/edit.svg | 2 +- src/views/ProjectWorkitem.vue | 78 ++++++++++++++++++++++++++++------- 3 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 src/assets/icons/delete.svg diff --git a/src/assets/icons/delete.svg b/src/assets/icons/delete.svg new file mode 100644 index 0000000..50d26f2 --- /dev/null +++ b/src/assets/icons/delete.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/edit.svg b/src/assets/icons/edit.svg index 00da47b..0b08836 100644 --- a/src/assets/icons/edit.svg +++ b/src/assets/icons/edit.svg @@ -1,2 +1,2 @@ \ No newline at end of file + \ No newline at end of file diff --git a/src/views/ProjectWorkitem.vue b/src/views/ProjectWorkitem.vue index 367ab51..1d827b2 100644 --- a/src/views/ProjectWorkitem.vue +++ b/src/views/ProjectWorkitem.vue @@ -39,7 +39,8 @@
@@ -147,11 +148,15 @@ (this.$store.state.staff&&scope.row.taskHolderId===this.$store.state.staff.staffId)))? 'unset':'hidden'}" text> - + - + + +
@@ -169,10 +174,10 @@ width="40%" top="60px" > - + - + @@ -248,7 +253,7 @@ - + @@ -271,7 +276,7 @@ - + @@ -339,15 +344,15 @@ export default { }, methods: { statusDisabled(row) { - return !(row.editable|| - (this.$store.state.staff&&row.taskHolderId===this.$store.state.staff.staffId)) + return !(row.editable || + (this.$store.state.staff && row.taskHolderId === this.$store.state.staff.staffId)) }, onRowClick(row, column, event) { - if(column.property==="operations") + if (column.property === "operations") return this.form = { disabled: !row.editable, - statusDisabled: this.statusDisabled(row), + statusDisabled: this.statusDisabled(row), title: '修改' + row.taskType, taskId: row.taskId, taskType: row.taskType, @@ -392,9 +397,9 @@ export default { taskEndTime: row.taskEndTime, taskDescription: row.taskDescription, taskId: row.taskId, - taskStatus:row.taskStatus, - taskCreatedTime:row.taskCreatedTime, - taskClosedTime:row.taskClosedTime + taskStatus: row.taskStatus, + taskCreatedTime: row.taskCreatedTime, + taskClosedTime: row.taskClosedTime } console.log(submitForm) const that = this @@ -456,19 +461,22 @@ export default { } console.log(submitForm) const that = this - if (this.form.operation==='add') { + if (this.form.operation === 'add') { request({ url: 'project/' + this.$route.params.projectId + '/task', method: 'post', data: submitForm }).then(response => { - console.log(response) + //console.log(response) if (response.data.code === 200) { if (submitForm.taskFatherId === 0) { that.getWorkitems() } else { + this.form.row.hasChildren = true let rtr = that.maps.get(submitForm.taskFatherId); + console.log(rtr) if (rtr) { + rtr.row.hasChildren = true rtr.treeNode.loading = true that.loadChildren(rtr.row, rtr.treeNode, rtr.resolve) } @@ -557,6 +565,7 @@ export default { }, onAddClick(row, taskType) { this.form = { + row: row, operation: 'add', title: '新增' + taskType, taskType: taskType, @@ -564,6 +573,41 @@ export default { } this.dialogVisible = true }, + onDeleteClick(row) { + const that = this + request({ + url: 'project/' + this.$route.params.projectId + '/task/' + row.taskId, + method: 'delete', + }).then(response => { + console.log(response) + if (response.data.code === 200) { + if (row.taskFatherId === 0) { + that.getWorkitems() + } else { + //console.log(that.$refs.tableRef.store.states.lazyTreeNodeMap) + if(that.$refs.tableRef.store.states.lazyTreeNodeMap.value[row.taskFatherId].length===1) + { + that.$refs.tableRef.store.states.lazyTreeNodeMap.value[row.taskFatherId] = [] + } + let rtr = that.maps.get(row.taskFatherId); + //console.log(rtr) + if (rtr) { + rtr.treeNode.loading = true + that.loadChildren(rtr.row, rtr.treeNode, rtr.resolve) + } + } + + ElMessage({ + message: '删除成功', + type: 'success', + }) + that.dialogVisible = false + } + }).catch(function (error) { + console.log(error) + }) + + }, getWorkitems() { const that = this; request({ @@ -594,6 +638,8 @@ export default { }).then(response => { if (response.data.code === 200) { let records = response.data.data.records + + const editable = row.editable || row.taskHolderId === this.$store.state.staff.staffId for (let workitem of records) { workitem['editable'] = editable From 2c69eb0462bd8bbaaf3698816c0b51a0aabbefaa Mon Sep 17 00:00:00 2001 From: wuyize Date: Fri, 8 Jul 2022 09:13:08 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E9=A1=B9=E9=83=A8=E5=88=86=E5=88=97=E7=9A=84=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ProjectWorkitem.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/ProjectWorkitem.vue b/src/views/ProjectWorkitem.vue index 1d827b2..5a3c16b 100644 --- a/src/views/ProjectWorkitem.vue +++ b/src/views/ProjectWorkitem.vue @@ -77,7 +77,7 @@
- +