mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
fix:1.审批中心时长显示优化修复,2.审批中心点击列表时滚动条不变 , 3调整可见性样式
This commit is contained in:
parent
5d57666cd4
commit
2e92682df2
@ -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>
|
||||
|
||||
@ -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"
|
||||
@ -94,8 +94,10 @@
|
||||
</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>
|
||||
<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>
|
||||
<RadioGroup v-model="addData.is_all_visible">
|
||||
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
||||
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
||||
@ -104,10 +106,11 @@
|
||||
class="item-content user"
|
||||
v-show="!addData.is_all_visible"
|
||||
v-model="addData.visibility_appointor"
|
||||
:avatar-size="28"
|
||||
:avatar-size="24"
|
||||
:title="$L('选择指定人员')"
|
||||
:project-id="addData.project_id"/>
|
||||
<!-- <Button size="small" type="primary" @click="updateVisible">{{$L('提交修改')}}</Button>-->
|
||||
:project-id="addData.project_id"
|
||||
border
|
||||
/>
|
||||
</FormItem>
|
||||
<div class="subtasks">
|
||||
<div v-if="addData.subtasks.length > 0" class="sublist">
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
:load-status="taskDetail.loading === true"
|
||||
@on-update="getLogLists"/>
|
||||
</div>
|
||||
<!-- <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 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
|
||||
v-model="taskDetail.name"
|
||||
@ -220,20 +220,24 @@
|
||||
<div class="item-label" slot="label">
|
||||
<i class="taskfont"></i>{{$L('可见性')}}
|
||||
</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>
|
||||
<div class="item-content user">
|
||||
<RadioGroup >
|
||||
<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>
|
||||
<RadioGroup v-model="taskDetail.is_all_visible">
|
||||
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
||||
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
||||
</RadioGroup>
|
||||
<UserSelect
|
||||
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>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem v-if="taskDetail.end_at || timeForce">
|
||||
<div class="item-label" slot="label">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user