Commit 68b037d7 by 姜雷

Merge branch 'test' into 'master'

Test See merge request !120
parents e1d900bc f47261e1
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
:customerId="customerId" :customerId="customerId"
:visible="visible" :visible="visible"
:showMoney="showMoney" :showMoney="showMoney"
:showCellphone="showCellphone"
ref="userContent" ref="userContent"
> >
<button <button
...@@ -65,6 +66,10 @@ export default { ...@@ -65,6 +66,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
showCellphone: {
type: Boolean,
default: false,
},
}, },
mixins: [Popup], mixins: [Popup],
// mounted() { // mounted() {
......
...@@ -77,6 +77,10 @@ export default { ...@@ -77,6 +77,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
showCellphone: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
...@@ -128,6 +132,7 @@ export default { ...@@ -128,6 +132,7 @@ export default {
customerId={this.customerId} customerId={this.customerId}
visible={this.visible} visible={this.visible}
showMoney={this.showMoney} showMoney={this.showMoney}
showCellphone={this.showCellphone}
title={this.title} title={this.title}
fullscreen={this.fullscreen} fullscreen={this.fullscreen}
top={this.top} top={this.top}
...@@ -152,6 +157,7 @@ export default { ...@@ -152,6 +157,7 @@ export default {
customerId={this.customerId} customerId={this.customerId}
visible={this.visible} visible={this.visible}
showMoney={this.showMoney} showMoney={this.showMoney}
showCellphone={this.showCellphone}
title={this.title} title={this.title}
fullscreen={this.fullscreen} fullscreen={this.fullscreen}
top={this.top} top={this.top}
......
...@@ -73,7 +73,8 @@ ...@@ -73,7 +73,8 @@
<span>{{getTypeLabel(customerType)}}</span> <span>{{getTypeLabel(customerType)}}</span>
</div> </div>
<div class="UserInfo-Name-Col"> <div class="UserInfo-Name-Col">
<span>{{$formatePhone(customerPhone)}}</span> <span v-if="showCellphone">{{customerPhone}}</span>
<span v-else>{{$formatePhone(customerPhone)}}</span>
<span>{{getSexLabel(customerSex)}}</span> <span>{{getSexLabel(customerSex)}}</span>
</div> </div>
</div> </div>
...@@ -144,6 +145,10 @@ export default { ...@@ -144,6 +145,10 @@ export default {
showEdit: { type: Function, default: () => {} }, showEdit: { type: Function, default: () => {} },
showAccount: { type: Function, default: () => {} }, showAccount: { type: Function, default: () => {} },
toggleLock: { type: Function, default: () => {} }, toggleLock: { type: Function, default: () => {} },
showCellphone: {
type: Boolean,
default: false,
},
}, },
mixins: [getUserInfoLabelMixin], mixins: [getUserInfoLabelMixin],
data() { data() {
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
<span>{{getTypeLabel(customerBaseInfo.customerType)}}</span> <span>{{getTypeLabel(customerBaseInfo.customerType)}}</span>
</div> </div>
<div class="UserInfo-Name-Col"> <div class="UserInfo-Name-Col">
<span>{{$formatePhone(customerBaseInfo.customerPhone)}}</span> <span v-if="showCellphone">{{customerBaseInfo.customerPhone}}</span>
<span v-else>{{$formatePhone(customerBaseInfo.customerPhone)}}</span>
<span>{{getSexLabel(customerBaseInfo.customerSex)}}</span> <span>{{getSexLabel(customerBaseInfo.customerSex)}}</span>
</div> </div>
</div> </div>
...@@ -84,6 +85,12 @@ import UserBaseInfoMixin from '../../mixins/user/userBaseInfo.js'; ...@@ -84,6 +85,12 @@ import UserBaseInfoMixin from '../../mixins/user/userBaseInfo.js';
import getUserInfoLabelMixin from '@/mixins/user/getUserInfoLabel.js'; import getUserInfoLabelMixin from '@/mixins/user/getUserInfoLabel.js';
export default { export default {
props: {
showCellphone: {
type: Boolean,
default: false,
},
},
mixins: [UserBaseInfoMixin, getUserInfoLabelMixin], mixins: [UserBaseInfoMixin, getUserInfoLabelMixin],
}; };
</script> </script>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
:customerId="customerId" :customerId="customerId"
:customerPhone="customerPhone" :customerPhone="customerPhone"
:showMoney="showMoney" :showMoney="showMoney"
:showCellphone="showCellphone"
:visible="visible" :visible="visible"
ref="UserInfo" ref="UserInfo"
/> />
...@@ -45,6 +46,10 @@ export default { ...@@ -45,6 +46,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
showCellphone: {
type: Boolean,
default: false,
},
}, },
methods: { methods: {
refreshBeanData() { refreshBeanData() {
......
...@@ -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),
......
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
useHtml: true, useHtml: true,
containerTpl: ` containerTpl: `
<div class="g2-legend"> <div class="g2-legend">
<ul class="g2-legend-list" style="list-style-type:none;margin:0;padding:0;"></ul> <ul class="g2-legend-list legend-CampusRank" style="list-style-type:none;margin:0;padding:0;"></ul>
</div>`, </div>`,
itemTpl: (value, color, checked, index) => { itemTpl: (value, color, checked, index) => {
const obj = this.data[index]; const obj = this.data[index];
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
class="g2-legend-list-item item-${index} ${checked}" class="g2-legend-list-item item-${index} ${checked}"
data-value="${value}" data-value="${value}"
data-color=${color} data-color=${color}
data-index=${index}
style="cursor: pointer;font-size:14px;width:100%;" style="cursor: pointer;font-size:14px;width:100%;"
> >
<i <i
...@@ -137,6 +138,7 @@ export default { ...@@ -137,6 +138,7 @@ export default {
this.changeSelected(this.data[0]); this.changeSelected(this.data[0]);
this.updateCampusName(this.data[0]); this.updateCampusName(this.data[0]);
this.SelectedDataIndex = this.data[0]; this.SelectedDataIndex = this.data[0];
this.bindClickLegendHandle();
} else { } else {
this.updateCampusName(); this.updateCampusName();
this.SelectedDataIndex = null; this.SelectedDataIndex = null;
...@@ -144,6 +146,8 @@ export default { ...@@ -144,6 +146,8 @@ export default {
}, },
clickHandle(ev) { clickHandle(ev) {
let data = ev.data._origin; let data = ev.data._origin;
console.log(data);
if (this.SelectedDataIndex.areaId !== data.areaId) { if (this.SelectedDataIndex.areaId !== data.areaId) {
this.SelectedDataIndex = data; this.SelectedDataIndex = data;
this.changeSelected(data); this.changeSelected(data);
...@@ -152,11 +156,55 @@ export default { ...@@ -152,11 +156,55 @@ export default {
} else { } else {
this.showOtherNameHandle(); this.showOtherNameHandle();
} }
} else {
let selected = this.chartGeom._getSelectedShapes();
if (selected && selected.length) {
this.chartGeom.clearActivedShapes();
this.chartGeom.clearSelected();
} else {
this.chartGeom.setSelected(data);
}
}
},
bindClickLegendHandle() {
let ulDom = document.querySelector('.legend-CampusRank');
ulDom.removeEventListener('click', this.clickLegendHandle);
ulDom.addEventListener('click', this.clickLegendHandle);
},
clickLegendHandle(ev) {
let liDom = null;
if (ev.target.tagName === 'LI') {
liDom = ev.target;
} else {
liDom = ev.target.parentElement;
}
const index = Number(liDom.dataset.index);
if (isNaN(index)) {
return;
}
// this.chart.eachShape(function(data, shape, gemo) {
// console.log(gemo);
// });
this.chartGeom.clearActivedShapes();
const data = this.data[index];
if (this.SelectedDataIndex.areaId !== data.areaId) {
this.SelectedDataIndex = data;
this.chartGeom.setSelected(data);
this.changeSelected(data);
if (data.areaId) {
this.changeCampusHandle(data);
} else {
this.showOtherNameHandle();
}
} }
}, },
changeSelected(data) { changeSelected(data) {
this.percentDom = document.querySelector('.CampusRank-percent'); this.percentDom = document.querySelector('.CampusRank-percent');
this.areaNameDom = document.querySelector('.CampusRank-areaName'); // this.areaNameDom = document.querySelector('.CampusRank-areaName');
if (this.percentDom) { if (this.percentDom) {
if (this.total === 0) { if (this.total === 0) {
this.percentDom.innerHTML = '0.00'; this.percentDom.innerHTML = '0.00';
...@@ -166,9 +214,9 @@ export default { ...@@ -166,9 +214,9 @@ export default {
); );
} }
} }
if (this.areaNameDom) { // if (this.areaNameDom) {
this.areaNameDom.innerHTML = data.areaName; // this.areaNameDom.innerHTML = data.areaName;
} // }
}, },
}, },
}; };
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
useHtml: true, useHtml: true,
containerTpl: ` containerTpl: `
<div class="g2-legend"> <div class="g2-legend">
<ul class="g2-legend-list" style="list-style-type:none;margin:0;padding:0;"></ul> <ul class="g2-legend-list legend-SeviceRatio" style="list-style-type:none;margin:0;padding:0;"></ul>
</div>`, </div>`,
itemTpl: (value, color, checked, index) => { itemTpl: (value, color, checked, index) => {
const obj = this.data[index]; const obj = this.data[index];
...@@ -61,6 +61,7 @@ export default { ...@@ -61,6 +61,7 @@ export default {
class="g2-legend-list-item item-${index} ${checked}" class="g2-legend-list-item item-${index} ${checked}"
data-value="${value}" data-value="${value}"
data-color=${color} data-color=${color}
data-index=${index}
style="cursor: pointer;font-size:14px;width:100%;" style="cursor: pointer;font-size:14px;width:100%;"
> >
<i <i
...@@ -122,6 +123,7 @@ export default { ...@@ -122,6 +123,7 @@ export default {
this.chartGeom.setSelected(this.data[0]); this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]); this.changeSelected(this.data[0]);
this.SelectedDataIndex = this.data[0]; this.SelectedDataIndex = this.data[0];
this.bindClickLegendHandle();
} }
}, },
clickHandle(ev) { clickHandle(ev) {
...@@ -130,6 +132,42 @@ export default { ...@@ -130,6 +132,42 @@ export default {
this.SelectedDataIndex = data; this.SelectedDataIndex = data;
this.changeSelected(data); this.changeSelected(data);
this.changeServiceHandle(data); this.changeServiceHandle(data);
} else {
let selected = this.chartGeom._getSelectedShapes();
if (selected && selected.length) {
this.chartGeom.clearActivedShapes();
this.chartGeom.clearSelected();
} else {
this.chartGeom.setSelected(data);
}
}
},
bindClickLegendHandle() {
let ulDom = document.querySelector('.legend-SeviceRatio');
ulDom.removeEventListener('click', this.clickLegendHandle);
ulDom.addEventListener('click', this.clickLegendHandle);
},
clickLegendHandle(ev) {
let liDom = null;
if (ev.target.tagName === 'LI') {
liDom = ev.target;
} else {
liDom = ev.target.parentElement;
}
const index = Number(liDom.dataset.index);
if (isNaN(index)) {
return;
}
this.chartGeom.clearActivedShapes();
const data = this.data[index];
console.log(liDom, data);
if (this.SelectedDataIndex.serviceId !== data.serviceId) {
this.SelectedDataIndex = data;
this.chartGeom.setSelected(data);
this.changeSelected(data);
} }
}, },
changeSelected(data) { changeSelected(data) {
......
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