Commit c7b510ff by 姜雷

Merge branch 'develop' into 'test'

Develop See merge request !3
parents b0c86993 d5a54bbc
module.exports = {
presets: ['@vue/app'],
plugins: [
[
'component',
{
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk',
},
],
],
};
......@@ -26,14 +26,13 @@
"@antv/g2": "^3.5.1",
"axios": "^0.18.0",
"blueimp-md5": "^2.10.0",
"element-ui": "^2.4.5",
"js-cookie": "^2.2.0",
"lodash": "^4.17.5",
"normalize.css": "^8.0.0",
"nprogress": "^0.2.0",
"popmotion": "^8.1.22",
"qiniu-js": "^2.2.0",
"rym-element-ui": "^0.1.50",
"rym-element-ui": "^0.1.54",
"vue-qr": "^1.2.8",
"vuedraggable": "^2.16.0",
"wangeditor": "^3.1.1"
......
......@@ -14,18 +14,6 @@
<script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.js"></script>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.css"
/>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.css"
/>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.css"
/>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.css"
/>
<title>系统管理</title>
......
import fetch from '../fetch';
const path = process.env.VUE_APP_BASE_SERVER_URL;
// const path = 'http://192.168.1.33:8889';
export const fetchAreaList = req =>
fetch({
......@@ -35,7 +34,7 @@ export const fetchOperatorList = req =>
// 获取豆类型
export const fetchBeansList = req =>
fetch({
url: '/baseData/beans',
url: path + '/baseData/beans',
method: 'get',
...req,
});
......
......@@ -12,7 +12,8 @@ const createBaseFetch = config => {
// request拦截器
service.interceptors.request.use(
conf => {
store.dispatch('fetchStart');
const { notLoading } = conf;
store.dispatch('fetchStart', notLoading);
conf.headers = {
...conf.headers,
reqSource: 'pc',
......@@ -34,7 +35,8 @@ const createBaseFetch = config => {
* code为非 1000 是抛错
*/
setTimeout(() => {
store.dispatch('fetchDone');
const { notLoading } = response.config;
store.dispatch('fetchDone', notLoading);
}, 500);
if (res.code !== 1000) {
if (
......
import axios from 'axios';
import { Message, MessageBox } from 'element-ui';
import store from '../store';
import { SUCCESS_CODE } from '@/config';
import { SUCCESS_CODE, LOGOUT_CODE } from '@/config';
import { errorHandle } from './validate';
import { getYourIP } from '@/utils/getIp.js';
......@@ -67,7 +67,7 @@ service.interceptors.response.use(response => {
});
// -2:其他客户端登录了;Token 过期了;
if (res.code === '-2') {
if (res.code === LOGOUT_CODE) {
if (logout) return;
logout = true;
MessageBox.confirm(
......
......@@ -65,6 +65,7 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts';
height: 40px;
line-height: 40px;
}
.el-cascader,
.el-input__inner,
.el-button {
height: 22px;
......@@ -88,6 +89,7 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts';
height: 56px;
line-height: 56px;
}
.el-cascader,
.el-input__inner,
.el-button {
height: 40px;
......
......@@ -3,16 +3,24 @@ import store from './store';
export default {
props: {
// null所有/1自助/2三方
// 服务类型:null所有/1自助/2三方
ServiceType: {
type: Number,
default: null,
},
// 服务状态:null所有/1开启/0关闭
ServiceState: {
type: Number,
default: null,
},
},
created() {
store.install(this.$store);
if (!this.serviceTypeLists[this.ServiceType].length) {
this.fetchServiceTypeList(this.ServiceType);
this.fetchServiceTypeList({
serviceType: this.ServiceType,
serviceState: this.ServiceState,
});
}
},
computed: {
......
......@@ -21,11 +21,11 @@ const getters = {
};
const actions = {
fetchServiceTypeList({ state, commit }, serviceType) {
fetchServiceTypeList({ state, commit }, { serviceType, serviceState }) {
if (state.fetching[serviceType]) return;
commit(FETCH_STATE, { value: true, index: serviceType });
return fetchServiceList({
params: { serviceType },
params: { serviceType, state: serviceState },
}).then(res => {
const { selfService } = res;
commit(SERVICE_TYPE_LIST, { list: selfService, index: serviceType });
......
export const TOKEN_KEY = 'dcrym';
export const SUCCESS_CODE = 1000;
export const LOGOUT_CODE = -2;
export const selectTypeMapping = [
{ label: '赠送类型', value: '2' },
......
......@@ -7,6 +7,8 @@ import {
const GET_CONSUME_DATA = 'GET_CONSUME_DATA';
const GET_REPORT_DATA = 'GET_REPORT_DATA';
const GET_TITLE_DATA = 'GET_TITLE_DATA';
const GET_PERCENT_DATA = 'GET_PERCENT_DATA';
const GET_EUIPMENT_DATA = 'GET_EUIPMENT_DATA';
const state = () => ({
consume: {
......@@ -48,6 +50,14 @@ const actions = {
},
}).then(res => {
let list = res.data;
if (entity && entity.updatePercentList) {
commit(GET_PERCENT_DATA, list);
return;
}
if (entity && entity.updateEuipmentList) {
commit(GET_EUIPMENT_DATA, list);
return;
}
commit(GET_CONSUME_DATA, list);
});
},
......@@ -75,6 +85,12 @@ const mutations = {
state.consume.list = data.list;
state.consume.percentList = data.percentList;
},
[GET_PERCENT_DATA]: (state, data) => {
state.consume.percentList = data.percentList;
},
[GET_EUIPMENT_DATA]: (state, data) => {
state.consume.consumeHardVos = data.consumeHardVos;
},
[GET_REPORT_DATA]: (state, data) => {
state.report.year = data.year;
state.report.month = data.month;
......
......@@ -67,7 +67,10 @@
/>
</search-item>
</div>
<CampusRank :data="campusRankList" />
<CampusRank
:data="campusRankList"
:changeCampusHandle="changeCampusHandle"
/>
</div>
<div class="Dashboard-DataCard">
<div class="Dashboard-title">
......@@ -77,7 +80,10 @@
<div class="Dashboard-title-text">各服务消费占比</div>
<div class="Dashboard-title-top">TOP1</div>
</div>
<SeviceRatio :data="seviceRatioList" />
<SeviceRatio
:data="seviceRatioList"
:changeServiceHandle="changeServiceHandle"
/>
</div>
<div class="Dashboard-DataCard">
<div class="Dashboard-title">
......@@ -207,11 +213,36 @@ export default {
});
}
},
changeCampusHandle(data) {
let operateId = this.operatorFilters.operateId;
let year = this.operatorFilters.year;
let month = this.operatorFilters.month;
this.fetchConsumeList({
year: year ? year : null,
month: month ? month : null,
operateId: operateId ? operateId : null,
areaId: data.areaId,
updatePercentList: true,
});
},
changeServiceHandle(data) {
let operateId = this.operatorFilters.operateId;
let year = this.operatorFilters.year;
let month = this.operatorFilters.month;
this.fetchConsumeList({
year: year ? year : null,
month: month ? month : null,
operateId: operateId ? operateId : null,
serviceId: data.serviceId,
updateEuipmentList: true,
});
},
},
};
</script>
<style lang="scss">
@import '@/assets/styles/variables.scss';
.Dashboard {
display: flex;
flex-direction: column;
......@@ -246,7 +277,6 @@ export default {
}
.Dashboard-CampusData {
display: flex;
height: 300px;
padding: 0 15px;
.Dashboard-title {
......@@ -321,4 +351,20 @@ export default {
}
}
}
@media screen and (max-width: $bigScreenWidth) {
.Dashboard {
.Dashboard-SearchBar {
padding: 10px 0 10px;
}
.Dashboard-OperatorData {
.Dashboard-SearchBar {
height: 50px;
}
.Dashboard-title {
margin: 10px 10px 0;
padding-bottom: 10px;
}
}
}
}
</style>
......@@ -8,6 +8,7 @@ export default {
data() {
return {
chart: null,
height: 270,
chartGeom: null,
};
},
......@@ -17,6 +18,11 @@ export default {
},
},
mounted() {
const innerWidth = window.innerWidth;
const innerHeight = window.innerHeight;
if (innerWidth < 1600) {
this.height = (innerHeight - 250) / 2;
}
this.initData();
},
methods: {
......
......@@ -24,7 +24,7 @@ export default {
this.chart = new G2.Chart({
container: 'ActiveUserByMonth',
forceFit: true,
height: 270,
height: this.height,
padding: [50, 40],
});
this.chart
......
......@@ -11,6 +11,11 @@ import chartMixin from '../chartMixin';
export default {
name: 'CampusRank',
mixins: [chartMixin],
props: {
changeCampusHandle: {
type: Function,
},
},
data() {
let totle = this.data.reduce((count, item) => count + item.count, 0);
return {
......@@ -19,6 +24,7 @@ export default {
totle: totle,
percentDom: null,
areaNameDom: null,
SelectedDataIndex: null,
};
},
mounted() {
......@@ -29,7 +35,7 @@ export default {
this.chart = new G2.Chart({
container: 'CampusRank',
forceFit: true,
height: 270,
height: this.height,
padding: [0, 130, 0, 0],
});
this.chart.source(this.data);
......@@ -116,19 +122,28 @@ export default {
alignY: 'middle',
});
this.chart.render();
this.chart.on('plotclick', this.clickHandle);
this.chart.on('interval:click', this.clickHandle);
},
updateData() {
if (this.data.length) {
this.totle = this.data.reduce((count, item) => count + item.count, 0);
this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]);
let data = this.SelectedDataIndex;
if (data) {
this.changeSelected(data);
this.chartGeom.setSelected(data);
} else {
this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]);
this.SelectedDataIndex = this.data[0];
}
}
},
clickHandle(ev) {
if (ev.data) {
let data = ev.data._origin;
let data = ev.data._origin;
if (this.SelectedDataIndex.areaId !== data.areaId) {
this.SelectedDataIndex = data;
this.changeSelected(data);
this.changeCampusHandle(data);
}
},
changeSelected(data) {
......
......@@ -19,7 +19,7 @@ export default {
this.chart = new G2.Chart({
container: 'RegisterByDay',
forceFit: true,
height: 270,
height: this.height,
padding: [40, 20, 30, 45],
});
this.chart
......
......@@ -18,7 +18,7 @@ export default {
this.chart = new G2.Chart({
container: 'RegisterByMonth',
forceFit: true,
height: 270,
height: this.height,
padding: [0, 20, 30, 20],
});
this.chart
......
......@@ -12,12 +12,18 @@ import chartMixin from '../chartMixin';
export default {
name: 'SeviceRatio',
mixins: [chartMixin],
props: {
changeServiceHandle: {
type: Function,
},
},
data() {
let totle = this.data.reduce((count, item) => count + item.count, 0);
return {
totle: totle,
percentDom: null,
serviceNameDom: null,
SelectedDataIndex: null,
};
},
mounted() {
......@@ -29,7 +35,7 @@ export default {
this.chart = new G2.Chart({
container: 'SeviceRatio',
forceFit: true,
height: 270,
height: this.height,
padding: [0, 130, 0, 0],
});
this.chart.source(this.data);
......@@ -102,14 +108,23 @@ export default {
updateData() {
if (this.data.length) {
this.totle = this.data.reduce((count, item) => count + item.count, 0);
this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]);
let data = this.SelectedDataIndex;
if (data) {
this.changeSelected(data);
this.chartGeom.setSelected(data);
} else {
this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]);
this.SelectedDataIndex = this.data[0];
}
}
},
clickHandle(ev) {
if (ev.data) {
let data = ev.data._origin;
if (this.SelectedDataIndex.serviceId !== data.serviceId) {
let data = ev.data._origin;
this.changeSelected(data);
this.changeServiceHandle(data);
}
},
changeSelected(data) {
......
......@@ -485,7 +485,8 @@ export default {
this.updateUserCellphone(entity)
.then(res => {
this.resetCellphoneForm();
console.log(res);
this.$message.success(res.msg || '修改成功');
this.cancelCellphoneUpdate();
})
.catch(err => {
console.log(err);
......
......@@ -8,19 +8,6 @@
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/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>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.css"
/>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.css"
/>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.css"
/>
<title>系统管理</title>
</head>
<body>
......@@ -36,4 +23,7 @@
<script src="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.umd.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.umd.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.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>
</html>
......@@ -5,10 +5,9 @@ import { constantRouterMap, routeStore } from '../router';
import store from '../store';
import createBaseFetch from './Api';
import configRoutePermission from './permission';
import extendCom from '@/utils/extends';
import '@/assets/styles/index.scss'; // global css
import extendCom from '@/utils/extends';
import { formatRouteLink } from '@/utils/route';
import storeModule from './storeModule';
import mixinModule from './mixins';
......
......@@ -12,20 +12,24 @@ const getters = {
};
const actions = {
fetchStart({ commit }) {
commit(FETCH_START);
fetchStart({ commit }, notLoading) {
commit(FETCH_START, notLoading);
},
fetchDone({ commit }) {
commit(FETCH_DONE);
fetchDone({ commit }, notLoading) {
commit(FETCH_DONE, notLoading);
},
};
const mutations = {
[FETCH_START](state) {
fetchCount++;
state.loading = true;
[FETCH_START](state, notLoading) {
if (!notLoading) {
fetchCount++;
state.loading = true;
}
},
[FETCH_DONE](state) {
fetchCount--;
[FETCH_DONE](state, notLoading) {
if (!notLoading) {
fetchCount--;
}
if (fetchCount === 0) {
state.loading = false;
}
......
import { login, logout, changePwd } from '@/api/user/login';
import { getToken, setToken, removeToken } from '@/utils/auth';
import { SET_TOKEN, UPDATE_USERINFO } from './mutation-types';
import { updateUserinfo, updateUserCellphone } from '@/api/user/update';
import md5 from 'blueimp-md5';
const state = {
......@@ -85,6 +86,37 @@ const actions = {
dispatch('getAsyncRoute', userRoles);
});
},
// 修改资料
updateUserinfo({ commit, dispatch }, { name, newPwd, oldPwd }) {
return updateUserinfo({
data: newPwd
? {
name,
newPwd: md5(newPwd),
oldPwd: md5(oldPwd),
}
: {
name,
},
}).then(res => {
const {
data: { userRoles, userInfo },
} = res;
commit(UPDATE_USERINFO, userInfo);
dispatch('getAsyncRoute', userRoles);
return res;
});
},
// 修改电话
updateUserCellphone({ commit }, entity) {
return updateUserCellphone({
params: entity,
}).then(res => {
console.log(res);
commit(UPDATE_USERINFO, entity);
return res;
});
},
};
const mutations = {
......
......@@ -21,6 +21,7 @@ import GiveTypeSelect from '../components/input/GiveTypeSelect.vue';
import BaseDataSelect from '../components/input/BaseDataSelect/index';
import OperatorSelect from '../components/input/OperatorSelect/index';
import BeansSelect from '../components/input/BeanTypeSelect/index';
import ImageUploader from '../components/input/ImageUploader/index';
const extendVue = Vue => {
Vue.use(rymUi);
......@@ -44,6 +45,7 @@ const extendVue = Vue => {
Vue.component(GiveTypeSelect.name, GiveTypeSelect);
Vue.component(OperatorSelect.name, OperatorSelect);
Vue.component(BeansSelect.name, BeansSelect);
Vue.component(ImageUploader.name, ImageUploader);
};
export default extendVue;
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