|
@@ -145,7 +145,12 @@
|
|
|
|
|
|
<script>
|
|
|
// @ is an alias to /src
|
|
|
-import { overlapSearchTitle, selectDate, tvrange,tvrangeexport } from "@/api/kuyun";
|
|
|
+import {
|
|
|
+ overlapSearchTitle,
|
|
|
+ selectDate,
|
|
|
+ tvrange,
|
|
|
+ tvrangeexport,
|
|
|
+} from "@/api/kuyun";
|
|
|
|
|
|
import config from "@/config/index";
|
|
|
|
|
@@ -162,24 +167,7 @@ export default {
|
|
|
region: -1,
|
|
|
},
|
|
|
total: {},
|
|
|
- tableData: [
|
|
|
- {
|
|
|
- market_ratings: 0.037223,
|
|
|
- tv_name: "湖南卫视",
|
|
|
- rank: 1,
|
|
|
- tv_ratings: 0.007224,
|
|
|
- id: 24,
|
|
|
- type: "卫视",
|
|
|
- },
|
|
|
- {
|
|
|
- market_ratings: 0.035458,
|
|
|
- tv_name: "东方卫视",
|
|
|
- rank: 2,
|
|
|
- tv_ratings: 0.006882,
|
|
|
- id: 23,
|
|
|
- type: "卫视",
|
|
|
- },
|
|
|
- ],
|
|
|
+ tableData: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -242,29 +230,49 @@ export default {
|
|
|
|
|
|
onExport() {
|
|
|
let d = this.form.date || [];
|
|
|
- let time =
|
|
|
- this.form.filter.time && this.form.filter.time.length
|
|
|
- ? this.form.filter.time
|
|
|
- : (this.form.rangeTime || []).join("_");
|
|
|
- tvrangeexport({
|
|
|
- tv_id: this.form.tv_id,
|
|
|
- area_id: this.form.region,
|
|
|
- weekday: 0,
|
|
|
- tv_type: this.form.tv_type,
|
|
|
- start: d[0] ? d[0] + "+00:00:00" : "",
|
|
|
- end: d[1] ? d[1] + "+23:59:59" : "",
|
|
|
- time_range: time,
|
|
|
- }, '自定义时段 频道收视排行.csv')
|
|
|
+ let li = this.form.rangeTime || [],
|
|
|
+ type = "range";
|
|
|
+ if (this.form.filter.time && this.form.filter.time.length) {
|
|
|
+ li = this.form.filter.time;
|
|
|
+ type = "select";
|
|
|
+ }
|
|
|
+ let time = this.formatTime(li, type);
|
|
|
+ tvrangeexport(
|
|
|
+ {
|
|
|
+ tv_id: this.form.tv_id,
|
|
|
+ area_id: this.form.region,
|
|
|
+ weekday: 0,
|
|
|
+ tv_type: this.form.tv_type,
|
|
|
+ start: d[0] ? d[0] + "+00:00:00" : "",
|
|
|
+ end: d[1] ? d[1] + "+23:59:59" : "",
|
|
|
+ time_range: time,
|
|
|
+ },
|
|
|
+ "自定义时段 频道收视排行.csv"
|
|
|
+ );
|
|
|
},
|
|
|
disabledDate(time) {
|
|
|
return time.getTime() > Date.now() - 86400000;
|
|
|
},
|
|
|
+ formatTime(li, type) {
|
|
|
+ let timelist = li || [],
|
|
|
+ start = timelist[0] || "",
|
|
|
+ end = timelist[timelist.length - 1] || "";
|
|
|
+ if (type === "select") {
|
|
|
+ let out = "" || "";
|
|
|
+ out += start.split("_")[0] + "_" + (end.split("_")[1] || "");
|
|
|
+ return out;
|
|
|
+ }
|
|
|
+ return start.replace(":", "") + "_" + end.replace(":", "");
|
|
|
+ },
|
|
|
onSubmit() {
|
|
|
let d = this.form.date || [];
|
|
|
- let time =
|
|
|
- this.form.filter.time && this.form.filter.time.length
|
|
|
- ? this.form.filter.time
|
|
|
- : (this.form.rangeTime || []).join("_");
|
|
|
+ let li = this.form.rangeTime || [],
|
|
|
+ type = "range";
|
|
|
+ if (this.form.filter.time && this.form.filter.time.length) {
|
|
|
+ li = this.form.filter.time;
|
|
|
+ type = "select";
|
|
|
+ }
|
|
|
+ let time = this.formatTime(li, type);
|
|
|
tvrange({
|
|
|
tv_id: this.form.tv_id,
|
|
|
area_id: this.form.region,
|
|
@@ -292,7 +300,6 @@ export default {
|
|
|
.replace(/,$/, "")
|
|
|
.split(",");
|
|
|
},
|
|
|
-
|
|
|
select(v, se) {
|
|
|
this.timesSelect(se, v.id, "0000_2400");
|
|
|
this.rangeTime = [];
|