mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-10 00:18:21 +00:00
perf(client): 优化添加任务可见性点击效果
This commit is contained in:
parent
40b637b16e
commit
d2b8d0372e
@ -93,50 +93,53 @@
|
|||||||
border/>
|
border/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<div slot="label">
|
<div slot="label" class="visibility-text" @click="showCisibleDropdown">
|
||||||
<EDropdown ref="eDropdownRef" trigger="click" placement="bottom" @command="dropVisible">
|
{{ $L('可见性') }}
|
||||||
<span class="visibility-text">{{$L('可见性')}}
|
<i class="taskfont"></i>
|
||||||
<i class="taskfont"></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>
|
||||||
<div class="ivu-input task-add-visibility" v-if="addData.visibility_appoint < 3" @click="showCisibleDropdown">
|
<div
|
||||||
<span v-if="addData.visibility_appoint == 1">{{$L('项目人员可见')}}</span>
|
v-if="addData.visibility_appoint == 1 || addData.visibility_appoint == 2"
|
||||||
<span v-else-if="addData.visibility_appoint == 2">{{$L('任务人员可见')}}</span>
|
ref="visibilityText"
|
||||||
|
class="ivu-input task-add-visibility"
|
||||||
|
@click="showCisibleDropdown">
|
||||||
|
{{ addData.visibility_appoint == 1 ? $L('项目人员可见') : $L('任务人员可见') }}
|
||||||
</div>
|
</div>
|
||||||
<UserSelect v-else
|
<UserSelect
|
||||||
|
v-else
|
||||||
ref="visibleUserSelectRef"
|
ref="visibleUserSelectRef"
|
||||||
v-model="addData.visibility_appointor"
|
v-model="addData.visibility_appointor"
|
||||||
:avatar-size="24"
|
:avatar-size="24"
|
||||||
:title="$L('选择指定人员')"
|
:title="$L('选择指定人员')"
|
||||||
:project-id="addData.project_id"
|
:project-id="addData.project_id"
|
||||||
@on-show-change="visibleUserSelectShowChange"
|
@on-show-change="visibleUserSelectShowChange"
|
||||||
border
|
border/>
|
||||||
/>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<EDropdown ref="eDropdownRef" class="calculate-dropdown" trigger="click" placement="bottom" @command="dropVisible">
|
||||||
|
<div class="calculate-content"></div>
|
||||||
|
<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 class="subtasks">
|
<div class="subtasks">
|
||||||
<div v-if="addData.subtasks.length > 0" class="sublist">
|
<div v-if="addData.subtasks.length > 0" class="sublist">
|
||||||
<Row>
|
<Row>
|
||||||
@ -559,8 +562,29 @@ export default {
|
|||||||
this.$emit("input", !this.value)
|
this.$emit("input", !this.value)
|
||||||
},
|
},
|
||||||
|
|
||||||
showCisibleDropdown(){
|
showCisibleDropdown(e){
|
||||||
this.$refs.eDropdownRef.show()
|
let eRect = null
|
||||||
|
if (e === null) {
|
||||||
|
eRect = this.$refs.visibilityText?.getBoundingClientRect()
|
||||||
|
} else {
|
||||||
|
eRect = e.target.getBoundingClientRect()
|
||||||
|
}
|
||||||
|
if (eRect === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const boxRect = this.$el.getBoundingClientRect()
|
||||||
|
const refEl = this.$refs.eDropdownRef.$el
|
||||||
|
refEl.style.top = (eRect.top - boxRect.top) + 'px'
|
||||||
|
refEl.style.left = (eRect.left - boxRect.left) + 'px'
|
||||||
|
refEl.style.width = eRect.width + 'px'
|
||||||
|
refEl.style.height = eRect.height + 'px'
|
||||||
|
//
|
||||||
|
if (this.$refs.eDropdownRef.visible) {
|
||||||
|
this.$refs.eDropdownRef.hide()
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs.eDropdownRef.show()
|
||||||
|
}, 0)
|
||||||
},
|
},
|
||||||
|
|
||||||
visibleUserSelectShowChange(isShow){
|
visibleUserSelectShowChange(isShow){
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
.task-add {
|
.task-add {
|
||||||
|
position: relative;
|
||||||
.head {
|
.head {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -54,6 +55,17 @@
|
|||||||
}
|
}
|
||||||
.task-add-form,
|
.task-add-form,
|
||||||
.task-add-advanced {
|
.task-add-advanced {
|
||||||
|
.calculate-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
z-index: -1;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
.title {
|
.title {
|
||||||
.ivu-input {
|
.ivu-input {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user