Commit 57f324f6 by 姜雷

更新提交

parent 263fbaa7
...@@ -4,7 +4,7 @@ VUE_APP_CUSTOMER_MENU_CODE=0001 ...@@ -4,7 +4,7 @@ VUE_APP_CUSTOMER_MENU_CODE=0001
VUE_APP_BASE_MENU_CODE=0002 VUE_APP_BASE_MENU_CODE=0002
VUE_APP_SYSTEM_MENU_CODE=0003 VUE_APP_SYSTEM_MENU_CODE=0003
VUE_APP_FEEDBACK_MENU_CODE=0018 VUE_APP_FEEDBACK_MENU_CODE=0018
VUE_APP_WARNNING_MENU_CODE=0098 VUE_APP_WARNNING_MENU_CODE=0100
VUE_APP_STATISTICS_MENU_CODE=0044 VUE_APP_STATISTICS_MENU_CODE=0044
VUE_APP_DEVICE_MENU_CODE=0048 VUE_APP_DEVICE_MENU_CODE=0048
VUE_APP_CUSTOMER_OPERATE_CODE=0077 VUE_APP_CUSTOMER_OPERATE_CODE=0077
......
# 多彩校园综合项目
内含多个子项目`customerManage`,`baseManage`,`systemManage`,`operateManage`,`statisticsManage`,`deviceManage`,`smaproManage`.
# 运维替换文件 # 运维替换文件
打包分别有 3 种模式 打包分别有 3 种模式
......
...@@ -3,7 +3,7 @@ if (process.env.NODE_ENV === 'production') { ...@@ -3,7 +3,7 @@ if (process.env.NODE_ENV === 'production') {
removeConsolePlugin.push([ removeConsolePlugin.push([
'transform-remove-console', 'transform-remove-console',
{ {
exclude: ['error', 'warn'], exclude: ['error', 'warn', 'table'],
}, },
]); ]);
} }
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"popmotion": "^8.1.22", "popmotion": "^8.1.22",
"qiniu-js": "^2.2.0", "qiniu-js": "^2.2.0",
"rym-element-ui": "^0.1.62", "rym-element-ui": "^0.1.64",
"systemjs": "^4.0.0",
"vue-qr": "^1.2.8", "vue-qr": "^1.2.8",
"vuedraggable": "^2.16.0", "vuedraggable": "^2.16.0",
"wangeditor": "^3.1.1" "wangeditor": "^3.1.1"
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" /> <link rel="icon" href="<%= BASE_URL %>ic_logo.ico" />
<script src="<%= BASE_URL %>system.js"></script>
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script> <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
<script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script> <script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script>
<script src="https://unpkg.com/vue-router@3.0.1/dist/vue-router.js"></script> <script src="https://unpkg.com/vue-router@3.0.1/dist/vue-router.js"></script>
<link rel="stylesheet" href="<%= VUE_APP_DEV_LIB_URL %>/lib/manageShell.css" />
<title>多彩综合管理系统</title> <title>多彩综合管理系统</title>
</head> </head>
...@@ -21,15 +21,6 @@ ...@@ -21,15 +21,6 @@
<div id="app"></div> <div id="app"></div>
<script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script> <script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script> <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="<%= VUE_APP_DEV_LIB_URL %>/lib/manageShell.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/customerManage/lib/customerManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/baseManage/lib/baseManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/systemManage/lib/systemManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/operateManage/lib/operateManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/statisticsManage/lib/statisticsManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/deviceManage/lib/deviceManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/smaproManage/lib/smaproManage.umd.min.js"></script>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
......
...@@ -40,5 +40,6 @@ export const getFeedbackList = req => ...@@ -40,5 +40,6 @@ export const getFeedbackList = req =>
export const getWarnningCount = req => export const getWarnningCount = req =>
fetch({ fetch({
url: devicePath + '/device/warning/count', url: devicePath + '/device/warning/count',
noErrorAlert: true,
...req, ...req,
}); });
...@@ -33,7 +33,7 @@ export const validateCode = res => { ...@@ -33,7 +33,7 @@ export const validateCode = res => {
}; };
export const errorHandle = error => { export const errorHandle = error => {
console.error('err' + error); // for debug console.table(['fetchError: ', error]); // for debug
store.dispatch('fetchDone'); store.dispatch('fetchDone');
if (error.message && /timeout/.test(error.message)) { if (error.message && /timeout/.test(error.message)) {
Message({ Message({
...@@ -45,7 +45,7 @@ export const errorHandle = error => { ...@@ -45,7 +45,7 @@ export const errorHandle = error => {
} }
if (isCancel(error)) { if (isCancel(error)) {
console.log('取消请求'); console.log('取消请求');
} else { } else if (!error.config.noErrorAlert) {
Message({ Message({
message: error.message, message: error.message,
type: 'error', type: 'error',
......
...@@ -101,6 +101,9 @@ $--color-danger: #ff3333; ...@@ -101,6 +101,9 @@ $--color-danger: #ff3333;
line-height: 1; line-height: 1;
font-size: 14px; font-size: 14px;
} }
.el-cascader__label {
line-height: 40px;
}
.el-button { .el-button {
font-size: 14px; font-size: 14px;
padding: 12px 20px; padding: 12px 20px;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
:showMoney="showMoney" :showMoney="showMoney"
:showCellphone="showCellphone" :showCellphone="showCellphone"
:visible="visible" :visible="visible"
:isRefresh="isRefresh"
ref="UserInfo" ref="UserInfo"
/> />
<div class="right-part"> <div class="right-part">
...@@ -50,6 +51,10 @@ export default { ...@@ -50,6 +51,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isRefresh:{
type: Boolean,
default: false,
},
}, },
methods: { methods: {
refreshBeanData() { refreshBeanData() {
......
...@@ -69,6 +69,9 @@ export default { ...@@ -69,6 +69,9 @@ export default {
this.debouncedQueryChange = debounce(this.debounce, value => { this.debouncedQueryChange = debounce(this.debounce, value => {
this.handleQueryChange(value); this.handleQueryChange(value);
}); });
if (this.value && this.value.find(item => item === -1)) {
this.selectedAll = true;
}
}, },
computed: { computed: {
filterList() { filterList() {
......
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
value: Number, value: Number,
disabled: Boolean, disabled: Boolean,
clearable: { clearable: {
type:Boolean, type: Boolean,
default: true, default: true,
}, },
}, },
...@@ -35,8 +35,10 @@ export default { ...@@ -35,8 +35,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (val) { if (val) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} else { } else {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} }
}, },
}, },
......
...@@ -40,8 +40,10 @@ export default { ...@@ -40,8 +40,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (val || val === 0) { if (val || val === 0) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} else { } else {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} }
}, },
disabledValue(val) { disabledValue(val) {
......
...@@ -54,6 +54,12 @@ export default { ...@@ -54,6 +54,12 @@ export default {
}); });
} }
}, },
methods: {
changeHandle(val) {
this.$emit('input', val);
this.$emit('change', val);
},
},
}; };
</script> </script>
...@@ -26,9 +26,6 @@ export default { ...@@ -26,9 +26,6 @@ export default {
}, },
methods: { methods: {
...mapActions(actionsList), ...mapActions(actionsList),
changeHandle(val) {
this.$emit('input', val);
},
getOptionsList(label) { getOptionsList(label) {
let optionValue = this.getOptionsValue(label); let optionValue = this.getOptionsValue(label);
if (optionValue) { if (optionValue) {
......
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
methods: { methods: {
changeHandle(val) { changeHandle(val) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
}, },
}, },
}; };
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
}, },
disabled: Boolean, disabled: Boolean,
clearable: { clearable: {
type:Boolean, type: Boolean,
default: true, default: true,
}, },
}, },
...@@ -46,8 +46,10 @@ export default { ...@@ -46,8 +46,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (!val) { if (!val) {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} else { } else {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} }
}, },
}, },
......
...@@ -40,8 +40,10 @@ export default { ...@@ -40,8 +40,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (val || val === 0) { if (val || val === 0) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} else { } else {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} }
}, },
}, },
......
...@@ -54,7 +54,13 @@ ...@@ -54,7 +54,13 @@
</template> </template>
<script> <script>
import listMixin from '../../mixins/listPage';
export default { export default {
mixins: [listMixin],
created() {
console.log('in cre');
},
data() { data() {
return { return {
filters: { filters: {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="IconMenu-name">{{ menuName }}</div> <div class="IconMenu-name">{{ menuName }}</div>
</div> </div>
<div <div
:class="`SubmenuBox ${showSubMenus?'show':''}`" :class="{SubmenuBox: true, show: showSubMenus, scroll: needScroll}"
:style="style" :style="style"
v-if="menuList && menuList.length" v-if="menuList && menuList.length"
> >
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
<script> <script>
import LikeIcon from './LikeIcon'; import LikeIcon from './LikeIcon';
let timers = null;
export default { export default {
name: 'MenuItem', name: 'MenuItem',
components: { LikeIcon }, components: { LikeIcon },
...@@ -101,6 +102,7 @@ export default { ...@@ -101,6 +102,7 @@ export default {
data() { data() {
return { return {
showSubMenus: false, showSubMenus: false,
needScroll: false,
style: '', style: '',
}; };
}, },
...@@ -123,6 +125,19 @@ export default { ...@@ -123,6 +125,19 @@ export default {
methods: { methods: {
toggleSubmenus(visiable) { toggleSubmenus(visiable) {
this.showSubMenus = visiable; this.showSubMenus = visiable;
if (visiable) {
// this.$nextTick(() => {
// });
timers = setTimeout(() => {
this.needScroll = visiable;
}, 280);
} else {
if (timers) {
clearTimeout(timers);
timers = null;
}
this.needScroll = visiable;
}
}, },
selectHandle() { selectHandle() {
if (typeof this.selectRouteMenu === 'function') { if (typeof this.selectRouteMenu === 'function') {
...@@ -173,9 +188,12 @@ export default { ...@@ -173,9 +188,12 @@ export default {
transition: all 0.28s ease-in-out; transition: all 0.28s ease-in-out;
overflow: hidden; overflow: hidden;
&.show { &.show {
max-height: 1000px; max-height: 600px;
height: auto; height: auto;
} }
&.scroll {
overflow-y: auto;
}
.Submenu-title { .Submenu-title {
width: 560px; width: 560px;
height: 30px; height: 30px;
......
...@@ -131,11 +131,12 @@ ...@@ -131,11 +131,12 @@
<el-form label-width="120px"> <el-form label-width="120px">
<el-form-item label="登录账户">{{userInfo.loginAccount}}</el-form-item> <el-form-item label="登录账户">{{userInfo.loginAccount}}</el-form-item>
<el-form-item label="姓名"> <el-form-item label="姓名">
<el-input <!-- <el-input
v-model="userForm.name" v-model="userForm.name"
maxlength="20" maxlength="20"
placeholder="请输入姓名" placeholder="请输入姓名"
></el-input> ></el-input> -->
{{userInfo.name}}
</el-form-item> </el-form-item>
<el-form-item label="运营商">{{userInfo.operateName}}</el-form-item> <el-form-item label="运营商">{{userInfo.operateName}}</el-form-item>
<el-form-item label="手机号">{{userInfo.cellphone}}</el-form-item> <el-form-item label="手机号">{{userInfo.cellphone}}</el-form-item>
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" /> <link rel="icon" href="<%= BASE_URL %>ic_logo.ico" />
<script src="<%= BASE_URL %>system.js"></script>
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script> <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
<script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script> <script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script>
...@@ -20,14 +21,6 @@ ...@@ -20,14 +21,6 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script src="<%= VUE_APP_SUBSYSTEM %>/customerManage/lib/customerManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/baseManage/lib/baseManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/systemManage/lib/systemManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/operateManage/lib/operateManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/statisticsManage/lib/statisticsManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/deviceManage/lib/deviceManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/smaproManage/lib/smaproManage.umd.min.js"></script>
<script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script> <script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script> <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="https://unpkg.com/@antv/data-set"></script> <script src="https://unpkg.com/@antv/data-set"></script>
......
import System from '../lib/main'; import CreatSystem from '../lib/main';
import asyncRouterMap from '../router/asyncRoutes'; import asyncRouterMap from '../router/asyncRoutes';
window.manageShell = { default: System }; window.manageShell = { default: CreatSystem };
window.allAasyncRouterMap = [...asyncRouterMap];
setTimeout(() => { let constantRouter = [
let allAasyncRouterMap = [...asyncRouterMap]; {
let routeNameList = [ path: '/asd',
name: 'asd',
component: {
template: '<div>asdasdasd</div>',
},
},
];
const routeFilter = (routes, allRoute) => {
if (allRoute && allRoute.length) {
let addRoute = manageShell.default.utils.route.formatRouteLink(allRoute);
for (let index = 0; index < addRoute.length; index++) {
const element = addRoute[index];
if (element.children) {
routes = routes.concat(element.children);
} else if (
element.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
) {
routes.unshift(element);
}
}
}
return {
allRoute,
routes,
};
};
const script = document.createElement('script');
script.text = `
var routeNameList = [
'customerManage', 'customerManage',
'baseManage', 'baseManage',
'systemManage', 'systemManage',
...@@ -14,48 +43,30 @@ setTimeout(() => { ...@@ -14,48 +43,30 @@ setTimeout(() => {
'deviceManage', 'deviceManage',
'smaproManage', 'smaproManage',
]; ];
routeNameList.map(name => { Promise.all(routeNameList.map(name => {
try { var node = document.createElement("link");
allAasyncRouterMap = allAasyncRouterMap.concat(window[name].default); node.rel = "stylesheet";
} catch (error) { node.type = "text/css";
console.error(name + ': ', error); node.href = '${
process.env.VUE_APP_SUBSYSTEM
}/' + name + '/lib/' + name + '.css?t=${new Date().getTime()}';
document.getElementsByTagName("head")[0].appendChild(node);
return System.import('${
process.env.VUE_APP_SUBSYSTEM
}/' + name + '/lib/' + name + '.umd.min.js?t=${new Date().getTime()}')
}))
.then(res => {
for (let index = 0; index < res.length; index++) {
const element = res[index];
allAasyncRouterMap = allAasyncRouterMap.concat(element.default.default);
} }
return name; manageShell.default.createSystem({
}); basePath: '${process.env.VUE_APP_BASE_URL}',
routers: allAasyncRouterMap,
System.createSystem({ constantRouter: ${JSON.stringify(constantRouter)},
basePath: process.env.VUE_APP_BASE_URL, whiteList: '/asd',
routers: allAasyncRouterMap, routeFilter: ${routeFilter.toString()},
constantRouter: [ })
{ })
path: '/asd', `;
name: 'asd', document.body.appendChild(script);
component: {
render(h) {
return <div>asdasdasd</div>;
},
},
},
],
whiteList: '/asd',
routeFilter: (routes, allRoute) => {
if (allRoute && allRoute.length) {
let addRoute = System.utils.route.formatRouteLink(allRoute);
for (let index = 0; index < addRoute.length; index++) {
const element = addRoute[index];
if (element.children) {
routes = routes.concat(element.children);
} else if (
element.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
) {
routes.unshift(element);
}
}
}
return {
allRoute,
routes,
};
},
});
}, 1000);
import CreatSystem from './lib/main';
import asyncRouterMap from './router/asyncRoutes'; import asyncRouterMap from './router/asyncRoutes';
let allAasyncRouterMap = [...asyncRouterMap]; window.manageShell = { default: CreatSystem };
let routeNameList = [ window.allAasyncRouterMap = [...asyncRouterMap];
'customerManage',
'baseManage',
'systemManage',
'operateManage',
'statisticsManage',
'deviceManage',
'smaproManage',
];
routeNameList.map(name => {
try {
allAasyncRouterMap = allAasyncRouterMap.concat(window[name].default);
} catch (error) {
console.error(name + ': ', error);
}
return name;
});
const System = manageShell.default;
export default System.createSystem({ const routeFilter = (routes, allRoute) => {
basePath: process.env.VUE_APP_BASE_URL, if (allRoute && allRoute.length) {
routers: allAasyncRouterMap, let addRoute = System.utils.route.formatRouteLink(allRoute);
routeFilter: (routes, allRoute) => { for (let index = 0; index < addRoute.length; index++) {
if (allRoute && allRoute.length) { const element = addRoute[index];
let addRoute = System.utils.route.formatRouteLink(allRoute); if (element.children) {
for (let index = 0; index < addRoute.length; index++) { routes = routes.concat(element.children);
const element = addRoute[index]; } else if (
if (element.children) { element.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
routes = routes.concat(element.children); ) {
} else if ( routes.unshift(element);
element.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
) {
routes.unshift(element);
}
} }
} }
return { }
allRoute, return {
routes, allRoute,
}; routes,
}, };
}); };
const script = document.createElement('script');
script.text = `
var routeNameList = [
'customerManage',
'baseManage',
'systemManage',
'operateManage',
'statisticsManage',
'deviceManage',
'smaproManage',
];
Promise.all(
routeNameList.map(function(name) {
var node = document.createElement("link");
node.rel = "stylesheet";
node.type = "text/css";
node.href = '${process.env.VUE_APP_SUBSYSTEM}/' + name + '/lib/' + name + '.css?t=${new Date().getTime()}';
document.getElementsByTagName("head")[0].appendChild(node);
return System.import('${
process.env.VUE_APP_SUBSYSTEM
}/' + name + '/lib/' + name + '.umd.min.js?t=${new Date().getTime()}');
})
)
.then(function(res) {
for (let index = 0; index < res.length; index++) {
const element = res[index];
allAasyncRouterMap = allAasyncRouterMap.concat(element.default.default);
}
manageShell.default.createSystem({
basePath: '${process.env.VUE_APP_BASE_URL}',
routers: allAasyncRouterMap,
routeFilter: function(routes, allRoute) {
if (allRoute && allRoute.length) {
let addRoute = manageShell.default.utils.route.formatRouteLink(
allRoute
);
for (let index = 0; index < addRoute.length; index++) {
const element = addRoute[index];
if (element.children) {
routes = routes.concat(element.children);
} else if (
element.menuCode === ${
process.env.VUE_APP_REGISTER_DASHBOARD_CODE
}
) {
routes.unshift(element);
}
}
}
return {
allRoute,
routes,
};
},
});
});
`;
document.body.appendChild(script);
import { mapGetters } from 'vuex'; import { mapGetters, mapActions } from 'vuex';
/** /**
* 需要页面组件自己注入或重写参数 * 需要页面组件自己注入或重写参数
...@@ -24,17 +24,18 @@ export default { ...@@ -24,17 +24,18 @@ export default {
}, },
// //
computed: { computed: {
...mapGetters(['loading']), ...mapGetters(['loading', 'routeNames']),
}, },
created() { created() {
// 当页面没有列表数据的时候调用 // 当页面没有打开过的时候调用
if (!this.listData || !this.listData.length) { if (this.routeNames.find(name => name === this.$route.name)) return;
this.fetchList({ this.updateRouteNames(this.$route.name);
pageNum: 1, this.fetchList({
}); pageNum: 1,
} });
}, },
methods: { methods: {
...mapActions(['updateRouteNames']),
// 页面组件需自己实现获取列表数据的方法 // 页面组件需自己实现获取列表数据的方法
fetchList() {}, fetchList() {},
// 点击搜索时处理函数 // 点击搜索时处理函数
......
...@@ -11,6 +11,10 @@ export default { ...@@ -11,6 +11,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isRefresh:{
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
...@@ -26,6 +30,14 @@ export default { ...@@ -26,6 +30,14 @@ export default {
this.getAllData(); this.getAllData();
} }
}, },
isRefresh(newIsRefresh){
if(newIsRefresh && this.visible){
this.fetchUserBaseInfo({
customerId: this.customerId,
});
this.getAllData();
}
},
customerId(newId) { customerId(newId) {
if (newId && this.visible) { if (newId && this.visible) {
this.fetchUserBaseInfo({ this.fetchUserBaseInfo({
......
...@@ -5,6 +5,7 @@ const GET_WHITE_LIST = 'GET_WHITE_LIST'; ...@@ -5,6 +5,7 @@ const GET_WHITE_LIST = 'GET_WHITE_LIST';
const UPDATE_BACK_PAGE = 'UPDATE_BACK_PAGE'; const UPDATE_BACK_PAGE = 'UPDATE_BACK_PAGE';
const UPDATE_FEEDBACK_PAGE = 'UPDATE_FEEDBACK_PAGE'; const UPDATE_FEEDBACK_PAGE = 'UPDATE_FEEDBACK_PAGE';
const UPDATE_WARNNING_PAGE = 'UPDATE_WARNNING_PAGE'; const UPDATE_WARNNING_PAGE = 'UPDATE_WARNNING_PAGE';
const UPDATE_ROUTE_NAMES = 'UPDATE_ROUTE_NAMES';
let fetchCount = 0; let fetchCount = 0;
const state = () => ({ const state = () => ({
...@@ -13,6 +14,7 @@ const state = () => ({ ...@@ -13,6 +14,7 @@ const state = () => ({
dashboardBackPage: undefined, dashboardBackPage: undefined,
feedbackPage: undefined, feedbackPage: undefined,
warnningPage: undefined, warnningPage: undefined,
routeNames: [],
}); });
const getters = { const getters = {
...@@ -21,6 +23,7 @@ const getters = { ...@@ -21,6 +23,7 @@ const getters = {
dashboardBackPage: state => state.dashboardBackPage, dashboardBackPage: state => state.dashboardBackPage,
feedbackPage: state => state.feedbackPage, feedbackPage: state => state.feedbackPage,
warnningPage: state => state.warnningPage, warnningPage: state => state.warnningPage,
routeNames: state => state.routeNames,
}; };
const actions = { const actions = {
...@@ -42,6 +45,9 @@ const actions = { ...@@ -42,6 +45,9 @@ const actions = {
updateWarnningPage({ commit }, name) { updateWarnningPage({ commit }, name) {
commit(UPDATE_WARNNING_PAGE, name); commit(UPDATE_WARNNING_PAGE, name);
}, },
updateRouteNames({ commit }, name) {
commit(UPDATE_ROUTE_NAMES, name);
},
}; };
const mutations = { const mutations = {
[FETCH_START](state, notLoading) { [FETCH_START](state, notLoading) {
...@@ -70,6 +76,33 @@ const mutations = { ...@@ -70,6 +76,33 @@ const mutations = {
[UPDATE_WARNNING_PAGE](state, name) { [UPDATE_WARNNING_PAGE](state, name) {
state.warnningPage = name; state.warnningPage = name;
}, },
[UPDATE_ROUTE_NAMES](state, name) {
let idx = state.routeNames.indexOf(name);
if (idx > -1) {
state.routeNames = [
...state.routeNames.slice(0, idx),
...state.routeNames.slice(idx + 1),
];
} else {
state.routeNames.push(name);
}
},
DEL_VISITED_VIEWS: (state, view) => {
let name = view.name;
let idx = state.routeNames.indexOf(name);
if (idx > -1) {
state.routeNames = [
...state.routeNames.slice(0, idx),
...state.routeNames.slice(idx + 1),
];
}
},
DEL_OTHERS_VIEWS: (state, view) => {
state.routeNames = [view.name];
},
DEL_ALL_VIEWS: state => {
state.routeNames = [];
},
}; };
export default { export default {
modules: { modules: {
......
export default (err, vm, info) => { export default (err, vm, info) => {
console.table([err, { info: info }]); console.error(err);
console.table([{ name: 'vm', data: vm }, { name: 'info', data: info }]);
return false; return false;
}; };
...@@ -106,7 +106,7 @@ export const getAuthRoute = (asyncRouterMap, addRoute, path = '/') => { ...@@ -106,7 +106,7 @@ export const getAuthRoute = (asyncRouterMap, addRoute, path = '/') => {
} else { } else {
return { return {
path: path + route.menuLink, path: path + route.menuLink,
component: null, redirect: '/404',
name: route.id, name: route.id,
meta: { meta: {
title: route.menuName, title: route.menuName,
......
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