mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
perf: 项目--删除任务查看详情页功能
This commit is contained in:
parent
849ac56296
commit
d38ccba618
@ -931,8 +931,9 @@ class ProjectController extends AbstractController
|
|||||||
//
|
//
|
||||||
$scopeAll = false;
|
$scopeAll = false;
|
||||||
if ($parent_id > 0) {
|
if ($parent_id > 0) {
|
||||||
ProjectTask::userTask($parent_id, str_replace(['all', 'yes', 'no'], [null, false, true], $archived));
|
ProjectTask::userTask($parent_id, str_replace(['all', 'yes', 'no'], [null, false, true], $archived), false, [], true);
|
||||||
$scopeAll = true;
|
$scopeAll = true;
|
||||||
|
$builder->withTrashed();
|
||||||
$builder->where('project_tasks.parent_id', $parent_id);
|
$builder->where('project_tasks.parent_id', $parent_id);
|
||||||
} elseif ($parent_id === -1) {
|
} elseif ($parent_id === -1) {
|
||||||
$builder->where('project_tasks.parent_id', 0);
|
$builder->where('project_tasks.parent_id', 0);
|
||||||
@ -1220,7 +1221,7 @@ class ProjectController extends AbstractController
|
|||||||
$task_id = intval(Request::input('task_id'));
|
$task_id = intval(Request::input('task_id'));
|
||||||
$archived = Request::input('archived', 'no');
|
$archived = Request::input('archived', 'no');
|
||||||
//
|
//
|
||||||
$task = ProjectTask::userTask($task_id, str_replace(['all', 'yes', 'no'], [null, false, true], $archived), false, ['taskUser', 'taskTag']);
|
$task = ProjectTask::userTask($task_id, str_replace(['all', 'yes', 'no'], [null, false, true], $archived), false, ['taskUser', 'taskTag'], true);
|
||||||
//
|
//
|
||||||
$data = $task->toArray();
|
$data = $task->toArray();
|
||||||
$data['project_name'] = $task->project?->name;
|
$data['project_name'] = $task->project?->name;
|
||||||
@ -1248,7 +1249,7 @@ class ProjectController extends AbstractController
|
|||||||
//
|
//
|
||||||
$task_id = intval(Request::input('task_id'));
|
$task_id = intval(Request::input('task_id'));
|
||||||
//
|
//
|
||||||
$task = ProjectTask::userTask($task_id, null);
|
$task = ProjectTask::userTask($task_id, null, false, [], true);
|
||||||
//
|
//
|
||||||
if (empty($task->content)) {
|
if (empty($task->content)) {
|
||||||
return Base::retSuccess('success', json_decode('{}'));
|
return Base::retSuccess('success', json_decode('{}'));
|
||||||
@ -1276,7 +1277,7 @@ class ProjectController extends AbstractController
|
|||||||
//
|
//
|
||||||
$task_id = intval(Request::input('task_id'));
|
$task_id = intval(Request::input('task_id'));
|
||||||
//
|
//
|
||||||
$task = ProjectTask::userTask($task_id, null);
|
$task = ProjectTask::userTask($task_id, null, false, [], true);
|
||||||
//
|
//
|
||||||
return Base::retSuccess('success', $task->taskFile);
|
return Base::retSuccess('success', $task->taskFile);
|
||||||
}
|
}
|
||||||
@ -1751,7 +1752,7 @@ class ProjectController extends AbstractController
|
|||||||
//
|
//
|
||||||
$task_id = intval(Request::input('task_id'));
|
$task_id = intval(Request::input('task_id'));
|
||||||
//
|
//
|
||||||
$projectTask = ProjectTask::select(['id', 'project_id', 'complete_at', 'flow_item_id', 'flow_item_name'])->find($task_id);
|
$projectTask = ProjectTask::select(['id', 'project_id', 'complete_at', 'flow_item_id', 'flow_item_name'])->withTrashed()->find($task_id);
|
||||||
if (empty($projectTask)) {
|
if (empty($projectTask)) {
|
||||||
return Base::retError('任务不存在', [ 'task_id' => $task_id ], -4002);
|
return Base::retError('任务不存在', [ 'task_id' => $task_id ], -4002);
|
||||||
}
|
}
|
||||||
@ -1932,7 +1933,7 @@ class ProjectController extends AbstractController
|
|||||||
//
|
//
|
||||||
$builder = ProjectLog::select(["*"]);
|
$builder = ProjectLog::select(["*"]);
|
||||||
if ($task_id > 0) {
|
if ($task_id > 0) {
|
||||||
$task = ProjectTask::userTask($task_id, null);
|
$task = ProjectTask::userTask($task_id, null,false,[],true);
|
||||||
$builder->whereTaskId($task->id);
|
$builder->whereTaskId($task->id);
|
||||||
} else {
|
} else {
|
||||||
$project = Project::userProject($project_id);
|
$project = Project::userProject($project_id);
|
||||||
|
|||||||
@ -107,7 +107,13 @@ export default {
|
|||||||
key: 'name',
|
key: 'name',
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
render: (h, {row}) => {
|
render: (h, {row}) => {
|
||||||
return h('AutoTip', row.name);
|
return h('AutoTip', {
|
||||||
|
on: {
|
||||||
|
'on-click': () => {
|
||||||
|
this.$store.dispatch("openTask", row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, row.name);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -143,6 +149,18 @@ export default {
|
|||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
const vNodes = [
|
const vNodes = [
|
||||||
|
h('span', {
|
||||||
|
style: {
|
||||||
|
fontSize: '13px',
|
||||||
|
cursor: 'pointer',
|
||||||
|
color: '#8bcf70',
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
'click': () => {
|
||||||
|
this.$store.dispatch("openTask", params.row);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}, this.$L('查看')),
|
||||||
h('Poptip', {
|
h('Poptip', {
|
||||||
props: {
|
props: {
|
||||||
title: this.$L('你确定要还原删除吗?'),
|
title: this.$L('你确定要还原删除吗?'),
|
||||||
@ -154,6 +172,7 @@ export default {
|
|||||||
fontSize: '13px',
|
fontSize: '13px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
color: '#8bcf70',
|
color: '#8bcf70',
|
||||||
|
marginLeft: "8px"
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
'on-ok': () => {
|
'on-ok': () => {
|
||||||
|
|||||||
@ -87,6 +87,9 @@
|
|||||||
<div v-if="taskDetail.archived_at" class="flow">
|
<div v-if="taskDetail.archived_at" class="flow">
|
||||||
<span class="archived" @click.stop="openMenu(taskDetail)">{{$L('已归档')}}</span>
|
<span class="archived" @click.stop="openMenu(taskDetail)">{{$L('已归档')}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="taskDetail.deleted_at" class="flow">
|
||||||
|
<span class="archived">{{$L('已删除')}}</span>
|
||||||
|
</div>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<p v-if="projectName"><span>{{projectName}}</span></p>
|
<p v-if="projectName"><span>{{projectName}}</span></p>
|
||||||
<p v-if="columnName"><span>{{columnName}}</span></p>
|
<p v-if="columnName"><span>{{columnName}}</span></p>
|
||||||
@ -383,16 +386,16 @@
|
|||||||
<div class="head">
|
<div class="head">
|
||||||
<Icon class="icon" type="ios-chatbubbles-outline" />
|
<Icon class="icon" type="ios-chatbubbles-outline" />
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<p :class="{active:navActive=='dialog'}" @click="navActive='dialog'">{{$L('聊天')}}</p>
|
<p :class="{active:navActive=='dialog'}" v-if="!taskDetail.deleted_at" @click="navActive='dialog'">{{$L('聊天')}}</p>
|
||||||
<p :class="{active:navActive=='log'}" @click="navActive='log'">{{$L('动态')}}</p>
|
<p :class="{active:navActive=='log' || taskDetail.deleted_at}" @click="navActive='log'">{{$L('动态')}}</p>
|
||||||
<div v-if="navActive=='log'" class="refresh">
|
<div v-if="navActive=='log' || taskDetail.deleted_at" class="refresh">
|
||||||
<Loading v-if="logLoadIng"/>
|
<Loading v-if="logLoadIng"/>
|
||||||
<Icon v-else type="ios-refresh" @click="getLogLists"></Icon>
|
<Icon v-else type="ios-refresh" @click="getLogLists"></Icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ProjectLog v-if="navActive=='log' && taskId > 0" ref="log" :task-id="taskDetail.id" :show-load="false" @on-load-change="logLoadChange"/>
|
<ProjectLog v-if="(navActive=='log' || taskDetail.deleted_at) && taskId > 0" ref="log" :task-id="taskDetail.id" :show-load="false" @on-load-change="logLoadChange"/>
|
||||||
<div v-else class="no-dialog"
|
<div v-else-if="!taskDetail.deleted_at" class="no-dialog"
|
||||||
@drop.prevent="taskPasteDrag($event, 'drag')"
|
@drop.prevent="taskPasteDrag($event, 'drag')"
|
||||||
@dragover.prevent="taskDragOver(true, $event)"
|
@dragover.prevent="taskDragOver(true, $event)"
|
||||||
@dragleave.prevent="taskDragOver(false, $event)">
|
@dragleave.prevent="taskDragOver(false, $event)">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user