Commit 927fb4e2 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 19bb4439 bfc44957
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-plugin-transform-remove-console": "^6.9.4", "babel-plugin-transform-remove-console": "^6.9.4",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"cache-loader": "^4.1.0",
"compression-webpack-plugin": "^2.0.0", "compression-webpack-plugin": "^2.0.0",
"deepmerge": "^4.2.2", "deepmerge": "^4.2.2",
"eslint": "^6.7.2", "eslint": "^6.7.2",
......
<template> <template>
<a-upload <a-upload
list-type="text" list-type="text"
class="file-uploader" class="file-uploader"
:show-upload-list="false" :show-upload-list="false"
:action="action" :action="action"
:headers="headers" :headers="headers"
@change="fileChange" @change="fileChange"
> >
<slot> <slot>
<div>导入</div> <div>导入</div>
</slot> </slot>
</a-upload> </a-upload>
</template> </template>
<script> <script>
import {mapMutations} from "vuex" import { mapMutations } from "vuex";
import {getCookie} from "@/utils/request" // import {getCookie} from "@/utils/request"
export default { export default {
props:{ props: {
action:String action: String,
},
data() {
return {
headers: "",
};
},
methods: {
...mapMutations("fileloading", ["settip", "setspinning"]),
/**
* 导入文件监听
*/
fileChange(info) {
if (info.file.status === "uploading") {
this.settip("文件导入中...");
this.setspinning(true);
return;
}
if (info.file.status === "error") {
this.$message.error("导入失败");
}
if (info.file.status === "done") {
this.$message("导入成功");
// 导出成功
this.$emit("success", "addfile");
}
this.setspinning(false);
this.settip("加载中...");
}, },
data(){ },
return{ };
headers:getCookie()
}
},
methods:{
...mapMutations('fileloading',['settip','setspinning']),
/**
* 导入文件监听
*/
fileChange(info){
if (info.file.status === 'uploading') {
this.settip('文件导入中...')
this.setspinning(true)
return;
}
if (info.file.status === 'error') {
this.$message.error("导入失败")
}
if (info.file.status === 'done') {
this.$message("导入成功")
// 导出成功
this.$emit("success",'addfile')
}
this.setspinning(false)
this.settip('加载中...')
}
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>
\ No newline at end of file
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
}, },
}, },
created() { created() {
this.loadCacheConfig(this.$router?.options?.routes); // this.loadCacheConfig(this.$router?.options?.routes);
this.loadCachedTabs(); this.loadCachedTabs();
const route = this.$route; const route = this.$route;
if (this.pageList.findIndex((item) => item.path === route.path) === -1) { if (this.pageList.findIndex((item) => item.path === route.path) === -1) {
...@@ -115,10 +115,10 @@ export default { ...@@ -115,10 +115,10 @@ export default {
this.correctPageMinHeight(this.tabsOffset); this.correctPageMinHeight(this.tabsOffset);
}, },
watch: { watch: {
"$router.options.routes": function (val) { // "$router.options.routes": function (val) {
this.excludeKeys = []; // this.excludeKeys = [];
this.loadCacheConfig(val); // this.loadCacheConfig(val);
}, // },
$route: function (newRoute) { $route: function (newRoute) {
this.activePage = newRoute.path; this.activePage = newRoute.path;
const page = this.pageList.find((item) => item.path === newRoute.path); const page = this.pageList.find((item) => item.path === newRoute.path);
...@@ -364,17 +364,18 @@ export default { ...@@ -364,17 +364,18 @@ export default {
} }
} }
}, },
loadCacheConfig(routes, pCache = true) { // loadCacheConfig(routes, pCache = true) {
routes.forEach((item) => { // routes.forEach((item) => {
const cacheAble = item.meta?.page?.cacheAble ?? pCache ?? true; // const cacheAble = item.meta?.page?.cacheAble ?? pCache ?? true;
if (!cacheAble) { // if (!cacheAble) {
this.excludeKeys.push(new RegExp(`${item.path}\\d+$`)); // this.excludeKeys.push(new RegExp(`${item.path}\\d+$`));
} // }
if (item.children) { // console.log(this.excludeKeys);
this.loadCacheConfig(item.children, cacheAble); // if (item.children) {
} // this.loadCacheConfig(item.children, cacheAble);
}); // }
}, // });
// },
...mapMutations("setting", ["correctPageMinHeight"]), ...mapMutations("setting", ["correctPageMinHeight"]),
}, },
}; };
......
...@@ -63,21 +63,17 @@ ...@@ -63,21 +63,17 @@
</span> </span>
</template> </template>
<!-- 部门 --> <!-- 部门 -->
<template slot="belongDept" slot-scope="text"> <template slot="deptCode" slot-scope="text">
{{ text.belongDept ? text.belongDept : "--" }} {{ text.deptCode ? text.deptCode : "--" }}
</template> </template>
<!-- 到现场次数 --> <!-- 到现场次数 -->
<template slot="num" slot-scope="text"> <template slot="num" slot-scope="text">
<span <span v-if="text.windowToTheSceneNum">{{
v-if="text.windowToTheSceneNum && text.windowToTheSceneNum != ''" text.windowToTheSceneNum
>{{ text.windowToTheSceneNum }}</span }}</span>
> <span v-else-if="text.onlineToTheSceneNum">{{
<span text.onlineToTheSceneNum
v-else-if=" }}</span>
text.onlineToTheSceneNum && text.onlineToTheSceneNum != ''
"
>{{ text.onlineToTheSceneNum }}</span
>
<span v-else>--</span> <span v-else>--</span>
</template> </template>
<!-- 操作 --> <!-- 操作 -->
...@@ -152,8 +148,8 @@ ...@@ -152,8 +148,8 @@
</span> </span>
</template> </template>
<!-- 部门 --> <!-- 部门 -->
<template slot="belongDept" slot-scope="text"> <template slot="deptCode" slot-scope="text">
{{ text.belongDept ? text.belongDept : "--" }} {{ text.deptCode ? text.deptCode : "--" }}
</template> </template>
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
<a href="javascript:;" class="jion" @click="handleIn(text.id)" <a href="javascript:;" class="jion" @click="handleIn(text.id)"
...@@ -204,10 +200,10 @@ const leftColumns = [ ...@@ -204,10 +200,10 @@ const leftColumns = [
scopedSlots: { customRender: "index" }, scopedSlots: { customRender: "index" },
}, },
{ {
title: "部门", title: "部门编号",
width: "20%", width: "20%",
scopedSlots: { scopedSlots: {
customRender: "belongDept", customRender: "deptCode",
}, },
}, },
{ {
...@@ -239,10 +235,10 @@ const rightColumns = [ ...@@ -239,10 +235,10 @@ const rightColumns = [
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
title: "部门", title: "部门编号",
width: "20%", width: "20%",
scopedSlots: { scopedSlots: {
customRender: "belongDept", customRender: "deptCode",
}, },
}, },
{ {
......
...@@ -105,8 +105,8 @@ ...@@ -105,8 +105,8 @@
</span> </span>
</template> </template>
<!-- 部门 --> <!-- 部门 -->
<template slot="belongDept" slot-scope="text"> <template slot="deptCode" slot-scope="text">
{{ text.belongDept ? text.belongDept : "--" }} {{ text.deptCode ? text.deptCode : "--" }}
</template> </template>
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
<a href="javascript:;" class="jion" @click="handleIn(text)">关联</a> <a href="javascript:;" class="jion" @click="handleIn(text)">关联</a>
...@@ -281,10 +281,10 @@ const rightColumns = [ ...@@ -281,10 +281,10 @@ const rightColumns = [
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
title: "部门", title: "部门编号",
width: "20%", width: "20%",
scopedSlots: { scopedSlots: {
customRender: "belongDept", customRender: "deptCode",
}, },
}, },
{ {
......
...@@ -428,7 +428,6 @@ export default { ...@@ -428,7 +428,6 @@ export default {
} }
}) })
.flat(); .flat();
console.log(data);
this.business = this.delChildren(this.business); this.business = this.delChildren(this.business);
}, },
// 新增部门 // 新增部门
......
import TabsView from '@/layouts/tabs/TabsView' import TabsView from "@/layouts/tabs/TabsView";
import BlankView from '@/layouts/BlankView' import BlankView from "@/layouts/BlankView";
// import PageView from '@/layouts/PageView' // import PageView from '@/layouts/PageView'
// 路由配置 // 路由配置
const options = { const options = {
routes: [ routes: [
{ {
path: '/jump', path: "/jump",
name: '跳转页面', name: "跳转页面",
component: () => import('@/pages/basicset/jump/jump'), component: () => import("@/pages/basicset/jump/jump"),
}, },
{ {
path: '*', path: "*",
name: '404', name: "404",
component: () => import('@/pages/exception/404'), component: () => import("@/pages/exception/404"),
}, },
{ {
path: '/403', path: "/403",
name: '403', name: "403",
component: () => import('@/pages/exception/403'), component: () => import("@/pages/exception/403"),
}, },
{ {
path: '/', path: "/",
name: '首页', name: "首页",
component: TabsView, component: TabsView,
redirect: '/jump', redirect: "/jump",
children: [ children: [
{ {
path: 'basicset', path: "basicset",
name: '基础设置', name: "基础设置",
meta: { meta: {
icon: 'dashboard', icon: "dashboard",
}, },
component: BlankView, component: BlankView,
children: [ children: [
...@@ -45,65 +45,66 @@ const options = { ...@@ -45,65 +45,66 @@ const options = {
// component: () => import('@/pages/basicset/menu/list'), // component: () => import('@/pages/basicset/menu/list'),
// }, // },
{ {
path: 'website', path: "website",
name: '站点管理', name: "站点管理",
component: () => import('@/pages/basicset/site/website'), component: () => import("@/pages/basicset/site/website"),
}, },
{ {
path: 'deploy', path: "deploy",
name: '部署模块管理', name: "部署模块管理",
component: () => import('@/pages/basicset/deploy/deploy'), component: () => import("@/pages/basicset/deploy/deploy"),
}, },
{ {
path: 'business', path: "business",
name: '业务事项管理', name: "业务事项管理",
component: () => import('@/pages/basicset/business/business'), component: () => import("@/pages/basicset/business/business"),
}, },
{ {
path: 'addbusiness', path: "addbusiness",
name: '新增事项', name: "新增事项",
component: () => import('@/pages/basicset/addbusiness/addbusiness.vue'), component: () =>
meta: { invisible: true } import("@/pages/basicset/addbusiness/addbusiness.vue"),
meta: { invisible: true },
}, },
{ {
path: 'department', path: "department",
name: '部门窗口管理', name: "部门窗口管理",
component: () => import('@/pages/basicset/dept/department'), component: () => import("@/pages/basicset/dept/department"),
}, },
{ {
path: 'personnel', path: "personnel",
name: '工作人员管理', name: "工作人员管理",
component: () => import('@/pages/basicset/workman/personnel'), component: () => import("@/pages/basicset/workman/personnel"),
}, },
{ {
path: 'surface', path: "surface",
component: () => import('@/pages/basicset/surface/index'), component: () => import("@/pages/basicset/surface/index"),
children: [ children: [
{ {
path: '', path: "",
name: '皮肤管理', name: "皮肤管理",
component: () => import('@/pages/basicset/surface/surface'), component: () => import("@/pages/basicset/surface/surface"),
meta: { invisible: true } meta: { invisible: true },
}, },
{ {
path: 'addsurfacetemplate', path: "addsurfacetemplate",
name: '新增皮肤m模板', name: "新增皮肤m模板",
component: () => import('@/pages/basicset/surface/AddSurfaceTemplate'), component: () =>
meta: { invisible: true } import("@/pages/basicset/surface/AddSurfaceTemplate"),
meta: { invisible: true },
}, },
] ],
}, },
{ {
path: 'configurat', path: "configurat",
name: '短信配置', name: "短信配置",
component: () => import('@/pages/basicset/sms/configurat'), component: () => import("@/pages/basicset/sms/configurat"),
}, },
{ {
path: 'festival', path: "festival",
name: '节假日配置', name: "节假日配置",
component: () => import('@/pages/basicset/holiday/festival'), component: () => import("@/pages/basicset/holiday/festival"),
}, },
// { // {
// path: 'qrcode', // path: 'qrcode',
...@@ -115,556 +116,11 @@ const options = { ...@@ -115,556 +116,11 @@ const options = {
// name: '皮肤管理', // name: '皮肤管理',
// component: () => import('@/pages/basicset/skins/skins'), // component: () => import('@/pages/basicset/skins/skins'),
// }, // },
] ],
}, },
// { ],
// path: 'reservation', },
],
// name: '预约系统', };
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'reserset',
// name: '预约设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [{
// path: 'basics',
// name: '基础设置',
// component: () => import('@/pages/reservation/reserset/basics'),
// },
// {
// path: 'matter',
// name: '事项设置',
// component: () => import('@/pages/reservation/reserset/matter'),
// },
// {
// path: 'classify',
// name: '分类引导设置',
// component: () => import('@/pages/reservation/reserset/classify'),
// },
// {
// path: 'time_frame',
// name: '预约时段设置',
// component: () => import('@/pages/reservation/reserset/timeFrame'),
// },
// {
// path: 'additem',
// name: '预约时段设置',
// meta: {
// invisible: true
// },
// component: () => import('@/pages/reservation/reserset/component/addItem'),
// },
// ]
// },
// {
// path: 'realtime',
// name: '实时数据',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [{
// path: 'reserbasics',
// name: '预约实时数据',
// component: () => import('@/pages/reservation/reserbasics/reserbasics'),
// },
// ]
// },
// {
// path: 'analyse',
// name: '数据分析',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'tendency',
// name: '预约趋势研究',
// component: () => import('@/pages/reservation/analyse/tendency'),
// },
// {
// path: 'heatrank',
// name: '预约热度排名',
// component: () => import('@/pages/reservation/analyse/heatrank'),
// },
// {
// path: 'portrayal',
// name: '预约人群画像',
// component: () => import('@/pages/reservation/analyse/portrayal'),
// },
// ]
// },
// {
// path: 'ports',
// name: '接口管理',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'ports',
// name: '接口管理',
// component: () => import('@/pages/reservation/ports/ports'),
// },
// {
// path: 'basis',
// name: '新增管理',
// meta: {
// invisible: true
// },
// component: () => import('@/pages/reservation/ports/basis'),
// },
// ]
// }
// ]
// },
// {
// path: 'phsoftware',
// name: '排号软件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'phbaseset',
// name: '排号基础设置',
// component: () => import('@/pages/numeralsystem/SoftWareSet/BaseSet/Index'),
// },
// {
// path: 'vap',
// name: '集中屏轮播图/视频',
// component: () => import('@/pages/numeralsystem/SoftWareSet/VedioAndPic/Index'),
// },
// {
// path: 'numeralperson',
// name: '排号人数设置',
// component: () => import('@/pages/numeralsystem/SoftWareSet/NumeralPerson/Index'),
// },
// {
// path: 'phtheme',
// name: '排号皮肤设置',
// component: () => import('@/pages/numeralsystem/SoftWareSet/Theme/Index'),
// },
// {
// path: 'business',
// name: '业务转移',
// component: () => import('@/pages/numeralsystem/SoftWareSet/BusinessTransfer/Index'),
// },
// {
// path: 'vipset',
// name: 'VIP设置',
// component: () => import('@/pages/numeralsystem/SoftWareSet/VipSet/Index'),
// },
// {
// path: 'blacklist',
// name: '黑名单设置',
// component: () => import('@/pages/numeralsystem/SoftWareSet/BlackList/Index'),
// }
// ]
// },
// {
// path: 'phhardware',
// name: '排号硬件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'lineup',
// name: '排队机',
// component: () => import('@/pages/numeralsystem/HardWareSet/LineUp/Index'),
// },
// {
// path: 'callout',
// name: '呼叫器',
// component: () => import('@/pages/numeralsystem/HardWareSet/CallOut/Index'),
// },
// {
// path: 'windowscreen',
// name: '窗口屏',
// component: () => import('@/pages/numeralsystem/HardWareSet/WindowScreen/Index'),
// },
// {
// path: 'concentrate',
// name: '集中显示屏',
// component: () => import('@/pages/numeralsystem/HardWareSet/Concentrate/Index'),
// },
// {
// path: 'ledscreen',
// name: 'LED通屏',
// component: () => import('@/pages/numeralsystem/HardWareSet/LedScreen/Index'),
// }
// ]
// },
// {
// path: 'pjsoftware',
// name: '评价软件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'pjbaseset',
// name: '评价基础设置',
// component: () => import('@/pages/evaluatesystem/SoftWareSet/BaseSet/Index'),
// },
// {
// path: 'vap',
// name: '轮播图/视频',
// component: () => import('@/pages/evaluatesystem/SoftWareSet/VedioAndPic/Index'),
// },
// {
// path: 'theme',
// name: '评价皮肤设置',
// component: () => import('@/pages/evaluatesystem/SoftWareSet/Theme/Index'),
// }
// ]
// },
// {
// path: 'pjhardware',
// name: '评价硬件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'evaluate',
// name: '评价设备管理',
// component: () => import('@/pages/evaluatesystem/HardWareSet/Evaluate/Index'),
// }
// ]
// },
// {
// path: 'signages',
// name: '导视',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'dsbaseset',
// name: '导视基础设置',
// component: () => import('@/pages/signagesystem/BaseSet/Index'),
// },
// {
// path: 'vap',
// name: '导视轮播图/视频',
// component: () => import('@/pages/signagesystem/VedioAndPic/Index'),
// },
// {
// path: 'floor',
// name: '楼层图',
// component: () => import('@/pages/signagesystem/Floor/Index'),
// },
// {
// path: 'coordinate',
// name: '坐标设置',
// component: () => import('@/pages/signagesystem/Coordinate/Index'),
// },
// {
// path: 'dstheme',
// name: '导视皮肤设置',
// component: () => import('@/pages/signagesystem/Theme/Index'),
// },
// {
// path: 'matter',
// name: '事项设置',
// component: () => import('@/pages/signagesystem/Matter/Index'),
// },
// {
// path: 'approval',
// name: '主题式审批',
// component: () => import('@/pages/signagesystem/Approval/Index'),
// }
// ]
// },
// {
// path: 'selfservice',
// name: '自助服务',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'township',
// name: '乡镇便民中心',
// component: () => import('@/pages/selfterminal/TownCenter/Index'),
// },
// {
// path: 'pretrial',
// name: '预审工作人员',
// component: () => import('@/pages/selfterminal/PreTrialWork/Index'),
// },
// // {
// // path: 'commitment',
// // name: '承诺书设置',
// // component: () => import('@/pages/selfterminal/CommitmentSet/Index'),
// // },
// ]
// },
// {
// path: 'evaluation',
// name: '背靠背评价',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'bkbbaseset',
// name: '基础设置',
// component: () => import('@/pages/evaluation/BaseSet/Index'),
// },
// {
// path: 'options',
// name: '评价选项设置',
// component: () => import('@/pages/evaluation/Options/Index'),
// },
// {
// path: 'hall',
// name: '大厅管理',
// component: () => import('@/pages/evaluation/Hall/Index'),
// },
// ]
// },
// {
// path: 'pickup',
// name: '取件系统',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'cabinet',
// name: '取件柜设置',
// component: () => import('@/pages/pickup/Cabinet/Index'),
// },
// {
// path: 'courier',
// name: '快递员管理',
// component: () => import('@/pages/pickup/Courier/Index'),
// }
// ]
// },
// {
// path: 'ybsoftware',
// name: '样表软件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'ybbaseset',
// name: '样表事项设置',
// component: () => import('@/pages/sampleform/SoftWareSet/BaseSet/Index'),
// },
// {
// path: 'manageform',
// name: '样表管理',
// component: () => import('@/pages/sampleform/SoftWareSet/Manage/Index'),
// }
// ]
// },
// {
// path: 'ybhardware',
// name: '样表硬件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'equipment',
// name: '样表设备管理',
// component: () => import('@/pages/sampleform/HardWareSet/Equipment/Index'),
// }
// ]
// },
// {
// path: 'infosoftware',
// name: '信发软件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'xfvap',
// name: '信发轮播图/视频',
// component: () => import('@/pages/information/SoftWareSet/VedioAndPic/Index'),
// },
// {
// path: 'newsbulletin',
// name: '新闻公告',
// component: () => import('@/pages/information/SoftWareSet/NewsBulletin/Index'),
// },
// {
// path: 'scheduling',
// name: '排班信息',
// component: () => import('@/pages/information/SoftWareSet/Scheduling/Index'),
// },
// ]
// },
// {
// path: 'infohardware',
// name: '信发硬件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'infoequipment',
// name: '信息发布设备管理',
// component: () => import('@/pages/information/HardWareSet/InfoEquipment/Index'),
// }
// ]
// },
// {
// path: 'imsoftware',
// name: 'IM软件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'phrase',
// name: '短语设置',
// component: () => import('@/pages/imsystem/SoftWareSet/Phrase/Index'),
// },
// ]
// },
// {
// path: 'imhardware',
// name: 'IM硬件设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'manageim',
// name: 'IM管理',
// component: () => import('@/pages/imsystem/HardWareSet/ManageIm/Index'),
// }
// ]
// },
// {
// path: 'onething',
// name: '一件事一次办',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'itemset',
// name: '一件事事项设置',
// component: () => import('@/pages/onething/ItemSet/Index'),
// },
// {
// path: 'firsttrial',
// name: '一件事审批(初审)',
// component: () => import('@/pages/onething/FirstTrial/Index'),
// },
// {
// path: 'decision',
// name: '一件事审批(决定)',
// component: () => import('@/pages/onething/Decision/Index'),
// }
// ]
// },
// {
// path: 'mircowebsite',
// name: '微官网设置',
// meta: {
// icon: 'dashboard',
// },
// component: BlankView,
// children: [
// {
// path: 'websiteset',
// name: '首页配置',
// component: () => import('@/pages/mircowebsite/WebsiteSet/Index'),
// }
// ]
// },
// {
// path: 'parent2',
// name: '父级路由2',
// meta: {
// icon: 'form'
// },
// component: PageView,
// children: [
// {
// path: 'demo2',
// name: '演示页面2',
// component: () => import('@/pages/demo'),
// }
// ]
// },
// {
// path: 'exception',
// name: '异常页',
// meta: {
// icon: 'warning',
// },
// component: BlankView,
// children: [
// {
// path: '404',
// name: 'Exp404',
// component: () => import('@/pages/exception/404')
// },
// {
// path: '403',
// name: 'Exp403',
// component: () => import('@/pages/exception/403')
// },
// {
// path: '500',
// name: 'Exp500',
// component: () => import('@/pages/exception/500')
// }
// ]
// },
// {
// name: '验权页面',
// path: 'auth/demo',
// meta: {
// icon: 'file-ppt',
// authority: {
// permission: 'form',
// role: 'manager'
// },
// component: () => import('@/pages/demo')
// }
// }
]
}
]
}
export default options export default options;
let path = require('path') let path = require("path");
const webpack = require('webpack') const webpack = require("webpack");
const ThemeColorReplacer = require('webpack-theme-color-replacer') const ThemeColorReplacer = require("webpack-theme-color-replacer");
const {getThemeColors, modifyVars} = require('./src/utils/themeUtil') const { getThemeColors, modifyVars } = require("./src/utils/themeUtil");
const {resolveCss} = require('./src/utils/theme-color-replacer-extend') const { resolveCss } = require("./src/utils/theme-color-replacer-extend");
const CompressionWebpackPlugin = require('compression-webpack-plugin') const CompressionWebpackPlugin = require("compression-webpack-plugin");
const productionGzipExtensions = ['js', 'css'] const productionGzipExtensions = ["js", "css"];
const isProd = process.env.NODE_ENV === 'production' const isProd = process.env.NODE_ENV === "production";
const assetsCDN = { const assetsCDN = {
// webpack build externals // webpack build externals
...@@ -20,79 +20,80 @@ const assetsCDN = { ...@@ -20,79 +20,80 @@ const assetsCDN = {
// '@antv/data-set': 'DataSet', // '@antv/data-set': 'DataSet',
// 'js-cookie': 'Cookies' // 'js-cookie': 'Cookies'
// }, // },
css: [ css: [],
],
js: [ js: [
'//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', "//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js",
'//cdn.jsdelivr.net/npm/vue-router@3.3.4/dist/vue-router.min.js', "//cdn.jsdelivr.net/npm/vue-router@3.3.4/dist/vue-router.min.js",
'//cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js', "//cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js",
'//cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', "//cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js",
'//cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js', "//cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js",
'//cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js', "//cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js",
'//cdn.jsdelivr.net/npm/@antv/data-set@0.11.4/build/data-set.min.js', "//cdn.jsdelivr.net/npm/@antv/data-set@0.11.4/build/data-set.min.js",
'//cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js' "//cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js",
] ],
} };
module.exports = { module.exports = {
devServer: { devServer: {
disableHostCheck: true, disableHostCheck: true,
port:8080, port: 8080,
proxy: { proxy: {
'/api': { //此处要与 /services/api.js 中的 API_PROXY_PREFIX 值保持一致 "/api": {
//此处要与 /services/api.js 中的 API_PROXY_PREFIX 值保持一致
target: process.env.VUE_APP_API_BASE_URL, target: process.env.VUE_APP_API_BASE_URL,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '' "^/api": "",
}, },
// cookieDomainRewrite: 'localhost', // cookieDomainRewrite: 'localhost',
} },
} },
}, },
pluginOptions: { pluginOptions: {
'style-resources-loader': { "style-resources-loader": {
preProcessor: 'less', preProcessor: "less",
patterns: [path.resolve(__dirname, "./src/theme/theme.less")], patterns: [path.resolve(__dirname, "./src/theme/theme.less")],
} },
}, },
configureWebpack: config => { configureWebpack: (config) => {
config.entry.app = ["babel-polyfill", "whatwg-fetch", "./src/main.js"]; config.entry.app = ["babel-polyfill", "whatwg-fetch", "./src/main.js"];
config.performance = { config.performance = {
hints: false hints: false,
} };
config.plugins.push( config.plugins.push(
new ThemeColorReplacer({ new ThemeColorReplacer({
fileName: 'css/theme-colors-[contenthash:8].css', fileName: "css/theme-colors-[contenthash:8].css",
matchColors: getThemeColors(), matchColors: getThemeColors(),
injectCss: true, injectCss: true,
resolveCss resolveCss,
}) })
) );
// Ignore all locale files of moment.js // Ignore all locale files of moment.js
// config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)) // config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
// 生产环境下将资源压缩成gzip格式 // 生产环境下将资源压缩成gzip格式
if (isProd) { if (isProd) {
// add `CompressionWebpack` plugin to webpack plugins // add `CompressionWebpack` plugin to webpack plugins
config.plugins.push(new CompressionWebpackPlugin({ config.plugins.push(
algorithm: 'gzip', new CompressionWebpackPlugin({
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'), algorithm: "gzip",
threshold: 10240, test: new RegExp("\\.(" + productionGzipExtensions.join("|") + ")$"),
minRatio: 0.8 threshold: 10240,
})) minRatio: 0.8,
})
);
} }
// if prod, add externals // if prod, add externals
if (isProd) { if (isProd) {
config.externals = assetsCDN.externals config.externals = assetsCDN.externals;
} }
}, },
chainWebpack: config => { chainWebpack: (config) => {
// 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突 // 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
if (isProd) { if (isProd) {
config.plugin('optimize-css') config.plugin("optimize-css").tap((args) => {
.tap(args => { args[0].cssnanoOptions.preset[1].colormin = false;
args[0].cssnanoOptions.preset[1].colormin = false return args;
return args });
})
} }
// 生产环境下使用CDN // 生产环境下使用CDN
// if (isProd) { // if (isProd) {
...@@ -108,14 +109,14 @@ module.exports = { ...@@ -108,14 +109,14 @@ module.exports = {
less: { less: {
lessOptions: { lessOptions: {
modifyVars: modifyVars(), modifyVars: modifyVars(),
javascriptEnabled: true javascriptEnabled: true,
} },
} },
} },
}, },
publicPath: './', publicPath: "./",
// publicPath: process.env.VUE_APP_PUBLIC_PATH, // publicPath: process.env.VUE_APP_PUBLIC_PATH,
outputDir: 'dist', outputDir: "dist",
assetsDir: 'static', assetsDir: "static",
productionSourceMap: false productionSourceMap: false,
} };
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment