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