Commit 35235ddb authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 496c554d 0be64733
......@@ -7,31 +7,31 @@
<div class="header">
<div class="hc-itme">
<div class="i-title">企业总量(家)</div>
<div class="i-num">{{enterpriseNums}}</div>
<div class="i-num">{{ enterpriseNums }}</div>
</div>
<div class="hc-itme">
<div class="i-title">产品数量(个)</div>
<div class="i-num">{{productNums}}</div>
<div class="i-num">{{ productNums }}</div>
</div>
<div class="hc-itme">
<div class="i-title">员工数量(人)</div>
<div class="i-num">{{staffNums}}</div>
<div class="i-num">{{ staffNums }}</div>
</div>
<div class="hc-itme">
<div class="i-title">新闻数量(篇)</div>
<div class="i-num">{{newsNums}}</div>
<div class="i-num">{{ newsNums }}</div>
</div>
<div class="hc-itme">
<div class="i-title">反馈数量(次)</div>
<div class="i-num">{{feedbackNums}}</div>
<div class="i-num">{{ feedbackNums }}</div>
</div>
<div class="hc-itme">
<div class="i-title">用户数量(次)</div>
<div class="i-num">{{customerNums}}</div>
<div class="i-num">{{ customerNums }}</div>
</div>
</div>
</div>
......@@ -40,19 +40,34 @@
<div class="card pie">
<div class="cardtitle">产品分布</div>
<div class="piecard">
<Pie class="echarts" :info="cpfbDayValue" ref="ageChild" style="width:100%;height:100%" />
<Pie
class="echarts"
:info="cpfbDayValue"
ref="ageChild"
style="width: 100%; height: 100%"
/>
</div>
</div>
<div class="card pie">
<div class="cardtitle">名片分布</div>
<div class="piecard">
<Pie class="echarts" :info="mpfbDayValue" ref="ageChild" style="width:100%;height:100%" />
<Pie
class="echarts"
:info="mpfbDayValue"
ref="ageChild"
style="width: 100%; height: 100%"
/>
</div>
</div>
<div class="card pie">
<div class="cardtitle">新闻分布</div>
<div class="piecard">
<Pie class="echarts" :info="xwfbDayValue" ref="ageChild" style="width:100%;height:100%" />
<Pie
class="echarts"
:info="xwfbDayValue"
ref="ageChild"
style="width: 100%; height: 100%"
/>
</div>
</div>
</div>
......@@ -67,7 +82,7 @@
<div class="card linebar">
<div class="cardtitle">员工累计发送名片次数</div>
<div class="linebarcar">
<CBar class="echarts" :info="barDayValue" />
<CBar class="echarts" :info="barDayValue" :type="'staff'" />
</div>
</div>
</div>
......@@ -82,12 +97,12 @@ export default {
computed: {
userData() {
return this.$store.state.userData.currUserName;
}
},
},
components: {
Pie,
CLine,
CBar
CBar,
},
data() {
return {
......@@ -102,7 +117,7 @@ export default {
staffNums: "--",
newsNums: "--",
feedbackNums: "--",
customerNums: "--"
customerNums: "--",
};
},
created() {
......@@ -110,7 +125,7 @@ export default {
},
methods: {
getData() {
this.$post("/company/stat").then(res => {
this.$post("/company/stat").then((res) => {
const { data, code } = res;
if (code == 1) {
this.enterpriseNums = data.enterpriseNums;
......@@ -121,52 +136,51 @@ export default {
this.customerNums = data.customerNums;
this.lineDayValue = data.accessStatList ? data.accessStatList : [];
this.barDayValue = data.businessCardDistributionList
? data.businessCardDistributionList
this.barDayValue = data.sendCardStaffList
? data.sendCardStaffList
: [];
if (data.newsDistributionList.length > 0) {
let arr = [];
data.newsDistributionList.forEach(item => {
data.newsDistributionList.forEach((item) => {
arr.push({
name: item.name,
value: item.newsNums
value: item.newsNums,
});
});
this.xwfbDayValue = arr
this.xwfbDayValue = arr;
} else {
this.xwfbDayValue = [];
}
if (data.productDistributionList.length > 0) {
let arr = [];
data.productDistributionList.forEach(item => {
data.productDistributionList.forEach((item) => {
arr.push({
name: item.companyName,
value: item.productNums
value: item.productNums,
});
});
this.cpfbDayValue = arr
this.cpfbDayValue = arr;
} else {
this.cpfbDayValue = [];
}
if (data.businessCardDistributionList.length > 0) {
let arr = [];
data.businessCardDistributionList.forEach(item => {
data.businessCardDistributionList.forEach((item) => {
arr.push({
name: item.companyName,
value: item.businessCardNums
value: item.businessCardNums,
});
});
this.mpfbDayValue = arr
this.mpfbDayValue = arr;
} else {
this.mpfbDayValue = [];
}
}
});
}
}
},
},
};
</script>
<style scoped lang="less">
......
......@@ -2,6 +2,8 @@
<div style="width: 100%; height: 100%"></div>
</template>
<script>
import { type } from "../../assets/utils";
// import { deepClone } from "@/utils/js/common.js";
// import lodash from "lodash";
// import { getStatisticAges } from "@/api/dataAdmin.js";
......@@ -19,10 +21,14 @@ export default {
type: String,
default: () => "0",
},
type: {
type: String,
default: "",
},
},
watch: {
info() {
this.getData()
this.getData();
},
},
async mounted() {
......@@ -30,8 +36,16 @@ export default {
},
methods: {
async getData() {
let label = this.info.map((item) => item.companyName);
let value = this.info.map((item) => item.businessCardNums);
let label = [];
let value = [];
if (this.type == "staff") {
label = this.info.map((item) => item.name);
value = this.info.map((item) => item.sendBusinessCardTimes);
console.log(this.info);
} else {
label = this.info.map((item) => item.companyName);
value = this.info.map((item) => item.businessCardNums);
}
this._initEcharts(label, value);
},
_initEcharts(label, value) {
......@@ -63,29 +77,29 @@ export default {
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
interval: 0, //使x轴文字显示全
// rotate: '15',// 刻度标签旋转的角度
formatter: function(value) {
var texts = value
if(label.length>3 && label.length<=6){
formatter: function (value) {
var texts = value;
if (label.length > 3 && label.length <= 6) {
if (texts.length > 10) {
// 限制长度自设
texts = texts.substr(0, 10) + '...'
texts = texts.substr(0, 10) + "...";
}
}
if(label.length>6 && label.length<=10){
if (label.length > 6 && label.length <= 10) {
if (texts.length > 6) {
// 限制长度自设
texts = texts.substr(0, 6) + '...'
texts = texts.substr(0, 6) + "...";
}
}
if(label.length>10){
if (label.length > 10) {
if (texts.length > 3) {
// 限制长度自设
texts = texts.substr(0, 3) + '...'
texts = texts.substr(0, 3) + "...";
}
}
return texts
return texts;
},
// formatter: function(params) {
// var newParamsName = "";
......@@ -109,8 +123,7 @@ export default {
// }
// return newParamsName;
// }
}
},
},
yAxis: {
type: "value",
......
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