no message
This commit is contained in:
parent
cacba4f9a6
commit
f4cd7fe1e2
@ -679,7 +679,7 @@ class ProjectController extends AbstractController
|
||||
return Base::retError('项目不存在或不在成员列表内');
|
||||
}
|
||||
//
|
||||
return Base::retSuccess('success', $task->content);
|
||||
return Base::retSuccess('success', $task->content ?: json_decode('{}'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -238,7 +238,7 @@ class ProjectTask extends AbstractModel
|
||||
*/
|
||||
public function taskUser(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(projectTaskUser::class, 'task_id', 'id')->orderByDesc('id');
|
||||
return $this->hasMany(projectTaskUser::class, 'task_id', 'id')->orderByDesc('owner')->orderByDesc('id');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -372,30 +372,6 @@ class ProjectTask extends AbstractModel
|
||||
}
|
||||
$this->name = $data['name'];
|
||||
}
|
||||
// 背景色
|
||||
if (Arr::exists($data, 'color')) {
|
||||
$this->color = $data['color'];
|
||||
}
|
||||
// 内容
|
||||
if ($content && $this->parent_id === 0) {
|
||||
ProjectTaskContent::updateInsert([
|
||||
'project_id' => $this->parent_id,
|
||||
'task_id' => $this->id,
|
||||
], [
|
||||
'content' => $content,
|
||||
]);
|
||||
$this->desc = Base::getHtml($content);
|
||||
}
|
||||
// 计划时间
|
||||
if ($times) {
|
||||
list($start, $end) = is_string($times) ? explode(",", $times) : (is_array($times) ? $times : []);
|
||||
if (Base::isDate($start) && Base::isDate($end)) {
|
||||
if ($start != $end) {
|
||||
$this->start_at = Carbon::parse($start);
|
||||
$this->end_at = Carbon::parse($end);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 负责人
|
||||
if ($owner) {
|
||||
if (is_array($owner)) {
|
||||
@ -414,6 +390,43 @@ class ProjectTask extends AbstractModel
|
||||
]);
|
||||
}
|
||||
}
|
||||
// 计划时间
|
||||
if ($times) {
|
||||
list($start, $end) = is_string($times) ? explode(",", $times) : (is_array($times) ? $times : []);
|
||||
if (Base::isDate($start) && Base::isDate($end)) {
|
||||
if ($start != $end) {
|
||||
$this->start_at = Carbon::parse($start);
|
||||
$this->end_at = Carbon::parse($end);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 以下紧顶级任务可修改
|
||||
if ($this->parent_id === 0) {
|
||||
// 背景色
|
||||
if (Arr::exists($data, 'color')) {
|
||||
$this->color = $data['color'];
|
||||
}
|
||||
// 内容
|
||||
if ($content && $this->parent_id === 0) {
|
||||
ProjectTaskContent::updateInsert([
|
||||
'project_id' => $this->parent_id,
|
||||
'task_id' => $this->id,
|
||||
], [
|
||||
'content' => $content,
|
||||
]);
|
||||
$this->desc = Base::getHtml($content);
|
||||
}
|
||||
// 优先级
|
||||
if (Arr::exists($data, 'p_level')) {
|
||||
$this->p_level = intval($data['p_level']);
|
||||
}
|
||||
if (Arr::exists($data, 'p_name')) {
|
||||
$this->p_name = trim($data['p_name']);
|
||||
}
|
||||
if (Arr::exists($data, 'p_color')) {
|
||||
$this->p_color = trim($data['p_color']);
|
||||
}
|
||||
}
|
||||
$this->save();
|
||||
return Base::retSuccess('修改成功');
|
||||
});
|
||||
|
@ -347,6 +347,12 @@
|
||||
this.$emit('editorChange', e);
|
||||
}
|
||||
});
|
||||
editor.on('focus', () => {
|
||||
this.$emit('on-focus');
|
||||
});
|
||||
editor.on('blur', () => {
|
||||
this.$emit('on-blur');
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -355,6 +361,7 @@
|
||||
closeFull() {
|
||||
this.content = this.getContent();
|
||||
this.$emit('input', this.content);
|
||||
this.$emit('on-blur');
|
||||
this.transfer = false;
|
||||
if (this.editorT != null) {
|
||||
this.editorT.destroy();
|
||||
|
@ -13,6 +13,7 @@
|
||||
</div>
|
||||
<div class="avatar-wrapper">
|
||||
<div :class="['avatar-box', userId === userid || user.online ? 'online' : '']" :style="boxStyle">
|
||||
<em :style="spotStyle"></em>
|
||||
<WAvatar v-if="showImg" :src="user.userimg" :size="avatarSize"/>
|
||||
<WAvatar v-else :size="avatarSize" class="avatar-text">{{nickname}}</WAvatar>
|
||||
</div>
|
||||
@ -77,8 +78,21 @@
|
||||
return style;
|
||||
},
|
||||
|
||||
spotStyle() {
|
||||
let {borderWitdh, size} = this
|
||||
if (size === 'default') size = 32;
|
||||
if (borderWitdh > 0) size-= borderWitdh;
|
||||
if (size == 32) {
|
||||
return {}
|
||||
}
|
||||
return {
|
||||
'transform': 'scale(' + (size / 32) + ')',
|
||||
}
|
||||
},
|
||||
|
||||
avatarSize() {
|
||||
const {borderWitdh, size} = this
|
||||
let {borderWitdh, size} = this
|
||||
if (size === 'default') size = 32;
|
||||
if (borderWitdh > 0) {
|
||||
return size - borderWitdh * 2;
|
||||
} else {
|
||||
|
@ -17,7 +17,13 @@
|
||||
@on-open-change="openChange"
|
||||
@on-set-default-options="setDefaultOptions">
|
||||
<div v-if="multipleMax" slot="drop-prepend" class="user-drop-prepend">{{$L('最多只能选择' + multipleMax + '个')}}</div>
|
||||
<Option v-for="(item, key) in lists" :value="item.userid" :key="key" :label="item.nickname" :avatar="item.userimg">
|
||||
<Option
|
||||
v-for="(item, key) in lists"
|
||||
:value="item.userid"
|
||||
:key="key"
|
||||
:label="item.nickname"
|
||||
:avatar="item.userimg"
|
||||
:disabled="isDisabled(item.userid)">
|
||||
<div class="user-input-option">
|
||||
<div class="user-input-avatar"><WAvatar :src="item.userimg"/></div>
|
||||
<div class="user-input-nickname">{{ item.nickname }}</div>
|
||||
@ -45,6 +51,12 @@
|
||||
return [];
|
||||
}
|
||||
},
|
||||
disabledChoice: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
placeholder: {
|
||||
default: ''
|
||||
},
|
||||
@ -103,7 +115,7 @@
|
||||
openChange(show) {
|
||||
if (show && !this.openLoad) {
|
||||
this.openLoad = true;
|
||||
if (this.lists.length == this.values.length) {
|
||||
if (this.lists.length == this.values.length || this.lists.length <= 1) {
|
||||
this.$nextTick(this.searchUser);
|
||||
}
|
||||
}
|
||||
@ -161,6 +173,13 @@
|
||||
} else {
|
||||
this.lists = [];
|
||||
}
|
||||
},
|
||||
|
||||
isDisabled(userid) {
|
||||
if (this.disabledChoice.length === 0) {
|
||||
return false;
|
||||
}
|
||||
return this.disabledChoice.includes(userid)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
2
resources/assets/js/functions/common.js
vendored
2
resources/assets/js/functions/common.js
vendored
@ -348,7 +348,7 @@
|
||||
* @returns {string}
|
||||
*/
|
||||
formatDate: function(format, v) {
|
||||
if (format === '') {
|
||||
if (typeof format === 'undefined' || format === '') {
|
||||
format = 'Y-m-d H:i:s';
|
||||
}
|
||||
let dateObj;
|
||||
|
@ -715,9 +715,7 @@ export default {
|
||||
this.$set(column, 'loading', true);
|
||||
//
|
||||
const backup = $A.cloneJSON(column);
|
||||
Object.keys(updata).forEach(key => {
|
||||
this.$set(column, key, updata[key]);
|
||||
});
|
||||
Object.keys(updata).forEach(key => this.$set(column, key, updata[key]));
|
||||
//
|
||||
this.$store.dispatch("call", {
|
||||
url: 'project/column/update',
|
||||
@ -726,14 +724,10 @@ export default {
|
||||
}),
|
||||
}).then(({data}) => {
|
||||
this.$set(column, 'loading', false);
|
||||
Object.keys(data).forEach(key => {
|
||||
this.$set(column, key, data[key]);
|
||||
});
|
||||
Object.keys(data).forEach(key => this.$set(column, key, data[key]));
|
||||
}).catch(({msg}) => {
|
||||
this.$set(column, 'loading', false);
|
||||
Object.keys(updata).forEach(key => {
|
||||
this.$set(column, key, backup[key]);
|
||||
});
|
||||
Object.keys(updata).forEach(key => this.$set(column, key, backup[key]));
|
||||
$A.modalError(msg);
|
||||
});
|
||||
},
|
||||
@ -835,7 +829,7 @@ export default {
|
||||
}
|
||||
this.$set(task, 'loading', true);
|
||||
this.$store.dispatch("taskArchivedOrRemove", {
|
||||
id: task.id,
|
||||
task_id: task.id,
|
||||
type: type,
|
||||
}).then(({msg}) => {
|
||||
this.$Modal.remove();
|
||||
|
@ -1,41 +1,58 @@
|
||||
<template>
|
||||
<div :class="['task-detail', projectOpenTask._dialog || projectOpenTask._msgText ? 'open-dialog' : '']">
|
||||
<div :class="{'task-detail':true, 'open-dialog': taskDetail._dialog || taskDetail._msgText, 'completed': taskDetail.complete_at}">
|
||||
<div class="task-info">
|
||||
<div class="head">
|
||||
<Icon class="icon" type="md-radio-button-off"/>
|
||||
<Icon v-if="taskDetail.complete_at" class="icon completed" type="md-checkmark-circle" @click="updateData('uncomplete')"/>
|
||||
<Icon v-else class="icon" type="md-radio-button-off" @click="updateData('complete')"/>
|
||||
<div class="nav">
|
||||
<p v-if="projectOpenTask.project_name">{{projectOpenTask.project_name}}</p>
|
||||
<p v-if="projectOpenTask.column_name">{{projectOpenTask.column_name}}</p>
|
||||
<p v-if="projectOpenTask.id">{{projectOpenTask.id}}</p>
|
||||
<p v-if="taskDetail.project_name">{{taskDetail.project_name}}</p>
|
||||
<p v-if="taskDetail.column_name">{{taskDetail.column_name}}</p>
|
||||
<p v-if="taskDetail.id">{{taskDetail.id}}</p>
|
||||
</div>
|
||||
<Icon class="menu" type="ios-more"/>
|
||||
</div>
|
||||
<div class="scroller overlay-y" :style="scrollerStyle">
|
||||
<div class="title">
|
||||
<Input
|
||||
v-model="projectOpenTask.name"
|
||||
v-model="taskDetail.name"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 1, maxRows: 8 }"
|
||||
:maxlength="255"/>
|
||||
:maxlength="255"
|
||||
@on-blur="updateData('name')"/>
|
||||
</div>
|
||||
<div v-if="hasContent" class="desc">
|
||||
<div class="desc">
|
||||
<TEditor
|
||||
v-model="projectOpenTask.content.content"
|
||||
v-model="taskDetail.content"
|
||||
:plugins="taskPlugins"
|
||||
:options="taskOptions"
|
||||
:option-full="taskOptionFull"
|
||||
:placeholder="$L('详细描述...')"
|
||||
@on-blur="updateData('content')"
|
||||
inline></TEditor>
|
||||
</div>
|
||||
<Form class="items" label-position="left" label-width="auto" @submit.native.prevent>
|
||||
<FormItem v-if="projectOpenTask.p_name">
|
||||
<FormItem v-if="taskDetail.p_name">
|
||||
<div class="item-label" slot="label">
|
||||
<i class="iconfont"></i>{{$L('优先级')}}
|
||||
</div>
|
||||
<ul class="item-content">
|
||||
<li>
|
||||
<TaskPriority :backgroundColor="projectOpenTask.p_color">{{projectOpenTask.p_name}}</TaskPriority>
|
||||
<EDropdown
|
||||
trigger="click"
|
||||
placement="bottom-start"
|
||||
@command="updateData('priority', $event)">
|
||||
<TaskPriority :backgroundColor="taskDetail.p_color">{{taskDetail.p_name}}</TaskPriority>
|
||||
<EDropdownMenu slot="dropdown">
|
||||
<EDropdownItem v-for="(item, key) in taskPriority" :key="key" :command="item">
|
||||
<i
|
||||
class="iconfont"
|
||||
:style="{color:item.color}"
|
||||
v-html="taskDetail.p_name == item.name ? '' : ''"></i>
|
||||
{{item.name}}
|
||||
</EDropdownItem>
|
||||
</EDropdownMenu>
|
||||
</EDropdown>
|
||||
</li>
|
||||
</ul>
|
||||
</FormItem>
|
||||
@ -44,15 +61,23 @@
|
||||
<i class="iconfont"></i>{{$L('负责人')}}
|
||||
</div>
|
||||
<ul class="item-content user">
|
||||
<li><UserAvatar :userid="getOwner().userid" :size="28"/></li>
|
||||
<li @click="openTransfer"><UserAvatar :userid="getOwner().userid" :size="28"/></li>
|
||||
</ul>
|
||||
</FormItem>
|
||||
<FormItem v-if="projectOpenTask.end_at">
|
||||
<FormItem v-if="getAssist.length > 0">
|
||||
<div class="item-label" slot="label">
|
||||
<i class="iconfont"></i>{{$L('协助人员')}}
|
||||
</div>
|
||||
<ul class="item-content user">
|
||||
<li v-for="item in getAssist" @click="openAssist"><UserAvatar :userid="item.userid" :size="28"/></li>
|
||||
</ul>
|
||||
</FormItem>
|
||||
<FormItem v-if="taskDetail.end_at">
|
||||
<div class="item-label" slot="label">
|
||||
<i class="iconfont"></i>{{$L('截止时间')}}
|
||||
</div>
|
||||
<ul class="item-content">
|
||||
<li>{{projectOpenTask.end_at}}</li>
|
||||
<li>{{taskDetail.end_at}}</li>
|
||||
</ul>
|
||||
</FormItem>
|
||||
<FormItem v-if="hasFile">
|
||||
@ -60,7 +85,7 @@
|
||||
<i class="iconfont"></i>{{$L('附件')}}
|
||||
</div>
|
||||
<ul class="item-content file">
|
||||
<li v-for="file in projectOpenTask.files">
|
||||
<li v-for="file in taskDetail.files">
|
||||
<img class="file-ext" :src="file.thumb"/>
|
||||
<div class="file-name">{{file.name}}</div>
|
||||
<div class="file-size">{{$A.bytesToSize(file.size)}}</div>
|
||||
@ -77,7 +102,7 @@
|
||||
<i class="iconfont"></i>{{$L('子任务')}}
|
||||
</div>
|
||||
<ul class="item-content subtask">
|
||||
<li v-for="task in projectOpenTask.sub_task">
|
||||
<li v-for="task in taskDetail.sub_task">
|
||||
<Icon class="subtask-icon" type="md-radio-button-off" />
|
||||
<div class="subtask-name">
|
||||
<Input
|
||||
@ -136,10 +161,59 @@
|
||||
<div class="no-dialog" :style="dialogStyle">
|
||||
<div class="no-tip">{{$L('暂无消息')}}</div>
|
||||
<div class="no-input">
|
||||
<Input class="dialog-input" v-model="projectOpenTask._msgText" type="textarea" :rows="1" :autosize="{ minRows: 1, maxRows: 3 }" :maxlength="255" :placeholder="$L('输入消息...')" />
|
||||
<Input
|
||||
ref="input"
|
||||
class="dialog-input"
|
||||
v-model="taskDetail._msgText"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 1, maxRows: 3 }"
|
||||
:maxlength="255"
|
||||
:placeholder="$L('输入消息...')"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--修改负责人-->
|
||||
<Modal
|
||||
v-model="transferShow"
|
||||
:title="$L('修改负责人')"
|
||||
:mask-closable="false">
|
||||
<Form ref="addProject" :model="transferData" label-width="auto" @submit.native.prevent>
|
||||
<FormItem prop="owner_userid" :label="$L('任务负责人')">
|
||||
<UserInput
|
||||
v-if="transferShow"
|
||||
v-model="transferData.owner_userid"
|
||||
:multiple-max="1"
|
||||
:placeholder="$L('选择任务负责人')"/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="default" @click="transferShow=false">{{$L('取消')}}</Button>
|
||||
<Button type="primary" :loading="transferLoad > 0" @click="onTransfer">{{$L('提交')}}</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!--修改协助人员-->
|
||||
<Modal
|
||||
v-model="assistShow"
|
||||
:title="$L('修改协助人员')"
|
||||
:mask-closable="false">
|
||||
<Form ref="addProject" :model="assistData" label-width="auto" @submit.native.prevent>
|
||||
<FormItem prop="owner_userid" :label="$L('协助人员')">
|
||||
<UserInput
|
||||
v-if="assistShow"
|
||||
v-model="assistData.assist_userid"
|
||||
:multiple-max="1"
|
||||
:disabled-choice="assistData.disabled"
|
||||
:placeholder="$L('选择任务协助人员')"/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="default" @click="assistShow=false">{{$L('取消')}}</Button>
|
||||
<Button type="primary" :loading="assistLoad > 0" @click="onAssist">{{$L('提交')}}</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -147,12 +221,23 @@
|
||||
import {mapState} from "vuex";
|
||||
import TEditor from "../../../components/TEditor";
|
||||
import TaskPriority from "./TaskPriority";
|
||||
import UserInput from "../../../components/UserInput";
|
||||
|
||||
export default {
|
||||
name: "TaskDetail",
|
||||
components: {TaskPriority, TEditor},
|
||||
components: {UserInput, TaskPriority, TEditor},
|
||||
data() {
|
||||
return {
|
||||
taskDetail: {},
|
||||
|
||||
transferShow: false,
|
||||
transferData: {},
|
||||
transferLoad: 0,
|
||||
|
||||
assistShow: false,
|
||||
assistData: {},
|
||||
assistLoad: 0,
|
||||
|
||||
nowTime: Math.round(new Date().getTime() / 1000),
|
||||
nowInterval: null,
|
||||
|
||||
@ -187,6 +272,7 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$store.dispatch('taskPriority');
|
||||
this.nowInterval = setInterval(() => {
|
||||
this.nowTime = Math.round(new Date().getTime() / 1000);
|
||||
}, 1000);
|
||||
@ -199,14 +285,14 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['userId', 'projectOpenTask']),
|
||||
...mapState(['userId', 'projectOpenTask', 'taskPriority']),
|
||||
|
||||
scrollerStyle() {
|
||||
const {innerHeight, projectOpenTask} = this;
|
||||
const {innerHeight, taskDetail} = this;
|
||||
if (!innerHeight) {
|
||||
return {};
|
||||
}
|
||||
if (!projectOpenTask._dialog) {
|
||||
if (!taskDetail._dialog) {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
@ -215,11 +301,11 @@ export default {
|
||||
},
|
||||
|
||||
dialogStyle() {
|
||||
const {innerHeight, projectOpenTask} = this;
|
||||
const {innerHeight, taskDetail} = this;
|
||||
if (!innerHeight) {
|
||||
return {};
|
||||
}
|
||||
if (projectOpenTask._dialog || projectOpenTask._msgText) {
|
||||
if (taskDetail._dialog || taskDetail._msgText) {
|
||||
return {
|
||||
minHeight: (innerHeight - 70 - 66 - 30) + 'px'
|
||||
}
|
||||
@ -241,25 +327,20 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
hasContent() {
|
||||
const {projectOpenTask} = this;
|
||||
return $A.isJson(projectOpenTask.content);
|
||||
},
|
||||
|
||||
hasFile() {
|
||||
const {projectOpenTask} = this;
|
||||
return $A.isArray(projectOpenTask.files) && projectOpenTask.files.length > 0;
|
||||
const {taskDetail} = this;
|
||||
return $A.isArray(taskDetail.files) && taskDetail.files.length > 0;
|
||||
},
|
||||
|
||||
hasSubtask() {
|
||||
const {projectOpenTask} = this;
|
||||
return $A.isArray(projectOpenTask.sub_task) && projectOpenTask.sub_task.length > 0;
|
||||
const {taskDetail} = this;
|
||||
return $A.isArray(taskDetail.sub_task) && taskDetail.sub_task.length > 0;
|
||||
},
|
||||
|
||||
getOwner() {
|
||||
return function (task) {
|
||||
if (task === undefined) {
|
||||
task = this.projectOpenTask;
|
||||
task = this.taskDetail;
|
||||
}
|
||||
if (!$A.isArray(task.task_user)) {
|
||||
return null;
|
||||
@ -268,38 +349,53 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
getAssist() {
|
||||
const {taskDetail} = this;
|
||||
if (!$A.isArray(taskDetail.task_user)) {
|
||||
return [];
|
||||
}
|
||||
return taskDetail.task_user.filter(({owner}) => owner !== 1);
|
||||
},
|
||||
|
||||
menuList() {
|
||||
const {projectOpenTask} = this;
|
||||
const {taskDetail} = this;
|
||||
let list = [];
|
||||
if (!projectOpenTask.p_name) {
|
||||
if (!taskDetail.p_name) {
|
||||
list.push({
|
||||
command: 'priority',
|
||||
icon: '',
|
||||
name: '优先级',
|
||||
});
|
||||
}
|
||||
if (!($A.isArray(projectOpenTask.task_user) && projectOpenTask.task_user.find(({owner}) => owner === 1))) {
|
||||
if (!($A.isArray(taskDetail.task_user) && taskDetail.task_user.find(({owner}) => owner === 1))) {
|
||||
list.push({
|
||||
command: 'owner',
|
||||
icon: '',
|
||||
name: '负责人',
|
||||
});
|
||||
}
|
||||
if (!projectOpenTask.end_at) {
|
||||
if (!($A.isArray(taskDetail.task_user) && taskDetail.task_user.find(({owner}) => owner !== 1))) {
|
||||
list.push({
|
||||
command: 'owner',
|
||||
icon: '',
|
||||
name: '协助人员',
|
||||
});
|
||||
}
|
||||
if (!taskDetail.end_at) {
|
||||
list.push({
|
||||
command: 'times',
|
||||
icon: '',
|
||||
name: '截止时间',
|
||||
});
|
||||
}
|
||||
if (!($A.isArray(projectOpenTask.files) && projectOpenTask.files.length > 0)) {
|
||||
if (!($A.isArray(taskDetail.files) && taskDetail.files.length > 0)) {
|
||||
list.push({
|
||||
command: 'file',
|
||||
icon: '',
|
||||
name: '附件',
|
||||
});
|
||||
}
|
||||
if (!($A.isArray(projectOpenTask.sub_task) && projectOpenTask.sub_task.length > 0)) {
|
||||
if (!($A.isArray(taskDetail.sub_task) && taskDetail.sub_task.length > 0)) {
|
||||
list.push({
|
||||
command: 'subtask',
|
||||
icon: '',
|
||||
@ -311,7 +407,10 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
||||
projectOpenTask(data) {
|
||||
this.taskDetail = $A.cloneJSON(data);
|
||||
if (data._show) this.$nextTick(this.$refs.input.focus)
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -354,6 +453,95 @@ export default {
|
||||
else if (seconds > 0) duration = this.formatBit(seconds) + "s";
|
||||
return duration;
|
||||
},
|
||||
|
||||
updateData(action, params) {
|
||||
switch (action) {
|
||||
case 'complete':
|
||||
this.$set(this.taskDetail, 'complete_at', $A.formatDate());
|
||||
action = 'complete_at';
|
||||
break;
|
||||
case 'uncomplete':
|
||||
this.$set(this.taskDetail, 'complete_at', false);
|
||||
action = 'complete_at';
|
||||
break;
|
||||
case 'priority':
|
||||
this.$set(this.taskDetail, 'p_level', params.priority)
|
||||
this.$set(this.taskDetail, 'p_name', params.name)
|
||||
this.$set(this.taskDetail, 'p_color', params.color)
|
||||
action = ['p_level', 'p_name', 'p_color'];
|
||||
break;
|
||||
}
|
||||
//
|
||||
let dataJson = {task_id: this.taskDetail.id};
|
||||
($A.isArray(action) ? action : [action]).forEach(key => {
|
||||
let newData = this.taskDetail[key];
|
||||
let originalData = this.projectOpenTask[key];
|
||||
if ($A.jsonStringify(newData) != $A.jsonStringify(originalData)) {
|
||||
dataJson[key] = newData;
|
||||
}
|
||||
})
|
||||
if (Object.keys(dataJson).length <= 1) return;
|
||||
//
|
||||
this.$store.dispatch("taskUpdate", dataJson).then(() => {
|
||||
// 更新成功
|
||||
}).catch(() => {
|
||||
// 更新失败
|
||||
})
|
||||
},
|
||||
|
||||
openTransfer() {
|
||||
this.$set(this.taskDetail, 'owner_userid', [this.getOwner().userid])
|
||||
this.$set(this.transferData, 'owner_userid', [this.getOwner().userid]);
|
||||
this.transferShow = true;
|
||||
},
|
||||
|
||||
onTransfer() {
|
||||
if ($A.jsonStringify(this.taskDetail.owner_userid) === $A.jsonStringify(this.transferData.owner_userid)) {
|
||||
return;
|
||||
}
|
||||
this.transferLoad++;
|
||||
this.$store.dispatch("taskUpdate", {
|
||||
task_id: this.taskDetail.id,
|
||||
owner: this.transferData.owner_userid
|
||||
}).then(() => {
|
||||
this.transferLoad--;
|
||||
this.transferShow = false;
|
||||
this.$store.dispatch("taskOne", this.taskDetail.id);
|
||||
}).catch(({msg}) => {
|
||||
this.transferLoad--;
|
||||
this.transferShow = false;
|
||||
$A.modalError(msg);
|
||||
})
|
||||
},
|
||||
|
||||
openAssist() {
|
||||
const list = this.getAssist.map(({userid}) => userid)
|
||||
this.$set(this.taskDetail, 'assist_userid', list)
|
||||
this.$set(this.assistData, 'assist_userid', list);
|
||||
this.$set(this.assistData, 'disabled', [this.getOwner().userid]);
|
||||
this.assistShow = true;
|
||||
},
|
||||
|
||||
onAssist() {
|
||||
if ($A.jsonStringify(this.taskDetail.assist_userid) === $A.jsonStringify(this.assistData.assist_userid)) {
|
||||
return;
|
||||
}
|
||||
let assist = this.assistData.assist_userid;
|
||||
if (assist.length === 0) assist = false;
|
||||
this.assistLoad++;
|
||||
this.$store.dispatch("taskUpdate", {
|
||||
task_id: this.taskDetail.id,
|
||||
assist,
|
||||
}).then(() => {
|
||||
this.assistLoad--;
|
||||
this.assistShow = false;
|
||||
this.$store.dispatch("taskOne", this.taskDetail.id);
|
||||
}).catch(({msg}) => {
|
||||
this.assistLoad--;
|
||||
this.assistShow = false;
|
||||
$A.modalError(msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
53
resources/assets/js/store/actions.js
vendored
53
resources/assets/js/store/actions.js
vendored
@ -430,9 +430,10 @@ export default {
|
||||
task_id,
|
||||
},
|
||||
}).then(result => {
|
||||
state.projectTaskContent[task_id] = result.data;
|
||||
const {content} = result.data;
|
||||
state.projectTaskContent[task_id] = content;
|
||||
if (task_id == state.projectOpenTask.id) {
|
||||
state.projectOpenTask = Object.assign({}, state.projectOpenTask, {content: result.data || {}});
|
||||
state.projectOpenTask = Object.assign({}, state.projectOpenTask, {content: content});
|
||||
}
|
||||
resolve(result)
|
||||
}).catch(result => {
|
||||
@ -509,7 +510,7 @@ export default {
|
||||
}
|
||||
});
|
||||
//
|
||||
data.content = state.projectTaskContent[task_id] || {}
|
||||
data.content = state.projectTaskContent[task_id] || ""
|
||||
data.files = state.projectTaskFiles[task_id] || []
|
||||
data.sub_task = state.projectSubTask[task_id] || []
|
||||
//
|
||||
@ -520,25 +521,6 @@ export default {
|
||||
dispatch("subTask", task_id);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取任务优先级预设数据
|
||||
* @param state
|
||||
* @param dispatch
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
taskPriority({state, dispatch}) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
dispatch("call", {
|
||||
url: 'system/priority',
|
||||
}).then(result => {
|
||||
state.taskPriority = result.data;
|
||||
resolve(result)
|
||||
}).catch(result => {
|
||||
reject(result)
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
* @param dispatch
|
||||
@ -555,13 +537,13 @@ export default {
|
||||
if (result.data.parent_id) {
|
||||
dispatch('taskOne', result.data.parent_id);
|
||||
}
|
||||
if (typeof updata.complete_at !== "undefined") {
|
||||
if (typeof data.complete_at !== "undefined") {
|
||||
dispatch('projectOne', result.data.project_id);
|
||||
}
|
||||
dispatch("taskData", result.data);
|
||||
resolve(result)
|
||||
}).catch(result => {
|
||||
dispatch('taskOne', data.id);
|
||||
dispatch('taskOne', data.task_id);
|
||||
reject(result)
|
||||
});
|
||||
});
|
||||
@ -575,12 +557,12 @@ export default {
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
taskArchivedOrRemove({state, dispatch}, data) {
|
||||
let {id, type} = data;
|
||||
let {task_id, type} = data;
|
||||
return new Promise(function (resolve, reject) {
|
||||
dispatch("call", {
|
||||
url: 'project/task/' + type,
|
||||
data: {
|
||||
task_id: id,
|
||||
task_id,
|
||||
},
|
||||
}).then(result => {
|
||||
const column = state.projectDetail.project_column.find(({id}) => id === result.data.column_id);
|
||||
@ -598,6 +580,25 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取任务优先级预设数据
|
||||
* @param state
|
||||
* @param dispatch
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
taskPriority({state, dispatch}) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
dispatch("call", {
|
||||
url: 'system/priority',
|
||||
}).then(result => {
|
||||
state.taskPriority = result.data;
|
||||
resolve(result)
|
||||
}).catch(result => {
|
||||
reject(result)
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取会话列表
|
||||
* @param state
|
||||
|
@ -9,8 +9,7 @@
|
||||
.avatar-text {
|
||||
background-color: #87d068;
|
||||
}
|
||||
&:before {
|
||||
content: "";
|
||||
> em {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
@ -22,7 +21,7 @@
|
||||
z-index: 1;
|
||||
}
|
||||
&.online {
|
||||
&:before {
|
||||
> em {
|
||||
background-color: #87d068;
|
||||
}
|
||||
}
|
||||
|
6
resources/assets/sass/iconfont.scss
vendored
6
resources/assets/sass/iconfont.scss
vendored
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* Project id 2583385 */
|
||||
src: url('//at.alicdn.com/t/font_2583385_xuuhcu42k99.woff2?t=1623393761654') format('woff2'),
|
||||
url('//at.alicdn.com/t/font_2583385_xuuhcu42k99.woff?t=1623393761654') format('woff'),
|
||||
url('//at.alicdn.com/t/font_2583385_xuuhcu42k99.ttf?t=1623393761654') format('truetype');
|
||||
src: url('//at.alicdn.com/t/font_2583385_acaq8xa48dj.woff2?t=1623513995409') format('woff2'),
|
||||
url('//at.alicdn.com/t/font_2583385_acaq8xa48dj.woff?t=1623513995409') format('woff'),
|
||||
url('//at.alicdn.com/t/font_2583385_acaq8xa48dj.ttf?t=1623513995409') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
@ -348,6 +348,7 @@
|
||||
color: #999999;
|
||||
margin-top: 10px;
|
||||
line-height: 20px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.task-tags {
|
||||
margin-top: 10px;
|
||||
|
@ -6,6 +6,7 @@
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
.head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -26,6 +27,9 @@
|
||||
width: 18px;
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
&.completed {
|
||||
color: #87d068;
|
||||
}
|
||||
}
|
||||
.nav {
|
||||
flex: 1;
|
||||
@ -103,11 +107,15 @@
|
||||
align-items: center;
|
||||
list-style: none;
|
||||
line-height: 26px;
|
||||
.el-dropdown {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
&.user {
|
||||
margin-top: 4px;
|
||||
margin-top: 0;
|
||||
> li {
|
||||
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
&.file {
|
||||
@ -191,8 +199,7 @@
|
||||
height: 26px;
|
||||
line-height: 1;
|
||||
.avatar-box {
|
||||
&:before {
|
||||
transform: scale(0.7);
|
||||
> em {
|
||||
right: -2px;
|
||||
bottom: -1px;
|
||||
}
|
||||
@ -362,6 +369,23 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.completed {
|
||||
.task-info {
|
||||
&:before {
|
||||
content: "\f373";
|
||||
font-family: Ionicons, serif;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 13%;
|
||||
font-size: 72px;
|
||||
color: #19be6b;
|
||||
opacity: .2;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user