mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-16 22:22:49 +00:00
no message
This commit is contained in:
parent
22862edc13
commit
2468f7acb2
@ -245,7 +245,6 @@ class ProjectController extends AbstractController
|
|||||||
foreach ($sort as $item) {
|
foreach ($sort as $item) {
|
||||||
if (!is_array($item)) continue;
|
if (!is_array($item)) continue;
|
||||||
if (!intval($item['id'])) continue;
|
if (!intval($item['id'])) continue;
|
||||||
if (!is_array($item['task'])) continue;
|
|
||||||
ProjectColumn::whereId($item['id'])->whereProjectId($project->id)->update([
|
ProjectColumn::whereId($item['id'])->whereProjectId($project->id)->update([
|
||||||
'sort' => $index
|
'sort' => $index
|
||||||
]);
|
]);
|
||||||
@ -475,8 +474,8 @@ class ProjectController extends AbstractController
|
|||||||
$column->sort = intval(ProjectColumn::whereProjectId($project->id)->orderByDesc('sort')->value('sort')) + 1;
|
$column->sort = intval(ProjectColumn::whereProjectId($project->id)->orderByDesc('sort')->value('sort')) + 1;
|
||||||
$column->save();
|
$column->save();
|
||||||
//
|
//
|
||||||
$data = $column->toArray();
|
$data = $column->find($column->id);
|
||||||
$data['project_task'] = [];
|
$data->project_task = [];
|
||||||
return Base::retSuccess('添加成功', $data);
|
return Base::retSuccess('添加成功', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -655,22 +654,28 @@ class ProjectController extends AbstractController
|
|||||||
return Base::retError('项目不存在或不在成员列表内');
|
return Base::retError('项目不存在或不在成员列表内');
|
||||||
}
|
}
|
||||||
// 列表
|
// 列表
|
||||||
|
$column = null;
|
||||||
|
$newColumn = null;
|
||||||
if (is_array($column_id)) {
|
if (is_array($column_id)) {
|
||||||
$column_id = Base::arrayFirst($column_id);
|
$column_id = Base::arrayFirst($column_id);
|
||||||
}
|
}
|
||||||
if (empty($column_id)) {
|
if ($column_id) {
|
||||||
$column = $project->projectColumn->first();
|
if (intval($column_id) > 0) {
|
||||||
} elseif (intval($column_id) > 0) {
|
$column = $project->projectColumn->find($column_id);
|
||||||
$column = $project->projectColumn->where('id', $column_id)->first();
|
|
||||||
} else {
|
|
||||||
$column = ProjectColumn::whereProjectId($project->id)->whereName($column_id)->first();
|
|
||||||
if (empty($column)) {
|
|
||||||
$column = ProjectColumn::createInstance([
|
|
||||||
'project_id' => $project->id,
|
|
||||||
'name' => $column_id,
|
|
||||||
]);
|
|
||||||
$column->save();
|
|
||||||
}
|
}
|
||||||
|
if (empty($column)) {
|
||||||
|
$column = ProjectColumn::whereProjectId($project->id)->whereName($column_id)->first();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($column)) {
|
||||||
|
$column = ProjectColumn::createInstance([
|
||||||
|
'project_id' => $project->id,
|
||||||
|
'name' => $column_id ?: 'Default',
|
||||||
|
]);
|
||||||
|
$column->sort = intval(ProjectColumn::whereProjectId($project->id)->orderByDesc('sort')->value('sort')) + 1;
|
||||||
|
$column->save();
|
||||||
|
$newColumn = $column->find($column->id);
|
||||||
|
$newColumn->project_task = [];
|
||||||
}
|
}
|
||||||
if (empty($column)) {
|
if (empty($column)) {
|
||||||
return Base::retError('任务列表不存在或已被删除');
|
return Base::retError('任务列表不存在或已被删除');
|
||||||
@ -682,7 +687,11 @@ class ProjectController extends AbstractController
|
|||||||
'column_id' => $column->id,
|
'column_id' => $column->id,
|
||||||
]));
|
]));
|
||||||
if (Base::isSuccess($result)) {
|
if (Base::isSuccess($result)) {
|
||||||
$result['data'] = ProjectTask::with(['taskUser', 'taskTag'])->whereId($result['data']['id'])->first();
|
$result['data'] = [
|
||||||
|
'new_column' => $newColumn,
|
||||||
|
'in_top' => intval($data['top']),
|
||||||
|
'task' => ProjectTask::with(['taskUser', 'taskTag'])->find($result['data']['id']),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
1
resources/assets/js/functions/common.js
vendored
1
resources/assets/js/functions/common.js
vendored
@ -1195,6 +1195,7 @@
|
|||||||
fireAjaxCallback('ajaxSuccess ajax:success', {xhr: xhr}, 'success', responseData, xhr.status, xhr);
|
fireAjaxCallback('ajaxSuccess ajax:success', {xhr: xhr}, 'success', responseData, xhr.status, xhr);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
fireAjaxCallback('ajaxError ajax:error', {
|
fireAjaxCallback('ajaxError ajax:error', {
|
||||||
xhr: xhr,
|
xhr: xhr,
|
||||||
parseerror: true
|
parseerror: true
|
||||||
|
|||||||
@ -215,7 +215,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</Draggable>
|
</Draggable>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="project-table">
|
<div v-else class="project-table overlay-y">
|
||||||
<div class="project-table-head">
|
<div class="project-table-head">
|
||||||
<Row class="task-row">
|
<Row class="task-row">
|
||||||
<Col span="12"># {{$L('任务名称')}}</Col>
|
<Col span="12"># {{$L('任务名称')}}</Col>
|
||||||
@ -607,9 +607,7 @@ export default {
|
|||||||
success: ({ret, data, msg}) => {
|
success: ({ret, data, msg}) => {
|
||||||
if (ret === 1) {
|
if (ret === 1) {
|
||||||
$A.messageSuccess(msg);
|
$A.messageSuccess(msg);
|
||||||
this.addTaskSuccess(Object.assign(data, {
|
this.addTaskSuccess(data)
|
||||||
top: !!this.addData.top
|
|
||||||
}))
|
|
||||||
this.addShow = false;
|
this.addShow = false;
|
||||||
this.addData = {
|
this.addData = {
|
||||||
owner: 0,
|
owner: 0,
|
||||||
@ -644,15 +642,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
addTaskSuccess(data) {
|
addTaskSuccess(data) {
|
||||||
this.projectDetail.project_column.some((item) => {
|
const {task, in_top, new_column} = data;
|
||||||
if (item.id === data.column_id) {
|
if (new_column) {
|
||||||
if (data.top) {
|
this.projectDetail.project_column.push(new_column)
|
||||||
item.project_task.unshift(data);
|
}
|
||||||
} else {
|
const column = this.projectDetail.project_column.find(({id}) => id === task.column_id);
|
||||||
item.project_task.push(data);
|
if (column) {
|
||||||
}
|
if (in_top) {
|
||||||
|
column.project_task.unshift(task);
|
||||||
|
} else {
|
||||||
|
column.project_task.push(task);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addColumnOpen() {
|
addColumnOpen() {
|
||||||
|
|||||||
@ -161,9 +161,17 @@ export default {
|
|||||||
success: ({ret, data, msg}) => {
|
success: ({ret, data, msg}) => {
|
||||||
if (ret === 1) {
|
if (ret === 1) {
|
||||||
$A.messageSuccess(msg);
|
$A.messageSuccess(msg);
|
||||||
data.top = this.addTop ? 1 : 0;
|
|
||||||
this.$emit("on-success", data)
|
this.$emit("on-success", data)
|
||||||
this.active = false;
|
this.active = false;
|
||||||
|
this.addData = {
|
||||||
|
owner: 0,
|
||||||
|
column_id: 0,
|
||||||
|
times: [],
|
||||||
|
subtasks: [],
|
||||||
|
p_level: 0,
|
||||||
|
p_name: '',
|
||||||
|
p_color: '',
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user