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

首页接口对接

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