|
|
@@ -13,8 +13,9 @@
|
|
|
{{ getGreeting() }},{{ userStore.getUser.nickname }}
|
|
|
</h1>
|
|
|
<p class="hero-desc text-var(--text-secondary)!">
|
|
|
- 今天是 {{ new Date().toLocaleDateString() }}。您有
|
|
|
- {{ stats[0].number }}条流程待处理。
|
|
|
+ {{ $t("flow.today") }} {{ new Date().toLocaleDateString()
|
|
|
+ }}{{ $t("common.dot") }} {{ $t("flow.you") }} {{ stats[0].number }}
|
|
|
+ {{ $t("flow.flows") }}{{ $t("common.dot") }}
|
|
|
</p>
|
|
|
</div>
|
|
|
</section>
|
|
|
@@ -62,9 +63,11 @@
|
|
|
v-if="item.title === '我的待办'"
|
|
|
class="text-[#6b6f99] !text-sm"
|
|
|
>
|
|
|
- 待处理的流程
|
|
|
+ {{ $t("flow.todoTip") }}
|
|
|
+ </p>
|
|
|
+ <p v-else class="text-[#6b6f99] !text-sm">
|
|
|
+ {{ $t("flow.doneTip") }}
|
|
|
</p>
|
|
|
- <p v-else class="text-[#6b6f99] !text-sm">已完成的流程</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -74,7 +77,7 @@
|
|
|
v-for="(task, idx) in getDetailList(index)"
|
|
|
:key="idx"
|
|
|
class="detail-item"
|
|
|
- @click="handleDetailClick(task, item.title)"
|
|
|
+ @click="handleDetailClick(task, item.type)"
|
|
|
>
|
|
|
<span class="detail-name">{{ task.name }}</span>
|
|
|
<span class="detail-val">{{ task.value }}</span>
|
|
|
@@ -96,7 +99,7 @@
|
|
|
v-model.trim="searchKeyword"
|
|
|
type="text"
|
|
|
class="search-field"
|
|
|
- placeholder="搜索流程名称"
|
|
|
+ :placeholder="t('flow.search')"
|
|
|
/>
|
|
|
</div>
|
|
|
<span v-if="searchKeyword" class="search-meta">
|
|
|
@@ -233,12 +236,15 @@ import { useUserStore } from "@/stores/useUserStore";
|
|
|
import { useThemeStore } from "@/stores/useThemeStore";
|
|
|
import { getAccessToken } from "@/utils/auth";
|
|
|
import { useRouter } from "vue-router";
|
|
|
+import { useI18n } from "@/i18n";
|
|
|
import * as dd from "dingtalk-jsapi";
|
|
|
const router = useRouter();
|
|
|
import { ElLoading, ElMessage } from "element-plus";
|
|
|
const userStore = useUserStore();
|
|
|
const themeStore = useThemeStore();
|
|
|
|
|
|
+const { t } = useI18n();
|
|
|
+
|
|
|
// 1. 定义 Ref
|
|
|
const tabsContainerRef = ref(null);
|
|
|
const isLeftDisabled = ref(true);
|
|
|
@@ -286,9 +292,9 @@ const currentBanner = computed(() => {
|
|
|
|
|
|
const getGreeting = () => {
|
|
|
const hour = new Date().getHours();
|
|
|
- if (hour < 12) return "早上好";
|
|
|
- if (hour < 18) return "下午好";
|
|
|
- return "晚上好";
|
|
|
+ if (hour < 12) return t("flow.morning");
|
|
|
+ if (hour < 18) return t("flow.afternoon");
|
|
|
+ return t("flow.night");
|
|
|
};
|
|
|
|
|
|
const getDetailList = (index) => {
|
|
|
@@ -546,13 +552,12 @@ const go = async (item) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const handleDetailClick = (task, categoryTitle) => {
|
|
|
- console.log(`点击了 ${categoryTitle} 中的 ${task.name}: ${task.value}`);
|
|
|
+const handleDetailClick = (task, type) => {
|
|
|
let ua2 = navigator.userAgent.toLowerCase();
|
|
|
let isMobile = ua2.indexOf("dingtalk") > -1;
|
|
|
|
|
|
if (isMobile) {
|
|
|
- if (task.name === "OA" && categoryTitle === "我的待办") {
|
|
|
+ if (task.name === "OA" && type === "todo") {
|
|
|
// router.push({
|
|
|
// path: "/mobile-todo-list",
|
|
|
// query: { type: task.name.toLowerCase() },
|
|
|
@@ -564,7 +569,7 @@ const handleDetailClick = (task, categoryTitle) => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "OA" && categoryTitle === "已办事项") {
|
|
|
+ if (task.name === "OA" && type === "done") {
|
|
|
// router.push({
|
|
|
// path: "/oa-done-list",
|
|
|
// query: { type: task.name.toLowerCase() },
|
|
|
@@ -576,28 +581,28 @@ const handleDetailClick = (task, categoryTitle) => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "CRM" && categoryTitle === "我的待办") {
|
|
|
+ if (task.name === "CRM" && type === "todo") {
|
|
|
router.push({
|
|
|
path: "/mobile-crm-todo-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "CRM" && categoryTitle === "已办事项") {
|
|
|
+ if (task.name === "CRM" && type === "done") {
|
|
|
router.push({
|
|
|
path: "/crm-done-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "SRM" && categoryTitle === "我的待办") {
|
|
|
+ if (task.name === "SRM" && type === "todo") {
|
|
|
router.push({
|
|
|
path: "/mobile-srm-todo-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "SRM" && categoryTitle === "已办事项") {
|
|
|
+ if (task.name === "SRM" && type === "done") {
|
|
|
router.push({
|
|
|
path: "/srm-done-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
@@ -605,49 +610,49 @@ const handleDetailClick = (task, categoryTitle) => {
|
|
|
}
|
|
|
} else {
|
|
|
// 示例:根据类型跳转
|
|
|
- if (task.name === "OA" && categoryTitle === "我的待办") {
|
|
|
+ if (task.name === "OA" && type === "todo") {
|
|
|
router.push({
|
|
|
path: "/todo-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "OA" && categoryTitle === "已办事项") {
|
|
|
+ if (task.name === "OA" && type === "done") {
|
|
|
router.push({
|
|
|
path: "/oa-done-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "CRM" && categoryTitle === "我的待办") {
|
|
|
+ if (task.name === "CRM" && type === "todo") {
|
|
|
router.push({
|
|
|
path: "/crm-todo-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "CRM" && categoryTitle === "已办事项") {
|
|
|
+ if (task.name === "CRM" && type === "done") {
|
|
|
router.push({
|
|
|
path: "/crm-done-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "SRM" && categoryTitle === "我的待办") {
|
|
|
+ if (task.name === "SRM" && type === "todo") {
|
|
|
router.push({
|
|
|
path: "/srm-todo-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "SRM" && categoryTitle === "已办事项") {
|
|
|
+ if (task.name === "SRM" && type === "done") {
|
|
|
router.push({
|
|
|
path: "/srm-done-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (task.name === "EHR" && categoryTitle === "我的待办") {
|
|
|
+ if (task.name === "EHR" && type === "todo") {
|
|
|
router.push({
|
|
|
path: "/ehr-todo-list",
|
|
|
query: { type: task.name.toLowerCase() },
|
|
|
@@ -662,18 +667,20 @@ let srmTasks = ref([]);
|
|
|
let ehrTasks = ref([]);
|
|
|
const statsLoading = ref(true);
|
|
|
|
|
|
-const stats = ref([
|
|
|
+const stats = computed(() => [
|
|
|
{
|
|
|
icon: "mdi:clock-outline",
|
|
|
- title: "我的待办",
|
|
|
+ title: t("flow.todo"),
|
|
|
number: 0,
|
|
|
+ type: "todo",
|
|
|
extra: "+2 今日",
|
|
|
bgcolor: "#fff7ed",
|
|
|
color: "#f59e0b",
|
|
|
},
|
|
|
{
|
|
|
icon: "mdi:check-circle-outline",
|
|
|
- title: "已办事项",
|
|
|
+ title: t("flow.done"),
|
|
|
+ type: "done",
|
|
|
number: 0,
|
|
|
bgcolor: "#eff6ff",
|
|
|
color: "#2563eb",
|