Commit 7c3f3634 authored by 王晓旭's avatar 王晓旭

首页接口对接

parent ce6fb0a2
...@@ -7,31 +7,31 @@ ...@@ -7,31 +7,31 @@
<div class="header"> <div class="header">
<div class="hc-itme"> <div class="hc-itme">
<div class="i-title">企业总量(家)</div> <div class="i-title">企业总量(家)</div>
<div class="i-num">5</div> <div class="i-num">{{enterpriseNums}}</div>
</div> </div>
<div class="hc-itme"> <div class="hc-itme">
<div class="i-title">产品数量(个)</div> <div class="i-title">产品数量(个)</div>
<div class="i-num">35</div> <div class="i-num">{{productNums}}</div>
</div> </div>
<div class="hc-itme"> <div class="hc-itme">
<div class="i-title">员工数量(人)</div> <div class="i-title">员工数量(人)</div>
<div class="i-num">48</div> <div class="i-num">{{staffNums}}</div>
</div> </div>
<div class="hc-itme"> <div class="hc-itme">
<div class="i-title">新闻数量(篇)</div> <div class="i-title">新闻数量(篇)</div>
<div class="i-num">89</div> <div class="i-num">{{newsNums}}</div>
</div> </div>
<div class="hc-itme"> <div class="hc-itme">
<div class="i-title">反馈数量(次)</div> <div class="i-title">反馈数量(次)</div>
<div class="i-num">65</div> <div class="i-num">{{feedbackNums}}</div>
</div> </div>
<div class="hc-itme"> <div class="hc-itme">
<div class="i-title">用户数量(次)</div> <div class="i-title">用户数量(次)</div>
<div class="i-num">156</div> <div class="i-num">{{customerNums}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -92,114 +92,81 @@ export default { ...@@ -92,114 +92,81 @@ export default {
data() { data() {
return { return {
classList: "page page-home", classList: "page page-home",
// barDayValue: [{ nums: 1, age_area: "31-40岁" }], barDayValue: [],
lineDayValue: [ lineDayValue: [],
{ cpfbDayValue: [],
datetime: "08:00:00-09:00:00", mpfbDayValue: [],
count: 0 xwfbDayValue: [],
}, enterpriseNums: "--",
{ productNums: "--",
datetime: "09:00:00-10:00:00", staffNums: "--",
count: 0 newsNums: "--",
}, feedbackNums: "--",
{ customerNums: "--"
datetime: "10:00:00-11:00:00", };
count: 0
},
{
datetime: "11:00:00-12:00:00",
count: 0
},
{
datetime: "12:00:00-13:00:00",
count: 0
},
{
datetime: "13:00:00-14:00:00",
count: 0
},
{
datetime: "14:00:00-15:00:00",
count: 4
},
{
datetime: "15:00:00-16:00:00",
count: 1
},
{
datetime: "16:00:00-17:00:00",
count: 0
},
{
datetime: "17:00:00-18:00:00",
count: 0
}, },
{ created() {
datetime: "18:00:00-19:00:00", this.getData();
count: 0 },
methods: {
getData() {
this.$post("/company/stat").then(res => {
const { data, code } = res;
if (code == 1) {
this.enterpriseNums = data.enterpriseNums;
this.productNums = data.productNums;
this.staffNums = data.staffNums;
this.newsNums = data.newsNums;
this.feedbackNums = data.feedbackNums;
this.customerNums = data.customerNums;
this.lineDayValue = data.accessStatList ? data.accessStatList : [];
this.barDayValue = data.businessCardDistributionList
? data.businessCardDistributionList
: [];
if (data.newsDistributionList.length > 0) {
let arr = [];
data.newsDistributionList.forEach(item => {
arr.push({
name: item.name,
value: item.newsNums
});
});
this.xwfbDayValue = arr
} else {
this.xwfbDayValue = [];
} }
],
cpfbDayValue: [ if (data.productDistributionList.length > 0) {
{ let arr = [];
value: 5, data.productDistributionList.forEach(item => {
name: "四川思迈尔网络科技有限公司" arr.push({
}, name: item.companyName,
{ value: item.productNums
value: 10, });
name: "四川恒生信达科技有限公司" });
}, this.cpfbDayValue = arr
{ } else {
value: 10, this.cpfbDayValue = [];
name: "四川信宏翔科技有限公司"
},
{
value: 6,
name: "武汉力龙信息科技股份有限公司"
},
{
value: 32,
name: "四川力龙恒生科技股份有限公司"
} }
],
mpfbDayValue: [
{ if (data.sendCardStaffList.length > 0) {
value: 5, let arr = [];
name: "四川思迈尔网络科技有限公司" data.sendCardStaffList.forEach(item => {
}, arr.push({
{ name: item.name,
value: 10, value: item.sumViews
name: "四川恒生信达科技有限公司" });
}, });
{ this.mpfbDayValue = arr
value: 10, } else {
name: "四川信宏翔科技有限公司" this.mpfbDayValue = [];
}, }
{ }
value: 6, });
name: "武汉力龙信息科技股份有限公司"
},
{
value: 32,
name: "四川力龙恒生科技股份有限公司"
} }
],
xwfbDayValue: [
{
value: 33,
name: "集团频道"
},
{
value: 56,
name: "产品频道"
},
{
value: 89,
name: "机器人频道"
} }
]
};
},
created() {}
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
......
...@@ -9,32 +9,7 @@ export default { ...@@ -9,32 +9,7 @@ export default {
props: { props: {
info: { info: {
type: Array, type: Array,
default: () => [ default: () => [],
{
value: 200,
name: "员工1",
},
{
value: 400,
name: "员工2",
},
{
value: 600,
name: "员工3",
},
{
value: 500,
name: "员工4",
},
{
value: 260,
name: "员工5",
},
{
value: 100,
name: "员工6",
},
],
}, },
option: { option: {
type: Object, type: Object,
...@@ -46,8 +21,8 @@ export default { ...@@ -46,8 +21,8 @@ export default {
}, },
}, },
watch: { watch: {
day(newval, oldval) { info() {
newval ? this.getData() : ""; this.getData()
}, },
}, },
async mounted() { async mounted() {
...@@ -55,15 +30,8 @@ export default { ...@@ -55,15 +30,8 @@ export default {
}, },
methods: { methods: {
async getData() { async getData() {
// let res = await getStatisticAges({ let label = this.info.map((item) => item.companyName);
// selected: this.day == 5 ? null : this.day, let value = this.info.map((item) => item.businessCardNums);
// });
// if (res.code != 1) return;
// let label = res.data.map((item) => item.age_area);
// let value = res.data.map((item) => item.nums);
let label = this.info.map((item) => item.name);
let value = this.info.map((item) => item.value);
this._initEcharts(label, value); this._initEcharts(label, value);
}, },
_initEcharts(label, value) { _initEcharts(label, value) {
......
...@@ -29,10 +29,9 @@ export default { ...@@ -29,10 +29,9 @@ export default {
const VALUE = []; const VALUE = [];
const myChart = this.$echarts.init(this.$el); const myChart = this.$echarts.init(this.$el);
const echarts = this.$echarts; const echarts = this.$echarts;
console.log(123123,this.info);
this.info.forEach((item) => { this.info.forEach((item) => {
NAME.push(item.datetime); NAME.push(item.dateStr);
VALUE.push(item.count); VALUE.push(item.nums);
}); });
let option = { let option = {
legend: { legend: {
......
...@@ -9,16 +9,7 @@ export default { ...@@ -9,16 +9,7 @@ export default {
props: { props: {
info: { info: {
type: Array, type: Array,
default: () => [ default: () => [],
{
value: 300,
name: "女士",
},
{
value: 700,
name: "男士",
},
],
}, },
option: { option: {
type: Object, type: Object,
...@@ -30,8 +21,8 @@ export default { ...@@ -30,8 +21,8 @@ export default {
}, },
}, },
watch: { watch: {
day(newval, oldval) { info(newval, oldval) {
newval ? this.getData() : ""; this.getData()
}, },
}, },
mounted() { mounted() {
...@@ -39,16 +30,6 @@ export default { ...@@ -39,16 +30,6 @@ export default {
}, },
methods: { methods: {
async getData() { async getData() {
// let res = await getStatisticSexual({
// selected: this.day == 5 ? null : this.day,
// });
// if (res.code != 1) return;
// let value = res.data.map(({ idcard_Sex, nums }) => ({
// name: idcard_Sex,
// value: nums,
// }));
// this._initEcharts(value);
console.log(this.info);
this._initEcharts(this.info); this._initEcharts(this.info);
}, },
_initEcharts(value) { _initEcharts(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