no message

This commit is contained in:
kuaifan 2024-12-03 13:12:48 +08:00
parent 7fedb7d275
commit 96c64fbb91
9 changed files with 49 additions and 26 deletions

View File

@ -353,7 +353,10 @@ export default {
// //
'classroomscreen.com', 'classroomscreen.com',
'bigbluebutton.org' 'bigbluebutton.org',
//
'matrix.to'
]; ];
const lowerUrl = `${url}`.toLowerCase() const lowerUrl = `${url}`.toLowerCase()
return meetingDomains.some(domain => lowerUrl.indexOf(domain) !== -1); return meetingDomains.some(domain => lowerUrl.indexOf(domain) !== -1);

View File

@ -1064,6 +1064,36 @@ const timezone = require("dayjs/plugin/timezone");
} }
}, },
/**
* 给元素添加一个class过指定时间之后再去除这个class
* @param element
* @param className
* @param duration
*/
addClassWithTimeout(element, className, duration) {
if (!element || !className || !duration) return;
element.classList.add(className);
setTimeout(() => {
if (!element) return;
element.classList.remove(className);
}, duration);
},
/**
* 滚动到元素并抖动
* @param element
*/
scrollIntoAndShake(element) {
if (!element) return;
const elements = Array.isArray(element) ? element : [element];
elements.forEach(el => {
if (el) {
$A.scrollIntoViewIfNeeded(el);
$A.addClassWithTimeout(el, "common-shake", 800);
}
});
},
/** /**
* 等比缩放尺寸 * 等比缩放尺寸
* @param width * @param width

View File

@ -1468,11 +1468,7 @@ export default {
if (val > 0) { if (val > 0) {
this.msgActiveId = 0 this.msgActiveId = 0
const element = this.$refs.scroller.$el.querySelector(`[data-id="${val}"]`)?.querySelector(".dialog-head") const element = this.$refs.scroller.$el.querySelector(`[data-id="${val}"]`)?.querySelector(".dialog-head")
if (element) { $A.scrollIntoAndShake(element)
$A.scrollIntoViewIfNeeded(element)
element.classList.add("common-shake")
setTimeout(_ => element.classList.remove("common-shake"), 800)
}
} }
}, },

View File

@ -327,13 +327,7 @@ export default {
if ($e.classList.contains("common-shake")) { if ($e.classList.contains("common-shake")) {
return return
} }
$A.scrollIntoViewIfNeeded($e) $A.scrollIntoAndShake($e)
requestAnimationFrame(_ => {
$e.classList.add("common-shake")
setTimeout(_ => {
$e.classList.remove("common-shake")
}, 600)
})
} else { } else {
if (subtask.parent_id == this.taskId) { if (subtask.parent_id == this.taskId) {
return return

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="task-rows"> <div class="task-rows">
<div v-for="(item, key) in list" :key="key"> <div v-for="(item, key) in list" :key="key" :ref="`task_${item.id}`">
<Row class="task-row" :style="item.color ? {backgroundColor: item.color, borderBottomColor: item.color} : {}"> <Row class="task-row" :style="item.color ? {backgroundColor: item.color, borderBottomColor: item.color} : {}">
<em v-if="item.p_name" class="priority-color" :style="{backgroundColor:item.p_color}"></em> <em v-if="item.p_name" class="priority-color" :style="{backgroundColor:item.p_color}"></em>
<Col span="12" :class="['row-name', item.complete_at ? 'complete' : '']"> <Col span="12" :class="['row-name', item.complete_at ? 'complete' : '']">
@ -160,7 +160,7 @@ export default {
}, },
computed: { computed: {
...mapState(['cacheTasks', 'taskPriority', 'cacheColumns']), ...mapState(['cacheTasks', 'taskPriority', 'cacheColumns', 'taskLatestId']),
subTask() { subTask() {
return function(task_id) { return function(task_id) {
@ -175,13 +175,19 @@ export default {
} }
}, },
}, },
watch: {
taskLatestId(id) {
setTimeout(() => {
$A.scrollIntoAndShake(this.$refs[`task_${id}`]);
}, 300)
}
},
methods: { methods: {
columnName(column_id) { columnName(column_id) {
const column = this.cacheColumns.find(({id}) => id == column_id) const column = this.cacheColumns.find(({id}) => id == column_id)
return column ? column.name : ''; return column ? column.name : '';
}, },
dropTask(task, command) { dropTask(task, command) {
const el = this.$refs[`taskMenu_${task.id}`]; const el = this.$refs[`taskMenu_${task.id}`];
if (!el) { if (!el) {

View File

@ -1778,9 +1778,7 @@ export default {
this.$nextTick(_ => { this.$nextTick(_ => {
const dom = $A(this.$el).find(`[data-id="${fileId}"]`) const dom = $A(this.$el).find(`[data-id="${fileId}"]`)
if (dom.length > 0) { if (dom.length > 0) {
$A.scrollIntoViewIfNeeded(dom[0]) $A.scrollIntoAndShake(dom)
$A(dom[0]).addClass("common-shake")
setTimeout(_ => $A(dom[0]).removeClass("common-shake"), 800)
} }
}) })
}, },

View File

@ -714,13 +714,7 @@ export default {
if (el[0].classList.contains("common-shake")) { if (el[0].classList.contains("common-shake")) {
return return
} }
$A.scrollIntoViewIfNeeded(el[0]) $A.scrollIntoAndShake(el[0])
requestAnimationFrame(_ => {
el[0].classList.add("common-shake")
setTimeout(_ => {
el[0].classList.remove("common-shake")
}, 600)
})
} }
} }
}, },

View File

@ -2142,6 +2142,7 @@ export default {
if (result.data.is_visible === 1) { if (result.data.is_visible === 1) {
dispatch("addTaskSuccess", result.data) dispatch("addTaskSuccess", result.data)
} }
state.taskLatestId = result.data.id
resolve(result) resolve(result)
}).catch(e => { }).catch(e => {
console.warn(e); console.warn(e);

View File

@ -150,6 +150,7 @@ export default {
taskOperation: {}, taskOperation: {},
taskArchiveView: 0, taskArchiveView: 0,
taskTemplates: [], taskTemplates: [],
taskLatestId: 0,
// 任务等待状态 // 任务等待状态
taskOneLoad: {}, taskOneLoad: {},