add product
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
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";
|
||||
|
||||
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-stocks/:productId",
|
||||
name: "ProductStockDetail",
|
||||
component: ProductStockDetail,
|
||||
meta: pageMeta("库存详情")
|
||||
}
|
||||
];
|
||||
|
||||
export default productRoutes;
|
||||
Reference in New Issue
Block a user