mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 20:12:48 +00:00
no message
This commit is contained in:
parent
ec8e144655
commit
3c10976aff
@ -19,7 +19,10 @@
|
|||||||
:divided="!!item.divided"
|
:divided="!!item.divided"
|
||||||
:disabled="(active === item.value && !activeClick) || !!item.disabled">
|
:disabled="(active === item.value && !activeClick) || !!item.disabled">
|
||||||
<div class="item-box" :style="item.style" :class="item.className">
|
<div class="item-box" :style="item.style" :class="item.className">
|
||||||
<div class="item">{{language ? $L(item.label) : item.label}}</div>
|
<div class="item">
|
||||||
|
<div v-if="item.prefix" class="item-prefix" v-html="item.prefix"></div>
|
||||||
|
<div class="item-label">{{language ? $L(item.label) : item.label}}</div>
|
||||||
|
</div>
|
||||||
<div v-if="tickShow" class="tick">
|
<div v-if="tickShow" class="tick">
|
||||||
<i v-if="active === item.value && !item.disabled" class="taskfont"></i>
|
<i v-if="active === item.value && !item.disabled" class="taskfont"></i>
|
||||||
</div>
|
</div>
|
||||||
@ -46,17 +49,17 @@ export default {
|
|||||||
scrollHide: true, // 滚动立即隐藏
|
scrollHide: true, // 滚动立即隐藏
|
||||||
tickShow: true, // 是否显示打勾(默认为:true,如果 active === undefined 默认为:false)
|
tickShow: true, // 是否显示打勾(默认为:true,如果 active === undefined 默认为:false)
|
||||||
maxHeight: 0, // 滚动区域最大高度
|
maxHeight: 0, // 滚动区域最大高度
|
||||||
language: true, // 是否国际化 item.label
|
language: true, // 是否国际化 item.label(默认:true)
|
||||||
|
|
||||||
element: null,
|
scrollTarget: null,
|
||||||
target: null,
|
menuTarget: null,
|
||||||
styles: {},
|
styles: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (this.target) {
|
if (this.scrollTarget) {
|
||||||
this.target.removeEventListener('scroll', this.handlerEventListeners);
|
this.scrollTarget.removeEventListener('scroll', this.handlerEventListeners);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -71,7 +74,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
menuOperation(data) {
|
menuOperation(data) {
|
||||||
if (data.event && data.list) {
|
if (data.event && data.list) {
|
||||||
if (this.$refs.dropdown.visible && this.element === data.event.target) {
|
if (this.$refs.dropdown.visible && this.menuTarget === data.event.target) {
|
||||||
this.hide();
|
this.hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -99,7 +102,21 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.hide()
|
this.hide()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
windowScrollY() {
|
||||||
|
if (!this.visible || !this.menuTarget) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const eventRect = this.menuTarget.getBoundingClientRect();
|
||||||
|
this.styles = {
|
||||||
|
left: `${eventRect.left}px`,
|
||||||
|
top: `${eventRect.top}px`,
|
||||||
|
width: `${eventRect.width}px`,
|
||||||
|
height: `${eventRect.height}px`,
|
||||||
|
};
|
||||||
|
this.updatePopper();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -129,23 +146,23 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setupEventListeners(event) {
|
setupEventListeners(event) {
|
||||||
this.element = event.target;
|
this.menuTarget = event.target;
|
||||||
let target = this.getScrollParent(this.element);
|
let target = this.getScrollParent(this.menuTarget);
|
||||||
if (target === window.document.body || target === window.document.documentElement) {
|
if (target === window.document.body || target === window.document.documentElement) {
|
||||||
target = window;
|
target = window;
|
||||||
}
|
}
|
||||||
if (this.target) {
|
if (this.scrollTarget) {
|
||||||
if (this.target === target) {
|
if (this.scrollTarget === target) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.target.removeEventListener('scroll', this.handlerEventListeners);
|
this.scrollTarget.removeEventListener('scroll', this.handlerEventListeners);
|
||||||
}
|
}
|
||||||
this.target = target;
|
this.scrollTarget = target;
|
||||||
this.target.addEventListener('scroll', this.handlerEventListeners);
|
this.scrollTarget.addEventListener('scroll', this.handlerEventListeners);
|
||||||
},
|
},
|
||||||
|
|
||||||
handlerEventListeners(e) {
|
handlerEventListeners(e) {
|
||||||
if (!this.visible || !this.element) {
|
if (!this.visible || !this.menuTarget) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.scrollHide) {
|
if (this.scrollHide) {
|
||||||
@ -153,7 +170,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const scrollRect = e.target.getBoundingClientRect();
|
const scrollRect = e.target.getBoundingClientRect();
|
||||||
const eventRect = this.element.getBoundingClientRect();
|
const eventRect = this.menuTarget.getBoundingClientRect();
|
||||||
if (eventRect.top < scrollRect.top || eventRect.top > scrollRect.top + scrollRect.height) {
|
if (eventRect.top < scrollRect.top || eventRect.top > scrollRect.top + scrollRect.height) {
|
||||||
this.hide();
|
this.hide();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -652,16 +652,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
sendContent() {
|
sendContent() {
|
||||||
const {sendTip} = this.$refs
|
this.tempHiddenSendTip();
|
||||||
if (sendTip && sendTip.$refs.popper) {
|
|
||||||
sendTip.$refs.popper.style.visibility = 'hidden'
|
|
||||||
sendTip.showPopper = false
|
|
||||||
setTimeout(_ => {
|
|
||||||
if (sendTip.$refs.popper) {
|
|
||||||
sendTip.$refs.popper.style.visibility = 'visible'
|
|
||||||
}
|
|
||||||
}, 300)
|
|
||||||
}
|
|
||||||
return this.sendClass === 'recorder' ? '长按录音' : '发送'
|
return this.sendClass === 'recorder' ? '长按录音' : '发送'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1370,6 +1361,10 @@ export default {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'click':
|
case 'click':
|
||||||
|
if (this.showMenu) {
|
||||||
|
this.tempHiddenSendTip()
|
||||||
|
this.showMenu = false;
|
||||||
|
}
|
||||||
if (this.touchFocus) {
|
if (this.touchFocus) {
|
||||||
this.quill.blur();
|
this.quill.blur();
|
||||||
this.quill.focus();
|
this.quill.focus();
|
||||||
@ -2318,6 +2313,19 @@ export default {
|
|||||||
mention.setMentionContainerPosition()
|
mention.setMentionContainerPosition()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
tempHiddenSendTip() {
|
||||||
|
const {sendTip} = this.$refs
|
||||||
|
if (sendTip && sendTip.$refs.popper) {
|
||||||
|
sendTip.$refs.popper.style.visibility = 'hidden'
|
||||||
|
sendTip.showPopper = false
|
||||||
|
setTimeout(_ => {
|
||||||
|
if (sendTip.$refs.popper) {
|
||||||
|
sendTip.$refs.popper.style.visibility = 'visible'
|
||||||
|
}
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -174,22 +174,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul class="item-content priority">
|
<ul class="item-content priority">
|
||||||
<li>
|
<li>
|
||||||
<EDropdown
|
<TaskPriority :backgroundColor="taskDetail.p_color"><span ref="priorityText" @click="onPriority">{{taskDetail.p_name}}</span></TaskPriority>
|
||||||
ref="priority"
|
|
||||||
trigger="click"
|
|
||||||
placement="bottom"
|
|
||||||
@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="taskfont"
|
|
||||||
:style="{color:item.color}"
|
|
||||||
v-html="taskDetail.p_name == item.name ? '' : ''"></i>
|
|
||||||
{{item.name}}
|
|
||||||
</EDropdownItem>
|
|
||||||
</EDropdownMenu>
|
|
||||||
</EDropdown>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@ -279,22 +264,11 @@
|
|||||||
<div class="item-label" slot="label">
|
<div class="item-label" slot="label">
|
||||||
<i class="taskfont"></i>{{$L('重复周期')}}
|
<i class="taskfont"></i>{{$L('重复周期')}}
|
||||||
</div>
|
</div>
|
||||||
<ul class="item-content">
|
<ul class="item-content loop">
|
||||||
<li>
|
<li>
|
||||||
<EDropdown
|
<ETooltip :disabled="$isEEUiApp || windowTouch || !taskDetail.loop_at" :content="`${$L('下个周期')}: ${taskDetail.loop_at}`" placement="right">
|
||||||
ref="loop"
|
<span ref="loopText" @click="onLoop">{{$L(loopLabel(taskDetail.loop))}}</span>
|
||||||
trigger="click"
|
</ETooltip>
|
||||||
placement="bottom"
|
|
||||||
@command="updateData('loop', $event)">
|
|
||||||
<ETooltip :disabled="$isEEUiApp || windowTouch || !taskDetail.loop_at" :content="`${$L('下个周期')}: ${taskDetail.loop_at}`" placement="right">
|
|
||||||
<span>{{$L(loopLabel(taskDetail.loop))}}</span>
|
|
||||||
</ETooltip>
|
|
||||||
<EDropdownMenu slot="dropdown" class="task-detail-loop">
|
|
||||||
<EDropdownItem v-for="item in loops" :key="item.key" :command="item.key">
|
|
||||||
{{$L(item.label)}}
|
|
||||||
</EDropdownItem>
|
|
||||||
</EDropdownMenu>
|
|
||||||
</EDropdown>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@ -356,23 +330,13 @@
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div v-if="menuList.length > 0" class="add">
|
<div v-if="menuList.length > 0" class="add">
|
||||||
<EDropdown
|
<div class="add-wrap">
|
||||||
trigger="click"
|
<div class="add-button" @click="onAddItem">
|
||||||
placement="bottom"
|
|
||||||
@command="dropAdd">
|
|
||||||
<div class="add-button">
|
|
||||||
<i class="taskfont"></i>
|
<i class="taskfont"></i>
|
||||||
<span>{{$L('添加')}}</span>
|
<span>{{$L('添加')}}</span>
|
||||||
<em>{{menuText}}</em>
|
<em>{{menuText}}</em>
|
||||||
</div>
|
</div>
|
||||||
<EDropdownMenu slot="dropdown">
|
</div>
|
||||||
<EDropdownItem v-for="(item, key) in menuList" :key="key" :command="item.command">
|
|
||||||
<div class="item">
|
|
||||||
<i class="taskfont" v-html="item.icon"></i>{{$L(item.name)}}
|
|
||||||
</div>
|
|
||||||
</EDropdownItem>
|
|
||||||
</EDropdownMenu>
|
|
||||||
</EDropdown>
|
|
||||||
</div>
|
</div>
|
||||||
</Scrollbar>
|
</Scrollbar>
|
||||||
<TaskUpload ref="upload" class="upload" @on-select-file="onSelectFile"/>
|
<TaskUpload ref="upload" class="upload" @on-select-file="onSelectFile"/>
|
||||||
@ -1542,7 +1506,61 @@ export default {
|
|||||||
this.logLoadIng = load
|
this.logLoadIng = load
|
||||||
},
|
},
|
||||||
|
|
||||||
dropAdd(command) {
|
onPriority(event) {
|
||||||
|
const list = this.taskPriority.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
value: item,
|
||||||
|
prefix: `<i class="taskfont" style="color:${item.color};font-size:18px">${this.taskDetail.p_name == item.name ? '' : ''}</i>`,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$store.commit('menu/operation', {
|
||||||
|
event,
|
||||||
|
list,
|
||||||
|
size: 'large',
|
||||||
|
language: false,
|
||||||
|
onUpdate: (value) => {
|
||||||
|
this.updateData('priority', value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoop(event) {
|
||||||
|
const list = this.loops.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.label,
|
||||||
|
value: item.key,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$store.commit('menu/operation', {
|
||||||
|
event,
|
||||||
|
list,
|
||||||
|
size: 'large',
|
||||||
|
onUpdate: (value) => {
|
||||||
|
this.updateData('loop', value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onAddItem(event) {
|
||||||
|
const list = this.menuList.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
value: item.command,
|
||||||
|
prefix: `<i class="taskfont">${item.icon}</i>`,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$store.commit('menu/operation', {
|
||||||
|
event,
|
||||||
|
list,
|
||||||
|
size: 'large',
|
||||||
|
onUpdate: (value) => {
|
||||||
|
this.dropAddItem(value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
dropAddItem(command) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case 'tag':
|
case 'tag':
|
||||||
this.tagForce = true;
|
this.tagForce = true;
|
||||||
@ -1554,7 +1572,7 @@ export default {
|
|||||||
case 'priority':
|
case 'priority':
|
||||||
this.$set(this.taskDetail, 'p_name', this.$L('未设置'));
|
this.$set(this.taskDetail, 'p_name', this.$L('未设置'));
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.priority.show();
|
this.onPriority({target: this.$refs.priorityText})
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1584,7 +1602,7 @@ export default {
|
|||||||
case 'loop':
|
case 'loop':
|
||||||
this.loopForce = true;
|
this.loopForce = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.loop.show();
|
this.onLoop({target: this.$refs.loopText})
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1870,22 +1888,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
showDropdown(ref, eRect){
|
|
||||||
const boxRect = this.$refs.scroller.$el.getBoundingClientRect()
|
|
||||||
const refEl = ref.$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 (ref.visible) {
|
|
||||||
ref.hide()
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
ref.show()
|
|
||||||
}, 0)
|
|
||||||
},
|
|
||||||
|
|
||||||
showCisibleDropdown(event){
|
showCisibleDropdown(event){
|
||||||
const list = [
|
const list = [
|
||||||
{label: '项目人员', value: 1},
|
{label: '项目人员', value: 1},
|
||||||
|
|||||||
@ -61,6 +61,12 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
|
.item-prefix,
|
||||||
|
.item-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
> i {
|
> i {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
|
|||||||
@ -44,6 +44,10 @@
|
|||||||
.task-info {
|
.task-info {
|
||||||
.scroller {
|
.scroller {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
|
||||||
|
.scrollbar-content {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -523,7 +527,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.priority {
|
||||||
|
.task-priority {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.loop {
|
||||||
|
margin-top: 6px;
|
||||||
|
.el-tooltip {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
&.subtask-add {
|
&.subtask-add {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
> li {
|
> li {
|
||||||
@ -552,7 +566,8 @@
|
|||||||
.add {
|
.add {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
.el-dropdown {
|
.add-wrap {
|
||||||
|
display: inline-block;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
.add-button {
|
.add-button {
|
||||||
> em {
|
> em {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user