fix: 桌面客户端任务独立窗口无法操作任务状态的问题

This commit is contained in:
kuaifan 2022-06-09 11:05:02 +08:00
parent e161912496
commit f05914f2a1
3 changed files with 27 additions and 10 deletions

View File

@ -3,11 +3,26 @@
<keep-alive> <keep-alive>
<router-view class="child-view"></router-view> <router-view class="child-view"></router-view>
</keep-alive> </keep-alive>
<!--任务操作-->
<TaskOperation/>
<!--右下角加载提示-->
<Spinner/> <Spinner/>
<!--右下角客户端-->
<RightBottom/> <RightBottom/>
<!--网络提示-->
<NetworkException/> <NetworkException/>
<!--图片预览-->
<PreviewImageState/> <PreviewImageState/>
<!--音频播放-->
<AudioManager/> <AudioManager/>
<!--Manifest-->
<iframe v-if="manifestUrl" v-show="false" :src="manifestUrl"></iframe> <iframe v-if="manifestUrl" v-show="false" :src="manifestUrl"></iframe>
</div> </div>
</template> </template>
@ -27,10 +42,11 @@ import RightBottom from "./components/RightBottom";
import PreviewImageState from "./components/PreviewImage/state"; import PreviewImageState from "./components/PreviewImage/state";
import NetworkException from "./components/NetworkException"; import NetworkException from "./components/NetworkException";
import AudioManager from "./components/AudioManager"; import AudioManager from "./components/AudioManager";
import TaskOperation from "./pages/manage/components/TaskOperation";
import {mapState} from "vuex"; import {mapState} from "vuex";
export default { export default {
components: {AudioManager, NetworkException, PreviewImageState, RightBottom, Spinner}, components: {TaskOperation, AudioManager, NetworkException, PreviewImageState, RightBottom, Spinner},
data() { data() {
return { return {

View File

@ -310,9 +310,6 @@
</div> </div>
</Modal> </Modal>
<!--任务操作-->
<TaskOperation/>
<!--任务详情--> <!--任务详情-->
<TaskModal ref="taskModal"/> <TaskModal ref="taskModal"/>
@ -382,11 +379,9 @@ import TaskModal from "./manage/components/TaskModal";
import notificationKoro from "notification-koro1"; import notificationKoro from "notification-koro1";
import {Store} from "le5le-store"; import {Store} from "le5le-store";
import ManageLoad from "../components/ManageLoad"; import ManageLoad from "../components/ManageLoad";
import TaskOperation from "./manage/components/TaskOperation";
export default { export default {
components: { components: {
TaskOperation,
ManageLoad, ManageLoad,
TaskModal, TaskModal,
DialogModal, DialogModal,
@ -461,10 +456,6 @@ export default {
$A.messageSuccess("清除成功"); $A.messageSuccess("清除成功");
} }
// //
this.loadUser();
this.$store.dispatch("getTaskPriority").catch(_ => {})
//
this.getReportUnread(0);
this.notificationInit(); this.notificationInit();
this.onVisibilityChange(); this.onVisibilityChange();
// //
@ -474,6 +465,12 @@ export default {
document.addEventListener('keydown', this.shortcutEvent); document.addEventListener('keydown', this.shortcutEvent);
}, },
activated() {
this.loadUser();
this.getReportUnread(0);
this.$store.dispatch("getTaskPriority").catch(_ => {})
},
beforeDestroy() { beforeDestroy() {
if (this.addTaskSubscribe) { if (this.addTaskSubscribe) {
this.addTaskSubscribe.unsubscribe(); this.addTaskSubscribe.unsubscribe();

View File

@ -124,6 +124,10 @@ export default {
watch: { watch: {
taskOperation(data) { taskOperation(data) {
if (data.event && data.task) { if (data.event && data.task) {
if (this.$refs.dropdown.visible && this.element === data.event.target) {
this.hide();
return;
}
const eventRect = data.event.target.getBoundingClientRect(); const eventRect = data.event.target.getBoundingClientRect();
this.styles = { this.styles = {
left: `${eventRect.left}px`, left: `${eventRect.left}px`,