no message

This commit is contained in:
kuaifan 2025-04-14 03:10:57 +08:00
parent 7c501cec45
commit b9830bc64a
7 changed files with 97 additions and 23 deletions

View File

@ -19,6 +19,7 @@
<Dropdown <Dropdown
trigger="custom" trigger="custom"
:visible="operateVisible" :visible="operateVisible"
placement="bottom-start"
@on-clickoutside="operateVisible = false" @on-clickoutside="operateVisible = false"
transfer> transfer>
<div :style="{userSelect:operateVisible ? 'none' : 'auto', height: operateStyles.height}"></div> <div :style="{userSelect:operateVisible ? 'none' : 'auto', height: operateStyles.height}"></div>
@ -117,11 +118,12 @@ export default {
}, },
mounted() { mounted() {
const containsName = this.windowPortrait ? "task-detail" : "ivu-modal-wrap";
let parent = this.$parent.$el.parentNode; let parent = this.$parent.$el.parentNode;
while (parent) { while (parent) {
if (parent.classList?.contains(".ivu-modal-wrap")) { if (parent.classList?.contains(containsName)) {
this.listener = parent; this.listener = parent;
parent.addEventListener("scroll", this.onTouchstart); this.listener.addEventListener("scroll", this.onTouchstart);
break; break;
} }
parent = parent.parentNode; parent = parent.parentNode;
@ -197,7 +199,7 @@ export default {
if (!this.windowTouch) { if (!this.windowTouch) {
return return
} }
if (Date.now() - this.operateHiddenTime < 300) { if (Date.now() - this.operateHiddenTime < 350) {
return; return;
} }
event.stopPropagation() event.stopPropagation()

View File

@ -0,0 +1,54 @@
/**
* 尺寸变化监听指令
*
* 用法示例
* 1. 简单监听: v-resize-observer="handleResize"
* 2. 配置选项: v-resize-observer="{ handler: handleResize, throttle: 200 }"
*
* @param {Function|Object} binding.value - 处理函数或配置选项
* @param {Function} binding.value.handler - 处理回调函数
* @param {Number} binding.value.throttle - 节流时间(毫秒)默认200
*/
import {throttle} from 'lodash';
export default {
inserted(el, binding) {
const handler = typeof binding.value === 'function'
? binding.value
: binding.value?.handler;
if (typeof handler !== 'function') {
// console.warn('[v-resize-observer] 需要提供一个函数作为处理回调');
return;
}
const throttleTime = typeof binding.value === 'object'
? binding.value.throttle || 200
: 200;
el._resizeHandler = throttle(entries => {
const entry = entries[0];
// 传递尺寸信息给回调函数
handler({
width: entry.contentRect.width,
height: entry.contentRect.height,
entry: entry
});
}, throttleTime);
el._resizeObserver = new ResizeObserver(el._resizeHandler);
el._resizeObserver.observe(el);
},
unbind(el) {
if (el._resizeObserver) {
el._resizeObserver.disconnect();
el._resizeObserver = null;
}
if (el._resizeHandler) {
el._resizeHandler.cancel && el._resizeHandler.cancel();
el._resizeHandler = null;
}
}
};

View File

@ -2365,10 +2365,6 @@ export default {
this.focusTimer && clearTimeout(this.focusTimer) this.focusTimer && clearTimeout(this.focusTimer)
this.focusLazy = true this.focusLazy = true
this.$emit("on-focus") this.$emit("on-focus")
//
this.$refs.footer?.scrollIntoView({
block: "end"
})
}, },
onEventBlur() { onEventBlur() {
@ -4393,14 +4389,21 @@ export default {
} }
}, },
autoScrollInto() {
return this.location === "modal"
&& this.$isEEUiApp
&& this.windowPortrait
&& this.$refs.input?.isFocus
},
keepIntoInput() { keepIntoInput() {
if (!this.$isEEUiApp) { if (!this.autoScrollInto()) {
return return;
} }
this.keepIntoTimer && clearTimeout(this.keepIntoTimer) this.keepIntoTimer && clearTimeout(this.keepIntoTimer)
this.keepIntoTimer = setTimeout(_ => { this.keepIntoTimer = setTimeout(_ => {
if (!this.$refs.input?.isFocus) { if (!this.autoScrollInto()) {
return true; // return;
} }
this.$store.dispatch("scrollBottom", this.$refs.footer) this.$store.dispatch("scrollBottom", this.$refs.footer)
}, 500) }, 500)

View File

@ -59,7 +59,7 @@
class="task-detail" class="task-detail"
:class="taskDetailClass" :class="taskDetailClass"
:style="taskDetailStyle"> :style="taskDetailStyle">
<div v-show="taskDetail.id > 0" class="task-info"> <div v-show="taskDetail.id > 0" class="task-info" v-resize-observer="scrollIntoInput">
<div class="head"> <div class="head">
<TaskMenu <TaskMenu
:ref="`taskMenu_${taskDetail.id}`" :ref="`taskMenu_${taskDetail.id}`"
@ -599,6 +599,7 @@ import ResizeLine from "../../../components/ResizeLine.vue";
import TaskContentHistory from "./TaskContentHistory.vue"; import TaskContentHistory from "./TaskContentHistory.vue";
import TaskTagAdd from "./ProjectTaskTag/add.vue"; import TaskTagAdd from "./ProjectTaskTag/add.vue";
import emitter from "../../../store/events"; import emitter from "../../../store/events";
import resizeObserver from "../../../directives/resize-observer";
export default { export default {
name: "TaskDetail", name: "TaskDetail",
@ -618,6 +619,7 @@ export default {
TaskUpload, TaskUpload,
TaskPriority, TaskPriority,
}, },
directives: {resizeObserver},
props: { props: {
taskId: { taskId: {
type: Number, type: Number,
@ -1653,9 +1655,7 @@ export default {
}, },
onFocus() { onFocus() {
this.$refs.taskDialog?.scrollIntoView({ this.scrollIntoInput()
block: "end"
})
}, },
onEventMore(e) { onEventMore(e) {
@ -2150,14 +2150,29 @@ export default {
} }
}, },
autoScrollInto() {
return this.$isEEUiApp
&& this.windowPortrait
&& this.$refs.chatInput?.isFocus
},
scrollIntoInput() {
if (!this.autoScrollInto()) {
return;
}
this.$refs.taskDialog?.scrollIntoView({
block: "end"
})
},
keepIntoInput() { keepIntoInput() {
if (!this.$isEEUiApp) { if (!this.autoScrollInto()) {
return return;
} }
this.keepIntoTimer && clearTimeout(this.keepIntoTimer) this.keepIntoTimer && clearTimeout(this.keepIntoTimer)
this.keepIntoTimer = setTimeout(_ => { this.keepIntoTimer = setTimeout(_ => {
if (!this.$refs.chatInput?.isFocus) { if (!this.autoScrollInto()) {
return true; // return;
} }
this.$store.dispatch("scrollBottom", this.$refs.taskDialog) this.$store.dispatch("scrollBottom", this.$refs.taskDialog)
}, 500) }, 500)

View File

@ -35,7 +35,7 @@
</li> </li>
<li> <li>
<span>{{$L('最后在线')}}: </span> <span>{{$L('最后在线')}}: </span>
{{userData.line_at || '-'}} {{userData.line_at ? $A.dayjs(userData.line_at).format("YYYY-MM-DD HH:mm") : '-'}}
</li> </li>
</template> </template>
</ul> </ul>

View File

@ -2549,7 +2549,7 @@ body.window-portrait {
&.completed { &.completed {
&:after { &:after {
font-size: 36px; font-size: 36px;
right: 40px; right: 44px;
} }
.dialog-title { .dialog-title {
padding-right: 0; padding-right: 0;
@ -2603,7 +2603,7 @@ body.window-portrait {
} }
} }
.dialog-block { .dialog-block {
margin: 0 80px; margin: 0 84px;
justify-content: center; justify-content: center;
.dialog-avatar { .dialog-avatar {
display: none; display: none;

@ -1 +1 @@
Subproject commit 7be2bcdaa7ad68b1912099b6a60e92cb679aab46 Subproject commit c40f8b16e992581c280760a082c1f6f56653c380