From 804211973fb50e056e9fcfd9acd061807fdac810 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 14 Jun 2021 01:10:49 +0800 Subject: [PATCH] no message --- resources/assets/js/pages/manage.vue | 2 +- .../js/pages/manage/components/TaskDetail.vue | 149 +++++++++++++----- .../js/pages/manage/components/TaskRow.vue | 10 +- .../sass/pages/components/task-detail.scss | 15 +- 4 files changed, 130 insertions(+), 46 deletions(-) diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index dcc40c3a..a15d8d0d 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -107,7 +107,7 @@ :mask-closable="false" :styles="{ width: '90%', - maxWidth: projectOpenTask._dialog || projectOpenTask._msgText ? '1200px' : '640px' + maxWidth: projectOpenTask.dialog_id ? '1200px' : '640px' }" footer-hide> diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index 1f21312e..b63e34ff 100644 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -84,7 +84,7 @@ -
+
@@ -94,7 +94,34 @@

{{taskDetail.column_name}}

{{taskDetail.id}}

- + + + + +
+ {{$L('标记未完成')}} +
+
+ +
+ {{$L('完成')}} +
+
+ +
+ {{$L('归档')}} +
+
+ +
+ {{$L('删除')}} +
+
+
+
@@ -125,6 +152,7 @@
  • @@ -172,13 +200,13 @@
    --
    - +
    {{$L('协助人员')}}
    {{$L('确定')}}
-
+
+
--
- +
{{$L('截止时间')}}
@@ -219,7 +248,7 @@ @on-ok="timeOk" transfer>
-
{{cutTime}}
+
{{taskDetail.end_at ? cutTime : '--'}}
{{expiresFormat(taskDetail.end_at)}} {{$L('超期未完成')}}
@@ -245,11 +274,11 @@
- +
{{$L('子任务')}}
-
    +
    • -
      +
      + @command="dropAdd">
      {{$L('添加')}} @@ -342,14 +371,23 @@ export default { ownerData: {}, ownerLoad: 0, + assistForce: false, assistShow: false, assistData: {}, assistLoad: 0, + addsubForce: false, addsubShow: false, addsubName: "", addsubLoad: 0, + timeForce: false, + timeOpen: false, + timeValue: [], + timeOptions: { + shortcuts: [] + }, + nowTime: Math.round(new Date().getTime() / 1000), nowInterval: null, @@ -380,12 +418,6 @@ export default { valid_elements : 'a[href|target=_blank],em,strong/b,div[align],span[style],a,br,img[src|alt|witdh|height],pre[class],code', toolbar: 'uploadImages | uploadFiles | bold italic underline forecolor backcolor | codesample | preview screenload' }, - - timeOpen: false, - timeValue: [], - timeOptions: { - shortcuts: [] - }, } }, @@ -410,7 +442,7 @@ export default { if (!innerHeight) { return {}; } - if (!taskDetail._dialog) { + if (!taskDetail.dialog_id) { return {}; } return { @@ -423,7 +455,7 @@ export default { if (!innerHeight) { return {}; } - if (taskDetail._dialog || taskDetail._msgText) { + if (taskDetail.dialog_id) { return { minHeight: (innerHeight - 70 - 66 - 30) + 'px' } @@ -493,16 +525,9 @@ export default { name: '优先级', }); } - if (!($A.isArray(taskDetail.task_user) && taskDetail.task_user.find(({owner}) => owner === 1))) { - list.push({ - command: 'owner', - icon: '', - name: '负责人', - }); - } if (!($A.isArray(taskDetail.task_user) && taskDetail.task_user.find(({owner}) => owner !== 1))) { list.push({ - command: 'owner', + command: 'assist', icon: '', name: '协助人员', }); @@ -542,9 +567,14 @@ export default { }, 'openTask._show' (v) { if (v) { - this.$nextTick(this.$refs.input.focus) + this.$nextTick(() => { + this.$refs.input.focus() + }); } else { this.timeOpen = false; + this.timeForce = false; + this.assistForce = false; + this.addsubForce = false; } } }, @@ -653,14 +683,17 @@ export default { }, dropTask(command) { - if (command === 'complete') { - this.updateData('complete') - } - else if (command === 'uncomplete') { - this.updateData('uncomplete') - } - else if (command === 'delete') { - this.archivedOrRemoveTask('delete'); + switch (command) { + case 'complete': + this.updateData('complete') + break; + case 'uncomplete': + this.updateData('uncomplete') + break; + case 'archived': + case 'delete': + this.archivedOrRemoveTask(command); + break; } }, @@ -705,10 +738,11 @@ export default { }, archivedOrRemoveTask(type) { + let typeName = type == 'delete' ? '删除' : '归档'; let typeTitle = this.taskDetail.parent_id > 0 ? '子任务' : '任务'; $A.modalConfirm({ - title: '删除' + typeTitle, - content: '你确定要删除' + typeTitle + '【' + this.taskDetail.name + '】吗?', + title: typeName + typeTitle, + content: '你确定要' + typeName + typeTitle + '【' + this.taskDetail.name + '】吗?', loading: true, onOk: () => { if (this.taskDetail.loading === true) { @@ -867,7 +901,44 @@ export default { this.addsubLoad--; $A.modalError(msg); }); - } + }, + + dropAdd(command) { + switch (command) { + case 'priority': + this.$set(this.taskDetail, 'p_name', this.$L('未设置')); + this.$nextTick(() => { + this.$refs.priority.show(); + }) + break; + + case 'assist': + this.assistForce = true; + this.openAssist(); + this.$nextTick(() => { + this.$refs.assist.handleClick(); + }); + break; + + case 'times': + this.timeForce = true; + this.$nextTick(() => { + this.$refs.time.click() + }) + break; + + case 'file': + this.$refs.upload.handleClick(); + break; + + case 'subtask': + this.addsubForce = true; + this.$nextTick(() => { + this.addsubOpen(); + }); + break; + } + }, } } diff --git a/resources/assets/js/pages/manage/components/TaskRow.vue b/resources/assets/js/pages/manage/components/TaskRow.vue index 721f12ac..cc07373b 100644 --- a/resources/assets/js/pages/manage/components/TaskRow.vue +++ b/resources/assets/js/pages/manage/components/TaskRow.vue @@ -30,7 +30,7 @@ {{$L('完成')}}
      - +
      {{$L('归档')}}
      @@ -51,14 +51,14 @@
      {{item.name}}
      -
      - - {{item.sub_complete}}/{{item.sub_num}} -
      {{item.file_num}}
      {{item.msg_num}}
      +
      + + {{item.sub_complete}}/{{item.sub_num}} +
      {{item.column_name}}
      diff --git a/resources/assets/sass/pages/components/task-detail.scss b/resources/assets/sass/pages/components/task-detail.scss index d48ba699..4c2f0354 100644 --- a/resources/assets/sass/pages/components/task-detail.scss +++ b/resources/assets/sass/pages/components/task-detail.scss @@ -242,6 +242,8 @@ } .subtask-avatar { height: 26px; + line-height: 26px; + margin-top: -2px; cursor: pointer; } .ivu-icon-ios-loading { @@ -249,6 +251,15 @@ } } } + &.nosub { + margin-top: 0; + > li { + .add-input, + .add-button { + margin-top: 3px; + } + } + } } } .add { @@ -369,7 +380,7 @@ overflow: auto; .head { .menu { - margin-right: 0; + margin: 0 2px; } } } @@ -399,7 +410,9 @@ padding-left: 0; > p { margin-right: 28px; + cursor: pointer; &.active { + cursor: default; font-size: 18px; } }