This commit is contained in:
2026-01-26 20:47:41 +08:00
4 changed files with 78 additions and 57 deletions

View File

@@ -8,7 +8,7 @@ export default {
</script>
<template>
<el-card class="h-[400px] box-card">
<el-card class="h-[400px] box-card task-message">
<template #header>
<div class="card-header">
<span>{{ t('spdm.taskList.title') }}</span>

View File

@@ -8,7 +8,7 @@ export default {
</script>
<template>
<el-card class="h-[400px] box-card">
<el-card class="h-[400px] box-card task-message">
<template #header>
<div class="card-header">
<span>{{ t('spdm.taskMessage.title') }}</span>
@@ -103,3 +103,16 @@ onMounted(() => {
margin-top: 8px;
}
</style>
<style lang="scss">
.task-message {
.el-table td.el-table__cell div {
font-size: 14px;
color: #6d6b6b;
font-family: -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
}
.el-table__header {
font-family: auto;
}
}
</style>

View File

@@ -37,7 +37,7 @@ export default {
<p class="font-medium cell-title">
{{ cell.data.customData.msgTitle }}
</p>
<div class="font-small" :title="cell.data.customData.msgBody">
<div class="font-small text-base msgBody" :title="cell.data.customData.msgBody">
{{ cell.data.customData.msgBody }}
</div>
<p class="text-xs font-medium text-gray-400 dark:text-gray-400 leading-2">
@@ -194,11 +194,14 @@ onMounted(() => {
align-items: center;
}
.cell-title {
font-size: 12px;
font-size: 14px;
font-weight: bold;
font-family: 'auto';
}
.font-small {
font-size: 12px;
font-size: 14px;
color: #6d6b6b;
font-family: -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
// 文字超过两行展示省略号
display: -webkit-box;
-webkit-box-orient: vertical;

View File

@@ -1,46 +1,46 @@
<script lang="ts" setup name="TopNav">
import {queryTaskListApi, getTaskCountApi} from '/@/spdm/api/spdm-task';
import {getTenantAssignmentsListByUsername} from '/@/api/admin/user';
import {useUserInfo} from '/@/stores/userInfo';
import { queryTaskListApi, getTaskCountApi } from '/@/spdm/api/spdm-task';
import { getTenantAssignmentsListByUsername } from '/@/api/admin/user';
import { useUserInfo } from '/@/stores/userInfo';
const {t} = useI18n();
const {userInfos, userId} = useUserInfo();
const { t } = useI18n();
const { userInfos, userId } = useUserInfo();
const tenantInfo = ref<any>(null);
const list = ref([
{
name: '我关注的',
{
name: '我关注的',
label: 'spdm.tapnav.task.focus',
count: 0,
color: 'rgb(221, 221, 9)',
path: '/spdm/task/attention',
},
{
name: '今明任务',
name: '今明任务',
label: 'spdm.tapnav.task.todayTmrTasks',
count: 0,
key: 'todayTmrTasks',
key: 'todayTmrTasks',
color: '#FF9900',
path: '/spdm/task/execute',
},
{
name: '进行中任务',
name: '进行中任务',
label: 'spdm.tapnav.task.inProgress',
count: 0,
key: 'inProgress',
key: 'inProgress',
color: '#1890ff',
path: '/spdm/task/execute',
},
{
name: '逾期任务',
name: '逾期任务',
label: 'spdm.tapnav.task.postponed',
count: 0,
key: 'postponed',
key: 'postponed',
color: '#FF0000',
path: '/spdm/task/execute',
},
])
]);
const getTenantList = () => {
return getTenantAssignmentsListByUsername(userId).then((response) => {
@@ -50,52 +50,51 @@ const getTenantList = () => {
};
const getFocusCount = () => {
let idMap = [
{"key": null, "value": "tag1"},
{"key": null, "value": "tag2"},
{"key": null, "value": "tag3"},
{"key": null, "value": "tag4"},
{"key": null, "value": "tag5"},
{"key": null, "value": "tag6"},
{"key": null, "value": "tag7"},
{"key": null, "value": "tag8"},
{"key": null, "value": "tag9"},
{"key": null, "value": "tag10"}
]
const params = {
current: 1,
size: 10,
sortOrder: 1,
type: 1,
idMap: idMap
}
queryTaskListApi(params).then((res) => {
list.value[0].count = res.data.total;
})
getTaskCountApi({ idMap, type: 0 }).then((res) => {
const data = res.data;
list.value[1].count = data.todayTmrTasks || 0;
list.value[2].count = data.inProgress || 0;
list.value[3].count = data.postponed || 0;
})
}
let idMap = [
{ key: null, value: 'tag1' },
{ key: null, value: 'tag2' },
{ key: null, value: 'tag3' },
{ key: null, value: 'tag4' },
{ key: null, value: 'tag5' },
{ key: null, value: 'tag6' },
{ key: null, value: 'tag7' },
{ key: null, value: 'tag8' },
{ key: null, value: 'tag9' },
{ key: null, value: 'tag10' },
];
const params = {
current: 1,
size: 10,
sortOrder: 1,
type: 1,
idMap: idMap,
};
queryTaskListApi(params).then((res) => {
list.value[0].count = res.data.total;
});
getTaskCountApi({ idMap, type: 0 }).then((res) => {
const data = res.data;
list.value[1].count = data.todayTmrTasks || 0;
list.value[2].count = data.inProgress || 0;
list.value[3].count = data.postponed || 0;
});
};
onActivated(() => {
getTenantList();
getFocusCount();
getFocusCount();
});
watchEffect(() => {
getTenantList();
getFocusCount();
getFocusCount();
});
const router = useRouter();
const handleClick = (item: any) => {
// if(['todayTmrTasks', 'inProgress', 'postponed'].includes(item.key)) {
// localStorage.setItem('SPDM_JUMP_TASK_TYPE', item.key);
// }
// if(['todayTmrTasks', 'inProgress', 'postponed'].includes(item.key)) {
// localStorage.setItem('SPDM_JUMP_TASK_TYPE', item.key);
// }
router.push(item.path);
};
</script>
@@ -104,7 +103,7 @@ const handleClick = (item: any) => {
<div class="grid grid-cols-3 gap-4 mb-4 bg-white el-card is-always-shadow py-2 px-4 h-24 items-center">
<div class="col-span-1 pl-4 flex items-center">
<ImageAvatar class="!h-[60px] !w-[60px]" :src="userInfos.user.avatar" />
<div class="flex flex-col h-[40px] justify-between ml-6">
<div class="flex flex-col h-[40px] justify-between ml-6 title">
<div v-if="tenantInfo?.deptNameList?.[0] || tenantInfo?.postNameList?.[0]" class="text-sm text-[#000000A6]">
<span>{{ tenantInfo?.deptNameList?.[0] }}</span>
<span v-if="tenantInfo?.deptNameList?.[0] && tenantInfo?.postNameList?.[0]"></span>
@@ -115,9 +114,15 @@ const handleClick = (item: any) => {
</div>
<div class="col-span-2 grid grid-cols-4 h-[40px] justify-between">
<div v-for="item in list" :key="item.label" class="flex flex-col justify-between cursor-pointer" @click="handleClick(item)">
<div class="text-sm text-[#000000A6]">{{ t(item.label) }}</div>
<div class="text-xl" :style="{ color: item.color }" >{{ item.count ?? 0 }}</div>
<div class="text-base text-[#000000A6]">{{ t(item.label) }}</div>
<div class="text-xl" :style="{ color: item.color }">{{ item.count ?? 0 }}</div>
</div>
</div>
</div>
</template>
<style scoped>
.title {
font-family: 'auto';
}
</style>