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>
|
<template>
|
||||||
<div class="common-user-select" :class="warpClass">
|
<div class="common-user-select" :class="warpClass">
|
||||||
<ul v-if="!module" @click="onSelection">
|
<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/>
|
<UserAvatar :userid="userid" :size="avatarSize" :show-icon="avatarIcon" :show-name="avatarName" tooltip-disabled/>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="addIcon || values.length === 0" class="add-icon" :style="addStyle" @click.stop="onSelection"></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) {
|
getTimeDifference(startTime,endTime) {
|
||||||
const currentTime = new Date((endTime + '').replace(/-/g,"/"));
|
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) {
|
if (timeDiff < 60) {
|
||||||
return {time:timeDiff,unit:this.$L('秒')};
|
return {time:timeDiff,unit:this.$L('秒')};
|
||||||
} else if (timeDiff < 3600) {
|
} else if (timeDiff < 3600) {
|
||||||
const minutes = Math.floor(timeDiff / 60);
|
const minutes = Math.floor(timeDiff / 60);
|
||||||
return {time:minutes,unit:this.$L('分钟')};
|
return {time:minutes,unit:this.$L('分钟')};
|
||||||
} else if(timeDiff < 3600 * 24) {
|
} else if(timeDiff < 3600 * 24) {
|
||||||
const hours = Math.floor(timeDiff / 3600);
|
const hours = (currentTime - endTimes) / (1000 * 60 * 60);
|
||||||
return {time:hours,unit:this.$L('小时')};
|
return {time:hours,unit:this.$L('小时')};
|
||||||
} else {
|
} else {
|
||||||
const days = Math.floor(timeDiff / 3600 / 24);
|
const days = Math.floor(timeDiff / 3600 / 24);
|
||||||
@ -292,7 +293,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取详情
|
// 获取详情
|
||||||
getInfo(){
|
getInfo(){
|
||||||
this.datas = this.data
|
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: 'approve/process/detail',
|
url: 'approve/process/detail',
|
||||||
@ -308,7 +308,9 @@ export default {
|
|||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
|
this.$nextTick(()=>{
|
||||||
this.datas = data
|
this.datas = data
|
||||||
|
})
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
}).finally(_ => {
|
}).finally(_ => {
|
||||||
@ -379,6 +381,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 评论
|
// 评论
|
||||||
comment(){
|
comment(){
|
||||||
|
this.commentData.content = ""
|
||||||
|
this.commentData.pictures = []
|
||||||
this.commentShow = true;
|
this.commentShow = true;
|
||||||
},
|
},
|
||||||
// 提交评论
|
// 提交评论
|
||||||
|
|||||||
@ -372,8 +372,14 @@ export default {
|
|||||||
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
||||||
}
|
}
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
|
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)=>{
|
this.unreadList = 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;
|
return h;
|
||||||
})
|
})
|
||||||
if(this.approvalType == 'all'){
|
if(this.approvalType == 'all'){
|
||||||
@ -381,7 +387,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if(this.tabsValue == 'unread'){
|
if(this.tabsValue == 'unread'){
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.details = this.unreadList[0] || {}
|
this.details = this.unreadList[activeIndex] || {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
@ -402,13 +408,19 @@ export default {
|
|||||||
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
||||||
}
|
}
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
|
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)=>{
|
this.doneList = 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;
|
return h;
|
||||||
})
|
})
|
||||||
if(this.tabsValue == 'done'){
|
if(this.tabsValue == 'done'){
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.details = this.doneList[0] || {}
|
this.details = this.doneList[activeIndex] || {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
@ -429,13 +441,19 @@ export default {
|
|||||||
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
proc_def_name: this.approvalType == 'all' ? '' : this.approvalType,
|
||||||
}
|
}
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
|
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)=>{
|
this.notifyList = 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;
|
return h;
|
||||||
})
|
})
|
||||||
if(this.tabsValue == 'notify'){
|
if(this.tabsValue == 'notify'){
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.details = this.notifyList[0] || {}
|
this.details = this.notifyList[activeIndex] || {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
@ -457,13 +475,19 @@ export default {
|
|||||||
state: this.searchState == 'all' ? '' : this.searchState
|
state: this.searchState == 'all' ? '' : this.searchState
|
||||||
}
|
}
|
||||||
}).then(({data}) => {
|
}).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)=>{
|
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;
|
return h;
|
||||||
})
|
})
|
||||||
if(this.tabsValue == 'initiated'){
|
if(this.tabsValue == 'initiated'){
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.details = this.initiatedList[0] || {}
|
this.details = this.initiatedList[activeIndex] || {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
|
|||||||
@ -94,8 +94,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem :label="$L('可见性')">
|
<FormItem :label="$L('可见性')">
|
||||||
|
<RadioGroup>
|
||||||
<Checkbox disabled v-model="addData.visibility_principal" :true-value="1" :false-value="0">{{$L('任务负责人')}}</Checkbox>
|
<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>
|
<Checkbox disabled v-model="addData.visibility_assist" :true-value="1" :false-value="0">{{$L('任务协助人')}}</Checkbox>
|
||||||
|
</RadioGroup>
|
||||||
<RadioGroup v-model="addData.is_all_visible">
|
<RadioGroup v-model="addData.is_all_visible">
|
||||||
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
||||||
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
||||||
@ -104,10 +106,11 @@
|
|||||||
class="item-content user"
|
class="item-content user"
|
||||||
v-show="!addData.is_all_visible"
|
v-show="!addData.is_all_visible"
|
||||||
v-model="addData.visibility_appointor"
|
v-model="addData.visibility_appointor"
|
||||||
:avatar-size="28"
|
:avatar-size="24"
|
||||||
:title="$L('选择指定人员')"
|
:title="$L('选择指定人员')"
|
||||||
:project-id="addData.project_id"/>
|
:project-id="addData.project_id"
|
||||||
<!-- <Button size="small" type="primary" @click="updateVisible">{{$L('提交修改')}}</Button>-->
|
border
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<div class="subtasks">
|
<div class="subtasks">
|
||||||
<div v-if="addData.subtasks.length > 0" class="sublist">
|
<div v-if="addData.subtasks.length > 0" class="sublist">
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
:load-status="taskDetail.loading === true"
|
:load-status="taskDetail.loading === true"
|
||||||
@on-update="getLogLists"/>
|
@on-update="getLogLists"/>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div v-if="taskDetail.flow_item_name" class="subtask-flow">-->
|
<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>-->
|
<span :class="taskDetail.flow_item_status" @click.stop="openMenu($event, taskDetail)">{{taskDetail.flow_item_name}}</span>
|
||||||
<!-- </div>-->
|
</div>
|
||||||
<div class="subtask-name">
|
<div class="subtask-name">
|
||||||
<Input
|
<Input
|
||||||
v-model="taskDetail.name"
|
v-model="taskDetail.name"
|
||||||
@ -220,20 +220,24 @@
|
|||||||
<div class="item-label" slot="label">
|
<div class="item-label" slot="label">
|
||||||
<i class="taskfont"></i>{{$L('可见性')}}
|
<i class="taskfont"></i>{{$L('可见性')}}
|
||||||
</div>
|
</div>
|
||||||
|
<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_principal" :true-value="1" :false-value="0">{{$L('任务负责人')}}</Checkbox>
|
||||||
<Checkbox disabled v-model="visibility_assist" :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">
|
<RadioGroup v-model="taskDetail.is_all_visible">
|
||||||
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
<Radio :label=1>{{$L('所有人员')}}</Radio>
|
||||||
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
<Radio :label=0>{{$L('指定成员')}}</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
<UserSelect
|
<UserSelect
|
||||||
class="item-content user"
|
|
||||||
v-show="!taskDetail.is_all_visible"
|
v-show="!taskDetail.is_all_visible"
|
||||||
v-model="taskDetail.visibility_appointor"
|
v-model="taskDetail.visibility_appointor"
|
||||||
:avatar-size="28"
|
:avatar-size="28"
|
||||||
:title="$L('选择指定人员')"
|
:title="$L('选择指定人员')"
|
||||||
:project-id="taskDetail.project_id"/>
|
:project-id="taskDetail.project_id"
|
||||||
|
/>
|
||||||
<Button size="small" type="primary" @click="updateVisible">{{$L('提交修改')}}</Button>
|
<Button size="small" type="primary" @click="updateVisible">{{$L('提交修改')}}</Button>
|
||||||
|
</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="taskDetail.end_at || timeForce">
|
<FormItem v-if="taskDetail.end_at || timeForce">
|
||||||
<div class="item-label" slot="label">
|
<div class="item-label" slot="label">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user