diff --git a/src/plugins/index.js b/src/plugins/index.js index d000f2d..373de48 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -1,20 +1,21 @@ -import tab from './tab' -import auth from './auth' -import cache from './cache' -import modal from './modal' -import download from './download' +import tab from "./tab"; +import auth from "./auth"; +import cache from "./cache"; +import modal from "./modal"; +import download from "./download"; +import "./platform"; export default { install(Vue) { // 页签操作 - Vue.prototype.$tab = tab + Vue.prototype.$tab = tab; // 认证对象 - Vue.prototype.$auth = auth + Vue.prototype.$auth = auth; // 缓存对象 - Vue.prototype.$cache = cache + Vue.prototype.$cache = cache; // 模态框对象 - Vue.prototype.$modal = modal + Vue.prototype.$modal = modal; // 下载文件 - Vue.prototype.$download = download - } -} + Vue.prototype.$download = download; + }, +}; diff --git a/src/plugins/platform.js b/src/plugins/platform.js new file mode 100644 index 0000000..4c4581b --- /dev/null +++ b/src/plugins/platform.js @@ -0,0 +1,29 @@ +import router from "@/router"; + +function meta(to, type, desc) { + to.meta.manufacturer = { + name: to.fullPath.split("/").at(1), + //1:厂商管理,2:经销商管理,3:门店管理 + type, + //1:厂商/经销商/商店列表,2:审核 + subType: to.fullPath.split("/").at(-1), + desc, + }; +} + +router.beforeEach((to, from, next) => { + switch (to.fullPath.split("/").at(1)) { + case "manufacturer": + meta(to, "1", "厂商"); + break; + case "dealer": + meta(to, "2", "经销商"); + break; + case "store": + meta(to, "3", "门店"); + break; + } + + // your logic + next(); +}); diff --git a/src/views/platform/manufacturer/base.vue b/src/views/platform/manufacturer/base.vue index 36c2232..345b371 100644 --- a/src/views/platform/manufacturer/base.vue +++ b/src/views/platform/manufacturer/base.vue @@ -6,10 +6,10 @@
- + - +
@@ -19,10 +19,11 @@ - + - + @@ -32,7 +33,7 @@ range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
- + @@ -56,35 +57,70 @@ }}
- - -