|
|
@@ -181,6 +181,7 @@ import { useUserStore } from "@/stores/useUserStore";
|
|
|
import { getAccessToken } from "@/utils/auth";
|
|
|
import * as echarts from "echarts";
|
|
|
import { useRouter } from "vue-router";
|
|
|
+import { pa } from "element-plus/es/locales.mjs";
|
|
|
const router = useRouter();
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
@@ -418,7 +419,7 @@ const go = async (item) => {
|
|
|
|
|
|
setTimeout(function () {
|
|
|
newTab.location.href = item.flowUrl;
|
|
|
- }, 50);
|
|
|
+ }, 100);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -432,7 +433,7 @@ const go = async (item) => {
|
|
|
|
|
|
setTimeout(function () {
|
|
|
newTab.location.href = item.flowUrl;
|
|
|
- }, 50);
|
|
|
+ }, 100);
|
|
|
}
|
|
|
} else {
|
|
|
router.push({ path: "/login" });
|
|
|
@@ -449,12 +450,26 @@ const handleDetailClick = (task, categoryTitle) => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ if (task.name === "OA" && categoryTitle === "已办事项") {
|
|
|
+ router.push({
|
|
|
+ path: "/oa-done-list",
|
|
|
+ query: { type: task.name.toLowerCase() },
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (task.name === "CRM" && categoryTitle === "我的待办") {
|
|
|
router.push({
|
|
|
path: "/crm-todo-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ if (task.name === "CRM" && categoryTitle === "已办事项") {
|
|
|
+ router.push({
|
|
|
+ path: "/crm-done-list",
|
|
|
+ query: { type: task.name.toLowerCase() },
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
let oaTasks = ref([]);
|
|
|
@@ -490,18 +505,6 @@ const doneCount = ref([
|
|
|
{ name: "CRM", value: 0 },
|
|
|
]);
|
|
|
|
|
|
-// 发起流程
|
|
|
-const startCount = ref([
|
|
|
- { name: "OA", value: 0 },
|
|
|
- { name: "CRM", value: 0 },
|
|
|
-]);
|
|
|
-
|
|
|
-// 草稿箱
|
|
|
-const drafts = ref([
|
|
|
- { name: "OA", value: 0 },
|
|
|
- { name: "CRM", value: 0 },
|
|
|
-]);
|
|
|
-
|
|
|
onMounted(async () => {
|
|
|
getAll();
|
|
|
// 等待 DOM 与样式生效,避免移动端首屏尺寸为 0
|
|
|
@@ -522,10 +525,19 @@ onMounted(async () => {
|
|
|
|
|
|
if (userStore.getUser.username) {
|
|
|
try {
|
|
|
- const res = await getOATasks(userStore.getUser.username);
|
|
|
+ const res = await getOATasks({
|
|
|
+ id: userStore.getUser.username,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 99,
|
|
|
+ });
|
|
|
oaTasks.value = res;
|
|
|
|
|
|
- const crmRes = await getCRMTasks(userStore.getUser.username);
|
|
|
+ const crmRes = await getCRMTasks({
|
|
|
+ id: userStore.getUser.username,
|
|
|
+ type: "pending",
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
crmTasks.value = crmRes;
|
|
|
|
|
|
stats.value[0].number =
|
|
|
@@ -535,16 +547,42 @@ onMounted(async () => {
|
|
|
{ name: "OA", value: oaTasks.value.todoCount ?? 0 },
|
|
|
{ name: "CRM", value: crmTasks.value.todoCount ?? 0 },
|
|
|
];
|
|
|
+
|
|
|
+ // *****************已办事项统计*************************
|
|
|
+
|
|
|
+ const crmDoneRes = await getCRMTasks({
|
|
|
+ id: userStore.getUser.username,
|
|
|
+ type: "approved",
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
+
|
|
|
+ stats.value[1].number =
|
|
|
+ Number(oaTasks.value.doneCount) + Number(crmDoneRes.todoCount);
|
|
|
+
|
|
|
+ doneCount.value = [
|
|
|
+ { name: "OA", value: oaTasks.value.doneCount ?? 0 },
|
|
|
+ { name: "CRM", value: crmDoneRes.todoCount ?? 0 },
|
|
|
+ ];
|
|
|
} finally {
|
|
|
statsLoading.value = false;
|
|
|
}
|
|
|
|
|
|
setInterval(
|
|
|
async () => {
|
|
|
- const res = await getOATasks(userStore.getUser.username);
|
|
|
+ const res = await getOATasks({
|
|
|
+ id: userStore.getUser.username,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
oaTasks.value = res;
|
|
|
|
|
|
- const crmRes = await getCRMTasks(userStore.getUser.username);
|
|
|
+ const crmRes = await getCRMTasks({
|
|
|
+ id: userStore.getUser.username,
|
|
|
+ type: "pending",
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
crmTasks.value = crmRes;
|
|
|
|
|
|
stats.value[0].number =
|
|
|
@@ -554,6 +592,21 @@ onMounted(async () => {
|
|
|
{ name: "OA", value: oaTasks.value.todoCount ?? 0 },
|
|
|
{ name: "CRM", value: crmTasks.value.todoCount ?? 0 },
|
|
|
];
|
|
|
+
|
|
|
+ const crmDoneRes = await getCRMTasks({
|
|
|
+ id: userStore.getUser.username,
|
|
|
+ type: "approved",
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
+
|
|
|
+ stats.value[1].number =
|
|
|
+ Number(oaTasks.value.doneCount) + Number(crmDoneRes.todoCount);
|
|
|
+
|
|
|
+ doneCount.value = [
|
|
|
+ { name: "OA", value: oaTasks.value.doneCount ?? 0 },
|
|
|
+ { name: "CRM", value: crmDoneRes.todoCount ?? 0 },
|
|
|
+ ];
|
|
|
},
|
|
|
5 * 60 * 1000,
|
|
|
); // 每5分钟刷新一次
|