|
|
|
|
@@ -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>
|
|
|
|
|
|