From 2f4f4f473d71d8e4ccd0db5c0adc9e3610789d91 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:45:53 +0800 Subject: [PATCH] 1 --- .gitattributes | 1 + babel.config.js | 28 +++++ src/config/router.config.js | 167 +++++++++++++------------- src/views/dataCenter/goods/Update.vue | 5 +- 4 files changed, 114 insertions(+), 87 deletions(-) create mode 100644 .gitattributes create mode 100644 babel.config.js diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e507319 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +public/* linguist-vendored \ No newline at end of file diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..e80ad97 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,28 @@ +const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) + +const plugins = [] +if (IS_PROD) { + plugins.push('transform-remove-console') +} + +// lazy load ant-design-vue +// if your use import on Demand, Use this code +plugins.push(['import', { + 'libraryName': 'ant-design-vue', + 'libraryDirectory': 'es', + 'style': true // `style: true` 会加载 less 文件 +}]) + +module.exports = { + presets: [ + '@vue/cli-plugin-babel/preset', + [ + '@babel/preset-env', + { + 'useBuiltIns': 'entry', + 'corejs': 3 + } + ] + ], + plugins +} diff --git a/src/config/router.config.js b/src/config/router.config.js index d2b8db5..bfd1273 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -3,7 +3,6 @@ import { UserLayout, BasicLayout, PageView } from '@/layouts' import * as Icon from '@/core/icons' export const asyncRouterMap = [ - { path: '/', name: 'index', @@ -21,35 +20,35 @@ export const asyncRouterMap = [ { path: 'index', component: () => import(/* webpackChunkName: "store" */ '@/views/store/index'), - meta: { title: '商城列表', keepAlive: true, hiddenHeaderContent: false, permission: ['store'] } + meta: { title: '商城列表', keepAlive: true, hiddenHeaderContent: false, permission: ['store'] }, }, { path: '/store/recycle', component: () => import(/* webpackChunkName: "store" */ '@/views/store/recycle'), - meta: { title: '回收站', keepAlive: true, permission: ['store'] } - } - ] - }, - - { - name: 'Menu', - path: 'menu', - redirect: '/menu/index', - component: PageView, - meta: { title: '菜单管理', keepAlive: true, icon: Icon['menu'], permission: ['access'] }, - children: [ - { - path: '/menu/index', - component: () => import(/* webpackChunkName: "menu" */ '@/views/menu/index'), - meta: { title: '菜单列表', keepAlive: true, permission: ['access'] } + meta: { title: '回收站', keepAlive: true, permission: ['store'] }, }, - { - path: '/menu/access/index', - component: () => import(/* webpackChunkName: "menu" */ '@/views/menu/access/index'), - meta: { title: 'API权限', keepAlive: true, permission: ['access'] } - } - ] + ], }, + + // { + // name: 'Menu', + // path: 'menu', + // redirect: '/menu/index', + // component: PageView, + // meta: { title: '菜单管理', keepAlive: true, icon: Icon['menu'], permission: ['access'] }, + // children: [ + // { + // path: '/menu/index', + // component: () => import(/* webpackChunkName: "menu" */ '@/views/menu/index'), + // meta: { title: '菜单列表', keepAlive: true, permission: ['access'] }, + // }, + // { + // path: '/menu/access/index', + // component: () => import(/* webpackChunkName: "menu" */ '@/views/menu/access/index'), + // meta: { title: 'API权限', keepAlive: true, permission: ['access'] }, + // }, + // ], + // }, { name: 'dataCenter', path: 'dataCenter', @@ -65,37 +64,37 @@ export const asyncRouterMap = [ { path: '/goods/index', component: () => import(/* webpackChunkName: "goods" */ '@/views/dataCenter/goods/Index'), - meta: { title: '商品列表', keepAlive: false, permission: ['access'] } + meta: { title: '商品列表', keepAlive: false, permission: ['access'] }, }, { path: '/goods/create', component: () => import(/* webpackChunkName: "goods" */ '@/views/dataCenter/goods/Create'), meta: { title: '创建商品', keepAlive: false }, - hidden: true + hidden: true, }, { path: '/goods/update', component: () => import(/* webpackChunkName: "goods" */ '@/views/dataCenter/goods/Update'), meta: { title: '编辑商品', keepAlive: false }, - hidden: true + hidden: true, }, { path: '/goods/modify', component: () => import(/* webpackChunkName: "goods" */ '@/views/dataCenter/goods/modify'), meta: { title: '批量修改', keepAlive: false }, - hidden: true + hidden: true, }, { path: '/goods/copy', component: () => import(/* webpackChunkName: "goods" */ '@/views/dataCenter/goods/Copy'), meta: { title: '复制商品', keepAlive: false }, hidden: true, - moduleKey: 'goods-copy' + moduleKey: 'goods-copy', }, { path: '/goods/category/index', component: () => import(/* webpackChunkName: "goods" */ '@/views/dataCenter/goods/category/Index'), - meta: { title: '商品分类', keepAlive: false } + meta: { title: '商品分类', keepAlive: false }, }, { @@ -104,19 +103,19 @@ export const asyncRouterMap = [ meta: { title: '商品导入', pageTitle: '商品导入记录', - keepAlive: false + keepAlive: false, }, moduleKey: 'goods-import', // 访问其他页面时激活该菜单(router-link-active) - activePath: ['/goods/import/batch'] + activePath: ['/goods/import/batch'], }, { path: '/goods/import/batch', component: () => import(/* webpackChunkName: "goods" */ '@/views/dataCenter/goods/import/Batch'), meta: { title: '商品导入', pageTitle: '商品批量导入', keepAlive: false }, - hidden: true - } - ] + hidden: true, + }, + ], }, { @@ -129,46 +128,46 @@ export const asyncRouterMap = [ { path: '/setting/cache', component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/cache'), - meta: { title: '清理缓存', keepAlive: false, permission: ['setting'] } + meta: { title: '清理缓存', keepAlive: false, permission: ['setting'] }, }, - { - path: '/setting/science', - component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/science'), - meta: { title: '环境检测', keepAlive: false, permission: ['setting'] } - }, - { - path: '/setting/timer', - component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/timer'), - meta: { title: '定时任务', keepAlive: false, permission: ['setting'] } - }, - { - path: '/setting/queue', - component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/queue'), - meta: { title: '队列服务', keepAlive: false, permission: ['setting'] } - } - ] - }, - - { - name: 'Cloud', - path: 'cloud', - redirect: '/cloud/authorize', - component: PageView, - meta: { title: '云服务', keepAlive: false, icon: Icon['access'], permission: ['cloud'] }, - children: [ // { - // path: '/cloud/upgrade', - // component: () => import(/* webpackChunkName: "cloud" */ '@/views/cloud/upgrade'), - // meta: { title: '在线更新', keepAlive: false, permission: ['cloud'] } + // path: '/setting/science', + // component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/science'), + // meta: { title: '环境检测', keepAlive: false, permission: ['setting'] } // }, - { - path: '/cloud/authorize', - component: () => import(/* webpackChunkName: "cloud" */ '@/views/cloud/authorize'), - meta: { title: '商业授权', keepAlive: false, permission: ['cloud'] } - } - ] + // { + // path: '/setting/timer', + // component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/timer'), + // meta: { title: '定时任务', keepAlive: false, permission: ['setting'] } + // }, + // { + // path: '/setting/queue', + // component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/queue'), + // meta: { title: '队列服务', keepAlive: false, permission: ['setting'] } + // } + ], }, + // { + // name: 'Cloud', + // path: 'cloud', + // redirect: '/cloud/authorize', + // component: PageView, + // meta: { title: '云服务', keepAlive: false, icon: Icon['access'], permission: ['cloud'] }, + // children: [ + // // { + // // path: '/cloud/upgrade', + // // component: () => import(/* webpackChunkName: "cloud" */ '@/views/cloud/upgrade'), + // // meta: { title: '在线更新', keepAlive: false, permission: ['cloud'] } + // // }, + // { + // path: '/cloud/authorize', + // component: () => import(/* webpackChunkName: "cloud" */ '@/views/cloud/authorize'), + // meta: { title: '商业授权', keepAlive: false, permission: ['cloud'] } + // } + // ] + // }, + { name: 'Manage', path: '/manage', @@ -180,17 +179,18 @@ export const asyncRouterMap = [ { // name: 'Renew', path: 'renew', - component: () => import(/* webpackChunkName: "user" */ '@/views/manage/renew') - } - ] - } - - ] + component: () => import(/* webpackChunkName: "user" */ '@/views/manage/renew'), + }, + ], + }, + ], }, { - path: '*', redirect: '/404', hidden: true - } + path: '*', + redirect: '/404', + hidden: true, + }, ] /** @@ -208,14 +208,13 @@ export const constantRouterMap = [ // name: 'Login', path: 'login', meta: { title: '超级管理后台' }, - component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login') - } - ] + component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login'), + }, + ], }, { path: '/404', - component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404') - } - + component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'), + }, ] diff --git a/src/views/dataCenter/goods/Update.vue b/src/views/dataCenter/goods/Update.vue index c8052a9..92fde47 100644 --- a/src/views/dataCenter/goods/Update.vue +++ b/src/views/dataCenter/goods/Update.vue @@ -504,7 +504,7 @@