88 lines
2.4 KiB
TypeScript
88 lines
2.4 KiB
TypeScript
import type { RouteRecordRaw } from "vue-router";
|
|
import ProductCategoryList from "@/pages/product/ProductCategoryList.vue";
|
|
import ProductCategoryRank from "@/pages/product/ProductCategoryRank.vue";
|
|
import ProductDetail from "@/pages/product/ProductDetail.vue";
|
|
import ProductEdit from "@/pages/product/ProductEdit.vue";
|
|
import ProductList from "@/pages/product/ProductList.vue";
|
|
import ProductStockDetail from "@/pages/product/ProductStockDetail.vue";
|
|
import ProductStockList from "@/pages/product/ProductStockList.vue";
|
|
import ProductStockRecordDetail from "@/pages/product/ProductStockRecordDetail.vue";
|
|
import ProductStockRecordList from "@/pages/product/ProductStockRecordList.vue";
|
|
|
|
function pageMeta(title: string, depth = 3, background = "#F5F5F8"): RouteRecordRaw["meta"] {
|
|
return {
|
|
depth,
|
|
navBarVisible: true,
|
|
navBarCanBack: true,
|
|
navBarTitle: title,
|
|
tabBarVisible: false,
|
|
bodyBackground: background,
|
|
darkBodyBackground: "#10161f"
|
|
};
|
|
}
|
|
|
|
const productRoutes: RouteRecordRaw[] = [
|
|
{
|
|
path: "/management/product-categories",
|
|
name: "ProductCategoryList",
|
|
component: ProductCategoryList,
|
|
meta: pageMeta("产品分类")
|
|
},
|
|
{
|
|
path: "/management/product-categories/rank",
|
|
name: "ProductCategoryRank",
|
|
component: ProductCategoryRank,
|
|
meta: pageMeta("产品分类排序", 4)
|
|
},
|
|
{
|
|
path: "/management/products",
|
|
name: "ProductList",
|
|
component: ProductList,
|
|
meta: pageMeta("产品库")
|
|
},
|
|
{
|
|
path: "/management/products/create",
|
|
name: "ProductCreate",
|
|
component: ProductEdit,
|
|
meta: pageMeta("新增产品", 4)
|
|
},
|
|
{
|
|
path: "/management/products/:id",
|
|
name: "ProductDetail",
|
|
component: ProductDetail,
|
|
meta: pageMeta("产品详情", 4)
|
|
},
|
|
{
|
|
path: "/management/products/:id/edit",
|
|
name: "ProductEdit",
|
|
component: ProductEdit,
|
|
meta: pageMeta("编辑产品", 5)
|
|
},
|
|
{
|
|
path: "/management/product-stocks",
|
|
name: "ProductStockList",
|
|
component: ProductStockList,
|
|
meta: pageMeta("库存")
|
|
},
|
|
{
|
|
path: "/management/product-stock-records",
|
|
name: "ProductStockRecordList",
|
|
component: ProductStockRecordList,
|
|
meta: pageMeta("库存流水")
|
|
},
|
|
{
|
|
path: "/management/product-stock-records/:id",
|
|
name: "ProductStockRecordDetail",
|
|
component: ProductStockRecordDetail,
|
|
meta: pageMeta("库存流水详情", 4)
|
|
},
|
|
{
|
|
path: "/management/product-stocks/:productId",
|
|
name: "ProductStockDetail",
|
|
component: ProductStockDetail,
|
|
meta: pageMeta("库存详情", 4)
|
|
}
|
|
];
|
|
|
|
export default productRoutes;
|