add data export
This commit is contained in:
+8
-2
@@ -15,9 +15,10 @@ import followUpReminderRoutes from "@/router/routes/followUpReminderRoutes";
|
||||
import productRoutes from "@/router/routes/productRoutes";
|
||||
import salesOrderRoutes from "@/router/routes/salesOrderRoutes";
|
||||
import fulfillmentRoutes from "@/router/routes/fulfillmentRoutes";
|
||||
import dataExportRoutes from "@/router/routes/dataExportRoutes";
|
||||
import { useCurrentStoreStore } from "@/store/currentStoreStore";
|
||||
import { useGlobalUIStore } from "@/store/globalUI";
|
||||
import { gaoRoleCodes } from "@/utils/permission";
|
||||
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
|
||||
import { useUserStore } from "timi-web-api/store";
|
||||
|
||||
const detailRoutes = [
|
||||
@@ -35,7 +36,8 @@ const detailRoutes = [
|
||||
...followUpReminderRoutes,
|
||||
...productRoutes,
|
||||
...salesOrderRoutes,
|
||||
...fulfillmentRoutes
|
||||
...fulfillmentRoutes,
|
||||
...dataExportRoutes
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
@@ -128,6 +130,10 @@ async function resolveStoreAccessRedirect(to: RouteLocationNormalized): Promise<
|
||||
if (routeName === "AiChat" && !userStore.hasRoles(gaoRoleCodes.storeManager)) {
|
||||
return "/management";
|
||||
}
|
||||
if (routeName === "DataExport" && (!userStore.hasRoles(gaoRoleCodes.storeManager)
|
||||
|| !userStore.hasPermissions(permissionCodes.dataExport.export))) {
|
||||
return "/management";
|
||||
}
|
||||
const storeDiaryRouteNameList = ["StoreDiaryList", "StoreDiaryCreate", "StoreDiaryDetail", "StoreDiaryEdit"];
|
||||
if (storeDiaryRouteNameList.includes(routeName)) {
|
||||
if (!userStore.hasRoles(gaoRoleCodes.storeManager)) {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
|
||||
const dataExportRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/management/data-export",
|
||||
name: "DataExport",
|
||||
component: () => import("@/pages/dataExport/DataExport.vue"),
|
||||
meta: {
|
||||
depth: 3,
|
||||
tabBarVisible: false,
|
||||
bodyBackground: "#F5F5F8",
|
||||
darkBodyBackground: "#10161f"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/management/data-export/stat",
|
||||
name: "DataExportStat",
|
||||
component: () => import("@/pages/dataExport/DataExportStat.vue"),
|
||||
meta: {
|
||||
depth: 4,
|
||||
tabBarVisible: false,
|
||||
bodyBackground: "#F5F5F8",
|
||||
darkBodyBackground: "#10161f"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/management/data-export/task/:taskId",
|
||||
name: "DataExportTask",
|
||||
component: () => import("@/pages/dataExport/DataExportTask.vue"),
|
||||
meta: {
|
||||
depth: 5,
|
||||
tabBarVisible: false,
|
||||
bodyBackground: "#F5F5F8",
|
||||
darkBodyBackground: "#10161f"
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export default dataExportRoutes;
|
||||
Reference in New Issue
Block a user