wang hou sheng 8 months ago
parent c80e3ab20f
commit 2f4f4f473d
  1. 1
      .gitattributes
  2. 28
      babel.config.js
  3. 167
      src/config/router.config.js
  4. 5
      src/views/dataCenter/goods/Update.vue

1
.gitattributes vendored

@ -0,0 +1 @@
public/* linguist-vendored

@ -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
}

@ -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'),
},
]

@ -504,7 +504,7 @@
<script>
import * as GoodsApi from '@/api/goods'
import { SelectImage, SelectGoods, SelectVideo, Ueditor, InputNumberGroup } from '@/components'
import { SelectImage, SelectVideo, Ueditor, InputNumberGroup } from '@/components'
import GoodsModel from '@/common/model/goods/Index'
import { GoodsType, MultiSpec } from './modules'
import { isEmptyObject } from '@/utils/util'
@ -520,7 +520,6 @@ export default {
components: {
GoodsType,
SelectImage,
SelectGoods,
SelectVideo,
Ueditor,
InputNumberGroup,
@ -600,7 +599,7 @@ export default {
// (form-item)
this.$nextTick(() => {
this.form.setFieldsValue(GoodsModel.getFieldsValue2())
this.ruleList = this.formData.goods.rules?this.formData.goods.rules:[]
this.ruleList = this.formData.goods.rules ? this.formData.goods.rules : []
this.onForceUpdate()
})
}

Loading…
Cancel
Save