liyongli %!s(int64=3) %!d(string=hai) anos
pai
achega
bf572e5439

+ 7 - 0
.http

@@ -0,0 +1,7 @@
+POST http://114.117.161.191:9001/kuyun/api/evaluation/eye/performance/absepg_filter
+
+{
+    date: ["2021-01-01","2021-01-02"],
+    key: "abs_epg,channel_0,time,week,area_c_1",
+    org_id: 20
+}

+ 170 - 78
src/api/kuyun.js

@@ -1,96 +1,188 @@
 import ajax from "@/utils/request.js";
+import fileDownload from "@/utils/download.js";
 
 // 全国接口
 
-  /**
-   * 频道全天节目
-   * 表格查询
-   * @props {}
-   * @return {AxjxPromise}
-   */
-   export function allDayEpg(data) {
-    return ajax({
-      urlType: "kuyunApi",
-      url: "/broadcast/list",
-      method: "get",
-      data
-    });
-  }
+/**
+ *
+ * @param {*} data
+ * @returns {AxjxPromise}
+ */
+export function selectDate(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/performance/absepg_filter",
+    method: "POST",
+    data,
+  });
+}
 
-  /**
-   * 节目查询
-   * @props kw&ft
-   * @return {AxjxPromise}
-   */
-   export function overlapSearchTitle(data) {
-    return ajax({
-      urlType: "kuyunApi",
-      url: "/api/evaluation/eye/search_suggest?" + data,
-      method: "GET",
-    });
-  }
+/**
+ * 频道全天节目
+ * 表格查询
+ * @props {}
+ * @return {AxjxPromise}
+ */
+export function allDayEpg(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/broadcast/list",
+    method: "get",
+    data,
+  });
+}
 
-  /**
-   * 节目查询
-   * @props kw&ft
-   * @return {AxjxPromise}
-   */
-   export function epgAggregate(data) {
-    return ajax({
-      urlType: "kuyunApi",
-      url: "/api/evaluation/eye/EpgListByCaIdGrowAction?" + data,
-      method: "GET",
-    });
-  }
+/**
+ * 节目查询
+ * @props kw&ft
+ * @return {AxjxPromise}
+ */
+export function overlapSearchTitle(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/search_suggest?" + data,
+    method: "GET",
+  });
+}
 
-  // 重叠度
-  /**
-   * 节目重叠度
-   * 图表查询
-   * @props epg_ids=&area_id=
-   * @return {AxjxPromise}
-   */
-   export function overlap(data) {
-    return ajax({
+/**
+ * 节目查询
+ * @props kw&ft
+ * @return {AxjxPromise}
+ */
+export function epgAggregate(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/EpgListByCaIdGrowAction?" + data,
+    method: "GET",
+  });
+}
+
+// 重叠度
+/**
+ * 节目重叠度
+ * 图表查询
+ * @props epg_ids=&area_id=
+ * @return {AxjxPromise}
+ */
+export function overlap(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/ProUserOverlapAction?" + data,
+    method: "GET",
+  });
+}
+// 电视剧排播信息及表现(全国)
+/**
+ * 节目排行-同时段频道
+ * @props epg_id=&area_id=
+ * @return {AxjxPromise}
+ */
+export function summary(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/EpgPeriodLeaderboardTvAction?" + data,
+    method: "GET",
+  });
+}
+/**
+ * 节目排行-同时段频道导出
+ * @props epg_id=&area_id=&domain=pro.eye.kuyun.com%2F&download=csv&page_no=1&page_size=10000
+ */
+export function summaryExport(data, fileName) {
+  fileDownload(
+    {
       urlType: "kuyunApi",
-      url: "/api/evaluation/eye/ProUserOverlapAction?" + data,
+      url:
+        "/api/evaluation/eye/download/api/eye/EpgPeriodLeaderboardTvAction?" +
+        data,
       method: "GET",
-    });
-  }
-  // 电视剧排播信息及表现(全国)
-  /**
-   * 节目排行-同时段频道
-   * @props epg_id=&area_id=
-   * @return {AxjxPromise}
-   */
-   export function summary(data) {
-    return ajax({
+    },
+    fileName
+  );
+}
+/**
+ * 节目排行-同时段节目
+ * @props epg_id=&area_id=
+ * @return {AxjxPromise}
+ */
+export function program(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/EpgPeriodLeaderboardAction?page_no=1&" + data,
+    method: "GET",
+  });
+}
+/**
+ * 节目排行-同时段节目导出
+ * @props epg_id=&area_id=&domain=pro.eye.kuyun.com%2F&download=csv&page_no=1&page_size=10000
+ */
+export function programExport(data, fileName) {
+  fileDownload(
+    {
       urlType: "kuyunApi",
-      url: "/api/evaluation/eye/EpgPeriodLeaderboardTvAction?" + data,
+      url:
+        "/api/evaluation/eye/download/api/eye/EpgPeriodLeaderboardAction?" +
+        data,
       method: "GET",
-    });
-  }
-  /**
-   * 节目排行-同时段节目
-   * @props epg_id=&area_id=
-   * @return {AxjxPromise}
-   */
-   export function program(data) {
-    return ajax({
+    },
+    fileName
+  );
+}
+/**
+ * 节目排行-同时段多节目
+ * @props epg_ids=&area_id=
+ * @return {AxjxPromise}
+ */
+export function programs(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/performance/epgkpi/summary?" + data,
+    method: "GET",
+  });
+}
+/**
+ * 节目排行-同时段节目导出
+ * @props epg_ids=&area_id=&domain=api.eye.kuyun.com
+ */
+export function programsExport(data, fileName) {
+  fileDownload(
+    {
       urlType: "kuyunApi",
-      url: "/api/evaluation/eye/EpgPeriodLeaderboardAction?page_no=1&" + data,
+      url:
+        "/api/evaluation/eye/download/performance/epgkpi/summary/download?" +
+        data,
       method: "GET",
-    });
-  }
-  /**
-   * 节目排行-同时段多节目
-   * @props epg_ids=&area_id=
-   * @return {AxjxPromise}
-   */
-   export function programs(data) {
+    },
+    fileName
+  );
+}
+//
+
+/**
+ * 抽象节目剧目分地区收视(全国)
+ * @props epg_ids=&area_id=
+ * @return {AxjxPromise}
+ */
+export function country(data) {
+  return ajax({
+    urlType: "kuyunApi",
+    url: "/api/evaluation/eye/performance/absepgkpi",
+    method: "POST",
+    data,
+  });
+}
+
+
+/**
+ * 单期节目流入流出
+ * @props epg_ids=&area_id=
+ * @return {AxjxPromise}
+ */
+ export function singleProgram(data) {
     return ajax({
       urlType: "kuyunApi",
-      url: "/api/evaluation/eye/performance/epgkpi/summary?" + data,
+      url: "/api/evaluation/eye/EpgInputOutputAction?kpi=tv_ratings&" +data,
       method: "GET",
     });
   }

+ 0 - 74
src/node.js

@@ -1,74 +0,0 @@
-const { Promise } = require("core-js");
-const https = require("https");
-const fs = require("fs");
-
-async function getlist() {
-  return new Promise((resolve, reject) => {
-    https
-      .get("https://bigdata.smcic.net/overview?&season=1", res => {
-        let d = "";
-
-        res.on("data", data => {
-          d += data;
-        });
-        res.on("end", () => {
-          let date = JSON.parse(d);
-          resolve(date);
-        });
-      })
-      .on("error", e => {
-        reject(e);
-      });
-  });
-}
-async function getpla(v) {
-  return new Promise((resolve, reject) => {
-    https
-      .get(
-        "https://bigdata.smcic.net/name?topic_name=" +
-          v +
-          "&platform=ALL&type=all&season=1",
-        res => {
-          let d = "";
-          res.on("data", data => {
-            d += data;
-          });
-          res.on("end", () => {
-            let date = JSON.parse(d);
-            resolve(date);
-          });
-        }
-      )
-      .on("error", e => {
-        reject(e);
-      });
-  });
-}
-
-async function t() {
-  const list = await getlist();
-  const out = {};
-  const li = [];
-  for (let i = 0; i < list.length; i++) {
-    const v = list[i];
-    const plist = await getpla(v.topic_name);
-    for (let o = 0; o < plist.length; o++) {
-      const item = plist[o];
-      const key = item.nickname.replace(/\s*/g, "")
-      if (out[key] === undefined) {
-        li.push(item);
-        out[key] = li.length - 1;
-        continue;
-      }
-      let keys = Object.keys(item);
-      for (let p = 0; p < keys.length; p++) {
-        const value = keys[p];
-        if (value !== "nickname") li[out[key]][value] += item[value];
-      }
-    }
-  }
-  
-  fs.writeFileSync("./list.json", JSON.stringify(li.sort((a,b)=>a.pv -b.pv)));
-}
-
-t();

+ 38 - 0
src/node/h.html

@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8" />
+    <title></title>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+    <meta http-equiv="Pragma" content="no-cache" />
+    <meta http-equiv="Expires" content="0" />
+    <script src="https://djweb.smcic.net/gouju/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
+</head>
+
+<body>
+    <script>
+        $.ajax({
+            url: 'http://114.117.161.191:9001/kuyun/api/evaluation/eye/performance/absepg_filter',
+            type: 'put',
+            dataType: 'json',
+            //data: JSON.stringify({data:{status: "start"}}),
+            data: {
+                date: ["2021-01-01", "2021-01-02"],
+                key: "abs_epg,channel_0,time,week,area_c_1",
+                org_id: 20,
+            },
+            cache: false,
+            headers: {
+                'Content-Type': 'application/json;charset=UTF-8'  //multipart/form-data;boundary=--xxxxxxx   application/json
+            },
+            success: function (res) {
+                console.log(res)
+            }
+        })
+    </script>
+</body>
+
+</html>

+ 108 - 0
src/node/node.js

@@ -0,0 +1,108 @@
+// const { Promise } = require("core-js");
+// const https = require("https");
+// const fs = require("fs");
+
+// async function getlist() {
+//   return new Promise((resolve, reject) => {
+//     https
+//       .get("https://bigdata.smcic.net/overview?&season=1", res => {
+//         let d = "";
+
+//         res.on("data", data => {
+//           d += data;
+//         });
+//         res.on("end", () => {
+//           let date = JSON.parse(d);
+//           resolve(date);
+//         });
+//       })
+//       .on("error", e => {
+//         reject(e);
+//       });
+//   });
+// }
+// async function getpla(v) {
+//   return new Promise((resolve, reject) => {
+//     https
+//       .get(
+//         "https://bigdata.smcic.net/name?topic_name=" +
+//           v +
+//           "&platform=ALL&type=all&season=1",
+//         res => {
+//           let d = "";
+//           res.on("data", data => {
+//             d += data;
+//           });
+//           res.on("end", () => {
+//             let date = JSON.parse(d);
+//             resolve(date);
+//           });
+//         }
+//       )
+//       .on("error", e => {
+//         reject(e);
+//       });
+//   });
+// }
+
+// async function t() {
+//   const list = await getlist();
+//   const out = {};
+//   const li = [];
+//   for (let i = 0; i < list.length; i++) {
+//     const v = list[i];
+//     const plist = await getpla(v.topic_name);
+//     for (let o = 0; o < plist.length; o++) {
+//       const item = plist[o];
+//       const key = item.nickname.replace(/\s*/g, "")
+//       if (out[key] === undefined) {
+//         li.push(item);
+//         out[key] = li.length - 1;
+//         continue;
+//       }
+//       let keys = Object.keys(item);
+//       for (let p = 0; p < keys.length; p++) {
+//         const value = keys[p];
+//         if (value !== "nickname") li[out[key]][value] += item[value];
+//       }
+//     }
+//   }
+
+//   fs.writeFileSync("./list.json", JSON.stringify(li.sort((a,b)=>a.pv -b.pv)));
+// }
+
+// t();
+
+const request = require("request");
+
+request.post(
+  "http://114.117.161.191:9001/kuyun/api/evaluation/eye/performance/absepgkpi",
+  {
+    json: {
+      date: ["2021-01-01", "2021-01-08"],
+      filter: {
+        week: [1, 2, 3, 4, 5, 6, 7],
+        channel_0: [5],
+        area_c_1: ["area_c_320000", "area_c_640000"],
+        abs_epg: [10231],
+        time: ["0000_2400"],
+      },
+      field: [
+        "area_c_1",
+        "abs_epg",
+        "indicators_tv_ratings",
+        "indicators_market_ratings",
+      ],
+      info: 1,
+      org_id: 20,
+    },
+  },
+  (error, res, body) => {
+    if (error) {
+      console.error(error);
+      return;
+    }
+    console.log(`statusCode: ${res.statusCode}`);
+    console.log(body);
+  }
+);

+ 41 - 0
src/utils/download.js

@@ -0,0 +1,41 @@
+import config from "../config/index";
+
+function getdata(data) {
+  let text = "";
+  for (const key in data) {
+    text += key + "=" + data[key] + "&";
+  }
+  text ? (text = "?" + text) : "";
+  text = text.replace(/&$/, "");
+  return text;
+}
+
+export default function(ori, fileName) {
+  let baseurl = config.base[ori.urlType || "url"];
+  let url = baseurl + ori.url + getdata(ori.data || {})
+  let xhttp;
+  if (window.XMLHttpRequest) xhttp = new XMLHttpRequest();
+  else xhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
+  xhttp.responseType = "blob";
+  xhttp.open("GET", url, true);
+  xhttp.send();
+  xhttp.addEventListener(
+    "progress",
+    res => {
+      console.log(res, (res.loaded / res.total) * 100);
+    },
+    false
+  );
+  xhttp.onreadystatechange = function() {
+    if (this.readyState != 4 || this.status != 200) return;
+    // 组装a标签
+    let elink = document.createElement("a");
+    // 设置下载文件名
+    elink.download = fileName;
+    elink.style.display = "none";
+    elink.href = URL.createObjectURL(this.response);
+    document.body.appendChild(elink);
+    elink.click();
+    document.body.removeChild(elink);
+  };
+}

+ 16 - 9
src/utils/request.js

@@ -1,7 +1,5 @@
 import config from "../config/index";
 
-import { ElLoading } from "element-plus";
-
 function getdata(data) {
   let text = "";
   for (const key in data) {
@@ -13,30 +11,39 @@ function getdata(data) {
 }
 
 export default function(ori) {
+  let method = ori.method.toUpperCase();
   let baseurl = config.base[ori.urlType || "url"];
-  let url = baseurl + ori.url + getdata(ori.data || {});
+  let url = baseurl + ori.url;
+  if (method === "GET") url += getdata(ori.data || {});
   if (ori.downCsv) return window.open(url);
   let d = {
     lock: true,
     background: "rgba(255, 255, 255, 0.7)",
   };
   ori.target && (d.target = ori.target);
-  let load = {};
-  if (!ori.notLoad) load = ElLoading.service(d);
   return new Promise((resolve, reject) => {
     var xhttp;
     if (window.XMLHttpRequest) xhttp = new XMLHttpRequest();
     else if (window.ActiveXObject)
       xhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
-    let method = ori.method.toUpperCase();
     xhttp.open(method, url, true);
-    method === "GET" ? xhttp.send() : xhttp.send(JSON.stringify(ori.data));
+    if (method === "POST") {
+      xhttp.setRequestHeader(
+        "Content-Type",
+        "application/json;charset=UTF-8"
+      );
+      xhttp.send(JSON.stringify(ori.data));
+    } else {
+      xhttp.send();
+    }
     xhttp.onreadystatechange = function() {
-      if (this.readyState === 4 && load.close) load.close();
       if (this.readyState != 4 || this.status != 200) return;
       let data = {};
       try {
-        data = this.responseText !== 'null' ? JSON.parse(this.responseText || "{}") : {};
+        data =
+          this.responseText !== "null"
+            ? JSON.parse(this.responseText || "{}")
+            : {};
       } catch (err) {
         console.error(err);
         reject(err);

+ 219 - 15
src/views/Abstract/Abstract.vue

@@ -13,12 +13,33 @@
         label-width="120px"
         class="demo-form-inline"
       >
+        <el-form-item label="抽象节目">
+          <el-select
+            v-model="form.program"
+            multiple
+            filterable
+            collapse-tags
+            remote
+            placeholder="请输入节目名"
+            reserve-keyword
+            :remote-method="querySearchAsync"
+          >
+            <el-option
+              v-for="item in selectList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="日期">
           <el-date-picker
             v-model="form.date"
             type="daterange"
             :disabled-date="time => disabledDate(time)"
             range-separator="-"
+            value-format="YYYY-MM-DD"
             start-placeholder="开始日期"
             end-placeholder="结束日期"
           >
@@ -42,17 +63,67 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="区域">
+        <el-form-item label="星期">
+          <el-select
+            v-model="form.week"
+            placeholder="请选择星期"
+            multiple
+            collapse-tags
+            @change="weekSelect"
+          >
+            <el-option
+              v-for="item in weeks"
+              :key="item.value"
+              :label="item.label"
+              :value="item.label"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="时间">
+          <el-time-picker
+            v-model="form.rangeTime"
+            is-range
+            format="HH:mm"
+            @change="() => (form.rangeTimeRange = [])"
+            range-separator="-"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+          >
+          </el-time-picker>
+        </el-form-item>
+        <el-form-item label="时段">
+          <el-select
+            v-model="form.rangeTimeRange"
+            placeholder="请选择时段"
+            multiple
+            collapse-tags
+            clearable
+            @change="timeSelect"
+          >
+            <el-option
+              v-for="item in cycle"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.disabled"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="29省">
           <el-select
             v-model="form.region"
-            placeholder="请选择区域"
+            multiple
+            collapse-tags
+            placeholder="请选择29省"
             @change="regionSelect"
           >
             <el-option
               v-for="item in region"
               :key="item.value"
               :label="item.label"
-              :value="item.value"
+              :value="item.label"
             >
             </el-option>
           </el-select>
@@ -106,7 +177,7 @@
 
 <script>
 // @ is an alias to /src
-// import {  } from "@/api/index";
+import { overlapSearchTitle, selectDate, country } from "@/api/kuyun";
 
 import lineCharts from "@/views/Country/components/lineCharts";
 
@@ -115,13 +186,12 @@ export default {
   name: "Channel",
   data() {
     return {
+      selectList: [],
       form: {
         channel: 0,
-        date: [
-          new Date(new Date() - 86400000),
-          new Date(new Date() - 86400000),
-        ],
-        region: 9,
+        program: "",
+        date: [],
+        region: "",
       },
       tableData: [
         {
@@ -133,12 +203,48 @@ export default {
           indicators_tv_ratings: 0.0015932668968739211,
           indicators_tv_ratings_rank: 1,
           is_live: "首播/重播",
-          week: "星期六",
+          week: [],
         },
       ],
     };
   },
-  mounted() {},
+  mounted() {
+    // const d = new Date(Date.now() - 86400000);
+    // let Y = d.getFullYear(),
+    //   M = d.getMonth() + 1,
+    //   D = d.getDate();
+    // M > 9 ? "" : (M = "0" + M);
+    // D > 9 ? "" : (D = "0" + D);
+    // this.form.date = [[Y, M, D].join("-"), [Y - 1, M, D].join("-")];
+    this.form.date = ["2021-01-01", "2021-01-02"];
+    selectDate({
+      date: this.form.date,
+      key: "abs_epg,channel_0,time,week,area_c_1",
+      org_id: 20,
+    }).then(r => {
+      console.log(r, "---");
+    });
+    country({
+      date: ["2021-01-01", "2021-01-08"],
+      filter: {
+        week: [1, 2, 3, 4, 5, 6, 7],
+        channel_0: [5],
+        area_c_1: ["area_c_320000", "area_c_640000"],
+        abs_epg: [10231],
+        time: ["0000_2400"],
+      },
+      field: [
+        "area_c_1",
+        "abs_epg",
+        "indicators_tv_ratings",
+        "indicators_market_ratings",
+      ],
+      info: 1,
+      org_id: 20,
+    }).then(r => {
+      console.log(r);
+    });
+  },
   computed: {
     channelList() {
       return config.channelNameList;
@@ -149,10 +255,16 @@ export default {
       for (let i = 0; i < reg.length; i++) {
         const v = reg[i];
         if (v.label === "行业分城") {
-          li = v.options || [];
+          for (let o = 0; o < v.options.length; o++) {
+            const item = v.options[o];
+            if (item.label !== "29省") continue;
+            li = item.options || [];
+            break;
+          }
           break;
         }
       }
+
       return li;
     },
     tableDate() {
@@ -189,7 +301,6 @@ export default {
           ...p,
         });
       }
-      console.log(li)
       return li;
     },
     chartKeys() {
@@ -244,19 +355,112 @@ export default {
           }),
         });
       }
-      console.log(li)
       return li;
     },
+    weeks() {
+      return [
+        {
+          label: "全部",
+          value: 0,
+        },
+        ...config.weeks,
+      ];
+    },
+    cycle() {
+      return config.cycle;
+    },
   },
   methods: {
+    timeSelect(a) {
+      let end = (a || [])[(a || []).length - 1],
+        s = this.form.rangeTimeRange.join(",") + ",";
+      for (let i = 0; i < this.form.rangeTimeRange.length; i++) {
+        const v = this.form.rangeTimeRange[i];
+        if (end === v) return;
+      }
+
+      if (/0000_2400/.test(s)) this.form.rangeTimeRange = [];
+      if (end === "0000_2400") this.form.rangeTimeRange = ["0000_2400"];
+      else if (end) this.form.rangeTimeRange.push(end);
+      else this.form.rangeTimeRange = [];
+      this.form.rangeTime = [];
+    },
+    querySearchAsync(queryString) {
+      if (!queryString) {
+        this.selectList = [];
+        return;
+      }
+      overlapSearchTitle("kw=" + queryString + "&ft=1").then(r => {
+        this.selectList = r || [];
+      });
+    },
     onExport() {},
     disabledDate(time) {
       return time.getTime() > Date.now() - 86400000;
     },
-    onSubmit() {},
+    onSubmit() {
+      console.log(this.form, this.region);
+      let o = {
+        全部: [1, 2, 3, 4, 5, 6, 7],
+        星期一: 1,
+        星期二: 2,
+        星期三: 3,
+        星期四: 4,
+        星期五: 5,
+        星期六: 6,
+        星期日: 7,
+      };
+      let week = [],
+        channel = [],
+        channelT = this.form.channel.join(",") + ",",
+        region = [],
+        regionT = this.form.region.join(",") + ",";
+      (this.form.week || []).map(v => {
+        if (o[v].length) week = o[v];
+        else week.push(o[v]);
+      });
+      config.channelNameList.map(v => {
+        let nex = new RegExp(v.label + ",");
+        if (nex.test(channelT)) channel.push(v.value);
+      });
+      this.region.map(v => {
+        let nex = new RegExp(v.label + ",");
+        if (nex.test(regionT)) region.push(v.value);
+      });
+
+      const p = {
+        date: this.form.date || [],
+        info: 1,
+        org_id: 20,
+        field: [
+          "area_c_1",
+          "abs_epg",
+          "indicators_tv_ratings",
+          "indicators_market_ratings",
+        ],
+        filter: {
+          week,
+          channel_0: channel,
+          area_c_1: region,
+          abs_epg: [686508],
+          time: ["1200_1400"],
+        },
+      };
+      console.log(p);
+    },
     matrer(row, column, cellValue) {
       return (cellValue * 100).toFixed(4) - 0 + "%";
     },
+    weekSelect(a) {
+      let li = [],
+        end = a[a.length - 1];
+      for (let i = 0; i < (a || []).length; i++) {
+        const v = (a || [])[i];
+        if (v !== "全部") li.push(v);
+      }
+      if (end == "全部") li = ["全部"];
+      this.selectAll(li, "week", 0);
+    },
     channelSelect(a) {
       this.selectAll(a, "channel", 0);
     },

+ 1 - 1
src/views/Country/components/flowCharts.vue

@@ -65,7 +65,7 @@ export default {
         pieces.push({
           gte: this.xText[v.start_x],
           lt: this.xText[v.end_x],
-          color: v.end_y - v.start_y > 0 ? "#fcc543" : "#00bed0",
+          color: v.end_y - v.start_y > 0 ? "#00bed0" : "#fcc543",
         });
       }
       return pieces;

+ 65 - 837
src/views/Flow/Flow.vue

@@ -13,34 +13,16 @@
         label-width="120px"
         class="demo-form-inline"
       >
-        <el-form-item label="日期">
-          <el-date-picker
-            v-model="form.date"
-            type="daterange"
-            :disabled-date="time => disabledDate(time)"
-            range-separator="-"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          >
-          </el-date-picker>
+        <el-form-item label="节目">
+          <el-autocomplete
+            v-model="form.program"
+            :fetch-suggestions="querySearchAsync"
+            placeholder="请输入节目名"
+            @select="handleSelect"
+          />
         </el-form-item>
-        <el-form-item label="频道">
-          <el-select
-            v-model="form.channel"
-            placeholder="请选择频道"
-            multiple
-            collapse-tags
-            @change="channelSelect"
-          >
-            <el-option
-              v-for="item in channelList"
-              :key="item.label"
-              :label="item.label"
-              :value="item.label"
-              :disabled="item.disabled"
-            >
-            </el-option>
-          </el-select>
+        <el-form-item label="栏目">
+          <Programcom @change="change" :list="lmList" />
         </el-form-item>
         <el-form-item label="区域">
           <el-cascader
@@ -51,7 +33,6 @@
         </el-form-item>
         <el-form-item style="float: right">
           <el-button type="primary" @click="onSubmit">查询</el-button>
-          <el-button type="primary" @click="onExport">导出</el-button>
         </el-form-item>
       </el-form>
     </el-card>
@@ -59,6 +40,7 @@
     <el-card class="box-card">
       <flow-charts
         :list="tableData"
+        v-if="tableData.length"
         xName="time_stamp"
         :subsection="subsection"
         :keys="chartKeys"
@@ -69,7 +51,9 @@
 
 <script>
 // @ is an alias to /src
-// import {  } from "@/api/index";
+import { overlapSearchTitle, epgAggregate, singleProgram } from "@/api/kuyun";
+
+import Programcom from "./components/programs.vue";
 
 import flowCharts from "@/views/Country/components/flowCharts";
 
@@ -78,810 +62,18 @@ export default {
   name: "Channel",
   data() {
     return {
+      lmList: [],
       form: {
-        channel: 0,
-        date: [
-          new Date(new Date() - 86400000),
-          new Date(new Date() - 86400000),
-        ],
+        program: "",
+        programLi: [],
         region: -1,
       },
-      tableData: [
-        {
-          time_stamp: "20220112154600",
-          tv_ratings: 0.000166,
-        },
-        {
-          time_stamp: "20220112154700",
-          tv_ratings: 0.000164,
-        },
-        {
-          time_stamp: "20220112154800",
-          tv_ratings: 0.000164,
-        },
-        {
-          time_stamp: "20220112154900",
-          tv_ratings: 0.000163,
-        },
-        {
-          time_stamp: "20220112155000",
-          tv_ratings: 0.000161,
-        },
-        {
-          time_stamp: "20220112155100",
-          tv_ratings: 0.000161,
-        },
-        {
-          time_stamp: "20220112155200",
-          tv_ratings: 0.000156,
-        },
-        {
-          time_stamp: "20220112155300",
-          tv_ratings: 0.000151,
-        },
-        {
-          time_stamp: "20220112155400",
-          tv_ratings: 0.000144,
-        },
-        {
-          time_stamp: "20220112155500",
-          tv_ratings: 0.00014,
-        },
-        {
-          time_stamp: "20220112155600",
-          tv_ratings: 0.000134,
-        },
-        {
-          time_stamp: "20220112155700",
-          tv_ratings: 0.000124,
-        },
-        {
-          time_stamp: "20220112155800",
-          tv_ratings: 0.000122,
-        },
-        {
-          time_stamp: "20220112155900",
-          tv_ratings: 0.00012,
-        },
-        {
-          time_stamp: "20220112160000",
-          tv_ratings: 0.00012,
-        },
-        {
-          time_stamp: "20220112160100",
-          tv_ratings: 0.000118,
-        },
-        {
-          time_stamp: "20220112160200",
-          tv_ratings: 0.000113,
-        },
-        {
-          time_stamp: "20220112160300",
-          tv_ratings: 0.000108,
-        },
-        {
-          time_stamp: "20220112160400",
-          tv_ratings: 0.000111,
-        },
-        {
-          time_stamp: "20220112160500",
-          tv_ratings: 0.000111,
-        },
-        {
-          time_stamp: "20220112160600",
-          tv_ratings: 0.000111,
-        },
-        {
-          time_stamp: "20220112160700",
-          tv_ratings: 0.000111,
-        },
-        {
-          time_stamp: "20220112160800",
-          tv_ratings: 0.000107,
-        },
-        {
-          time_stamp: "20220112160900",
-          tv_ratings: 0.000104,
-        },
-        {
-          time_stamp: "20220112161000",
-          tv_ratings: 0.000107,
-        },
-        {
-          time_stamp: "20220112161100",
-          tv_ratings: 0.000116,
-        },
-        {
-          time_stamp: "20220112161200",
-          tv_ratings: 0.000118,
-        },
-        {
-          time_stamp: "20220112161300",
-          tv_ratings: 0.000117,
-        },
-        {
-          time_stamp: "20220112161400",
-          tv_ratings: 0.000131,
-        },
-        {
-          time_stamp: "20220112161500",
-          tv_ratings: 0.000136,
-        },
-        {
-          time_stamp: "20220112161600",
-          tv_ratings: 0.000137,
-        },
-        {
-          time_stamp: "20220112161700",
-          tv_ratings: 0.000135,
-        },
-        {
-          time_stamp: "20220112161800",
-          tv_ratings: 0.00014,
-        },
-        {
-          time_stamp: "20220112161900",
-          tv_ratings: 0.000139,
-        },
-        {
-          time_stamp: "20220112162000",
-          tv_ratings: 0.000135,
-        },
-        {
-          time_stamp: "20220112162100",
-          tv_ratings: 0.000133,
-        },
-        {
-          time_stamp: "20220112162200",
-          tv_ratings: 0.000139,
-        },
-        {
-          time_stamp: "20220112162300",
-          tv_ratings: 0.000137,
-        },
-        {
-          time_stamp: "20220112162400",
-          tv_ratings: 0.00014,
-        },
-        {
-          time_stamp: "20220112162500",
-          tv_ratings: 0.000147,
-        },
-        {
-          time_stamp: "20220112162600",
-          tv_ratings: 0.000144,
-        },
-        {
-          time_stamp: "20220112162700",
-          tv_ratings: 0.00014,
-        },
-        {
-          time_stamp: "20220112162800",
-          tv_ratings: 0.000145,
-        },
-        {
-          time_stamp: "20220112162900",
-          tv_ratings: 0.00014,
-        },
-        {
-          time_stamp: "20220112163000",
-          tv_ratings: 0.000143,
-        },
-        {
-          time_stamp: "20220112163100",
-          tv_ratings: 0.000148,
-        },
-      ],
-      subsection: [
-        {
-          start_x: "20220112154600",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.3333333333333333,
-            },
-            {
-              channel: "云南卫视",
-              value: 0.05263157894736842,
-              epg_name: "雪豹 26 27 28 29 30",
-            },
-            {
-              channel: "甘肃卫视",
-              value: 0.017543859649122806,
-              epg_name: "烈火刀影 62 63 64 65 66",
-            },
-            {
-              channel: "CCTV-3",
-              value: 0.017543859649122806,
-              epg_name: "我爱满堂彩",
-            },
-            {
-              channel: "CCTV-4",
-              value: 0.017543859649122806,
-              epg_name: "大决战 38 39 40 41 42",
-            },
-          ],
-          input: [
-            {
-              channel: "东南卫视",
-              value: 0.07017543859649122,
-              epg_name: "西游记 ",
-            },
-            {
-              channel: "天津卫视",
-              value: 0.03508771929824561,
-              epg_name: "娘道 52 53 54 55 56 57",
-            },
-            {
-              channel: "湖南金鹰卡通频道",
-              value: 0.03508771929824561,
-              epg_name: "熊出没之丛林总动员",
-            },
-            {
-              channel: "内蒙古卫视",
-              value: 0.03508771929824561,
-              epg_name: "正阳门下 11 12 13 14 15 16 17",
-            },
-            {
-              channel: "河南卫视",
-              value: 0.03508771929824561,
-              epg_name: "济公游记 ",
-            },
-          ],
-          in: 0.43859649122807015,
-          end_x: "20220112155100",
-          start_y: 0.000166,
-          end_y: 0.000161,
-          out: 0.5614035087719298,
-        },
-        {
-          start_x: "20220112155100",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.32727272727272727,
-            },
-            {
-              channel: "湖南金鹰卡通频道",
-              value: 0.06363636363636363,
-              epg_name: "熊出没之丛林总动员",
-            },
-            {
-              channel: "北京卫视",
-              value: 0.01818181818181818,
-              epg_name: "父母爱情 36 37 38 39 40",
-            },
-            {
-              channel: "卡酷少儿",
-              value: 0.01818181818181818,
-              epg_name: "熊出没之丛林总动员",
-            },
-            {
-              channel: "海南卫视",
-              value: 0.01818181818181818,
-              epg_name: "隋唐英雄 24 25 26 27 28 29",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.1,
-            },
-            {
-              channel: "CCTV-新闻",
-              value: 0.02727272727272727,
-              epg_name: "新闻直播间",
-            },
-            {
-              channel: "云南卫视",
-              value: 0.02727272727272727,
-              epg_name: "雪豹 26 27 28 29 30",
-            },
-            {
-              channel: "CCTV-6",
-              value: 0.01818181818181818,
-              epg_name: "新兵正传3",
-            },
-            {
-              channel: "山东卫视",
-              value: 0.01818181818181818,
-              epg_name: "伪装者 ",
-            },
-          ],
-          in: 0.2818181818181818,
-          end_x: "20220112160300",
-          start_y: 0.000161,
-          end_y: 0.000108,
-          out: 0.7181818181818181,
-        },
-        {
-          start_x: "20220112160300",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.20689655172413793,
-            },
-            {
-              channel: "广东卫视",
-              value: 0.034482758620689655,
-              epg_name: "东北剿匪记 7 8 9 10 11 12",
-            },
-            {
-              channel: "湖南金鹰卡通频道",
-              value: 0.017241379310344827,
-              epg_name: "熊出没之丛林总动员",
-            },
-            {
-              channel: "海南卫视",
-              value: 0.017241379310344827,
-              epg_name: "隋唐英雄 24 25 26 27 28 29",
-            },
-            {
-              channel: "嘉佳卡通频道",
-              value: 0.017241379310344827,
-              epg_name: "熊熊乐园",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.10344827586206896,
-            },
-            {
-              channel: "CCTV-新闻",
-              value: 0.05172413793103448,
-              epg_name: "新闻直播间",
-            },
-            {
-              channel: "辽宁卫视",
-              value: 0.034482758620689655,
-              epg_name: "守婚如玉 37 38 39 40",
-            },
-            {
-              channel: "四川卫视",
-              value: 0.034482758620689655,
-              epg_name: "飞虎队 23 24 25 26 27 28 29 30 31 32 33",
-            },
-            {
-              channel: "江苏卫视",
-              value: 0.034482758620689655,
-              epg_name: "新相亲大会第四季",
-            },
-          ],
-          in: 0.46551724137931033,
-          end_x: "20220112160900",
-          start_y: 0.000108,
-          end_y: 0.000104,
-          out: 0.5344827586206896,
-        },
-        {
-          start_x: "20220112160900",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.13978494623655913,
-            },
-            {
-              channel: "四川卫视",
-              value: 0.03225806451612903,
-              epg_name: "飞虎队 23 24 25 26 27 28 29 30 31 32 33",
-            },
-            {
-              channel: "湖北卫视",
-              value: 0.021505376344086023,
-              epg_name: "黑狐 9 10 11 12 13",
-            },
-            {
-              channel: "卡酷少儿",
-              value: 0.010752688172043012,
-              epg_name: "熊出没之丛林总动员",
-            },
-            {
-              channel: "CCTV-4",
-              value: 0.010752688172043012,
-              epg_name: "大决战 38 39 40 41 42",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.10752688172043011,
-            },
-            {
-              channel: "山西卫视",
-              value: 0.10752688172043011,
-              epg_name: "铁道游击队 33 34 35 36",
-            },
-            {
-              channel: "新疆卫视",
-              value: 0.07526881720430108,
-              epg_name: "神探狄仁杰2 32 33 34",
-            },
-            {
-              channel: "北京卫视",
-              value: 0.053763440860215055,
-              epg_name: "父母爱情 36 37 38 39 40",
-            },
-            {
-              channel: "CCTV-新闻",
-              value: 0.03225806451612903,
-              epg_name: "新闻直播间",
-            },
-          ],
-          in: 0.6881720430107527,
-          end_x: "20220112161800",
-          start_y: 0.000104,
-          end_y: 0.00014,
-          out: 0.3118279569892473,
-        },
-        {
-          start_x: "20220112161800",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.09433962264150944,
-            },
-            {
-              channel: "四川卫视",
-              value: 0.05660377358490566,
-              epg_name: "飞虎队 23 24 25 26 27 28 29 30 31 32 33",
-            },
-            {
-              channel: "广西卫视",
-              value: 0.03773584905660377,
-              epg_name: "铁道风云 16 17 18 19 20",
-            },
-            {
-              channel: "CCTV-2",
-              value: 0.03773584905660377,
-              epg_name: "正点财经",
-            },
-            {
-              channel: "CCTV-8",
-              value: 0.03773584905660377,
-              epg_name: "星推荐",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.07547169811320754,
-            },
-            {
-              channel: "浙江卫视",
-              value: 0.03773584905660377,
-              epg_name: "输赢 33 34 35",
-            },
-            {
-              channel: "CCTV-3",
-              value: 0.018867924528301886,
-              epg_name: "我爱满堂彩",
-            },
-            {
-              channel: "江西卫视",
-              value: 0.018867924528301886,
-              epg_name: "狙击手 11 12 13 14 15",
-            },
-            {
-              channel: "CCTV-4",
-              value: 0.018867924528301886,
-              epg_name: "大决战 38 39 40 41 42",
-            },
-          ],
-          in: 0.3584905660377358,
-          end_x: "20220112162100",
-          start_y: 0.00014,
-          end_y: 0.000133,
-          out: 0.6415094339622641,
-        },
-        {
-          start_x: "20220112162100",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.038461538461538464,
-            },
-            {
-              channel: "天津卫视",
-              value: 0.038461538461538464,
-              epg_name: "娘道 52 53 54 55 56 57",
-            },
-            {
-              channel: "CCTV-1",
-              value: 0.02564102564102564,
-              epg_name: "夺金 23 24 25 26",
-            },
-            {
-              channel: "CCTV-4",
-              value: 0.02564102564102564,
-              epg_name: "大决战 38 39 40 41 42",
-            },
-            {
-              channel: "山东卫视",
-              value: 0.02564102564102564,
-              epg_name: "伪装者 ",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.20512820512820512,
-            },
-            {
-              channel: "山西卫视",
-              value: 0.05128205128205128,
-              epg_name: "铁道游击队 33 34 35 36",
-            },
-            {
-              channel: "CCTV-17",
-              value: 0.038461538461538464,
-              epg_name: "最美的青春 10 11 12 13",
-            },
-            {
-              channel: "江苏卫视",
-              value: 0.038461538461538464,
-              epg_name: "新相亲大会第四季",
-            },
-            {
-              channel: "CCTV-新闻",
-              value: 0.02564102564102564,
-              epg_name: "新闻直播间",
-            },
-          ],
-          in: 0.6410256410256411,
-          end_x: "20220112162500",
-          start_y: 0.000133,
-          end_y: 0.000147,
-          out: 0.358974358974359,
-        },
-        {
-          start_x: "20220112162500",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.12280701754385964,
-            },
-            {
-              channel: "青海卫视",
-              value: 0.05263157894736842,
-              epg_name: "康熙微服私访记4 27 28 29 30 31",
-            },
-            {
-              channel: "内蒙古卫视",
-              value: 0.03508771929824561,
-              epg_name: "正阳门下 11 12 13 14 15 16 17",
-            },
-            {
-              channel: "四川卫视",
-              value: 0.03508771929824561,
-              epg_name: "飞虎队 23 24 25 26 27 28 29 30 31 32 33",
-            },
-            {
-              channel: "CCTV-新闻",
-              value: 0.03508771929824561,
-              epg_name: "新闻直播间",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.14035087719298245,
-            },
-            {
-              channel: "CCTV-4",
-              value: 0.07017543859649122,
-              epg_name: "大决战 38 39 40 41 42",
-            },
-            {
-              channel: "青海卫视",
-              value: 0.03508771929824561,
-              epg_name: "康熙微服私访记4 27 28 29 30 31",
-            },
-            {
-              channel: "天津卫视",
-              value: 0.017543859649122806,
-              epg_name: "娘道 52 53 54 55 56 57",
-            },
-            {
-              channel: "广西卫视",
-              value: 0.017543859649122806,
-              epg_name: "铁道风云 16 17 18 19 20",
-            },
-          ],
-          in: 0.42105263157894735,
-          end_x: "20220112162700",
-          start_y: 0.000147,
-          end_y: 0.00014,
-          out: 0.5789473684210527,
-        },
-        {
-          start_x: "20220112162700",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.07407407407407407,
-            },
-            {
-              channel: "甘肃卫视",
-              value: 0.037037037037037035,
-              epg_name: "烈火刀影 62 63 64 65 66",
-            },
-            {
-              channel: "CCTV-3",
-              value: 0.037037037037037035,
-              epg_name: "我爱满堂彩",
-            },
-            {
-              channel: "内蒙古卫视",
-              value: 0.037037037037037035,
-              epg_name: "正阳门下 11 12 13 14 15 16 17",
-            },
-            {
-              channel: "山西卫视",
-              value: 0.037037037037037035,
-              epg_name: "铁道游击队 33 34 35 36",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.1111111111111111,
-            },
-            {
-              channel: "吉林卫视",
-              value: 0.1111111111111111,
-              epg_name: "飞哥大英雄 44 45 46 47",
-            },
-            {
-              channel: "广西卫视",
-              value: 0.037037037037037035,
-              epg_name: "铁道风云 16 17 18 19 20",
-            },
-            {
-              channel: "青海卫视",
-              value: 0.037037037037037035,
-              epg_name: "康熙微服私访记4 27 28 29 30 31",
-            },
-            {
-              channel: "东方卫视",
-              value: 0.037037037037037035,
-              epg_name: "三生有幸遇上你 ",
-            },
-          ],
-          in: 0.48148148148148145,
-          end_x: "20220112162800",
-          start_y: 0.00014,
-          end_y: 0.000145,
-          out: 0.5185185185185185,
-        },
-        {
-          start_x: "20220112162800",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.05405405405405406,
-            },
-            {
-              channel: "深圳卫视",
-              value: 0.05405405405405406,
-              epg_name: "新世界 49 50 51 52 53",
-            },
-            {
-              channel: "湖北卫视",
-              value: 0.05405405405405406,
-              epg_name: "黑狐 9 10 11 12 13",
-            },
-            {
-              channel: "内蒙古卫视",
-              value: 0.05405405405405406,
-              epg_name: "正阳门下 11 12 13 14 15 16 17",
-            },
-            {
-              channel: "安徽卫视",
-              value: 0.02702702702702703,
-              epg_name: "黑狐 ",
-            },
-          ],
-          input: [
-            {
-              channel: "开启直播",
-              value: 0.24324324324324326,
-            },
-            {
-              channel: "江苏卫视",
-              value: 0.08108108108108109,
-              epg_name: "我的前半生 ",
-            },
-            {
-              channel: "青海卫视",
-              value: 0.05405405405405406,
-              epg_name: "康熙微服私访记4 27 28 29 30 31",
-            },
-            {
-              channel: "CCTV-新闻",
-              value: 0.02702702702702703,
-              epg_name: "新闻直播间",
-            },
-            {
-              channel: "海南卫视",
-              value: 0.02702702702702703,
-              epg_name: "隋唐英雄 24 25 26 27 28 29",
-            },
-          ],
-          in: 0.5405405405405406,
-          end_x: "20220112162900",
-          start_y: 0.000145,
-          end_y: 0.00014,
-          out: 0.4594594594594595,
-        },
-        {
-          start_x: "20220112162900",
-          output: [
-            {
-              channel: "退出直播",
-              value: 0.05,
-            },
-            {
-              channel: "青海卫视",
-              value: 0.05,
-              epg_name: "康熙微服私访记4 27 28 29 30 31",
-            },
-            {
-              channel: "深圳卫视",
-              value: 0.025,
-              epg_name: "新世界 49 50 51 52 53",
-            },
-            {
-              channel: "卡酷少儿",
-              value: 0.025,
-              epg_name: "熊出没之丛林总动员",
-            },
-            {
-              channel: "CCTV-4",
-              value: 0.025,
-              epg_name: "大决战 38 39 40 41 42",
-            },
-          ],
-          input: [
-            {
-              channel: "海南卫视",
-              value: 0.1,
-              epg_name: "隋唐英雄 24 25 26 27 28 29",
-            },
-            {
-              channel: "开启直播",
-              value: 0.075,
-            },
-            {
-              channel: "青海卫视",
-              value: 0.075,
-              epg_name: "康熙微服私访记4 27 28 29 30 31",
-            },
-            {
-              channel: "CCTV-3",
-              value: 0.05,
-              epg_name: "我爱满堂彩",
-            },
-            {
-              channel: "四川卫视",
-              value: 0.05,
-              epg_name: "飞虎队 23 24 25 26 27 28 29 30 31 32 33",
-            },
-          ],
-          in: 0.6,
-          end_x: "20220112163100",
-          start_y: 0.00014,
-          end_y: 0.000148,
-          out: 0.4,
-        },
-      ],
+      tableData: [],
+      subsection: [],
     };
   },
   mounted() {},
   computed: {
-    channelList() {
-      return config.channelNameList;
-    },
     chartKeys() {
       return [
         {
@@ -889,25 +81,61 @@ export default {
         },
       ];
     },
-    cycle() {
-      return config.cycle;
-    },
     region() {
       return config.region;
     },
   },
   methods: {
-    onExport() {},
-    disabledDate(time) {
-      return time.getTime() > Date.now() - 86400000;
+    change(li) {
+      this.form.programLi = li || [];
+    },
+    querySearchAsync(queryString, cb) {
+      if (!queryString) {
+        cb([]);
+        return;
+      }
+      overlapSearchTitle("kw=" + queryString + "&ft=1").then(r => {
+        let li = (r || []).map(v => {
+          return {
+            value: v.name,
+            id: v.id,
+          };
+        });
+        cb(li);
+      });
+    },
+    handleSelect(item) {
+      epgAggregate("ca_id=" + item.id).then(res => {
+        this.lmList = res || [];
+      });
+    },
+    onSubmit() {
+      let programLi = this.form.programLi || [{}];
+      console.log(programLi[0]);
+      // if (programLi.length !== 1)
+      // return ElNotification({
+      //   message: "请选择一个节目",
+      //   title: "Warning",
+      //   type: "warning",
+      // });
+      singleProgram(
+        "epg_ids=" +
+          (programLi[0] ? programLi[0].epg_id : "") +
+          "&area_id=" +
+          this.form.region
+      ).then(r => {
+        console.log(r);
+        const li = {
+          high_low: r ? r.high_low || [] : [],
+          list: r ? r.list || [] : [],
+        };
+        this.tableData = li.list;
+        this.subsection = li.high_low;
+      });
     },
-    onSubmit() {},
     matrer(row, column, cellValue) {
       return (cellValue * 100).toFixed(4) - 0 + "%";
     },
-    channelSelect(a) {
-      this.selectAll(a, "channel", 0);
-    },
     selectAll(a, key, val) {
       if (!a.length) return;
       let select = a[a.length - 1];
@@ -919,7 +147,7 @@ export default {
           .split(",");
     },
   },
-  components: { flowCharts },
+  components: { flowCharts, Programcom },
 };
 </script>
 

+ 92 - 0
src/views/Flow/components/popver.vue

@@ -0,0 +1,92 @@
+<template>
+  <div class="local_popver">
+    <div class="local_title" @click="showClick">
+      <span>
+        {{ titles.length ? title : placeholder || "请选择" }}
+        <el-tag v-if="titles.length > 1">+ {{ titles.length - 1 }}</el-tag>
+      </span>
+      <el-icon :size="14" color="#c0c4cc" style="padding-top: 0px;vertical-align: middle;">
+        <arrow-up v-show="card" />
+        <arrow-down v-show="!card" />
+      </el-icon>
+    </div>
+    <el-card v-show="card" style="position: absolute;z-index:10">
+      <div style="width: 300px">
+        <el-checkbox-group v-model="titles">
+          <el-checkbox v-for="item in list" :key="item.id" :label="item.name">
+            {{ item.name }}
+          </el-checkbox>
+        </el-checkbox-group>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+// @ is an alias to /src
+
+import { ArrowDown, ArrowUp } from "@element-plus/icons-vue";
+// import config from "@/config/index";
+export default {
+  name: "Channel",
+  props: {
+    list: {
+      type: Array,
+      default: () => [],
+    },
+    placeholder: String,
+  },
+  data() {
+    return {
+      titles: [],
+      card: false,
+    };
+  },
+  watch:{
+      titles(){
+          this.$emit("changeEvent", this.titles)
+      }
+  },
+  mounted() {},
+  computed: {
+    title() {
+      if (this.titles.length > 1) return this.titles[0] + "";
+      return this.titles.join(",");
+    },
+  },
+  methods: {
+    onSubmit() {},
+    showClick() {
+      this.card = !this.card;
+      if (!this.card) return;
+      document.body.addEventListener("click", this.showClickFunc, true);
+    },
+    showClickFunc(e) {
+      let classnames = [];
+      for (let i = 0; i < e.path.length; i++) {
+        const v = e.path[i];
+        const classList = v.classList || [];
+        for (let o = 0; o < classList.length; o++) {
+          const p = v.classList[o];
+          classnames.push(p);
+        }
+      }
+      classnames = classnames.join(",");
+      if (/card__body/g.test(classnames)) return;
+      this.card = false;
+      document.body.removeEventListener("click", this.showClickFunc, true);
+    },
+  },
+  components: { ArrowDown, ArrowUp },
+};
+</script>
+
+<style scoped>
+.local_popver {
+  position: relative;
+}
+.local_title {
+  padding: 3px 10px;
+  cursor: pointer;
+}
+</style>

+ 316 - 0
src/views/Flow/components/programs.vue

@@ -0,0 +1,316 @@
+<template>
+  <el-popover
+    placement="bottom"
+    :visible="visible"
+    :width="800"
+    trigger="click"
+  >
+    <template #reference>
+      <div
+        v-text="program || '请选择节目'"
+        class="el-input__inner"
+        @click="visible = !visible"
+        style="height: 33px;line-height: 33px;min-width: 220px;cursor: pointer;"
+      ></div>
+    </template>
+    <el-form :inline="true" size="small" :model="form" class="demo-form-inline">
+      <el-form-item label="">
+        <el-date-picker
+          v-model="form.data"
+          type="daterange"
+          @change="dateChange"
+          range-separator="-"
+          :disabled-date="disabledDate"
+          start-placeholder="开始时间"
+          end-placeholder="结束时间"
+        />
+      </el-form-item>
+      <el-form-item label="">
+        <local-popver
+          placeholder="请选择频道"
+          @changeEvent="changeChannel"
+          :list="channelList"
+        />
+      </el-form-item>
+      <el-form-item label="">
+        <local-popver
+          placeholder="请选择时间"
+          @changeEvent="changeTime"
+          :list="timeList"
+        />
+      </el-form-item>
+      <el-form-item label="">
+        <local-popver
+          placeholder="请选择星期"
+          @changeEvent="changeWeek"
+          :list="weeks"
+        />
+      </el-form-item>
+      <el-form-item label="">
+        <el-select
+          v-model="form.times"
+          @change="changeTimes"
+          style="width: 120px;"
+          class="programsinput"
+          placeholder="请选择频次"
+        >
+          <el-option
+            v-for="item in firstFrequency"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <el-table
+      ref="table"
+      @selection-change="handleSelectionChange"
+      :data="tableList"
+      height="300"
+    >
+      <el-table-column type="selection" width="55" />
+      <el-table-column
+        property="epg_name"
+        show-overflow-tooltip
+        label="节目"
+      ></el-table-column>
+      <el-table-column
+        property="tv_name"
+        show-overflow-tooltip
+        label="频道"
+      ></el-table-column>
+      <el-table-column
+        property="weekday"
+        show-overflow-tooltip
+        label="星期"
+      ></el-table-column>
+      <el-table-column
+        property="start_time"
+        show-overflow-tooltip
+        label="时间"
+        width="300"
+      >
+        <template #default="scope">
+          {{ scope.row.start_time.replace(/:00$/, "") }} -
+          {{ scope.row.end_time.replace(/:00$/, "") }}
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @current-change="handleCurrentChange"
+      :currentPage="page"
+      layout="prev, pager, next"
+      :total="total"
+    ></el-pagination>
+    <div class="progtamsfooter">
+      <el-row class="mb-4">
+        <el-button @click="visible = false">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </el-row>
+    </div>
+  </el-popover>
+</template>
+
+<script>
+// @ is an alias to /src
+
+import config from "@/config/index";
+
+import localPopver from "./popver.vue";
+import { ElNotification } from "element-plus";
+let selectTable = [];
+export default {
+  name: "Channel",
+  data() {
+    return {
+      form: {
+        times: 0,
+      },
+      program: "",
+      li: [],
+      page: 1,
+      visible: false,
+      size: 10,
+    };
+  },
+  props: ["list"],
+  emits: ["change"],
+  watch: {
+    list() {
+      if (!this.list || !this.list.length) return;
+      this.li = this.list;
+    },
+  },
+  mounted() {
+      selectTable = [];
+  },
+  computed: {
+    channelList() {
+      return this.li.map(v => {
+        return {
+          name: v.tv_name,
+          id: v.tv_id,
+        };
+      });
+    },
+    tableList() {
+      let l = [],
+        n = 0,
+        channel = (this.form.channel || []).join(",") + ",",
+        data = this.form.data || [],
+        time = this.form.time || [],
+        week = this.form.week || [],
+        rtmes = this.form.times || 0;
+      if (channel === ",") channel = "";
+      for (let i = 0; i < this.li.length; i++) {
+        const v = this.li[i],
+          exg = new RegExp(v.tv_name + ",", "g");
+        if (channel && !exg.test(channel)) continue;
+        for (let o = 0; o < (v.epg_list || []).length; o++) {
+          const item = (v.epg_list || [])[o];
+          if (data.length && !this.At(item.start_time, item.end_time, data))
+            continue;
+          if (time.length && !this.Attime(item.start_time, item.end_time, time))
+            continue;
+          if (week.length && !this.Atweek(item.weekday)) continue;
+          if (rtmes != 0 && item.is_live != rtmes ) continue;
+          ++n;
+          if (n <= this.page * this.size - this.size) continue;
+          if (n > this.page * this.size) break;
+          l.push(item);
+        }
+      }
+      return l;
+    },
+    total() {
+      let t = 0,
+        channel = (this.form.channel || []).join(",") + ",",
+        data = this.form.data || [],
+        time = this.form.time || [],
+        week = this.form.week || [],
+        rtmes = this.form.times || 0;
+      if (channel === ",") channel = "";
+      for (let i = 0; i < this.li.length; i++) {
+        const v = this.li[i],
+          exg = new RegExp(v.tv_name + ",", "g");
+        if (channel && !exg.test(channel)) continue;
+        for (let o = 0; o < (v.epg_list || []).length; o++) {
+          const item = (v.epg_list || [])[o];
+          if (data.length > 0 && !this.At(item.start_time, item.end_time, data))
+            continue;
+          if (time.length && !this.Attime(item.start_time, item.end_time, time))
+            continue;
+          if (week.length && !this.Atweek(item.weekday)) continue;
+          if (rtmes != 0 && item.is_live != rtmes ) continue;
+          t++;
+        }
+      }
+      return t;
+    },
+
+    timeList() {
+      let li = new Array(24);
+      li.fill(0);
+      for (let i = 0; i < 24; i++) {
+        li[i] = {
+          name: i,
+          id: i,
+        };
+      }
+      return li;
+    },
+    weeks() {
+      return config.weeks.map(v => {
+        return {
+          name: v.label,
+          id: v.value,
+        };
+      });
+    },
+    firstFrequency() {
+      return config.frequency;
+    },
+  },
+  methods: {
+    handleSelectionChange(val) {
+      selectTable = val || [];
+    },
+    onSubmit() {
+      if (selectTable.length > 1)
+        return ElNotification({
+          message: "请选择一个节目",
+          title: "Warning",
+          type: "warning",
+        });
+      this.visible = false;
+      this.program = selectTable[0].epg_name
+      this.$emit("change", selectTable);
+    },
+    disabledDate(time) {
+      return time.getTime() > Date.now();
+    },
+    handleCurrentChange(p) {
+      this.page = p;
+    },
+    dateChange() {
+      this.page = 1;
+    },
+    changeChannel(li) {
+      this.page = 1;
+      this.form.channel = li;
+    },
+    changeTime(li) {
+      this.page = 1;
+      this.form.time = li;
+    },
+    changeWeek(li) {
+      this.page = 1;
+      this.form.week = li;
+    },
+    changeTimes(li) {
+      this.page = 1;
+      console.log(li);
+    },
+    At(sT, eT, rang) {
+      if (!rang.length) return false;
+      let s = new Date(sT.split(" ")[0] + " 00:00:00");
+      let e = new Date(eT.split(" ")[0] + " 00:00:00");
+      let start = s <= rang[1] - 0 && s >= rang[0] - 0;
+      let end = e <= rang[1] - 0 && e >= rang[0] - 0;
+      return start || end;
+    },
+    Attime(sT, eT, rang) {
+      let out = false;
+      if (!rang.length) return out;
+      let s = sT.split(" ")[1].split(":");
+      let e = eT.split(" ")[1].split(":");
+      for (let i = 0; i < rang.length; i++) {
+        const v = rang[i];
+        if (v === s[0] - 0 || v === e[0] - 0) {
+          out = true;
+          break;
+        }
+      }
+      return out;
+    },
+    Atweek(w) {
+      const exg = new RegExp(w + ",", "g"),
+        weeks = (this.form.week || []).join(",") + ",";
+      return exg.test(weeks);
+    },
+  },
+  components: { localPopver },
+};
+</script>
+
+<style>
+.programsinput .el-input__inner {
+  border: none;
+}
+.progtamsfooter {
+  padding: 10px 0;
+  text-align: center;
+}
+</style>

+ 16 - 1
src/views/Scheduling/Scheduling.vue

@@ -118,6 +118,9 @@ import {
   summary,
   program,
   programs,
+  summaryExport,
+  programExport,
+  programsExport
 } from "@/api/kuyun";
 
 // import lineCharts from "@/views/Country/components/lineCharts";
@@ -425,7 +428,19 @@ export default {
         cb(li);
       });
     },
-    onExport() {},
+    onExport() {
+      let programLi = this.form.programLi || [{}];
+      const apis = [summaryExport, program, programs];
+      const apistext = [summaryExport, programExport, programsExport];
+      console.log(programLi[0]);
+      let epg = "epg_id=" + +(programLi[0] ? programLi[0].epg_id : "");
+      if (this.radio == 2)
+        epg = "epg_ids=" + +(programLi[0] ? programLi[0].epg_id : "");
+      apis[this.radio](
+        epg + "&area_id=" + this.form.region+"&domain=pro.eye.kuyun.com%2F&download=csv&page_no=1&page_size=10000",
+        "电视剧排播信息及表现(全国)-"+apistext[this.radio] + ".csv"
+      );
+    },
     onSubmit() {
       let programLi = this.form.programLi || [{}];
       const apis = [summary, program, programs];