|
@@ -47,7 +47,9 @@
|
|
|
<el-form-item label="日期">
|
|
|
<el-date-picker
|
|
|
v-model="form.dt"
|
|
|
- type="date"
|
|
|
+ type="daterange"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
:disabled-date="time => disabledDate(time)"
|
|
|
placeholder="日期"
|
|
|
>
|
|
@@ -189,10 +191,10 @@ export default {
|
|
|
activeTab: "agg",
|
|
|
form: {
|
|
|
platform: "",
|
|
|
- dt: "",
|
|
|
+ dt: [],
|
|
|
match: "",
|
|
|
},
|
|
|
- formRael: { platform: "", dt: "" },
|
|
|
+ formRael: { platform: "", dt: [] },
|
|
|
tableData: [],
|
|
|
pListData: [],
|
|
|
};
|
|
@@ -201,11 +203,11 @@ export default {
|
|
|
platformList().then(res => {
|
|
|
const first = res[0] || { platform: "", dt: "" };
|
|
|
this.form = {
|
|
|
- dt: first.dt,
|
|
|
+ dt: [first.dt, first.dt],
|
|
|
platform: first.platform,
|
|
|
};
|
|
|
this.formRael = {
|
|
|
- dt: first.dt,
|
|
|
+ dt: [first.dt, first.dt],
|
|
|
platform: first.platform || "",
|
|
|
};
|
|
|
this.pListData = res || [];
|
|
@@ -250,9 +252,16 @@ export default {
|
|
|
this.page = num;
|
|
|
},
|
|
|
onExport() {
|
|
|
- if (!this.formRael.dt) return;
|
|
|
+ console.log(this.formRael);
|
|
|
+ if (!this.formRael.dt || this.formRael.dt.length != 2) return;
|
|
|
+ const startd = this.dateFormat(this.formRael.dt[0] || 0);
|
|
|
+ const starte = this.dateFormat(this.formRael.dt[1] || 0);
|
|
|
window.open(
|
|
|
- config.base.url2 + "/new-media/export?dt=" + this.formRael.dt
|
|
|
+ config.base.url2 +
|
|
|
+ "/new-media/export?start=" +
|
|
|
+ [startd.year, startd.month, startd.day].join("-") +
|
|
|
+ "&end=" +
|
|
|
+ [starte.year, starte.month, starte.day].join("-")
|
|
|
);
|
|
|
},
|
|
|
disabledDate(time) {
|
|
@@ -261,12 +270,14 @@ export default {
|
|
|
onSubmit() {
|
|
|
const data = this.formatListData();
|
|
|
this.page = 0;
|
|
|
+ this.tableData = [];
|
|
|
+ this.total = [];
|
|
|
this.load = true;
|
|
|
const l = ElLoading.default.service();
|
|
|
Promise.all([platform(data), platformlistData(data)])
|
|
|
.then(list => {
|
|
|
- console.log(list);
|
|
|
this.formRael = data;
|
|
|
+ this.formRael.dt = [this.formRael.start,this.formRael.end];
|
|
|
this.tableData = (list[0] || []).map((v, i) => {
|
|
|
v.index = i + 1;
|
|
|
return v;
|
|
@@ -281,6 +292,7 @@ export default {
|
|
|
l.close();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
+ this.load = false;
|
|
|
l.close();
|
|
|
});
|
|
|
},
|
|
@@ -306,13 +318,19 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
formatListData() {
|
|
|
- const d = this.dateFormat(this.form.dt);
|
|
|
+ const startd = this.form.dt[0] ? this.dateFormat(this.form.dt[0]) : false;
|
|
|
+ const starte = this.form.dt[1] ? this.dateFormat(this.form.dt[1]) : false;
|
|
|
const loginname = JSON.parse(
|
|
|
window.parent.localStorage.userinfo || "{}"
|
|
|
).loginname;
|
|
|
return {
|
|
|
platform: this.form.platform || this.pListData[0],
|
|
|
- dt: [d.year, d.month, d.day].join("-"),
|
|
|
+ start: startd
|
|
|
+ ? [startd.year, startd.month, startd.day].join("-")
|
|
|
+ : undefined,
|
|
|
+ end: starte
|
|
|
+ ? [starte.year, starte.month, starte.day].join("-")
|
|
|
+ : undefined,
|
|
|
match: this.form.match,
|
|
|
userId: loginname,
|
|
|
};
|