Commit 6bfec76f by qiao

Merge branch 'develop' of http://git.168cad.top/jianglei/dcxy-manage-shell into develop

parents fb4230d3 fd14ae74
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"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.56", "rym-element-ui": "^0.1.61",
"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"
......
...@@ -220,6 +220,12 @@ export default { ...@@ -220,6 +220,12 @@ export default {
display: none; display: none;
} }
} }
.record-List {
.record-Item {
display: inline-block;
min-width: 100px;
}
}
@media screen and (max-width: $bigScreenWidth) { @media screen and (max-width: $bigScreenWidth) {
.topTitle { .topTitle {
.complate-logo { .complate-logo {
......
...@@ -35,6 +35,13 @@ export const fetchServiceList = req => ...@@ -35,6 +35,13 @@ export const fetchServiceList = req =>
method: 'get', method: 'get',
...req, ...req,
}); });
// 根据区域获取服务
export const fetchAreaService = req =>
fetch({
url: path + '/dcxy/api/base/service/together/relation',
method: 'get',
...req,
});
// 获取运营商 // 获取运营商
export const fetchOperatorList = req => export const fetchOperatorList = req =>
fetch({ fetch({
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
filterable filterable
:value="value" :value="value"
@change="changeHandle" @change="changeHandle"
@visible-change="resetFilterText"
:multiple="multiple" :multiple="multiple"
ref="select" ref="select"
> >
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
<el-input <el-input
v-if="multiple" v-if="multiple"
class="out-input" class="out-input"
:value="filterText"
clearable clearable
@click.stop @click.stop
@input="debouncedQueryChange" @input="debouncedQueryChange"
...@@ -111,6 +113,9 @@ export default { ...@@ -111,6 +113,9 @@ export default {
handleQueryChange(val) { handleQueryChange(val) {
this.filterText = val; this.filterText = val;
}, },
resetFilterText(visible) {
if (!visible) this.filterText = '';
},
}, },
}; };
</script> </script>
......
...@@ -31,11 +31,6 @@ export default { ...@@ -31,11 +31,6 @@ export default {
}, },
}, },
mixins: [areaMixin], mixins: [areaMixin],
computed: {
areaList() {
return this[`areaList${this.accessType}`];
},
},
methods: { methods: {
changeHandle(val) { changeHandle(val) {
if (val) { if (val) {
......
...@@ -28,6 +28,9 @@ export default { ...@@ -28,6 +28,9 @@ export default {
}, },
computed: { computed: {
...mapGetters('area', getterList), ...mapGetters('area', getterList),
areaList() {
return this[`areaList${this.accessType}`];
},
}, },
methods: { methods: {
...mapActions('area', actionsList), ...mapActions('area', actionsList),
......
<template>
<el-select
:clearable="clearable"
:disabled="disabled"
filterable
:value="value"
@change="changeHandle"
>
<el-option
v-for="(item, index) in areaServiceList"
:disabled="disabledValue(item.serviceId)"
:key="index"
:value="item.serviceId"
:label="item.serviceName"
></el-option>
</el-select>
</template>
<script>
import areaServiceMixin from './mixin.js';
export default {
name: 'area-service-select',
props: {
value: {
type: Number,
default: null,
},
disabled: Boolean,
clearable: {
type: Boolean,
default: true,
},
filterList: {
type: Array,
},
},
mixins: [areaServiceMixin],
methods: {
changeHandle(val) {
if (val || val === 0) {
this.$emit('input', val);
} else {
this.$emit('input', null);
}
},
disabledValue(val) {
if (this.filterList && this.filterList.length) {
return this.filterList.indexOf(val) > -1;
}
return false;
},
},
};
</script>
import { fetchAreaService } from '@/api/base/index';
const AREA_SERVICE_LIST = 'AREA_SERVICE_LIST';
const FETCH_STATE = 'FETCH_STATE';
const UPDATE_FILTER_ID = 'UPDATE_FILTER_ID';
const state = () => ({
list: [],
filterId: undefined,
fetching: false,
});
const getters = {
areaServiceList: state =>
state.list.filter(item =>
state.filterId
? item.areaId === state.filterId &&
item.serviceId !== 0 &&
item.serviceId !== 1
: true
),
};
const actions = {
fetchAreaServiceList({ state, commit }, entity) {
if (state.fetching) return;
commit(FETCH_STATE, true);
return fetchAreaService({
params: entity,
})
.then(res => {
const { data } = res;
commit(AREA_SERVICE_LIST, data);
commit(FETCH_STATE, false);
})
.catch(err => {
commit(FETCH_STATE, false);
});
},
updateFilterId({ commit }, id) {
commit(UPDATE_FILTER_ID, id);
},
};
const mutations = {
[AREA_SERVICE_LIST](state, list) {
state.list = list;
},
[FETCH_STATE](state, value) {
state.fetching = value;
},
[UPDATE_FILTER_ID](state, id) {
state.filterId = id;
},
};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
};
import AreaServiceSelect from './AreaServiceSelect.vue';
import areaServiceMixin from './mixin';
export { areaServiceMixin };
export default AreaServiceSelect;
import { mapGetters, mapActions } from 'vuex';
import store from './store';
export default {
props: {
// 所属区域
areaId: {
type: Number,
default: null,
},
},
created() {
store.install(this.$store);
if (!this.areaServiceList.length) {
this.fetchAreaServiceList({
areaId: this.areaId,
});
}
if (this.areaId) {
this.updateFilterId(this.areaId);
}
},
computed: {
...mapGetters('areaServiceOption', ['areaServiceList']),
},
watch: {
areaId(val) {
this.updateFilterId(val);
},
},
methods: {
...mapActions('areaServiceOption', [
'fetchAreaServiceList',
'updateFilterId',
]),
getServiceName(id) {
let item = this.areaServiceList.find(service => service.serviceId === id);
return item ? item.serviceName : '';
},
getServiceInfo() {
let item = this.areaServiceList.find(service => service.serviceId === id);
return item
? { serviceId: item.serviceId, serviceName: item.serviceName }
: null;
},
getOperatorInfo(id) {
let item = this.areaServiceList.find(service => service.serviceId === id);
return item
? { operateId: item.operateId, operateName: item.operateName }
: null;
},
getAreaInfo() {
let item = this.areaServiceList.find(service => service.serviceId === id);
return item ? { areaId: item.areaId, areaName: item.areaName } : null;
},
getAllItemInfo(id) {
let item = this.areaServiceList.find(service => service.serviceId === id);
return item ? item : null;
},
},
};
import areaServiceStore from './areaServiceStore';
export default {
install(store) {
if (!store.state.base) {
store.registerModule(['base'], {
state: {},
});
}
if (!store.state.base.areaServiceOption) {
store.registerModule(['base', 'areaServiceOption'], areaServiceStore);
}
},
uninstall(store) {
store.unregisterModule(['base', 'areaServiceOption']);
},
};
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<dashboard-area-select <dashboard-area-select
:operateId="filters.operateId" :operateId="filters.operateId"
:value="filters.areaId" :value="filters.areaId"
multiple
@input="val => updateFilters({areaId: val})" @input="val => updateFilters({areaId: val})"
/> />
</search-item> </search-item>
...@@ -114,6 +115,21 @@ export default { ...@@ -114,6 +115,21 @@ export default {
flex: 1; flex: 1;
} }
} }
.el-select {
.el-select__tags {
height: 90%;
overflow: hidden;
input {
display: none;
}
}
.el-input {
overflow: hidden;
}
.el-input__inner {
height: 100% !important;
}
}
} }
</style> </style>
...@@ -4,7 +4,7 @@ import initFiltersStore from '@/store/modules/filters'; ...@@ -4,7 +4,7 @@ import initFiltersStore from '@/store/modules/filters';
const initFilters = () => ({ const initFilters = () => ({
operateId: undefined, operateId: undefined,
areaId: undefined, areaId: [],
timeType: 0, // 0 本日,1 本月, 2 本年 timeType: 0, // 0 本日,1 本月, 2 本年
}); });
const filtersStore = initFiltersStore(initFilters); const filtersStore = initFiltersStore(initFilters);
......
<template> <template>
<div <div class="Dashboard-Row Dashboard-DataCard Dashboard-Register">
class="Dashboard-Row Dashboard-DataCard"
v-loading="loading.regist"
>
<div class="Dashboard-SearchBar"> <div class="Dashboard-SearchBar">
<search-item label="年份"> <search-item label="年份">
<el-date-picker <el-date-picker
v-model.trim="campusFilters.year" :value="filters.reportYear"
@change="changeReportYearHandle" @input="val => updateFilters({reportYear: val})"
type="year" type="year"
value-format="yyyy" value-format="yyyy"
placeholder="请选择" placeholder="请选择"
...@@ -16,28 +13,55 @@ ...@@ -16,28 +13,55 @@
</search-item> </search-item>
<search-item label="校区"> <search-item label="校区">
<area-select <area-select
v-model.trim="campusFilters.areaId" :value="filters.reportAreaId"
@input="changeReportAreaHandle" @input="val => updateFilters({reportAreaId: val})"
:accessType="isAdmin?0:1" :accessType="isAdmin?0:1"
/> />
</search-item> </search-item>
<search-item label="">
<el-button
:loading="loading.regist"
@click="searchList"
type="primary"
>搜索</el-button>
</search-item>
</div>
<div class="more-info">
{{ reportYear }}年注册人数为:{{ registeYearTotal }}人;平台注册会员总数: {{ registeTotal }}人;平台活跃会员总数:{{ activeTotal }}
</div> </div>
<div class="Dashboard-CampusData"> <div class="Dashboard-CampusData">
<div class="Dashboard-CampusItem"> <div
<div class="Dashboard-title">{{ reportYear }}年每月注册数据</div> class="Dashboard-CampusItem"
v-loading="loading.regist"
>
<div class="Dashboard-title">
{{ reportYear }}年每月注册数据
</div>
<RegisterByMonth <RegisterByMonth
:data="registePerMonth" :data="registePerMonth"
:changeReportMonthHandle="changeReportMonthHandle" :changeReportMonthHandle="changeReportMonthHandle"
/> />
</div> </div>
<div class="Dashboard-CampusItem"> </div>
<div class="Dashboard-CampusData">
<div
class="Dashboard-CampusItem"
v-loading="loading.regist || loading.registByDay"
>
<div class="Dashboard-title"> <div class="Dashboard-title">
{{ reportYear }}{{ reportMonth }}月注册数据 {{ reportYear }}{{ reportMonth }}月注册数据
</div> </div>
<RegisterByDay :data="registePerDay" /> <RegisterByDay :data="registePerDay" />
</div> </div>
<div class="Dashboard-CampusItem"> </div>
<div class="Dashboard-title">{{ reportYear }}年每月活跃数据</div> <div class="Dashboard-CampusData">
<div
class="Dashboard-CampusItem"
v-loading="loading.regist"
>
<div class="Dashboard-title">
{{ reportYear }}年每月活跃数据
</div>
<ActiveUserByMonth :data="activeUser" /> <ActiveUserByMonth :data="activeUser" />
</div> </div>
</div> </div>
...@@ -49,6 +73,7 @@ import { mapGetters, mapActions } from 'vuex'; ...@@ -49,6 +73,7 @@ import { mapGetters, mapActions } from 'vuex';
import RegisterByMonth from './components/RegisterByMonth'; import RegisterByMonth from './components/RegisterByMonth';
import RegisterByDay from './components/RegisterByDay'; import RegisterByDay from './components/RegisterByDay';
import ActiveUserByMonth from './components/ActiveUserByMonth'; import ActiveUserByMonth from './components/ActiveUserByMonth';
import { getFilters } from '@/utils/index';
export default { export default {
name: 'CustomerRegister', name: 'CustomerRegister',
...@@ -61,11 +86,9 @@ export default { ...@@ -61,11 +86,9 @@ export default {
isAdmin: Boolean, isAdmin: Boolean,
}, },
data() { data() {
let today = this.$formatDate(new Date(), 'yyyy-MM-dd');
return { return {
campusFilters: { today: today,
year: '',
areaId: undefined,
},
}; };
}, },
computed: { computed: {
...@@ -76,10 +99,26 @@ export default { ...@@ -76,10 +99,26 @@ export default {
'registePerMonth', 'registePerMonth',
'activeUser', 'activeUser',
'loading', 'loading',
'reportMounted',
'filters',
'registeTotal',
'activeTotal',
]), ]),
registeYearTotal() {
return this.registePerMonth.reduce((pre, curItem) => {
return pre + curItem.count;
}, 0);
},
},
mounted() {
if (!this.reportMounted) {
this.fetchReportList({
isAdmin: this.isAdmin ? 1 : 0,
});
}
}, },
methods: { methods: {
...mapActions('Dashboard', ['fetchReportList']), ...mapActions('Dashboard', ['fetchReportList', 'updateFilters']),
changeReportYearHandle(val) { changeReportYearHandle(val) {
if (val) { if (val) {
let areaId = this.campusFilters.areaId; let areaId = this.campusFilters.areaId;
...@@ -102,13 +141,15 @@ export default { ...@@ -102,13 +141,15 @@ export default {
}, },
changeReportMonthHandle(month) { changeReportMonthHandle(month) {
console.log(month); console.log(month);
let year = this.campusFilters.year;
let areaId = this.campusFilters.areaId;
this.fetchReportList({ this.fetchReportList({
isAdmin: this.isAdmin ? 1 : 0, isAdmin: this.isAdmin ? 1 : 0,
year: year ? year : null,
areaId: areaId ? areaId : null,
month: month, month: month,
updateRegisteByDay: true,
});
},
searchList() {
this.fetchReportList({
isAdmin: this.isAdmin ? 1 : 0,
}); });
}, },
}, },
...@@ -116,7 +157,27 @@ export default { ...@@ -116,7 +157,27 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/assets/styles/variables.scss';
.Dashboard { .Dashboard {
.Dashboard-Row.Dashboard-Register {
height: auto;
.Dashboard-SearchBar {
.filter-item-label {
min-width: auto;
width: auto;
}
}
}
.Dashboard-title {
font-size: 20px;
color: #333;
font-weight: 700;
}
@media screen and (max-width: $bigScreenWidth) {
.Dashboard-title {
font-size: 14px;
}
}
.Dashboard-DataCard { .Dashboard-DataCard {
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
...@@ -125,9 +186,17 @@ export default { ...@@ -125,9 +186,17 @@ export default {
margin-right: 0; margin-right: 0;
} }
} }
.more-info {
margin: 15px;
font-weight: normal;
color: #f70707;
}
.Dashboard-SearchBar { .Dashboard-SearchBar {
display: flex; display: flex;
padding: 10px 0 20px; padding: 10px 0 20px;
.filter-item {
margin: 0 0 0 34px;
}
.filter-item-input { .filter-item-input {
width: 200px; width: 200px;
.el-input { .el-input {
...@@ -138,6 +207,7 @@ export default { ...@@ -138,6 +207,7 @@ export default {
.Dashboard-CampusData { .Dashboard-CampusData {
display: flex; display: flex;
padding: 0 15px; padding: 0 15px;
margin-bottom: 16px;
.Dashboard-title { .Dashboard-title {
position: relative; position: relative;
} }
......
...@@ -15,7 +15,8 @@ export default { ...@@ -15,7 +15,8 @@ export default {
serviceList: [ serviceList: [
{ value: 'monthAppActive', name: 'APP活跃用户' }, { value: 'monthAppActive', name: 'APP活跃用户' },
{ value: 'monthHardActive', name: '硬件活跃用户' }, { value: 'monthHardActive', name: '硬件活跃用户' },
{ value: 'allActive', name: '两者兼具' }, { value: 'allActive', name: '全部活跃' },
{ value: 'total', name: '全部活跃' },
], ],
}; };
}, },
...@@ -25,14 +26,12 @@ export default { ...@@ -25,14 +26,12 @@ export default {
container: 'ActiveUserByMonth', container: 'ActiveUserByMonth',
forceFit: true, forceFit: true,
height: this.height, height: this.height,
padding: [50, 40], padding: [30, 20, 30, 50],
}); });
this.chart this.chart
.source(this.data, { .source(this.data, {
month: { month: {
min: 1, type: 'cat',
max: 12,
tickCount: 12,
}, },
mark: { mark: {
type: 'cat', type: 'cat',
...@@ -51,17 +50,17 @@ export default { ...@@ -51,17 +50,17 @@ export default {
position: 'top', position: 'top',
title: null, title: null,
marker: 'square', marker: 'square',
clickable: false,
}) })
.axis('count', false) .interval()
.axis('mark', {
formatter: value => {
let service = this.serviceList.find(item => item.value === value);
return service ? `${service.name}` : '';
},
})
.intervalStack()
.position('month*count') .position('month*count')
.color('mark', ['#4e82fb', '#ffc934', '#26c9a8']); .color('mark', ['#4e82fb', '#ffc934', '#26c9a8'])
.adjust([
{
type: 'dodge',
marginRatio: 1 / 32,
},
]);
this.chart.render(); this.chart.render();
}, },
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
container: 'RegisterByDay', container: 'RegisterByDay',
forceFit: true, forceFit: true,
height: this.height, height: this.height,
padding: [40, 20, 30, 45], padding: [40, 20, 30, 50],
}); });
this.chart this.chart
.source(this.data, { .source(this.data, {
...@@ -32,6 +32,12 @@ export default { ...@@ -32,6 +32,12 @@ export default {
}, },
count: { count: {
alias: '人数', alias: '人数',
formatter: val => {
if (/\./.test(val)) {
return '';
}
return val;
},
}, },
}) })
.tooltip({ .tooltip({
...@@ -39,7 +45,7 @@ export default { ...@@ -39,7 +45,7 @@ export default {
}) })
.line() .line()
.position('days*count'); .position('days*count');
this.chart.area().position('days*count'); this.chart.line().position('days*count');
this.chart.render(); this.chart.render();
}, },
}, },
......
...@@ -24,20 +24,20 @@ export default { ...@@ -24,20 +24,20 @@ export default {
container: 'RegisterByMonth', container: 'RegisterByMonth',
forceFit: true, forceFit: true,
height: this.height, height: this.height,
padding: [0, 20, 30, 20], padding: [30, 20, 30, 50],
}); });
this.chart this.chart
.source(this.data, { .source(this.data, {
month: {
min: 1,
max: 12,
tickCount: 12,
},
count: { count: {
alias: '人数', alias: '人数',
formatter: val => {
if (/\./.test(val)) {
return '';
}
return val;
},
}, },
}) })
.axis('count', false)
.axis('month', { .axis('month', {
label: { label: {
textStyle: { textStyle: {
...@@ -50,13 +50,20 @@ export default { ...@@ -50,13 +50,20 @@ export default {
}) })
.interval() .interval()
.position('month*count') .position('month*count')
.color('#4e82fb'); .color('#4e82fb')
.label('count', {
// position: 'middle',
offset: 10,
});
this.chart.render(); this.chart.render();
this.chart.on('interval:click', this.clickHandle); this.chart.on('plotclick', this.clickHandle);
}, },
clickHandle(ev) { clickHandle(ev) {
let data = ev.data._origin; let records = this.chart.getSnapRecords({ x: ev.x, y: ev.y });
this.changeReportMonthHandle(data.month); if (records && records.length) {
let data = records[0]._origin;
this.changeReportMonthHandle(data.month);
}
}, },
}, },
}; };
......
...@@ -21,11 +21,14 @@ const LOADING_AREA = 'LOADING_AREA'; ...@@ -21,11 +21,14 @@ const LOADING_AREA = 'LOADING_AREA';
const LOADING_SERVICE = 'LOADING_SERVICE'; const LOADING_SERVICE = 'LOADING_SERVICE';
const LOADING_EQUIPMENT = 'LOADING_EQUIPMENT'; const LOADING_EQUIPMENT = 'LOADING_EQUIPMENT';
const LOADING_REGIST = 'LOADING_REGIST'; const LOADING_REGIST = 'LOADING_REGIST';
const LOADING_REGIST_BY_DAY = 'LOADING_REGIST_BY_DAY';
const initFilters = () => ({ const initFilters = () => ({
operateId: undefined, operateId: undefined,
choiceareaIds: [], choiceareaIds: [],
timeType: 0, // 0 本日,1 本月, 2 本年 timeType: 0, // 0 本日,1 本月, 2 本年
reportYear: new Date().getFullYear().toString(),
reportAreaId: undefined,
}); });
const filtersStore = initFiltersStore(initFilters); const filtersStore = initFiltersStore(initFilters);
const nowTime = new Date(); const nowTime = new Date();
...@@ -36,6 +39,7 @@ const state = () => ({ ...@@ -36,6 +39,7 @@ const state = () => ({
service: false, service: false,
equipment: false, equipment: false,
regist: false, regist: false,
registByDay: false,
}, },
consume: { consume: {
areaInfo: { areaInfo: {
...@@ -51,11 +55,14 @@ const state = () => ({ ...@@ -51,11 +55,14 @@ const state = () => ({
percentList: [], percentList: [],
}, },
report: { report: {
mounted: false,
year: new Date().getFullYear(), year: new Date().getFullYear(),
month: new Date().getMonth() + 1, month: new Date().getMonth() + 1,
registePerDay: [], registePerDay: [],
registePerMonth: [], registePerMonth: [],
activeUser: [], activeUser: [],
customerCount: 0,
activeCount: 0,
}, },
title: { title: {
activeCount: 0, activeCount: 0,
...@@ -65,10 +72,13 @@ const state = () => ({ ...@@ -65,10 +72,13 @@ const state = () => ({
}); });
const getters = { const getters = {
reportMounted: state => state.report.mounted,
reportYear: state => state.report.year, reportYear: state => state.report.year,
reportMonth: state => state.report.month, reportMonth: state => state.report.month,
registePerDay: state => state.report.registePerDay, registePerDay: state => state.report.registePerDay,
registePerMonth: state => state.report.registePerMonth, registePerMonth: state => state.report.registePerMonth,
registeTotal: state => state.report.customerCount,
activeTotal: state => state.report.activeCount,
activeUser: state => state.report.activeUser, activeUser: state => state.report.activeUser,
titleData: state => state.title, titleData: state => state.title,
areaInfo: state => state.consume.areaInfo, areaInfo: state => state.consume.areaInfo,
...@@ -150,8 +160,19 @@ const actions = { ...@@ -150,8 +160,19 @@ const actions = {
commit(LOADING_AREA, false); commit(LOADING_AREA, false);
}); });
}, },
fetchReportList({ commit }, entity) { fetchReportList({ commit, getters }, entity) {
commit(LOADING_REGIST, true); let filters = getFilters(getters.filters);
if (filters.reportYear) {
entity.year = filters.reportYear;
}
if (filters.reportAreaId) {
entity.areaId = filters.reportAreaId;
}
if (entity && entity.updateRegisteByDay) {
commit(LOADING_REGIST_BY_DAY, true);
} else {
commit(LOADING_REGIST, true);
}
return fetchReportList({ return fetchReportList({
params: { params: {
...entity, ...entity,
...@@ -160,11 +181,19 @@ const actions = { ...@@ -160,11 +181,19 @@ const actions = {
.then(res => { .then(res => {
let list = res.data; let list = res.data;
commit(GET_REPORT_DATA, list); commit(GET_REPORT_DATA, list);
commit(LOADING_REGIST, false); if (entity && entity.updateRegisteByDay) {
commit(LOADING_REGIST_BY_DAY, false);
} else {
commit(LOADING_REGIST, false);
}
}) })
.catch(err => { .catch(err => {
console.error(err); console.error(err);
commit(LOADING_REGIST, false); if (entity && entity.updateRegisteByDay) {
commit(LOADING_REGIST_BY_DAY, false);
} else {
commit(LOADING_REGIST, false);
}
}); });
}, },
fetchTitleList({ commit }) { fetchTitleList({ commit }) {
...@@ -208,8 +237,12 @@ const mutations = { ...@@ -208,8 +237,12 @@ const mutations = {
: []; : [];
}, },
[GET_REPORT_DATA]: (state, data) => { [GET_REPORT_DATA]: (state, data) => {
state.report.customerCount = data.customerCount ? data.customerCount : 0;
state.report.activeCount = data.activeCount ? data.activeCount : 0;
state.report.year = data.year; state.report.year = data.year;
state.report.month = data.month; state.report.month = data.month;
let dayList = new Array(31).fill({ count: 0 }); let dayList = new Array(31).fill({ count: 0 });
dayList = dayList.map((v, idx) => ({ ...v, days: idx + 1 })); dayList = dayList.map((v, idx) => ({ ...v, days: idx + 1 }));
data.dayVos.map(val => { data.dayVos.map(val => {
...@@ -217,8 +250,40 @@ const mutations = { ...@@ -217,8 +250,40 @@ const mutations = {
dayList[idx].count = val.count; dayList[idx].count = val.count;
}); });
state.report.registePerDay = dayList; state.report.registePerDay = dayList;
state.report.registePerMonth = data.list;
state.report.activeUser = data.listCount; let registerList = new Array(12)
.fill({ count: 0, mark: null })
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
data.list.map(val => {
let idx = val.month - 1;
registerList[idx].count += val.count;
});
state.report.registePerMonth = registerList;
let activeList = new Array(12)
.fill({ count: 0, mark: 'allActive' })
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
let activeAppList = new Array(12)
.fill({ count: 0, mark: 'monthAppActive' })
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
let activeDeviceList = new Array(12)
.fill({ count: 0, mark: 'monthHardActive' })
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
data.listCount.map(val => {
let idx = val.month - 1;
if (val.mark === 'allActive') {
activeList[idx].count += val.count;
}
if (val.mark === 'monthAppActive') {
activeAppList[idx].count += val.count;
}
if (val.mark === 'monthHardActive') {
activeDeviceList[idx].count += val.count;
}
});
activeList.push.apply(activeList, activeAppList);
activeList.push.apply(activeList, activeDeviceList);
state.report.activeUser = activeList;
}, },
[GET_TITLE_DATA](state, data) { [GET_TITLE_DATA](state, data) {
state.title = data; state.title = data;
...@@ -244,8 +309,14 @@ const mutations = { ...@@ -244,8 +309,14 @@ const mutations = {
state.loading.equipment = fetching; state.loading.equipment = fetching;
}, },
[LOADING_REGIST](state, fetching) { [LOADING_REGIST](state, fetching) {
if (fetching) {
state.report.mounted = true;
}
state.loading.regist = fetching; state.loading.regist = fetching;
}, },
[LOADING_REGIST_BY_DAY](state, fetching) {
state.loading.registByDay = fetching;
},
}; };
export default { export default {
......
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
'g2-legend': { 'g2-legend': {
width: '215px', width: '215px',
'max-width': '215px', 'max-width': '215px',
'max-height': this.height - 30 + 'px',
// left: '-20px', // left: '-20px',
}, },
'g2-legend-list-item': { 'g2-legend-list-item': {
...@@ -168,6 +169,7 @@ export default { ...@@ -168,6 +169,7 @@ export default {
this.SelectedDataIndex = data; this.SelectedDataIndex = data;
this.chartGeom.setSelected(data); this.chartGeom.setSelected(data);
this.changeSelected(data); this.changeSelected(data);
this.changeServiceHandle(data);
} }
}, },
changeSelected(data) { changeSelected(data) {
......
...@@ -5,17 +5,32 @@ ...@@ -5,17 +5,32 @@
<operator-select <operator-select
:accessType="1" :accessType="1"
:value="filters.operateId" :value="filters.operateId"
@input="val => updateFilters({operateId: val,areaId:[]})" @input="val => updateFilters({operateId: val,areaIdArr:[]})"
/> />
</search-item> </search-item>
<search-item label="区域"> <!-- <search-item label="区域">
<dashboard-area-select <dashboard-area-select
:operateId="filters.operateId" :operateId="filters.operateId"
:value="filters.areaId" :value="filters.areaIdArr"
multiple multiple
@input="val => updateFilters({areaIdArr: val})"
/>
</search-item> -->
<search-item label="区域">
<area-select
:value="filters.areaId"
@input="val => updateFilters({areaId: val})" @input="val => updateFilters({areaId: val})"
/> />
</search-item> </search-item>
<search-item label="服务">
<area-service-select
:areaId="filters.areaId"
:filterList="[3]"
:value="filters.service"
@input="val => updateFilters({service: val})"
/>
</search-item>
</template> </template>
</list-layout> </list-layout>
</template> </template>
...@@ -26,7 +41,9 @@ export default { ...@@ -26,7 +41,9 @@ export default {
return { return {
filters: { filters: {
operateId: undefined, operateId: undefined,
areaId: [], areaIdArr: [],
areaId: undefined,
service: undefined,
}, },
}; };
}, },
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<div class="Dashboard Home-Dashboard"> <div class="Dashboard Home-Dashboard">
<CustomerRegister <CustomerRegister
v-if="show" v-if="show"
class="Dashboard-Row Dashboard-DataCard"
:isAdmin="isAdmin" :isAdmin="isAdmin"
/> />
</div> </div>
...@@ -35,21 +34,16 @@ export default { ...@@ -35,21 +34,16 @@ export default {
item => item.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE item => item.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
); );
if (item) { if (item) {
this.fetchReportList({
isAdmin: this.isAdmin ? 1 : 0,
});
this.show = true; this.show = true;
} }
}, },
methods: {
...mapActions('Dashboard', ['fetchReportList']),
},
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.Home-Dashboard.Dashboard { .Home-Dashboard.Dashboard {
padding: 22px 34px 0; padding: 22px 34px;
overflow-y: hidden; height: 100%;
overflow-y: scroll;
} }
</style> </style>
...@@ -115,6 +115,11 @@ export default { ...@@ -115,6 +115,11 @@ export default {
this.style = 'left: 0;'; this.style = 'left: 0;';
} }
}, },
watch: {
$route() {
this.toggleSubmenus(false);
},
},
methods: { methods: {
toggleSubmenus(visiable) { toggleSubmenus(visiable) {
this.showSubMenus = visiable; this.showSubMenus = visiable;
......
...@@ -12,6 +12,7 @@ import BaseData from '../components/input/BaseDataSelect/mixin'; ...@@ -12,6 +12,7 @@ import BaseData from '../components/input/BaseDataSelect/mixin';
import BeanType from '../components/input/BeanTypeSelect/mixin'; import BeanType from '../components/input/BeanTypeSelect/mixin';
import OperatorOptions from '../components/input/OperatorSelect/mixin'; import OperatorOptions from '../components/input/OperatorSelect/mixin';
import ServiceType from '../components/input/ServiceTypeSelect/mixin'; import ServiceType from '../components/input/ServiceTypeSelect/mixin';
import AreaService from '../components/input/AreaServiceSelect/mixin';
import SearchBar from '../mixins/searchBar'; import SearchBar from '../mixins/searchBar';
export default { export default {
...@@ -33,5 +34,6 @@ export default { ...@@ -33,5 +34,6 @@ export default {
BeanType, BeanType,
OperatorOptions, OperatorOptions,
ServiceType, ServiceType,
AreaService,
}, },
}; };
...@@ -63,8 +63,10 @@ const configRoutePermission = ( ...@@ -63,8 +63,10 @@ const configRoutePermission = (
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
next(); next();
} else { } else {
next('/login'); store.dispatch('FedLogOut').then(() => {
NProgress.done(); next({ path: '/login' });
NProgress.done();
});
} }
} }
}); });
......
...@@ -23,6 +23,7 @@ import BaseDataSelect from '../components/input/BaseDataSelect/index'; ...@@ -23,6 +23,7 @@ import BaseDataSelect from '../components/input/BaseDataSelect/index';
import OperatorSelect from '../components/input/OperatorSelect/index'; import OperatorSelect from '../components/input/OperatorSelect/index';
import BeansSelect from '../components/input/BeanTypeSelect/index'; import BeansSelect from '../components/input/BeanTypeSelect/index';
import ImageUploader from '../components/input/ImageUploader/index'; import ImageUploader from '../components/input/ImageUploader/index';
import AreaServiceSelect from '../components/input/AreaServiceSelect/index';
const extendVue = Vue => { const extendVue = Vue => {
Vue.use(rymUi); Vue.use(rymUi);
...@@ -48,6 +49,7 @@ const extendVue = Vue => { ...@@ -48,6 +49,7 @@ const extendVue = Vue => {
Vue.component(OperatorSelect.name, OperatorSelect); Vue.component(OperatorSelect.name, OperatorSelect);
Vue.component(BeansSelect.name, BeansSelect); Vue.component(BeansSelect.name, BeansSelect);
Vue.component(ImageUploader.name, ImageUploader); Vue.component(ImageUploader.name, ImageUploader);
Vue.component(AreaServiceSelect.name, AreaServiceSelect);
}; };
export default extendVue; 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