Authored by OF1706

report bug

@@ -3,6 +3,6 @@ export default { @@ -3,6 +3,6 @@ export default {
3 name: 'product', 3 name: 'product',
4 component: () => import(/* webpackChunkName: "statistics.product" */'./product'), 4 component: () => import(/* webpackChunkName: "statistics.product" */'./product'),
5 meta: { 5 meta: {
6 - pageName: '实时分析' 6 + pageName: '商品看板'
7 } 7 }
8 }; 8 };
1 <template> 1 <template>
2 <div class="stat-shop"> 2 <div class="stat-shop">
3 <layout-body> 3 <layout-body>
4 - <Card class="shop-card">  
5 - <p slot="title">商品看板</p>  
6 - <layout-filter class="box-filter" :inline="true" :col="1">  
7 - <filter-item label="时间">  
8 - <Date-picker  
9 - type="daterange"  
10 - v-model="dateRange"  
11 - format="yyyy-MM-dd"  
12 - placeholder="选择开始结束日期"></Date-picker>  
13 - <div class="quick">  
14 - <a href="javascript:;" @click="() => {changeLimit(7)}">近7天</a>  
15 - <a href="javascript:;" @click="() => {changeLimit(30)}">近30天</a> 4 + <p slot="title">商品看板</p>
  5 + <layout-filter class="box-filter" :inline="true" :col="1">
  6 + <filter-item label="时间">
  7 + <Date-picker
  8 + type="daterange"
  9 + v-model="dateRange"
  10 + format="yyyy-MM-dd"
  11 + placeholder="选择开始结束日期"></Date-picker>
  12 + <div class="quick">
  13 + <a href="javascript:;" @click="() => {changeLimit(7)}">近7天</a>
  14 + <a href="javascript:;" @click="() => {changeLimit(30)}">近30天</a>
  15 + </div>
  16 + <Poptip trigger="hover" placement="bottom-end">
  17 + <div slot="content">
  18 + * 仅支持历史数据,时间跨度不得超过30天
16 </div> 19 </div>
17 - <Poptip trigger="hover" placement="bottom-end">  
18 - <div slot="content">  
19 - * 仅支持历史数据,时间跨度不得超过30天  
20 - </div>  
21 - <Button type="primary" @click="exportFile">导出</Button>  
22 - </Poptip>  
23 - </filter-item>  
24 - </layout-filter>  
25 - <layout-list>  
26 - <Table border :columns="tableCols" :data="tableData"></Table>  
27 - <Page :total="pageData.total" :current="pageData.current"  
28 - @on-change="pageChange" :page-size="20" show-total></Page>  
29 - </layout-list>  
30 -  
31 - </Card> 20 + <Button type="primary" @click="exportFile">导出</Button>
  21 + </Poptip>
  22 + </filter-item>
  23 + </layout-filter>
  24 + <layout-list>
  25 + <Table border :columns="tableCols" :data="tableData"></Table>
  26 + <Page :total="pageData.total" :current="pageData.current"
  27 + @on-change="pageChange" :page-size="20" show-total></Page>
  28 + </layout-list>
32 </layout-body> 29 </layout-body>
33 </div> 30 </div>
34 </template> 31 </template>
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 * 仅支持导出历史数据,时间跨度不得超过30天 19 * 仅支持导出历史数据,时间跨度不得超过30天
20 </div> 20 </div>
21 <Button type="primary" @click="exportFile">导出</Button> 21 <Button type="primary" @click="exportFile">导出</Button>
  22 + <p style="display: inline-block;font-size: 10px;color: #c90;">* 当日数据不支持导出</p>
22 </Poptip> 23 </Poptip>
23 </filter-item> 24 </filter-item>
24 </layout-filter> 25 </layout-filter>
@@ -49,11 +50,13 @@ @@ -49,11 +50,13 @@
49 </Col> 50 </Col>
50 <Col span="6"> 51 <Col span="6">
51 <div class="box-item bg-light-blue"> 52 <div class="box-item bg-light-blue">
52 - <span class="box-item-label" style="marginLeft: 20px;">{{filters.targetColumns[4].title}}</span> 53 + <Icon type="clipboard"></Icon>
  54 + <span class="box-item-label">{{filters.targetColumns[4].title}}</span>
53 <span class="box-item-value">{{this.overviewData.shipmentOrderCount}}</span> 55 <span class="box-item-value">{{this.overviewData.shipmentOrderCount}}</span>
54 </div> 56 </div>
55 <div class="box-item bg-green"> 57 <div class="box-item bg-green">
56 - <span class="box-item-label" style="marginLeft: 20px;">{{filters.targetColumns[5].title}}</span> 58 + <Icon type="social-yen"></Icon>
  59 + <span class="box-item-label">{{filters.targetColumns[5].title}}</span>
57 <span class="box-item-value">{{this.overviewData.shipmentOrderAmount}}</span> 60 <span class="box-item-value">{{this.overviewData.shipmentOrderAmount}}</span>
58 </div> 61 </div>
59 </Col> 62 </Col>
@@ -118,12 +121,10 @@ @@ -118,12 +121,10 @@
118 121
119 this.getOverviewData(); 122 this.getOverviewData();
120 123
121 - if (this.endDate !== this.today) {  
122 - _.each(this.targetList, tar => {  
123 - tar.chatOpt = {};  
124 - });  
125 - this.getOverviewTrend();  
126 - } 124 + _.each(this.targetList, tar => {
  125 + tar.chatOpt = {};
  126 + });
  127 + this.getOverviewTrend();
127 }, 128 },
128 curTarget(value) { 129 curTarget(value) {
129 130
@@ -197,6 +198,17 @@ @@ -197,6 +198,17 @@
197 platform: '1,2' 198 platform: '1,2'
198 }).then(ret => { 199 }).then(ret => {
199 200
  201 + if (!ret.data) {
  202 + this.overviewData.uv = 1;
  203 + this.overviewData.pv = 1;
  204 + this.overviewData.orderCount = 0;
  205 + this.overviewData.orderAmount = 0;
  206 + this.overviewData.shipmentOrderCount = 0;
  207 + this.overviewData.shipmentOrderAmount = 0;
  208 + this.overviewData.uvOrderRate = 0;
  209 + return;
  210 + }
  211 +
200 this.overviewData = ret.data; 212 this.overviewData = ret.data;
201 213
202 this.overviewData.uv = _.get(ret.data, 'uv') ? ret.data.uv : '——'; 214 this.overviewData.uv = _.get(ret.data, 'uv') ? ret.data.uv : '——';
@@ -206,16 +218,18 @@ @@ -206,16 +218,18 @@
206 this.overviewData.shipmentOrderCount = _.get(ret.data, 'paymentOrderCount') ? ret.data.paymentOrderCount : '——'; 218 this.overviewData.shipmentOrderCount = _.get(ret.data, 'paymentOrderCount') ? ret.data.paymentOrderCount : '——';
207 this.overviewData.shipmentOrderAmount = _.get(ret.data, 'paymentOrderAmount') ? ret.data.paymentOrderAmount : '——'; 219 this.overviewData.shipmentOrderAmount = _.get(ret.data, 'paymentOrderAmount') ? ret.data.paymentOrderAmount : '——';
208 this.overviewData.uvOrderRate = ((_.get(ret.data, 'uvOrderRate') && (ret.data.uvOrderRate <= 1) ? 220 this.overviewData.uvOrderRate = ((_.get(ret.data, 'uvOrderRate') && (ret.data.uvOrderRate <= 1) ?
209 - (ret.data.uvOrderRate * 100) : ret.data.uvOrderRate)).toFixed(4) + '%'; 221 + (ret.data.uvOrderRate * 100) : ret.data.uvOrderRate)).toFixed(2) + '%';
210 222
211 if (this.beginDate !== this.endDate) { 223 if (this.beginDate !== this.endDate) {
212 - let formatData = _.slice(ret, 0, ret.length - 1); 224 + let formatData = _.slice(ret.data, 0, ret.data.length - 1);
213 225
214 this.overviewChartData.uv = _.get(ret, 'uv'); 226 this.overviewChartData.uv = _.get(ret, 'uv');
215 this.overviewChartData.pv = _.get(ret, 'pv'); 227 this.overviewChartData.pv = _.get(ret, 'pv');
216 this.overviewChartData.orderCount = _.get(ret, 'orderCount'); 228 this.overviewChartData.orderCount = _.get(ret, 'orderCount');
217 this.overviewChartData.orderAmount = _.get(ret, 'orderAmount'); 229 this.overviewChartData.orderAmount = _.get(ret, 'orderAmount');
218 - this.overviewChartData.xAxis = _.map(formatData, 'hour'); 230 + this.overviewChartData.paymentOrderCount = _.get(ret, 'paymentOrderCount');
  231 + this.overviewChartData.paymentOrderAmount = _.get(ret, 'paymentOrderAmount');
  232 + this.overviewChartData.xAxis = _.map(formatData, 'date');
219 } 233 }
220 }); 234 });
221 }, 235 },