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
trigger="custom"
:visible="operateVisible"
placement="bottom-start"
@on-clickoutside="operateVisible = false"
transfer>
<div :style="{userSelect:operateVisible ? 'none' : 'auto', height: operateStyles.height}"></div>
@ -117,11 +118,12 @@ export default {
},
mounted() {
const containsName = this.windowPortrait ? "task-detail" : "ivu-modal-wrap";
let parent = this.$parent.$el.parentNode;
while (parent) {
if (parent.classList?.contains(".ivu-modal-wrap")) {
if (parent.classList?.contains(containsName)) {
this.listener = parent;
parent.addEventListener("scroll", this.onTouchstart);
this.listener.addEventListener("scroll", this.onTouchstart);
break;
}
parent = parent.parentNode;
@ -197,7 +199,7 @@ export default {
if (!this.windowTouch) {
return
}
if (Date.now() - this.operateHiddenTime < 300) {
if (Date.now() - this.operateHiddenTime < 350) {
return;
}
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.focusLazy = true
this.$emit("on-focus")
//
this.$refs.footer?.scrollIntoView({
block: "end"
})
},
onEventBlur() {
@ -4393,14 +4389,21 @@ export default {
}
},
autoScrollInto() {
return this.location === "modal"
&& this.$isEEUiApp
&& this.windowPortrait
&& this.$refs.input?.isFocus
},
keepIntoInput() {
if (!this.$isEEUiApp) {
return
if (!this.autoScrollInto()) {
return;
}
this.keepIntoTimer && clearTimeout(this.keepIntoTimer)
this.keepIntoTimer = setTimeout(_ => {
if (!this.$refs.input?.isFocus) {
return true; //
if (!this.autoScrollInto()) {
return;
}
this.$store.dispatch("scrollBottom", this.$refs.footer)
}, 500)

View File

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

View File

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

View File

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

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