mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 03:52:50 +00:00
commit
854ed2147d
@ -1668,7 +1668,7 @@ class ProjectController extends AbstractController
|
||||
'column_id' => $task->column_id,
|
||||
'times' => [$task->start_at, $task->end_at],
|
||||
'owner' => [User::userid()],
|
||||
'is_all_visible' => 0,
|
||||
'is_all_visible' => 2,
|
||||
]);
|
||||
$data = ProjectTask::oneTask($task->id);
|
||||
$projectUserid = Project::whereId($data->project_id)->value('userid');
|
||||
@ -1717,9 +1717,9 @@ class ProjectController extends AbstractController
|
||||
$task_id = intval($param['task_id']);
|
||||
//
|
||||
$task = ProjectTask::userTask($task_id, true, true, 2);
|
||||
$taskUser = ProjectTaskUser::select(['userid', 'owner'])->whereTaskId($task_id)->whereIn('owner', [0, 1])->get();
|
||||
$taskUser = ProjectTaskUser::select(['userid', 'owner'])->whereTaskId($task_id)->get();
|
||||
$owners = $taskUser->where('owner', 1)->pluck('userid')->toArray(); // 负责人
|
||||
$assist = $taskUser->where('owner', 0)->pluck('userid')->toArray(); // 协助人
|
||||
$assists = $taskUser->where('owner', 0)->pluck('userid')->toArray(); // 协助人
|
||||
|
||||
// 更新任务
|
||||
$updateMarking = [];
|
||||
@ -1727,38 +1727,52 @@ class ProjectController extends AbstractController
|
||||
//
|
||||
$data = ProjectTask::oneTask($task->id)->toArray();
|
||||
$data['update_marking'] = $updateMarking ?: json_decode('{}');
|
||||
$data['visibility_appointor'] = $data['is_all_visible'] == 1 ? [0] : ProjectTaskUser::whereTaskId($task->id)->whereOwner(2)->pluck('userid');
|
||||
$data['visibility_appointor'] = $data['is_all_visible'] == 1 ? [] : ProjectTaskUser::whereTaskId($task->id)->whereOwner(2)->pluck('userid');
|
||||
$task->pushMsg('update', $data);
|
||||
// 可见性推送
|
||||
if (Arr::exists($param, 'is_all_visible')) {
|
||||
if ($data['is_all_visible'] == 1) {
|
||||
$task->pushMsgVisibleAdd($data);
|
||||
}
|
||||
if ($data['is_all_visible'] == 0) {
|
||||
if($task->parent_id == 0){
|
||||
$subUserids = ProjectTaskUser::whereTaskPid($data['id'])->pluck('userid')->toArray();
|
||||
if (Arr::exists($param, 'is_all_visible') || Arr::exists($param, 'visibility_appointor')) {
|
||||
if ($data['is_all_visible'] == 1) {
|
||||
$task->pushMsgVisibleAdd($data);
|
||||
}
|
||||
if ($param['visibility_appointor']) {
|
||||
$task->pushMsgVisibleUpdate($data);
|
||||
} else {
|
||||
$oldVisibleUserIds = $taskUser->where('owner', 2)->pluck('userid')->toArray()??[];
|
||||
$newVisibleUserIds = $param['visibility_appointor'] ?? [];
|
||||
$deleteUserIds = array_diff($oldVisibleUserIds, $newVisibleUserIds, $subUserids);
|
||||
$addUserIds = array_diff($newVisibleUserIds, $oldVisibleUserIds);
|
||||
$task->pushMsgVisibleUpdate($data, $deleteUserIds, $addUserIds);
|
||||
}
|
||||
if ($data['is_all_visible'] != 1 && empty($param['visibility_appointor'])) {
|
||||
$task->pushMsgVisibleRemove();
|
||||
}
|
||||
}
|
||||
} elseif (Arr::exists($param, 'visibility_appointor')) {
|
||||
if ($param['visibility_appointor']) {
|
||||
$task->pushMsgVisibleUpdate($data);
|
||||
} else {
|
||||
$task->pushMsgVisibleRemove();
|
||||
if (Arr::exists($param, 'owner') && $data['is_all_visible'] != 1) {
|
||||
$diff = array_diff($owners, $subUserids);
|
||||
if ($diff) {
|
||||
$task->pushMsgVisibleRemove($diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Arr::exists($param, 'owner') && $data['is_all_visible'] == 0) {
|
||||
$subUserids = ProjectTaskUser::whereTaskPid($data['id'])->pluck('userid')->toArray();
|
||||
$diff = array_diff($owners, $param['owner'], $subUserids);
|
||||
if ($diff) {
|
||||
$task->pushMsgVisibleRemove($diff);
|
||||
if (Arr::exists($param, 'assist') && $data['is_all_visible'] != 1) {
|
||||
$diff = array_diff($assists, $subUserids);
|
||||
if ($diff) {
|
||||
$task->pushMsgVisibleRemove($diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Arr::exists($param, 'assist') && $data['is_all_visible'] == 0) {
|
||||
$diff = array_diff($owners, $param['assist']);
|
||||
if ($diff) {
|
||||
$task->pushMsgVisibleRemove($diff);
|
||||
}else{
|
||||
if(Arr::exists($param, 'owner') ){
|
||||
$diff = array_diff($owners, $param['owner'] ?: [] );
|
||||
if ($diff) {
|
||||
$task->pushMsgVisibleRemove($diff);
|
||||
}
|
||||
$parentTask = ProjectTask::whereId($task->parent_id)->first();
|
||||
$subUserids = ProjectTaskUser::whereTaskPid($task->parent_id)->pluck('userid')->toArray();
|
||||
if ( $parentTask && $parentTask->is_all_visible != 1 && empty($subUserids) ) {
|
||||
$diff = array_diff($owners, $param['owner'] ?: [], $subUserids);
|
||||
if ($diff) {
|
||||
$parentTask->pushMsgVisibleRemove($diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
@ -370,18 +370,8 @@ class ProjectTask extends AbstractModel
|
||||
$p_color = $data['p_color'];
|
||||
$top = intval($data['top']);
|
||||
$userid = User::userid();
|
||||
$visibility_appoint = $data['visibility_appoint'];
|
||||
$visibility_appointor = $data['visibility_appointor'];
|
||||
// 可见性
|
||||
$visibility_userids = [];
|
||||
$is_all_visible = 0;
|
||||
if ($visibility_appoint) {
|
||||
if (in_array(0, $visibility_appointor)) {
|
||||
$is_all_visible = 1;
|
||||
} else {
|
||||
$visibility_userids = $visibility_appointor;
|
||||
}
|
||||
}
|
||||
$is_all_visible = $data['visibility_appoint'];
|
||||
$visibility_userids = $data['visibility_appointor'];
|
||||
//
|
||||
if (ProjectTask::whereProjectId($project_id)
|
||||
->whereNull('project_tasks.complete_at')
|
||||
@ -686,15 +676,24 @@ class ProjectTask extends AbstractModel
|
||||
foreach ($owner as $uid) {
|
||||
if (intval($uid) == 0) continue;
|
||||
if (!$this->project->useridInTheProject($uid)) continue;
|
||||
//
|
||||
ProjectTaskUser::updateInsert([
|
||||
'task_id' => $this->id,
|
||||
'userid' => $uid,
|
||||
], [
|
||||
'project_id' => $this->project_id,
|
||||
'task_pid' => $this->parent_id ?: $this->id,
|
||||
'owner' => 1,
|
||||
]);
|
||||
$row = ProjectTaskUser::where("task_id",$this->id)
|
||||
->where("userid",$uid)
|
||||
->where("owner",'!=', 2)
|
||||
->first();
|
||||
if(empty($row)){
|
||||
ProjectTaskUser::createInstance([
|
||||
'task_id' => $this->id,
|
||||
'userid' => $uid,
|
||||
'project_id' => $this->project_id,
|
||||
'task_pid' => $this->parent_id ?: $this->id,
|
||||
'owner' => 1,
|
||||
])->save();
|
||||
}else{
|
||||
$row->project_id = $this->project_id;
|
||||
$row->task_pid = $this->parent_id ?: $this->id;
|
||||
$row->owner = 1;
|
||||
$row->save();
|
||||
}
|
||||
$array[] = $uid;
|
||||
}
|
||||
if ($array) {
|
||||
@ -716,24 +715,23 @@ class ProjectTask extends AbstractModel
|
||||
$this->syncDialogUser();
|
||||
}
|
||||
// 可见性
|
||||
if (Arr::exists($data, 'visibility_appointor') || Arr::exists($data, 'is_all_visible')) {
|
||||
if ($data['is_all_visible'] == 1) {
|
||||
ProjectTask::whereId($data['task_id'])->update(['is_all_visible' => 1]);
|
||||
ProjectTaskUser::whereTaskId($data['task_id'])->whereOwner(2)->delete();
|
||||
} elseif ( isset($data['visibility_appointor']) || $data['is_all_visible'] == 0) {
|
||||
ProjectTask::whereId($data['task_id'])->update(['is_all_visible' => 0]);
|
||||
// 覆盖
|
||||
ProjectTaskUser::whereTaskId($data['task_id'])->whereOwner(2)->delete();
|
||||
if (Arr::exists($data, 'is_all_visible') || Arr::exists($data, 'visibility_appointor')) {
|
||||
if(Arr::exists($data, 'is_all_visible')){
|
||||
ProjectTask::whereId($data['task_id'])->update(['is_all_visible' => $data["is_all_visible"]]);
|
||||
}
|
||||
ProjectTaskUser::whereTaskId($data['task_id'])->whereOwner(2)->delete();
|
||||
if(Arr::exists($data, 'visibility_appointor')){
|
||||
foreach ($data['visibility_appointor'] as $uid) {
|
||||
ProjectTaskUser::createInstance([
|
||||
'project_id' => $this->project_id,
|
||||
'task_id' => $this->id,
|
||||
'task_pid' => $this->parent_id ?: $this->id,
|
||||
'userid' => $uid,
|
||||
'owner' => 2,
|
||||
])->save();
|
||||
if($uid){
|
||||
ProjectTaskUser::createInstance([
|
||||
'project_id' => $this->project_id,
|
||||
'task_id' => $this->id,
|
||||
'task_pid' => $this->parent_id ?: $this->id,
|
||||
'userid' => $uid,
|
||||
'owner' => 2,
|
||||
])->save();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 计划时间(原则:子任务时间在主任务时间内)
|
||||
@ -1455,7 +1453,7 @@ class ProjectTask extends AbstractModel
|
||||
$userids = array_diff($userids, $owners, $assists);
|
||||
} else {
|
||||
// 指定可见
|
||||
$userids = $taskUser->where('owner', 2)->pluck('userid')->toArray();
|
||||
$userids = $taskUser->pluck('userid')->toArray();
|
||||
}
|
||||
$data = array_merge($data, [
|
||||
'owner' => 0,
|
||||
@ -1488,7 +1486,7 @@ class ProjectTask extends AbstractModel
|
||||
* 添加可见性任务 推送
|
||||
* @param array|self $data 发送内容,默认为[id, parent_id, project_id, column_id, dialog_id]
|
||||
*/
|
||||
public function pushMsgVisibleAdd($data = null)
|
||||
public function pushMsgVisibleAdd($data = null, array $pushUserIds = [])
|
||||
{
|
||||
if (!$this->project) {
|
||||
return;
|
||||
@ -1506,7 +1504,9 @@ class ProjectTask extends AbstractModel
|
||||
}
|
||||
//
|
||||
$array = [];
|
||||
if ($this->is_all_visible == 0) {
|
||||
if ($pushUserIds) {
|
||||
$userids = $pushUserIds;
|
||||
}elseif ($this->is_all_visible != 1) {
|
||||
$userids = ProjectTaskUser::select(['userid', 'owner'])->whereTaskId($this->id)->orWhere('task_pid' , '=', $this->id)->pluck('userid')->toArray();
|
||||
} else {
|
||||
$userids = ProjectUser::whereProjectId($this->project_id)->pluck('userid')->toArray(); // 项目成员
|
||||
@ -1556,7 +1556,8 @@ class ProjectTask extends AbstractModel
|
||||
$projectUserids = ProjectUser::whereProjectId($this->project_id)->pluck('userid')->toArray(); // 项目成员
|
||||
$projectOwner = Project::whereId($this->project_id)->pluck('userid')->toArray(); // 项目负责人
|
||||
$taskOwnerAndAssists = ProjectTaskUser::select(['userid', 'owner'])->whereIn('owner', [0, 1])->whereTaskId($this->id)->pluck('userid')->toArray();
|
||||
$userids = array_diff($projectUserids, $projectOwner, $taskOwnerAndAssists);
|
||||
$subUserids = ProjectTaskUser::whereTaskPid($this->id)->pluck('userid')->toArray();
|
||||
$userids = array_diff($projectUserids, $projectOwner, $taskOwnerAndAssists,$subUserids);
|
||||
}
|
||||
//
|
||||
$array[] = [
|
||||
@ -1583,11 +1584,14 @@ class ProjectTask extends AbstractModel
|
||||
* 更新可见性任务 推送
|
||||
* @param array|self $data 发送内容,默认为[id, parent_id, project_id, column_id, dialog_id]
|
||||
*/
|
||||
public function pushMsgVisibleUpdate($data)
|
||||
public function pushMsgVisibleUpdate($data, array $deleteUserIds = [], array $addUserIds = [])
|
||||
{
|
||||
$this->pushMsgVisibleRemove();
|
||||
usleep(300);
|
||||
$this->pushMsgVisibleAdd($data);
|
||||
if ($deleteUserIds) {
|
||||
$this->pushMsgVisibleRemove($deleteUserIds);
|
||||
}
|
||||
if ($addUserIds) {
|
||||
$this->pushMsgVisibleAdd($data, $addUserIds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="common-user-select" :class="warpClass">
|
||||
<ul v-if="!module" @click="onSelection">
|
||||
<li v-for="userid in values">
|
||||
<li v-for="userid in values" v-if="userid" >
|
||||
<UserAvatar :userid="userid" :size="avatarSize" :show-icon="avatarIcon" :show-name="avatarName" tooltip-disabled/>
|
||||
</li>
|
||||
<li v-if="addIcon || values.length === 0" class="add-icon" :style="addStyle" @click.stop="onSelection"></li>
|
||||
@ -312,6 +312,7 @@ export default {
|
||||
} else {
|
||||
this.searchKey = ""
|
||||
}
|
||||
this.$emit("showUpdate",value)
|
||||
},
|
||||
|
||||
searchKey() {
|
||||
@ -668,6 +669,7 @@ export default {
|
||||
const clone = $A.cloneJSON(this.values)
|
||||
this.values = $A.cloneJSON(this.selects)
|
||||
this.$emit('input', this.values)
|
||||
this.$emit('submit', this.values)
|
||||
|
||||
if (!this.beforeSubmit) {
|
||||
this.showModal = false
|
||||
|
||||
@ -276,14 +276,15 @@ export default {
|
||||
// 获取时间差
|
||||
getTimeDifference(startTime,endTime) {
|
||||
const currentTime = new Date((endTime + '').replace(/-/g,"/"));
|
||||
const timeDiff = (currentTime - new Date((startTime + '').replace(/-/g,"/"))) / 1000; // convert to seconds
|
||||
const endTimes = new Date((startTime + '').replace(/-/g,"/"));
|
||||
const timeDiff = (currentTime - endTimes) / 1000; // convert to seconds
|
||||
if (timeDiff < 60) {
|
||||
return {time:timeDiff,unit:this.$L('秒')};
|
||||
} else if (timeDiff < 3600) {
|
||||
const minutes = Math.floor(timeDiff / 60);
|
||||
return {time:minutes,unit:this.$L('分钟')};
|
||||
} else if(timeDiff < 3600 * 24) {
|
||||
const hours = Math.floor(timeDiff / 3600);
|
||||
const hours = (currentTime - endTimes) / (1000 * 60 * 60);
|
||||
return {time:hours,unit:this.$L('小时')};
|
||||
} else {
|
||||
const days = Math.floor(timeDiff / 3600 / 24);
|
||||
@ -292,7 +293,6 @@ export default {
|
||||
},
|
||||
// 获取详情
|
||||
getInfo(){
|
||||
this.datas = this.data
|
||||
this.$store.dispatch("call", {
|
||||
method: 'get',
|
||||
url: 'approve/process/detail',
|
||||
@ -308,7 +308,9 @@ export default {
|
||||
}
|
||||
return item;
|
||||
})
|
||||
this.datas = data
|
||||
this.$nextTick(()=>{
|
||||
this.datas = data
|
||||
})
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg);
|
||||
}).finally(_ => {
|
||||
@ -379,6 +381,8 @@ export default {
|
||||
},
|
||||
// 评论
|
||||
comment(){
|
||||
this.commentData.content = ""
|
||||
this.commentData.pictures = []
|
||||
this.commentShow = true;
|
||||
},
|
||||
// 提交评论
|
||||
|
||||
@ -372,8 +372,14 @@ export default {
|
||||
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
||||
}
|
||||
}).then(({data}) => {
|
||||
this.unreadList = data.rows.map((h,index)=>{
|
||||
h._active = index == 0;
|
||||
let activeId = 0;
|
||||
let activeIndex = 0;
|
||||
if( this.unreadList.length == 0 || this.unreadList.length == data.rows.length){
|
||||
this.unreadList?.map((res)=>{ if(res._active) activeId = res.id })
|
||||
}
|
||||
this.unreadList = data.rows.map((h,index)=>{
|
||||
h._active = activeId > 0 ? h.id == activeId : index == 0;
|
||||
if(h._active) activeIndex = index
|
||||
return h;
|
||||
})
|
||||
if(this.approvalType == 'all'){
|
||||
@ -381,7 +387,7 @@ export default {
|
||||
}
|
||||
if(this.tabsValue == 'unread'){
|
||||
this.$nextTick(()=>{
|
||||
this.details = this.unreadList[0] || {}
|
||||
this.details = this.unreadList[activeIndex] || {}
|
||||
})
|
||||
}
|
||||
}).catch(({msg}) => {
|
||||
@ -402,13 +408,19 @@ export default {
|
||||
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
||||
}
|
||||
}).then(({data}) => {
|
||||
this.doneList = data.rows.map((h,index)=>{
|
||||
h._active = index == 0;
|
||||
let activeId = 0;
|
||||
let activeIndex = 0;
|
||||
if( this.doneList.length == 0 || this.doneList.length == data.rows.length){
|
||||
this.doneList?.map((res)=>{ if(res._active) activeId = res.id })
|
||||
}
|
||||
this.doneList = data.rows.map((h,index)=>{
|
||||
h._active = activeId > 0 ? h.id == activeId : index == 0;
|
||||
if(h._active) activeIndex = index
|
||||
return h;
|
||||
})
|
||||
if(this.tabsValue == 'done'){
|
||||
this.$nextTick(()=>{
|
||||
this.details = this.doneList[0] || {}
|
||||
this.details = this.doneList[activeIndex] || {}
|
||||
})
|
||||
}
|
||||
}).catch(({msg}) => {
|
||||
@ -429,13 +441,19 @@ export default {
|
||||
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
||||
}
|
||||
}).then(({data}) => {
|
||||
this.notifyList = data.rows.map((h,index)=>{
|
||||
h._active = index == 0;
|
||||
let activeId = 0;
|
||||
let activeIndex = 0;
|
||||
if( this.notifyList.length == 0 || this.notifyList.length == data.rows.length){
|
||||
this.notifyList?.map((res)=>{ if(res._active) activeId = res.id })
|
||||
}
|
||||
this.notifyList = data.rows.map((h,index)=>{
|
||||
h._active = activeId > 0 ? h.id == activeId : index == 0;
|
||||
if(h._active) activeIndex = index
|
||||
return h;
|
||||
})
|
||||
if(this.tabsValue == 'notify'){
|
||||
this.$nextTick(()=>{
|
||||
this.details = this.notifyList[0] || {}
|
||||
this.details = this.notifyList[activeIndex] || {}
|
||||
})
|
||||
}
|
||||
}).catch(({msg}) => {
|
||||
@ -457,13 +475,19 @@ export default {
|
||||
state: this.searchState == 'all' ? '' : this.searchState
|
||||
}
|
||||
}).then(({data}) => {
|
||||
let activeId = 0;
|
||||
let activeIndex = 0;
|
||||
if( this.initiatedList.length == 0 || this.initiatedList.length == data.rows.length){
|
||||
this.initiatedList?.map((res)=>{ if(res._active) activeId = res.id })
|
||||
}
|
||||
this.initiatedList = data.rows.map((h,index)=>{
|
||||
h._active = index == 0;
|
||||
h._active = activeId > 0 ? h.id == activeId : index == 0;
|
||||
if(h._active) activeIndex = index
|
||||
return h;
|
||||
})
|
||||
if(this.tabsValue == 'initiated'){
|
||||
this.$nextTick(()=>{
|
||||
this.details = this.initiatedList[0] || {}
|
||||
this.details = this.initiatedList[activeIndex] || {}
|
||||
})
|
||||
}
|
||||
}).catch(({msg}) => {
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
type="datetimerange"
|
||||
@on-change="taskTimeChange(addData.times)"/>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('任务负责人')">
|
||||
<FormItem :label="$L('任务负责人')" >
|
||||
<UserSelect
|
||||
v-model="addData.owner"
|
||||
:multiple-max="10"
|
||||
@ -93,20 +93,50 @@
|
||||
</ETooltip>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('可见性')">
|
||||
<Checkbox disabled v-model="addData.visibility_principal" :true-value="1" :false-value="0">{{$L('任务负责人')}}</Checkbox>
|
||||
<Checkbox disabled v-model="addData.visibility_assist" :true-value="1" :false-value="0">{{$L('任务协助人')}}</Checkbox>
|
||||
<RadioGroup v-model="addData.is_all_visible">
|
||||
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
||||
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
||||
</RadioGroup>
|
||||
<UserSelect
|
||||
class="item-content user"
|
||||
v-show="!addData.is_all_visible"
|
||||
<FormItem>
|
||||
<div class="item-label" slot="label">
|
||||
<EDropdown ref="eDropdownRef" trigger="click" placement="bottom" @command="dropVisible">
|
||||
<span cclass="dashed-text">{{$L('可见性')}}
|
||||
<i class="taskfont" style="font-size: 10px;margin-right: 0;"></i>
|
||||
</span>
|
||||
<EDropdownMenu slot="dropdown">
|
||||
<EDropdownItem :command="1">
|
||||
<div class="task-menu-icon" >
|
||||
<Icon v-if="addData.visibility_appoint == 1" class="completed" :type="'md-checkmark-circle'"/>
|
||||
<Icon v-else class="uncomplete" :type="'md-radio-button-off'"/>
|
||||
{{$L('项目人员')}}
|
||||
</div>
|
||||
</EDropdownItem>
|
||||
<EDropdownItem :command="2">
|
||||
<div class="task-menu-icon" >
|
||||
<Icon v-if="addData.visibility_appoint == 2" class="completed" :type="'md-checkmark-circle'"/>
|
||||
<Icon v-else class="uncomplete" :type="'md-radio-button-off'"/>
|
||||
{{$L('任务人员')}}
|
||||
</div>
|
||||
</EDropdownItem>
|
||||
<EDropdownItem :command="3">
|
||||
<div class="task-menu-icon" >
|
||||
<Icon v-if="addData.visibility_appoint == 3" class="completed" :type="'md-checkmark-circle'"/>
|
||||
<Icon v-else class="uncomplete" :type="'md-radio-button-off'"/>
|
||||
{{$L('指定成员')}}
|
||||
</div>
|
||||
</EDropdownItem>
|
||||
</EDropdownMenu>
|
||||
</EDropdown>
|
||||
</div>
|
||||
<div class="item-content user ivu-input ivu-input-default ivu-input-with-suffix" v-if="addData.visibility_appoint < 3" @click="showCisibleDropdown">
|
||||
<span v-if="addData.visibility_appoint == 1" class="dashed-text">{{$L('项目人员可见')}}</span>
|
||||
<span v-else-if="addData.visibility_appoint == 2" class="dashed-text">{{$L('任务人员可见')}}</span>
|
||||
</div>
|
||||
<UserSelect v-else
|
||||
ref="visibleUserSelectRef"
|
||||
v-model="addData.visibility_appointor"
|
||||
:avatar-size="28"
|
||||
:avatar-size="24"
|
||||
:title="$L('选择指定人员')"
|
||||
:project-id="addData.project_id"/>
|
||||
:project-id="addData.project_id"
|
||||
@showUpdate="visibleUserSelectShowUpdate"
|
||||
border
|
||||
/>
|
||||
</FormItem>
|
||||
<div class="subtasks">
|
||||
<div v-if="addData.subtasks.length > 0" class="sublist">
|
||||
@ -202,10 +232,7 @@ export default {
|
||||
p_name: '',
|
||||
p_color: '',
|
||||
// 可见性
|
||||
visibility_principal: 1,
|
||||
visibility_assist: 1,
|
||||
visibility_appoint: 1,
|
||||
is_all_visible: 1,
|
||||
visibility_appointor: [],
|
||||
},
|
||||
|
||||
@ -529,6 +556,35 @@ export default {
|
||||
close() {
|
||||
this.$emit("input", !this.value)
|
||||
},
|
||||
|
||||
showCisibleDropdown(){
|
||||
this.$refs.eDropdownRef.show()
|
||||
},
|
||||
|
||||
visibleUserSelectShowUpdate(isShow){
|
||||
if(!isShow && (this.addData.visibility_appointor.length == 0 || !this.addData.visibility_appointor[0])){
|
||||
let old = this.addData.old_visibility_appoint;
|
||||
this.addData.visibility_appoint = old > 2 ? 1 : (old || 1);
|
||||
if(this.addData.visibility_appoint < 3 ){
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dropVisible(command) {
|
||||
switch (command) {
|
||||
case 1:
|
||||
case 2:
|
||||
this.addData.visibility_appoint = command
|
||||
break;
|
||||
case 3:
|
||||
this.addData.old_visibility_appoint = this.addData.visibility_appoint
|
||||
this.addData.visibility_appoint = command
|
||||
this.$nextTick(() => {
|
||||
this.$refs.visibleUserSelectRef.onSelection()
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -114,10 +114,8 @@ export default {
|
||||
p_name: '',
|
||||
p_color: '',
|
||||
// 可见性
|
||||
visibility_principal: 1,
|
||||
visibility_assist: 1,
|
||||
visibility_appoint: 1,
|
||||
visibility_appointor: [0],
|
||||
visibility_appointor: [],
|
||||
},
|
||||
active: false,
|
||||
|
||||
@ -223,10 +221,8 @@ export default {
|
||||
p_name: '',
|
||||
p_color: '',
|
||||
// 可见性
|
||||
visibility_principal: 1,
|
||||
visibility_assist: 1,
|
||||
visibility_appoint: 1,
|
||||
visibility_appointor: [0],
|
||||
visibility_appointor: [],
|
||||
}
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg);
|
||||
|
||||
@ -1,60 +1,56 @@
|
||||
<template>
|
||||
<!--子任务-->
|
||||
<li style="display: block;margin-bottom: 16px;" v-if="ready && taskDetail.parent_id > 0">
|
||||
<div style="display: flex; margin-left: 6px;">
|
||||
<div class="subtask-icon">
|
||||
<TaskMenu
|
||||
:ref="`taskMenu_${taskDetail.id}`"
|
||||
:disabled="taskId === 0"
|
||||
:task="taskDetail"
|
||||
:load-status="taskDetail.loading === true"
|
||||
@on-update="getLogLists"/>
|
||||
</div>
|
||||
<div class="subtask-name">
|
||||
<Input
|
||||
v-model="taskDetail.name"
|
||||
ref="name"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 1, maxRows: 8 }"
|
||||
:maxlength="255"
|
||||
enterkeyhint="done"
|
||||
@on-blur="updateBlur('name')"
|
||||
@on-keydown="onNameKeydown"/>
|
||||
</div>
|
||||
<li v-if="ready && taskDetail.parent_id > 0">
|
||||
<div class="subtask-icon">
|
||||
<TaskMenu
|
||||
:ref="`taskMenu_${taskDetail.id}`"
|
||||
:disabled="taskId === 0"
|
||||
:task="taskDetail"
|
||||
:load-status="taskDetail.loading === true"
|
||||
@on-update="getLogLists"/>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<div style="display: flex;">
|
||||
<div style="margin-left: 28px;" class="item-label" slot="label">
|
||||
<i class="taskfont"></i>
|
||||
</div>
|
||||
<DatePicker
|
||||
v-model="timeValue"
|
||||
:open="timeOpen"
|
||||
:options="timeOptions"
|
||||
format="yyyy/MM/dd HH:mm"
|
||||
type="datetimerange"
|
||||
class="subtask-time"
|
||||
placement="bottom-end"
|
||||
@on-open-change="timeChange"
|
||||
@on-clear="timeClear"
|
||||
@on-ok="timeOk"
|
||||
transfer>
|
||||
<div class="picker-time">
|
||||
<div @click="openTime" class="time sub-time">{{taskDetail.end_at ? cutTime : '--'}}</div>
|
||||
</div>
|
||||
</DatePicker>
|
||||
</div>
|
||||
<UserSelect
|
||||
class="subtask-avatar"
|
||||
v-model="ownerData.owner_userid"
|
||||
:multiple-max="10"
|
||||
:avatar-size="20"
|
||||
:title="$L('修改负责人')"
|
||||
:add-icon="false"
|
||||
:project-id="taskDetail.project_id"
|
||||
:before-submit="onOwner"/>
|
||||
<div v-if="taskDetail.flow_item_name" class="subtask-flow">
|
||||
<span :class="taskDetail.flow_item_status" @click.stop="openMenu($event, taskDetail)">{{taskDetail.flow_item_name}}</span>
|
||||
</div>
|
||||
<div class="subtask-name">
|
||||
<Input style="min-width: 80px;"
|
||||
v-model="taskDetail.name"
|
||||
ref="name"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 1, maxRows: 8 }"
|
||||
:maxlength="255"
|
||||
enterkeyhint="done"
|
||||
@on-blur="updateBlur('name')"
|
||||
@on-keydown="onNameKeydown"
|
||||
/>
|
||||
</div>
|
||||
<DatePicker
|
||||
v-model="timeValue"
|
||||
:open="timeOpen"
|
||||
:options="timeOptions"
|
||||
format="yyyy/MM/dd HH:mm"
|
||||
type="datetimerange"
|
||||
class="subtask-time"
|
||||
placement="bottom-end"
|
||||
@on-open-change="timeChange"
|
||||
@on-clear="timeClear"
|
||||
@on-ok="timeOk"
|
||||
transfer>
|
||||
<div v-if="!taskDetail.complete_at && taskDetail.end_at && taskDetail.end_at != mainEndAt" @click="openTime" :class="['time', taskDetail.today ? 'today' : '', taskDetail.overdue ? 'overdue' : '']">
|
||||
{{expiresFormat(taskDetail.end_at)}}
|
||||
</div>
|
||||
<Icon v-else class="clock" type="ios-clock-outline" @click="openTime" />
|
||||
</DatePicker>
|
||||
<UserSelect
|
||||
class="subtask-avatar"
|
||||
v-model="ownerData.owner_userid"
|
||||
:multiple-max="10"
|
||||
:avatar-size="20"
|
||||
:title="$L('修改负责人')"
|
||||
:add-icon="false"
|
||||
:project-id="taskDetail.project_id"
|
||||
:before-submit="onOwner"/>
|
||||
</li>
|
||||
<!--主任务-->
|
||||
<div
|
||||
@ -207,22 +203,48 @@
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<div class="item-label" slot="label">
|
||||
<i class="taskfont"></i>{{$L('可见性')}}
|
||||
<i class="taskfont"></i>
|
||||
<EDropdown ref="eDropdownRef" trigger="click" placement="bottom" @command="dropVisible">
|
||||
<span class="dashed-text" style="color: #bbbbbb; ">{{$L('可见性')}}
|
||||
<i class="taskfont" style="font-size: 10px;margin-right: 0;"></i>
|
||||
</span>
|
||||
<EDropdownMenu slot="dropdown">
|
||||
<EDropdownItem :command="1">
|
||||
<div class="task-menu-icon" >
|
||||
<Icon v-if="taskDetail.is_all_visible == 1" class="completed" :type="'md-checkmark-circle'"/>
|
||||
<Icon v-else class="uncomplete" :type="'md-radio-button-off'"/>
|
||||
{{$L('项目人员')}}
|
||||
</div>
|
||||
</EDropdownItem>
|
||||
<EDropdownItem :command="2">
|
||||
<div class="task-menu-icon" >
|
||||
<Icon v-if="taskDetail.is_all_visible == 2" class="completed" :type="'md-checkmark-circle'"/>
|
||||
<Icon v-else class="uncomplete" :type="'md-radio-button-off'"/>
|
||||
{{$L('任务人员')}}
|
||||
</div>
|
||||
</EDropdownItem>
|
||||
<EDropdownItem :command="3">
|
||||
<div class="task-menu-icon" >
|
||||
<Icon v-if="taskDetail.is_all_visible == 3" class="completed" :type="'md-checkmark-circle'"/>
|
||||
<Icon v-else class="uncomplete" :type="'md-radio-button-off'"/>
|
||||
{{$L('指定成员')}}
|
||||
</div>
|
||||
</EDropdownItem>
|
||||
</EDropdownMenu>
|
||||
</EDropdown>
|
||||
</div>
|
||||
<div class="item-content user">
|
||||
<span @click="showCisibleDropdown" v-if="taskDetail.is_all_visible == 1" class="dashed-text">{{$L('项目人员可见')}}</span>
|
||||
<span @click="showCisibleDropdown" v-else-if="taskDetail.is_all_visible == 2" class="dashed-text">{{$L('任务人员可见')}}</span>
|
||||
<UserSelect v-else
|
||||
ref="visibleUserSelectRef"
|
||||
v-model="taskDetail.visibility_appointor"
|
||||
:avatar-size="28"
|
||||
:title="$L('选择指定人员')"
|
||||
:project-id="taskDetail.project_id"
|
||||
@showUpdate="visibleUserSelectShowUpdate"
|
||||
/>
|
||||
</div>
|
||||
<Checkbox disabled v-model="visibility_principal" :true-value="1" :false-value="0">{{$L('任务负责人')}}</Checkbox>
|
||||
<Checkbox disabled v-model="visibility_assist" :true-value="1" :false-value="0">{{$L('任务协助人')}}</Checkbox>
|
||||
<RadioGroup v-model="taskDetail.is_all_visible">
|
||||
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
||||
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
||||
</RadioGroup>
|
||||
<UserSelect
|
||||
class="item-content user"
|
||||
v-show="!taskDetail.is_all_visible"
|
||||
v-model="taskDetail.visibility_appointor"
|
||||
:avatar-size="28"
|
||||
:title="$L('选择指定人员')"
|
||||
:project-id="taskDetail.project_id"/>
|
||||
<Button size="small" type="primary" @click="updateVisible">{{$L('提交修改')}}</Button>
|
||||
</FormItem>
|
||||
<FormItem v-if="taskDetail.end_at || timeForce">
|
||||
<div class="item-label" slot="label">
|
||||
@ -309,11 +331,11 @@
|
||||
</li>
|
||||
</ul>
|
||||
</FormItem>
|
||||
<div v-if="subList.length > 0 || addsubForce">
|
||||
<FormItem v-if="subList.length > 0 || addsubForce">
|
||||
<div class="item-label" slot="label">
|
||||
<i class="taskfont"></i>{{$L('子任务')}}
|
||||
</div>
|
||||
<ul style="overflow: hidden;" class="item-content subtask">
|
||||
<ul class="item-content subtask">
|
||||
<TaskDetail
|
||||
v-for="(task, key) in subList"
|
||||
:ref="`subTask_${task.id}`"
|
||||
@ -341,7 +363,7 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div v-if="menuList.length > 0" class="add">
|
||||
<EDropdown
|
||||
@ -551,11 +573,6 @@ export default {
|
||||
{key: 'year', label: '每年'},
|
||||
{key: 'custom', label: '自定义'},
|
||||
],
|
||||
|
||||
// 可见性
|
||||
visibility_principal: 1,
|
||||
visibility_assist: 1,
|
||||
visibility_appoint: 1,
|
||||
}
|
||||
},
|
||||
|
||||
@ -726,7 +743,7 @@ export default {
|
||||
name: '优先级',
|
||||
});
|
||||
}
|
||||
if (!($A.isArray(taskDetail.task_user) && taskDetail.task_user.find(({owner}) => owner !== 1))) {
|
||||
if (!($A.isArray(taskDetail.task_user) && taskDetail.task_user.find(({owner}) => owner === 0 ))) {
|
||||
list.push({
|
||||
command: 'assist',
|
||||
icon: '',
|
||||
@ -830,6 +847,15 @@ export default {
|
||||
this.timeValue = this.taskDetail.end_at ? [this.taskDetail.start_at, this.taskDetail.end_at] : [];
|
||||
}
|
||||
},
|
||||
"taskDetail.visibility_appointor": {
|
||||
handler(arr) {
|
||||
if(arr?.length > 0 && arr[0]) {
|
||||
this.taskDetail.is_all_visible = 3
|
||||
this.updateVisible()
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -1520,6 +1546,37 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
showCisibleDropdown(){
|
||||
this.$refs.eDropdownRef.show()
|
||||
},
|
||||
|
||||
visibleUserSelectShowUpdate(isShow){
|
||||
if(!isShow && (this.taskDetail.visibility_appointor.length == 0 || !this.taskDetail.visibility_appointor[0])){
|
||||
let old = this.taskDetail.old_is_all_visible;
|
||||
this.taskDetail.is_all_visible = old > 2 ? 1 : (old || 1);
|
||||
if(this.taskDetail.is_all_visible < 3 ){
|
||||
this.updateVisible();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dropVisible(command) {
|
||||
switch (command) {
|
||||
case 1:
|
||||
case 2:
|
||||
this.taskDetail.is_all_visible = command
|
||||
this.updateVisible();
|
||||
break;
|
||||
case 3:
|
||||
this.taskDetail.old_is_all_visible = this.taskDetail.is_all_visible
|
||||
this.taskDetail.is_all_visible = command
|
||||
this.$nextTick(() => {
|
||||
this.$refs.visibleUserSelectRef.onSelection()
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
updateVisible() {
|
||||
this.updateData(['is_all_visible', 'visibility_appointor'])
|
||||
}
|
||||
@ -1533,4 +1590,12 @@ export default {
|
||||
::v-deep .sub-time {
|
||||
color: #BBBBBB;
|
||||
}
|
||||
.dashed-text{
|
||||
cursor: pointer;
|
||||
border-bottom: 1px dashed #acacac;
|
||||
}
|
||||
.dashed-text .taskfont{
|
||||
font-size: 10px;
|
||||
margin-right: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -336,6 +336,7 @@
|
||||
}
|
||||
.subtask-flow {
|
||||
> span {
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
height: 18px;
|
||||
min-width: 20px;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user