import { defineComponent as q, computed as I, ref as c, onMounted as Y, onUnmounted as ot, createElementBlock as p, openBlock as a, createElementVNode as r, Fragment as V, renderList as D, normalizeClass as N, toDisplayString as F, withDirectives as x, vModelText as et, createCommentVNode as C, withModifiers as J, vShow as j } from "vue";
import "../../text-text-basic/index.mjs";
import "../../text-table-basic/index.mjs";
import "../../chart-other-gauge/index.mjs";
import "../../chart-other-gauge-stage/index.mjs";
import "../../chart-other-gauge-grade/index.mjs";
import "../../chart-other-word-cloud/index.mjs";
import "../../chart-other-liquidfill/index.mjs";
import "../../chart-other-funnel/index.mjs";
import "../../chart-other-force/index.mjs";
import "../../chart-other-radar/index.mjs";
import "../../chart-other-funnel-split/index.mjs";
import "../../chart-other-funnel-contrast/index.mjs";
import "../../chart-other-candlestick-basic/index.mjs";
import "../../chart-other-candlestick-shanghai/index.mjs";
import "../../chart-other-candlestick-demo/index.mjs";
import "../../chart-other-heatmap/index.mjs";
import "../../chart-other-force2/index.mjs";
import "../../chart-other-graph-basic/index.mjs";
import "../../chart-other-graph-basic2/index.mjs";
import "../../chart-other-graph-calendar/index.mjs";
import "../../chart-other-tree-line/index.mjs";
import "../../chart-other-treemap-basic/index.mjs";
import "../../chart-other-sunburst-basic/index.mjs";
import "../../chart-other-sunburst-basic2/index.mjs";
import "../../chart-other-sunburst-basic3/index.mjs";
import "../../chart-other-sunburst-basic4/index.mjs";
import "../../chart-other-sunburst-book/index.mjs";
import "../../chart-other-sunburst-radius/index.mjs";
import "../../chart-other-sunburst-flavors/index.mjs";
import "../../chart-other-parallel-basic/index.mjs";
import "../../chart-other-parallel-mul/index.mjs";
import "../../chart-other-circular-graph/index.mjs";
import "../../map-earth-basic/index.mjs";
import "../../map-earth-cool-tech/index.mjs";
import "../../map-earth-particle/index.mjs";
import "../../map-earth-hacker/index.mjs";
import "../../map-earth-fly-line/index.mjs";
import "../../chart-other-grid-percentage/index.mjs";
import "../../chart-other-radar-stack/index.mjs";
import "../../chart-other-funnel2/index.mjs";
import "../../chart-other-label-gauge/index.mjs";
import "../../chart-other-theme-river/index.mjs";
import "../../chart-other-tree/index.mjs";
import "../../chart-other-treemap/index.mjs";
import "../../commons-product-model/index.mjs";
import "../../commons-vr-photo/index.mjs";
import "../../commons-vr-video/index.mjs";
import "../../commons-three-loader/index.mjs";
import "../../commons-three-loader3/index.mjs";
import "../../commons-loop-iterator/index.mjs";
import "../../commons-gaussian-splatting-view/index.mjs";
import "../../commons-babylon/index.mjs";
import "../../commons-svg/index.mjs";
import "../../commons-weather/index.mjs";
import "../../commons-weather-dynamic/index.mjs";
import "../../media-wavesurfer/index.mjs";
import "../../interaction-tabs/index.mjs";
import "../../interaction-tabs2/index.mjs";
import "../../interaction-button/index.mjs";
import "../../interaction-button-image/index.mjs";
import "../../interaction-select/index.mjs";
import "../../interaction-input/index.mjs";
import "../../interaction-radio/index.mjs";
import "../../interaction-slider/index.mjs";
import "../../interaction-switch/index.mjs";
import "../../interaction-data-picker/index.mjs";
import "../../interaction-button-refresh/index.mjs";
import "../../media-image/index.mjs";
import "../../text-title/index.mjs";
import "../../commons-qrcode/index.mjs";
import "../../media-video/index.mjs";
import "../../media-audio/index.mjs";
import "../../text-real-time/index.mjs";
import "../../media-carousel/index.mjs";
import "../../media-carousel-slides/index.mjs";
import "../../media-iframe-carousel/index.mjs";
import "../../media-iframe/index.mjs";
import "../../media-m3u8/index.mjs";
import "../../media-m3u8-dynamic/index.mjs";
import "../../media-audio-dynamic/index.mjs";
import "../../media-video-dynamic/index.mjs";
import "../../media-image-dynamic/index.mjs";
import "../../media-iframe-dynamic/index.mjs";
import "../../media-flv/index.mjs";
import "../../commons-echarts/index.mjs";
import "../../text-over-number/index.mjs";
import "../../text-table-scroll/index.mjs";
import "../../text-carousel/index.mjs";
import "../../text-row-scroll/index.mjs";
import "../../text-text-dynamic/index.mjs";
import "../../text-count-down/index.mjs";
import "../../graphical-circle/index.mjs";
import "../../graphical-diamond/index.mjs";
import "../../graphical-hexagon/index.mjs";
import "../../graphical-isosceles-triangle/index.mjs";
import "../../graphical-pentagon/index.mjs";
import "../../graphical-rect/index.mjs";
import "../../graphical-right-triangle/index.mjs";
import "../../scene-map3d/index.mjs";
import "../../scene-amap2d/index.mjs";
import "../../scene-amap3d/index.mjs";
import "../../scene-vr/index.mjs";
import "../../scene-unity-iframe/index.mjs";
import "../../scene-unity-webgl/index.mjs";
import "../../scene-ue-iframe/index.mjs";
import "../../scene-ue-shj/index.mjs";
import "../../scene-default/index.mjs";
import "../../interaction/tabs/index.mjs";
import "../../interaction/tabs-icon/index.mjs";
import "../../interaction/button/index.mjs";
import "../../interaction/date-picker/src/date-picker/index.mjs";
import "../../interaction/date-picker/src/date-picker-range/index.mjs";
import "../../text/list/index.mjs";
import "../../chart/src/bar/basic/index.mjs";
import "../../chart/src/bar/animation/index.mjs";
import "../../chart/src/bar/contrast/index.mjs";
import "../../chart/src/bar/contrast2/index.mjs";
import "../../chart/src/bar/contrast3/index.mjs";
import "../../chart/src/bar/gradient-column-chart/index.mjs";
import "../../chart/src/bar/horizontal/index.mjs";
import "../../chart/src/bar/horizontal-stack/index.mjs";
import "../../chart/src/bar/line-bar/index.mjs";
import "../../chart/src/bar/line-bar2/index.mjs";
import "../../chart/src/bar/loop/index.mjs";
import "../../chart/src/bar/mini/index.mjs";
import "../../chart/src/bar/polar/index.mjs";
import "../../chart/src/bar/polar-stack/index.mjs";
import "../../chart/src/bar/polar2/index.mjs";
import "../../chart/src/bar/radius-circle/index.mjs";
import "../../chart/src/bar/rank/index.mjs";
import "../../chart/src/bar/segmented-progress/index.mjs";
import "../../chart/src/bar/spire/index.mjs";
import "../../chart/src/bar/stack/index.mjs";
import "../../chart/src/bar/stack-line/index.mjs";
import "../../chart/src/bar/stack2/index.mjs";
import "../../chart/src/bar/stack3/index.mjs";
import "../../chart/src/bar/staggered/index.mjs";
import "../../chart/src/bar/three/index.mjs";
import "../../chart/src/bar/waterfall/index.mjs";
import "../../chart/src/bar/zebra/index.mjs";
import "../../chart/src/line/area-gradient/index.mjs";
import "../../chart/src/line/area-highlight/index.mjs";
import "../../chart/src/line/area-highlight2/index.mjs";
import "../../chart/src/line/basic/index.mjs";
import "../../chart/src/line/bump/index.mjs";
import "../../chart/src/line/dashed/index.mjs";
import "../../chart/src/line/ladder/index.mjs";
import "../../chart/src/line/logarithm/index.mjs";
import "../../chart/src/line/multix/index.mjs";
import "../../chart/src/line/polar-double/index.mjs";
import "../../chart/src/line/rain-flow/index.mjs";
import "../../chart/src/line/scale/index.mjs";
import "../../chart/src/line/smooth/index.mjs";
import "../../chart/src/line/smooth-area/index.mjs";
import "../../chart/src/line/stack/index.mjs";
import "../../chart/src/line/stack-area/index.mjs";
import "../../chart/src/line/temp/index.mjs";
import "../../chart/src/line/vertical/index.mjs";
import "../../chart/src/map/basic/index.mjs";
import "../../chart/src/map/bmap-basic/index.mjs";
import "../../chart/src/map/bmap-heatmap/index.mjs";
import "../../chart/src/map/bmap-rich/index.mjs";
import "../../chart/src/map/customize/index.mjs";
import "../../chart/src/map/lines/index.mjs";
import "../../chart/src/map/scatter/index.mjs";
import "../../chart/src/pie/3d/index.mjs";
import "../../chart/src/pie/basic/index.mjs";
import "../../chart/src/pie/basic2/index.mjs";
import "../../chart/src/pie/customized/index.mjs";
import "../../chart/src/pie/index/index.mjs";
import "../../chart/src/pie/interval/index.mjs";
import "../../chart/src/pie/legend-scroll/index.mjs";
import "../../chart/src/pie/radius/index.mjs";
import "../../chart/src/pie/rose/index.mjs";
import "../../chart/src/pie/round/index.mjs";
import "../../chart/src/pie/sunburst/index.mjs";
import "../../chart/src/scatter/basic/index.mjs";
import "../../chart/src/scatter/basic2/index.mjs";
import "../../chart/src/scatter/bubble/index.mjs";
import "../../chart/src/scatter/ripples/index.mjs";
import "../../commons/custom-component-render/index.mjs";
import "../zv-hj-tree-list/index.mjs";
import "../zv-hj-model-resource/index.mjs";
import "../zv-hj-one-map-config/index.mjs";
import "../zv-hj-video-control/index.mjs";
import "../zv-hj-video-page/index.mjs";
import "../zv-hj-password-input/index.mjs";
import "../zv-hj-carousel/index.mjs";
import "../zv-hj-video-monitor/index.mjs";
import "../zv-hj-scene-amap2d/index.mjs";
import "../zv-hj-scene-amap3d/index.mjs";
import "../zv-hj-person-face/index.mjs";
import "../zv-hj-resource-type-phone/index.mjs";
import "../zv-hj-tree-list-phone/index.mjs";
import "./index.mjs";
import "../zv-hj-model-resource-phone/index.mjs";
import "../zv-hj-bottom-suspend/index.mjs";
import "../zv-hj-pagination/index.mjs";
import "../zv-hj-password-input-phone/index.mjs";
/* empty css                           */
/* empty css                                  */
import { SHJDatasourceV2 as lt } from "../../../plugins/datasource/index.mjs";
import "lodash";
import "../../../plugins/event/actions/fullScreenAction.mjs";
import { HJLYDatasourceApi as w } from "../../../plugins/datasource/hjly/index.mjs";
const rt = { class: "index" }, st = { class: "tab-box" }, pt = ["onClick"], at = { class: "tab-item" }, mt = { class: "title" }, ct = { class: "tab1" }, nt = { class: "search-box" }, ut = { class: "search" }, dt = { class: "body" }, vt = {
  key: 0,
  class: "left"
}, ht = ["onClick"], _t = {
  key: 1,
  class: "right"
}, gt = { class: "right-content" }, kt = { class: "list-item-box" }, Nt = ["onClick"], ft = { class: "item-title" }, Lt = ["onClick"], yt = {
  key: 0,
  class: "no-data"
}, Ct = {
  key: 2,
  class: "no-data"
}, bt = { class: "tab2" }, Vt = ["onClick"], Dt = { class: "item-title" }, Ft = ["onClick"], wt = {
  key: 0,
  class: "no-data middle"
}, Et = { class: "tab2" }, St = ["onClick"], Tt = { class: "item-title" }, It = ["onClick"], xt = {
  key: 0,
  class: "no-data middle"
}, $t = q({ name: "zv-hj-video-page-phone" }), Fl = /* @__PURE__ */ q({
  ...$t,
  props: {
    basicOption: {},
    sources: {},
    useEvents: {},
    uuid: {}
  },
  emits: ["on-click"],
  setup(K, { emit: At }) {
    const z = K;
    I(() => {
      var t, o, i;
      return ((i = (o = (t = d.value[0]) == null ? void 0 : t.list[b.value]) == null ? void 0 : o.list[L.value]) == null ? void 0 : i.childList) || [];
    });
    const E = I(() => {
      var t, o;
      return ((o = (t = d.value[0]) == null ? void 0 : t.list[b.value]) == null ? void 0 : o.list) || [];
    }), $ = I(() => {
      var t, o, i, e, l, s, v;
      return A.value >= 0 ? ((e = (i = (o = (t = d.value[0]) == null ? void 0 : t.list[b.value]) == null ? void 0 : o.list[L.value]) == null ? void 0 : i.childList[A.value]) == null ? void 0 : e.listDeviceVos) || [] : ((v = (s = (l = d.value[0]) == null ? void 0 : l.list[b.value]) == null ? void 0 : s.list[L.value]) == null ? void 0 : v.listDeviceVos) || [];
    }), H = I(() => {
      var o, i;
      const t = [];
      return (i = (o = d.value[0]) == null ? void 0 : o.list) == null || i.forEach((e) => {
        var l;
        (l = e == null ? void 0 : e.list) == null || l.forEach((s) => {
          var v, k;
          (v = s == null ? void 0 : s.childList) == null || v.forEach((m) => {
            var u;
            (u = m == null ? void 0 : m.listDeviceVos) == null || u.forEach((y) => {
              y != null && y.collectId && t.push(y);
            });
          }), (k = s == null ? void 0 : s.listDeviceVos) == null || k.forEach((m) => {
            m != null && m.collectId && t.push(m);
          });
        });
      }), t;
    }), Q = c([]), W = c([
      { id: 1, title: "监控列表", icon: "video-list" },
      { id: 2, title: "最近浏览", icon: "video-history" },
      { id: 3, title: "收藏夹", icon: "video-collect" }
    ]), f = c(1), S = c(null), d = c([]), b = c(0), L = c(0), A = c(-1), h = c(!0), T = c([]), _ = "视频监控中心", g = "车载视频监控", X = c(2), n = c({}), M = c(!1);
    Y(() => {
      lt.parse({
        tId: z.uuid,
        sources: z.sources,
        callback: ({ data: t }) => {
          Q.value = t[0].data;
        }
      }), U();
    });
    const Z = (t) => {
      f.value = t, t === 1 && P(), t === 2 && tt(), t === 3 && P();
    }, P = () => {
      d.value = [], n.value = {}, U();
    }, tt = (t) => {
      h.value = !0;
      {
        const o = {
          dataType: 1
        };
        w.videoPreviewList(o).then((i) => {
          const e = i == null ? void 0 : i.data;
          T.value = (e == null ? void 0 : e.list) || [];
        });
      }
      setTimeout(() => {
        h.value = !1;
      }, 2e3);
    }, O = (t, o, i, e) => {
      M.value = !0, window && window.localStorage.setItem("redStyleFullPlayInfo", JSON.stringify({ item: t, i: o, arr: i, channelId: e })), window.location.href = w.preUrl + "/subPackageB/pages/videoSurveillance/full-play?moduleStyleFunllScreen=" + M.value;
    }, B = (t) => {
      if (t.collectId) {
        const o = {
          resourceId: t.resourceId
        };
        w.videoNotCollect(o).then((i) => {
          t.collectId = null;
        });
      } else {
        const o = {
          resourceId: t == null ? void 0 : t.resourceId,
          typeId: t == null ? void 0 : t.typeId,
          videoType: (t == null ? void 0 : t.protocolId) || (t == null ? void 0 : t.videoType) || 1
        };
        w.videoCollect(o).then((i) => {
          t.collectId = 1;
        });
      }
    }, U = () => {
      h.value = !0, G({
        typeId: "27",
        // 视频监控
        checklistPatternFilerInList: [
          {
            filedName: "branchId",
            filedValue: ""
          }
        ],
        filter: S.value,
        checkListCode: "A3-05-05",
        // 视频监控模板code
        groupName: _
      }), G({
        typeId: "49",
        // 车流监控
        checklistPatternFilerInList: [],
        filter: S.value,
        checkListCode: "A3-05-07",
        // 视频监控模板code
        groupName: g,
        dutyAreaId: ""
      });
    }, G = (t) => {
      const o = {
        typeId: t.typeId,
        // 视频监控
        checklistPatternFilerInList: t.checklistPatternFilerInList,
        filter: t.filter,
        dutyAreaId: t.dutyAreaId,
        pageNo: 1,
        pageSize: 2e3,
        checkListCode: t.checkListCode || "A3-05-05"
        // 视频监控模板code/车流监控模板
      };
      w.loadCheckList(o).then((i) => {
        var s;
        const l = ((i == null ? void 0 : i.data) || {}).listRet || [];
        if (t.groupName === g && R(l), n.value[t.groupName] = l, Object.keys(n.value).length >= X.value) {
          d.value = [];
          let v = [];
          if (n.value[_] && n.value[_].length > 0)
            if (n.value[_][0].listDeviceVos.length === 0)
              v = [];
            else {
              let k = 0, m = 0;
              n.value[_].forEach((u) => {
                u.total = 0, u.lineNum = 0, u.listDeviceVos && u.listDeviceVos.forEach((y) => {
                  y.offlineFlag === 0 && (u.lineNum += 1, m++), k++, u.total++;
                });
              }), v.push({
                groupName: _,
                name: _,
                total: k || 0,
                lineNum: m,
                expendFlag: !1,
                list: n.value[_]
              });
            }
          if (n.value[g] && n.value[g].length > 0) {
            let k = 0, m = 0;
            n.value[g].forEach((u) => {
              k += u.onlineNum, m += u.totalNum;
            }), v.push({
              groupName: g,
              name: g,
              total: m,
              lineNum: k,
              expendFlag: !1,
              list: n.value[g]
            });
          }
          d.value.push({
            groupName: "监控中心",
            name: "监控中心",
            list: v
          }), window && ((s = window == null ? void 0 : window.localStorage) == null || s.setItem("previewVideoList", JSON.stringify(d.value)));
        }
        setTimeout(() => {
          h.value = !1;
        }, 2e3);
      });
    }, R = (t) => {
      var e;
      let o = 0, i = 0;
      return (e = t == null ? void 0 : t.forEach) == null || e.call(t, (l) => {
        if (l.list && l.list.forEach((s) => {
          s.isCarVideoTag = !0;
        }), l.listDeviceVos && (l.onlineNum = 0, l.totalNum = 0, l.listDeviceVos.forEach((s) => {
          s.isCarVideoTag = !0, s.offlineFlag === 0 && (o++, l.onlineNum++), i++, l.totalNum++;
        })), l.childList) {
          l.onlineNum = 0, l.totalNum = 0;
          const s = R(l.childList);
          l.onlineNum = s.onlineNum, l.totalNum = s.totalNum;
        }
      }), {
        onlineNum: o,
        totalNum: i
      };
    }, it = (t, o) => {
      L.value = o, A.value = -1;
    };
    return Y(() => {
    }), ot(() => {
    }), (t, o) => (a(), p("div", rt, [
      r("div", st, [
        (a(!0), p(V, null, D(W.value, (i, e) => (a(), p("div", {
          key: e + "A",
          class: N(["tab-item-box", [i.id === f.value ? "active" : ""]]),
          onClick: (l) => Z(i.id)
        }, [
          r("div", at, [
            r("div", {
              class: N(["icon", [i.icon]])
            }, null, 2),
            r("div", mt, F(i.title), 1)
          ])
        ], 10, pt))), 128))
      ]),
      r("div", {
        class: N(["content", [f.value == 1 ? "no-scroll" : ""]])
      }, [
        x(r("div", ct, [
          r("div", nt, [
            r("div", ut, [
              o[2] || (o[2] = r("div", { class: "icon left" }, null, -1)),
              x(r("input", {
                "onUpdate:modelValue": o[0] || (o[0] = (i) => S.value = i),
                class: "input",
                type: "text",
                placeholder: "请输入监控地点名称"
              }, null, 512), [
                [
                  et,
                  S.value,
                  void 0,
                  { trim: !0 }
                ]
              ]),
              r("div", {
                class: "text",
                onClick: o[1] || (o[1] = (i) => P())
              }),
              o[3] || (o[3] = r("div", { class: "icon right" }, null, -1))
            ])
          ]),
          r("div", dt, [
            E.value.length > 0 ? (a(), p("div", vt, [
              (a(!0), p(V, null, D(E.value, (i, e) => (a(), p("div", {
                key: e + "B",
                class: N(["left-item", [L.value == e ? "active" : ""]]),
                onClick: (l) => it(i, e)
              }, F(i.groupName), 11, ht))), 128))
            ])) : C("", !0),
            E.value.length > 0 ? (a(), p("div", _t, [
              r("div", gt, [
                o[4] || (o[4] = r("div", { class: "head-item" }, null, -1)),
                r("div", kt, [
                  (a(!0), p(V, null, D($.value, (i, e) => (a(), p("div", {
                    key: e + "D",
                    class: "list-item",
                    onClick: (l) => O(i, e, $.value, null)
                  }, [
                    r("div", ft, F(i.resourceName), 1),
                    r("div", {
                      class: N(["item-img", [i.collectId ? "collect" : ""]]),
                      onClick: J((l) => B(i), ["stop"])
                    }, null, 10, Lt)
                  ], 8, Nt))), 128))
                ]),
                $.value.length == 0 && !h.value ? (a(), p("div", yt, " 暂无数据 ")) : C("", !0),
                o[5] || (o[5] = r("div", { class: "bottom-item" }, null, -1))
              ])
            ])) : C("", !0),
            E.value.length == 0 && !h.value ? (a(), p("div", Ct, " 暂无数据 ")) : C("", !0)
          ])
        ], 512), [
          [j, f.value == 1]
        ]),
        x(r("div", bt, [
          (a(!0), p(V, null, D(T.value, (i, e) => (a(), p("div", {
            key: e + "E",
            class: "list-item",
            onClick: (l) => O(i, e, T.value, null)
          }, [
            r("div", Dt, F(i.resourceName), 1),
            r("div", {
              class: N(["item-img", [i.collectId ? "collect" : ""]]),
              onClick: J((l) => B(i), ["stop"])
            }, null, 10, Ft)
          ], 8, Vt))), 128)),
          T.value.length == 0 && !h.value ? (a(), p("div", wt, " 暂无数据 ")) : C("", !0)
        ], 512), [
          [j, f.value == 2]
        ]),
        x(r("div", Et, [
          (a(!0), p(V, null, D(H.value, (i, e) => (a(), p("div", {
            key: e + "F",
            class: "list-item",
            onClick: (l) => O(i, e, d.value[0].list[b.value].list[L.value].listDeviceVos, null)
          }, [
            r("div", Tt, F(i.resourceName), 1),
            r("div", {
              class: N(["item-img", [i.collectId ? "collect" : ""]]),
              onClick: J((l) => B(i), ["stop"])
            }, null, 10, It)
          ], 8, St))), 128)),
          H.value.length == 0 && !h.value ? (a(), p("div", xt, " 暂无数据 ")) : C("", !0)
        ], 512), [
          [j, f.value == 3]
        ])
      ], 2)
    ]));
  }
});
export {
  Fl as default
};
