|
@@ -2,40 +2,51 @@
|
|
|
<div class="program">
|
|
|
<el-card class="box-card">
|
|
|
<el-form
|
|
|
- ref="form"
|
|
|
:model="form"
|
|
|
size="small"
|
|
|
:inline="true"
|
|
|
label-width="120px"
|
|
|
class="demo-form-inline"
|
|
|
>
|
|
|
- <el-form-item label="">
|
|
|
+ <el-form-item>
|
|
|
<el-button
|
|
|
:class="
|
|
|
'colorBtn ' +
|
|
|
- btnGroup[item].class +
|
|
|
- (form.platform == item
|
|
|
- ? ' ' + btnGroup[item].class + 'act'
|
|
|
+ btnGroup[item.platform].class +
|
|
|
+ (form.platform == item.platform
|
|
|
+ ? ' ' + btnGroup[item.platform].class + 'act'
|
|
|
: '')
|
|
|
"
|
|
|
- v-for="item in platformList"
|
|
|
- :key="item"
|
|
|
- @click="(form.platform = item), onSubmit()"
|
|
|
+ v-for="item in pListData"
|
|
|
+ :key="item.platform"
|
|
|
+ @click="() => tabChange(item)"
|
|
|
>
|
|
|
- <span v-if="item === '微信'" class="icon iconfont"></span>
|
|
|
- <span v-if="item === '微博'" class="icon iconfont weiboIcon1"
|
|
|
+ <span v-if="item.platform === '微信'" class="icon iconfont"
|
|
|
+ ></span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-if="item.platform === '微博'"
|
|
|
+ class="icon iconfont weiboIcon1"
|
|
|
></span
|
|
|
>
|
|
|
- <span v-if="item === '快手'" class="icon iconfont"></span>
|
|
|
- <span v-if="item === '抖音'" class="icon iconfont"></span>
|
|
|
- <span v-if="item === 'B站'" class="icon iconfont"></span>
|
|
|
- <span v-if="item === '头条'" class="icon iconfont"></span>
|
|
|
- {{ item }}
|
|
|
+ <span v-if="item.platform === '快手'" class="icon iconfont"
|
|
|
+ ></span
|
|
|
+ >
|
|
|
+ <span v-if="item.platform === '抖音'" class="icon iconfont"
|
|
|
+ ></span
|
|
|
+ >
|
|
|
+ <span v-if="item.platform === 'B站'" class="icon iconfont"
|
|
|
+ ></span
|
|
|
+ >
|
|
|
+ <span v-if="item.platform === '头条'" class="icon iconfont"
|
|
|
+ ></span
|
|
|
+ >
|
|
|
+ {{ item.platform }}
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="日期">
|
|
|
<el-date-picker
|
|
|
- v-model="form.date"
|
|
|
+ v-model="form.dt"
|
|
|
type="date"
|
|
|
:disabled-date="time => disabledDate(time)"
|
|
|
placeholder="日期"
|
|
@@ -173,25 +184,25 @@ export default {
|
|
|
activeTab: "agg",
|
|
|
form: {
|
|
|
platform: "",
|
|
|
- date: "",
|
|
|
+ dt: "",
|
|
|
},
|
|
|
- formRael: { platform: "", date: "" },
|
|
|
+ formRael: { platform: "", dt: "" },
|
|
|
tableData: [],
|
|
|
- platformList: [],
|
|
|
+ pListData: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- const d = this.dateFormat(new Date() - 86400000);
|
|
|
platformList().then(res => {
|
|
|
+ const first = res[0] || { platform: "", dt: "" };
|
|
|
this.form = {
|
|
|
- date: [d.year, d.month, d.day].join("-"),
|
|
|
- platform: (res || [])[0] || "",
|
|
|
+ dt: first.dt,
|
|
|
+ platform: first.platform,
|
|
|
};
|
|
|
this.formRael = {
|
|
|
- date: [d.year, d.month, d.day].join("-"),
|
|
|
- platform: (res || [])[0] || "",
|
|
|
+ dt: first.dt,
|
|
|
+ platform: first.platform || "",
|
|
|
};
|
|
|
- this.platformList = res || [];
|
|
|
+ this.pListData = res || [];
|
|
|
this.onSubmit();
|
|
|
});
|
|
|
},
|
|
@@ -218,6 +229,15 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ tabChange(item) {
|
|
|
+ let p = {
|
|
|
+ platform: item.platform,
|
|
|
+ dt: this.form.dt,
|
|
|
+ };
|
|
|
+ if (new Date(item.dt) - new Date(p.dt) < 0) p.dt = item.dt;
|
|
|
+ this.form = p;
|
|
|
+ this.onSubmit();
|
|
|
+ },
|
|
|
cChange(num) {
|
|
|
this.page = num;
|
|
|
},
|
|
@@ -277,9 +297,9 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
formatListData() {
|
|
|
- const d = this.dateFormat(this.form.date);
|
|
|
+ const d = this.dateFormat(this.form.dt);
|
|
|
return {
|
|
|
- platform: this.form.platform || this.platformList[0],
|
|
|
+ platform: this.form.platform || this.pListData[0],
|
|
|
dt: [d.year, d.month, d.day].join("-"),
|
|
|
};
|
|
|
},
|