import { defineComponent as K, useCssVars as ct, ref as r, watch as ut, onMounted as dt, resolveComponent as T, resolveDirective as vt, createElementBlock as l, openBlock as a, createElementVNode as t, createVNode as n, unref as _t, withCtx as f, Fragment as L, renderList as M, createTextVNode as Y, createCommentVNode as b, withDirectives as gt, normalizeStyle as ht, normalizeClass as ft, toDisplayString as y, pushScopeId as bt, popScopeId as yt } from "vue";
import { ElMessage as j } from "element-plus";
import B from "moment";
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 "../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 "./index.mjs";
import "../zv-hj-resource-type-phone/index.mjs";
import "../zv-hj-tree-list-phone/index.mjs";
import "../zv-hj-video-page-phone/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 kt } from "../../../plugins/datasource/index.mjs";
import { SHJParseEvent as Dt } from "../../../plugins/event/index.mjs";
import "lodash";
import { DataSourceUtils as R } from "../../../plugins/datasource/utils/utils.mjs";
import { HJLYDatasourceApi as Nt } from "../../../plugins/datasource/hjly/index.mjs";
const s = (g) => (bt("data-v-d9dffb57"), g = g(), yt(), g), St = { class: "hj-person-face" }, Ct = { class: "header" }, Et = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "title" }, [
  /* @__PURE__ */ Y(" 以图搜图 "),
  /* @__PURE__ */ t("img", {
    src: "https://guidedev.fxo2opt.com/document/shi/zv-hj-person-face/title-bg.png",
    alt: "",
    class: "title-img"
  })
], -1)), Vt = {
  key: 0,
  class: "upload-tip-box"
}, xt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", {
  class: "upload-img",
  alt: ""
}, null, -1)), Ut = /* @__PURE__ */ s(() => /* @__PURE__ */ t("span", { class: "upload-text" }, "将图片放到此处或", -1)), It = /* @__PURE__ */ s(() => /* @__PURE__ */ t("a", { class: "upload-btn" }, "上传文件", -1)), Tt = [
  xt,
  Ut,
  It
], Lt = {
  key: 1,
  class: "avatar-img-box"
}, Mt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", {
  class: "avatar-img",
  alt: ""
}, null, -1)), jt = [
  Mt
], wt = { class: "filter-area" }, zt = { class: "option" }, Yt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "label" }, "年龄段", -1)), Ht = { class: "option" }, Ot = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "label" }, "性别", -1)), At = { class: "option" }, Gt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "label" }, "戴眼镜", -1)), Pt = { class: "option" }, Bt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "label" }, "相似度", -1)), Rt = { class: "option" }, Kt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "label" }, "操作", -1)), Ft = { class: "operate-group" }, Jt = { class: "result-area" }, qt = {
  key: 0,
  class: "no-data"
}, Wt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "icon" }, null, -1)), $t = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "text" }, "暂无数据，请先上传目标照片进行查询", -1)), Xt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "tips" }, "图片支持jpg,jpeg,bmp,png格式,大小1KB-1MB", -1)), Qt = /* @__PURE__ */ s(() => /* @__PURE__ */ t("div", { class: "tips" }, "像素建议为480*640以上", -1)), Zt = [
  Wt,
  $t,
  Xt,
  Qt
], te = {
  key: 1,
  class: "image-box"
}, ee = ["onClick"], oe = ["src"], ie = {
  key: 0,
  class: "text"
}, re = {
  key: 0,
  class: "right"
}, le = { class: "top" }, ae = { class: "adddress" }, se = { class: "time" }, pe = { class: "detail-img" }, me = ["src"], ne = {
  key: 0,
  class: "text"
}, ce = K({ name: "zv-hj-person-face" }), al = /* @__PURE__ */ K({
  ...ce,
  props: {
    basicOption: {},
    sources: {},
    useEvents: {},
    uuid: {}
  },
  emits: ["on-click"],
  setup(g, { expose: F, emit: J }) {
    var P;
    ct((o) => ({
      "2296c374": "url(" + d.value + ")"
    }));
    const q = J, k = g;
    ut(() => k.sources, () => {
      I();
    }, { deep: !0 });
    const W = r({});
    r();
    const D = r(), $ = [
      { value: "UNKNOWN", label: "未知" },
      { value: "INFANT", label: "婴幼儿" },
      { value: "KID", label: "儿童" },
      { value: "CHILD", label: "少年" },
      { value: "TEENAGER", label: "青少年" },
      { value: "YOUNG", label: "青年" },
      { value: "PRIME", label: "壮年" },
      { value: "MIDDLE", label: "中年" },
      { value: "MIDDLEAGED", label: "中老年" },
      { value: "OLD", label: "老年" }
    ], N = r(), X = [
      {
        value: "UNKNOWN",
        label: "未知"
      },
      {
        value: "male",
        label: "男"
      },
      {
        value: "female",
        label: "女"
      }
    ], S = r(), Q = [
      {
        value: "UNKNOWN",
        label: "未知"
      },
      {
        value: "yes",
        label: "有"
      },
      {
        value: "no",
        label: "无"
      }
    ], p = r(50), d = r(), Z = R.getEnvironments(), H = "/imcs-admin/document/upload", tt = R.replaceEnvVariables(H, Z), et = r(tt + H);
    let C = null;
    const O = localStorage.getItem("Session_token") || sessionStorage.getItem("Session_token");
    O && (C = JSON.parse(O));
    const ot = { "X-Token": (P = C == null ? void 0 : C.data) == null ? void 0 : P.token }, E = r(0), h = r(0), A = r(20), w = r(0), V = r([]), x = r(5), U = r(!1), m = r();
    dt(() => {
      I();
    });
    const I = () => {
      kt.parse({
        tId: k.uuid,
        sources: k.sources,
        callback: ({ data: o }) => {
          W.value = o[0].data[0];
        }
      });
    }, G = (o) => {
      if (!d.value)
        return j({
          message: "请先上传图片",
          type: "error"
        });
      if (o === 1)
        h.value = 1, V.value = [];
      else {
        if (w.value > 0 && w.value / A.value < h.value)
          return j({
            message: "没有更多数据了",
            type: "warning"
          });
        h.value = h.value + 1;
      }
      const i = {
        facePicUrl: null,
        ageGroup: null,
        withGlass: null,
        sex: null,
        minSimilarity: 50,
        pageNo: h.value,
        pageSize: A.value,
        startTime: B().startOf("day").format("YYYY-MM-DDTHH:mm:ss.000+08:00"),
        // "2024-11-01T08:50:00+08:00"
        endTime: B().endOf("day").format("YYYY-MM-DDTHH:mm:ss.000+08:00")
        // "2024-11-01T08:59:59+08:00"
      };
      i.ageGroup = D.value, i.withGlass = S.value, i.sex = N.value, i.minSimilarity = p.value, i.facePicUrl = d.value, Nt.captureSearch(
        i
      ).then((c) => {
        var v, _;
        ((_ = (v = c == null ? void 0 : c.data) == null ? void 0 : v.list) == null ? void 0 : _.length) > 0 && (E.value = 1, V.value.push(...c.data.list), w.value = c.data.page.dataCount);
      }).catch(() => {
        E.value = 0, V.value = [];
      });
    }, it = () => {
      d.value = null, D.value = null, N.value = null, S.value = null, p.value = 50;
    }, rt = (o) => {
      o.data && (d.value = o.data);
    }, lt = (o) => {
      const i = o.size / 1024 / 1024 < 1;
      if (o.type !== "image/jpg" && o.type !== "image/png" && o.type !== "image/jpeg" && o.type !== "image/bmp")
        return j({
          message: "上传图片格式错误,请上传jpg/png/jpeg/bmp格式的图片!",
          type: "error"
        }), !1;
      if (!i)
        return j({
          message: "上传头像图片大小不能超过 1MB!",
          type: "error"
        }), !1;
    }, z = (o) => {
      o.target.src = "https://guidedev.fxo2opt.com/document/shi/zv-hj-person-face/default.png";
    }, at = (o) => {
      x.value = 3, m.value = o, U.value = !0;
    }, st = () => {
      x.value = 5, U.value = !1;
    }, pt = (o) => {
      q("on-click", o), Dt.parseEvents(k.useEvents, "on-click", o);
    };
    return F({
      refresh: () => I(),
      refreshData: () => I()
    }), (o, i) => {
      const c = T("el-upload"), v = T("el-option"), _ = T("el-select"), mt = T("el-input"), nt = vt("infinite-scroll");
      return a(), l("div", St, [
        t("div", Ct, [
          Et,
          n(c, {
            class: "upload-area avatar-uploader",
            drag: "",
            action: et.value,
            headers: _t(ot),
            "show-file-list": !1,
            name: "multipartFile",
            "on-success": rt,
            "before-upload": lt,
            size: 1
          }, {
            default: f(() => [
              d.value ? (a(), l("div", Lt, jt)) : (a(), l("div", Vt, Tt))
            ]),
            _: 1
          }, 8, ["action", "headers"])
        ]),
        t("div", wt, [
          t("div", zt, [
            Yt,
            n(_, {
              modelValue: D.value,
              "onUpdate:modelValue": i[0] || (i[0] = (e) => D.value = e),
              placeholder: "年龄段",
              clearable: ""
            }, {
              default: f(() => [
                (a(), l(L, null, M($, (e, u) => n(v, {
                  key: u + "A",
                  value: e.value,
                  label: e.label
                }, null, 8, ["value", "label"])), 64))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          t("div", Ht, [
            Ot,
            n(_, {
              modelValue: N.value,
              "onUpdate:modelValue": i[1] || (i[1] = (e) => N.value = e),
              placeholder: "性别",
              clearable: ""
            }, {
              default: f(() => [
                (a(), l(L, null, M(X, (e, u) => n(v, {
                  key: u + "B",
                  value: e.value,
                  label: e.label
                }, null, 8, ["value", "label"])), 64))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          t("div", At, [
            Gt,
            n(_, {
              modelValue: S.value,
              "onUpdate:modelValue": i[2] || (i[2] = (e) => S.value = e),
              placeholder: "戴眼镜",
              clearable: ""
            }, {
              default: f(() => [
                (a(), l(L, null, M(Q, (e, u) => n(v, {
                  key: u + "C",
                  value: e.value,
                  label: e.label
                }, null, 8, ["value", "label"])), 64))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          t("div", Pt, [
            Bt,
            n(mt, {
              modelValue: p.value,
              "onUpdate:modelValue": i[3] || (i[3] = (e) => p.value = e),
              placeholder: "相似度",
              oninput: (e) => {
                p.value = e.target.value.replace(/[^0-9]/g, ""), p.value > 100 && (p.value = 100), p.value < 1 && (p.value = 1);
              }
            }, {
              append: f(() => [
                Y("%")
              ]),
              _: 1
            }, 8, ["modelValue", "oninput"])
          ]),
          t("div", Rt, [
            Kt,
            t("div", Ft, [
              t("div", {
                class: "operate query",
                onClick: i[4] || (i[4] = (e) => G(1))
              }, "查询"),
              t("div", {
                class: "operate reset",
                onClick: it
              }, "重置")
            ])
          ])
        ]),
        t("div", Jt, [
          E.value == 0 ? (a(), l("div", qt, Zt)) : b("", !0),
          E.value == 1 ? (a(), l("div", te, [
            gt((a(), l("div", {
              class: ft(["left", [U.value ? "detail" : ""]]),
              style: ht({ gridTemplateRows: "repeat(" + x.value + ", 1fr)", gridTemplateColumns: "repeat(" + x.value + ", 1fr)" })
            }, [
              (a(!0), l(L, null, M(V.value, (e, u) => (a(), l("div", {
                key: "D" + u,
                class: "capture",
                alt: "",
                onClick: (ue) => at(e)
              }, [
                t("img", {
                  src: e.facePicUrl || e.snapUrl,
                  alt: "",
                  class: "capture-img",
                  referrerpolicy: "no-referrer",
                  onError: z
                }, null, 40, oe),
                e.similarity ? (a(), l("div", ie, y(e.similarity), 1)) : b("", !0)
              ], 8, ee))), 128))
            ], 6)), [
              [nt, G]
            ]),
            U.value ? (a(), l("div", re, [
              t("div", le, [
                t("div", null, y(m.value.cameraName), 1),
                t("div", {
                  class: "icon",
                  onClick: st
                })
              ]),
              t("div", ae, y(m.value.address), 1),
              t("div", se, y(m.value.captureTime && m.value.captureTime.replace("T", " ").replace("+08:00", "")), 1),
              t("div", pe, [
                t("img", {
                  src: m.value.facePicUrl,
                  alt: "",
                  referrerpolicy: "no-referrer",
                  onError: z
                }, null, 40, me),
                m.value.similarity ? (a(), l("div", ne, y(m.value.similarity), 1)) : b("", !0),
                t("div", {
                  class: "search",
                  onClick: i[5] || (i[5] = (e) => pt(m.value))
                }, [
                  t("img", {
                    src: "https://guidedev.fxo2opt.com/document/shi/zv-hj-person-face/detail-search.png",
                    alt: "",
                    onError: z
                  }, null, 32),
                  Y(" 搜图 ")
                ])
              ])
            ])) : b("", !0)
          ])) : b("", !0)
        ])
      ]);
    };
  }
});
export {
  al as default
};
