Commit 57f324f6 by 姜雷

更新提交

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