update 首页布局
This commit is contained in:
@@ -2283,18 +2283,19 @@
|
|||||||
"components.task-compare-chart.251031-1": "对于所有的任务完成的情况进行统计",
|
"components.task-compare-chart.251031-1": "对于所有的任务完成的情况进行统计",
|
||||||
"components.task-trend-chart.251031-0": "任务完成趋势图",
|
"components.task-trend-chart.251031-0": "任务完成趋势图",
|
||||||
"components.task-trend-chart.251031-1": "",
|
"components.task-trend-chart.251031-1": "",
|
||||||
"spdm.message.task": "任务",
|
"spdm.message.task": "任务",
|
||||||
"spdm.message.data": "数据",
|
"spdm.message.data": "数据",
|
||||||
"spdm.message.work": "作业",
|
"spdm.message.work": "作业",
|
||||||
"spdm.message.approve": "审批",
|
"spdm.message.approve": "审批",
|
||||||
"spdm.taskMessage.title": "任务消息",
|
"spdm.taskMessage.title": "任务消息",
|
||||||
"spdm.taskMessage.des": "任务消息列表",
|
"spdm.taskMessage.des": "任务消息列表",
|
||||||
"spdm.taskList.title": "任务列表",
|
"spdm.taskList.title": "任务列表",
|
||||||
"spdm.taskList.des": "我执行的任务列表_spdm",
|
"spdm.taskList.des": "我执行的任务列表_spdm",
|
||||||
"spdm.todoCalendar.title": "待办日历",
|
"spdm.todoCalendar.title": "待办日历",
|
||||||
"spdm.todoCalendar.des": "待办任务日历_spdm",
|
"spdm.todoCalendar.des": "待办任务日历_spdm",
|
||||||
"spdm.tapnav.task.focus":"我关注的",
|
"spdm.tapnav.task.focus": "我关注的",
|
||||||
"spdm.tapnav.task.todayTmrTasks":"今明任务",
|
"spdm.tapnav.task.todayTmrTasks": "今明任务",
|
||||||
"spdm.tapnav.task.inProgress":"进行中任务",
|
"spdm.tapnav.task.inProgress": "进行中任务",
|
||||||
"spdm.tapnav.task.postponed":"逾期任务"
|
"spdm.tapnav.task.postponed": "逾期任务",
|
||||||
|
"spdm.todoCalendar.tip": "是否确定已读该通知?"
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card class="h-[816px] box-card">
|
<el-card class="h-[816px] box-card spdm-calendar">
|
||||||
<Calendar
|
<Calendar
|
||||||
ref="calendar"
|
ref="calendar"
|
||||||
view="weekly"
|
view="weekly"
|
||||||
@@ -19,6 +19,7 @@ export default {
|
|||||||
borderless
|
borderless
|
||||||
expanded
|
expanded
|
||||||
@did-move="weeknumberClick"
|
@did-move="weeknumberClick"
|
||||||
|
@dayclick="dayClick"
|
||||||
/>
|
/>
|
||||||
<div v-if="calendar" class="py-4 px-6 w-full h-[46rem] overflow-y-auto">
|
<div v-if="calendar" class="py-4 px-6 w-full h-[46rem] overflow-y-auto">
|
||||||
<template v-for="{ day, cells } in Object.values(dayCells)">
|
<template v-for="{ day, cells } in Object.values(dayCells)">
|
||||||
@@ -60,7 +61,8 @@ import 'v-calendar/style.css';
|
|||||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
import { parseDate } from '/@/utils/formatTime';
|
import { parseDate } from '/@/utils/formatTime';
|
||||||
import { getUserMsgPageList, setMsgReadStatus } from '/@/spdm/api/spdm-task';
|
import { getUserMsgPageList, setMsgReadStatus } from '/@/spdm/api/spdm-task';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
// 获取当前国际化方言
|
// 获取当前国际化方言
|
||||||
const storesThemeConfig = useThemeConfig();
|
const storesThemeConfig = useThemeConfig();
|
||||||
@@ -102,10 +104,16 @@ const weeknumberClick = (page: any) => {
|
|||||||
|
|
||||||
// 修改开关状态
|
// 修改开关状态
|
||||||
const changeSwitch = async (id: string) => {
|
const changeSwitch = async (id: string) => {
|
||||||
setMsgReadStatus({ id: id, isRead: 1 }).then(() => {
|
ElMessageBox.confirm(t('spdm.todoCalendar.tip'), t('TableDialog.index.7634846-3'), {
|
||||||
ElMessage.success('操作成功');
|
confirmButtonText: t('TableDialog.index.7634846-2'),
|
||||||
// 初始化调度列表
|
cancelButtonText: t('TableDialog.index.7634846-1'),
|
||||||
initscheduleList();
|
type: 'warning',
|
||||||
|
}).then(() => {
|
||||||
|
setMsgReadStatus({ id: id, isRead: 1 }).then(() => {
|
||||||
|
ElMessage.success('操作成功');
|
||||||
|
// 初始化调度列表
|
||||||
|
initscheduleList();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -122,6 +130,7 @@ const getCurrentWeekDates = () => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const weekData = ref([]);
|
||||||
const initscheduleList = () => {
|
const initscheduleList = () => {
|
||||||
let params = {
|
let params = {
|
||||||
size: 100,
|
size: 100,
|
||||||
@@ -136,24 +145,42 @@ const initscheduleList = () => {
|
|||||||
reminders.value = list.map((item: any) => {
|
reminders.value = list.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
key: item.id,
|
key: item.id,
|
||||||
highlight: {
|
|
||||||
color: 'primary',
|
|
||||||
fillMode: 'outline',
|
|
||||||
},
|
|
||||||
dates: item.receiveTime,
|
dates: item.receiveTime,
|
||||||
customData: item,
|
customData: item,
|
||||||
|
highlight: {
|
||||||
|
// color: 'primary',
|
||||||
|
// fillMode: 'outline',
|
||||||
|
class: 'custom-highlight',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
weekData.value = reminders.value;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const selectedDate = ref(''); // 添加选中日期的集合
|
||||||
// 过滤日历中选中的单元格是否有日程
|
const dayClick = (day: any) => {
|
||||||
const filterCellSelected = (day: string) => {
|
if (day.id === selectedDate.value) {
|
||||||
return (
|
// 再次点击取消选中状态
|
||||||
reminders.value.filter((item: any) => {
|
reminders.value = [...weekData.value];
|
||||||
return item.dates.includes(day);
|
selectedDate.value = '';
|
||||||
}).length > 0
|
// 让日历失去焦点
|
||||||
);
|
nextTick(() => {
|
||||||
|
// 创建一个临时的可聚焦元素
|
||||||
|
const tempInput = document.createElement('input');
|
||||||
|
tempInput.style.position = 'absolute';
|
||||||
|
tempInput.style.left = '-9999px';
|
||||||
|
document.body.appendChild(tempInput);
|
||||||
|
tempInput.focus();
|
||||||
|
tempInput.remove();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
selectedDate.value = day.id;
|
||||||
|
// 更新
|
||||||
|
const list = [...weekData.value];
|
||||||
|
reminders.value = list.filter((item: any) => {
|
||||||
|
return item.dates.includes(day.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -181,3 +208,14 @@ onMounted(() => {
|
|||||||
margin: 6px 0;
|
margin: 6px 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.spdm-calendar {
|
||||||
|
.vc-highlight.custom-highlight {
|
||||||
|
background-color: rgb(178, 211, 248) !important;
|
||||||
|
}
|
||||||
|
.vc-highlight-content-solid {
|
||||||
|
/* color: black; */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -3,43 +3,67 @@ import { Session } from '/@/utils/storage';
|
|||||||
import { useMessage } from '/@/hooks/message';
|
import { useMessage } from '/@/hooks/message';
|
||||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
import { i18n } from '/@/i18n/index';
|
import { i18n } from '/@/i18n/index';
|
||||||
import {toQueryString, setTagsViewHighlight,transUrlParams} from '/@/utils/commonFunction';
|
import { toQueryString, setTagsViewHighlight, transUrlParams } from '/@/utils/commonFunction';
|
||||||
import { isObjectValueEqual } from '/@/utils/arrayOperation';
|
import { isObjectValueEqual } from '/@/utils/arrayOperation';
|
||||||
import mittBus from '/@/utils/mitt';
|
import mittBus from '/@/utils/mitt';
|
||||||
import {cloneDeep} from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
|
|
||||||
|
|
||||||
// SPDM CODE 默认常用功能,这里的应用名称要做多语言
|
// SPDM CODE 默认常用功能,这里的应用名称要做多语言
|
||||||
const defaultFavoriteRoutes = [
|
const defaultFavoriteRoutes = [
|
||||||
|
// 数据总览
|
||||||
{
|
{
|
||||||
contextMenuClickId: 5,
|
contextMenuClickId: 5,
|
||||||
path: '/spdm/competenceCenter/condition',
|
path: '/spdm/data/overview',
|
||||||
name: 'moduleRoutes.spdmCompetenceCenterCondition',
|
name: 'moduleRoutes.spdmDataOverview',
|
||||||
meta: { icon: 'ele-Suitcase' },
|
meta: { icon: 'ele-DataAnalysis' },
|
||||||
url: '/spdm/competenceCenter/condition',
|
url: '/spdm/data/overview',
|
||||||
},
|
},
|
||||||
{
|
// 新增待办
|
||||||
|
{
|
||||||
|
contextMenuClickId: 5,
|
||||||
|
path: '/spdm/task/sponsor',
|
||||||
|
name: 'moduleRoutes.spdmTaskSponsor',
|
||||||
|
meta: { icon: 'ele-Warning' },
|
||||||
|
url: '/spdm/task/sponsor',
|
||||||
|
},
|
||||||
|
// 项目列表
|
||||||
|
{
|
||||||
|
contextMenuClickId: 5,
|
||||||
|
path: '/spdm/project/projectList',
|
||||||
|
name: 'moduleRoutes.spdmProjectProjectList',
|
||||||
|
meta: { icon: 'ele-MessageBox' },
|
||||||
|
url: '/spdm/project/projectList',
|
||||||
|
},
|
||||||
|
// 任务执行
|
||||||
|
{
|
||||||
|
contextMenuClickId: 5,
|
||||||
|
path: '/spdm/task/execution',
|
||||||
|
name: 'moduleRoutes.spdmTaskExecution',
|
||||||
|
meta: { icon: 'ele-Operation' },
|
||||||
|
url: '/spdm/task/execution',
|
||||||
|
},
|
||||||
|
{
|
||||||
contextMenuClickId: 5,
|
contextMenuClickId: 5,
|
||||||
path: '/spdm/competenceCenter/indicator',
|
path: '/spdm/competenceCenter/indicator',
|
||||||
name: 'moduleRoutes.spdmCompetenceCenterIndicator',
|
name: 'moduleRoutes.spdmCompetenceCenterIndicator',
|
||||||
meta: { icon: 'ele-Money' },
|
meta: { icon: 'ele-Money' },
|
||||||
url: '/spdm/competenceCenter/indicator',
|
url: '/spdm/competenceCenter/indicator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
contextMenuClickId: 5,
|
contextMenuClickId: 5,
|
||||||
path: '/spdm/simulation/process',
|
path: '/spdm/simulation/process',
|
||||||
name: 'moduleRoutes.spdmSimulationProcess',
|
name: 'moduleRoutes.spdmSimulationProcess',
|
||||||
meta: { icon: 'ele-FolderChecked' },
|
meta: { icon: 'ele-FolderChecked' },
|
||||||
url: '/spdm/simulation/process',
|
url: '/spdm/simulation/process',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
contextMenuClickId: 5,
|
contextMenuClickId: 5,
|
||||||
path: '/spdm/simulation/application',
|
path: '/spdm/simulation/application',
|
||||||
name: 'moduleRoutes.spdmSystemApplication',
|
name: 'moduleRoutes.spdmSystemApplication',
|
||||||
meta: { icon: 'ele-Cellphone' },
|
meta: { icon: 'ele-Cellphone' },
|
||||||
url: '/spdm/simulation/application',
|
url: '/spdm/simulation/application',
|
||||||
},
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TagsView 路由列表
|
* TagsView 路由列表
|
||||||
@@ -70,10 +94,7 @@ export const useTagsViewRoutes = defineStore('tagsViewRoutes', {
|
|||||||
this.routePath = path;
|
this.routePath = path;
|
||||||
},
|
},
|
||||||
// 设置右键tagsView的x,y点
|
// 设置右键tagsView的x,y点
|
||||||
setDropdown(item: {
|
setDropdown(item: { x: string | number; y: string | number }) {
|
||||||
x: string | number;
|
|
||||||
y: string | number;
|
|
||||||
}) {
|
|
||||||
this.dropdown = item;
|
this.dropdown = item;
|
||||||
},
|
},
|
||||||
// 设置高亮tagsView的索引
|
// 设置高亮tagsView的索引
|
||||||
@@ -173,7 +194,7 @@ export const useTagsViewRoutes = defineStore('tagsViewRoutes', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 处理单标签时,第二次的值未覆盖第一次的 tagsViewList 值(Session Storage)
|
// 处理单标签时,第二次的值未覆盖第一次的 tagsViewList 值(Session Storage)
|
||||||
async singleAddTagsView (path: string, to?: RouteToFrom) {
|
async singleAddTagsView(path: string, to?: RouteToFrom) {
|
||||||
let isDynamicPath = to?.meta?.isDynamic ? to.meta.isDynamicPath : path;
|
let isDynamicPath = to?.meta?.isDynamic ? to.meta.isDynamicPath : path;
|
||||||
const tagsList = this.tagsViewList.map((v) => {
|
const tagsList = this.tagsViewList.map((v) => {
|
||||||
// 处理深拷贝问题
|
// 处理深拷贝问题
|
||||||
@@ -255,7 +276,7 @@ export const useTagsViewRoutes = defineStore('tagsViewRoutes', {
|
|||||||
// if (item.meta?.isKeepAlive) storesKeepALiveNames.addCachedView(item);
|
// if (item.meta?.isKeepAlive) storesKeepALiveNames.addCachedView(item);
|
||||||
},
|
},
|
||||||
// 3、关闭当前 tagsView:如果是设置了固定的(isAffix),不可以关闭
|
// 3、关闭当前 tagsView:如果是设置了固定的(isAffix),不可以关闭
|
||||||
async closeCurrentTagsView (path: string, router: any) {
|
async closeCurrentTagsView(path: string, router: any) {
|
||||||
// 最后一个页签不能关闭
|
// 最后一个页签不能关闭
|
||||||
if (this.tagsViewList.length === 1) return;
|
if (this.tagsViewList.length === 1) return;
|
||||||
const storesThemeConfig = useThemeConfig();
|
const storesThemeConfig = useThemeConfig();
|
||||||
@@ -331,14 +352,14 @@ export const useTagsViewRoutes = defineStore('tagsViewRoutes', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 6、开启当前页面全屏
|
// 6、开启当前页面全屏
|
||||||
async openCurrenFullscreen(path: string, router:any) {
|
async openCurrenFullscreen(path: string, router: any) {
|
||||||
const storesThemeConfig = useThemeConfig();
|
const storesThemeConfig = useThemeConfig();
|
||||||
const { themeConfig } = storeToRefs(storesThemeConfig);
|
const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||||
const item = this.tagsViewList.find((v: RouteItem) => (themeConfig.value.isShareTagsView ? v.path === path : v.url === path));
|
const item = this.tagsViewList.find((v: RouteItem) => (themeConfig.value.isShareTagsView ? v.path === path : v.url === path));
|
||||||
if (item?.meta.isDynamic) await router.push({ name: item.name, params: item.params });
|
if (item?.meta.isDynamic) await router.push({ name: item.name, params: item.params });
|
||||||
else await router.push({ name: item?.name, query: item?.query });
|
else await router.push({ name: item?.name, query: item?.query });
|
||||||
this.setCurrentFullscreen(true);
|
this.setCurrentFullscreen(true);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
persist: {
|
persist: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user