import { defineComponent, openBlock, createBlock, unref, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, createVNode, render, renderSlot, withDirectives, vShow, createTextVNode, ref, computed, watchEffect, mergeProps, withCtx, watch, normalizeStyle, Fragment, vModelText, renderList, withModifiers, resolveDynamicComponent, pushScopeId, popScopeId, reactive, toRefs, isRef } from "vue";
import WlSvg from "@wltech/svg";
import { Popup, List } from "vant";
var employeeSelector = {
  employeeData: null,
  topFiveEmployeeData: null,
  organization: null,
  organization_count: null,
  count: 0,
  dept_list: [],
  company_list: [],
  company_list_count: 0,
  companyEmployeeList: [],
  totalCompanyEmployeeList: [],
  totalCompanyEmployeeObjList: []
};
const Store = {
  sid: "",
  app_id: "",
  user_id: "",
  user_name: "",
  corp_id: "",
  node_env: "",
  domain: "",
  token: "",
  card_resource: "",
  employeeSelector
};
var Store$1 = new Proxy(Store, {
  get(target, name, property) {
    return Reflect.get(target, name, property);
  },
  set(target, name, value, property) {
    return Reflect.set(target, name, value, property);
  }
});
const proxy_api = {
  dev_uat: "/uat_api",
  dev_stg: "/stg_api",
  dev_prd: "/prd_api",
  dev_cos_api: "/cos_api",
  dev_uat_xsf: "/xsf_api",
  dev: "/uat_api",
  uat: "",
  stg: "",
  prd: "",
  gray: "",
  production: "",
  uat_xsf: "https://test.xsfapi.weiling.cn",
  stg_xsf: "https://pre-xsfapi.weiling.cn",
  prd_xsf: "https://xsfapi.weiling.cn",
  gray_xsf: "https://xsfapi.weiling.cn"
};
const token_key = {
  dev_uat: "auth-token-mp-test",
  dev_stg: "auth-token-mp",
  dev_prd: "auth-token-mp",
  dev_uat_xsf: "auth-token-se-test",
  dev_stg_xsf: "auth-token-se",
  dev_gray_xsf: "auth-token-se",
  dev_prd_xsf: "auth-token-se",
  uat: "auth-token-mp-test",
  stg: "auth-token-mp",
  prd: "auth-token-mp",
  gray: "auth-token-mp",
  uat_xsf: "auth-token-se-test",
  stg_xsf: "auth-token-se",
  prd_xsf: "auth-token-se",
  gray_xsf: "auth-token-se"
};
const __default__$8 = {
  name: "WlSvgIcon"
};
const _sfc_main$d = /* @__PURE__ */ defineComponent({
  ...__default__$8,
  props: {
    type: { default: "" },
    color: { default: "var(--wl-text-color-title-1)" },
    width: { default: "16" },
    height: { default: "16" }
  },
  setup(__props) {
    const sub = location.origin;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(WlSvg), {
        type: __props.type,
        width: __props.width,
        height: __props.height,
        color: __props.color,
        sub: unref(sub)
      }, null, 8, ["type", "width", "height", "color", "sub"]);
    };
  }
});
var index_vue_vue_type_style_index_0_lang$4 = "";
const _hoisted_1$a = { class: "icon" };
const _hoisted_2$a = { class: "text" };
const __default__$7 = {
  name: "WlNotice"
};
const _sfc_main$c = /* @__PURE__ */ defineComponent({
  ...__default__$7,
  props: {
    show_toast: { type: Boolean, default: true },
    message: { default: "" },
    type: { default: "success" },
    duration: { default: 1500 }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return __props.show_toast ? (openBlock(), createElementBlock("div", {
        key: 0,
        class: normalizeClass(`notice ${__props.type}`),
        "data-weiling-mobile-ui-wl-notice": ""
      }, [
        createElementVNode("div", _hoisted_1$a, [
          __props.type === "success" ? (openBlock(), createBlock(_sfc_main$d, {
            key: 0,
            type: "successFill",
            width: "24",
            height: "24",
            color: "#45ce03"
          })) : __props.type === "warning" ? (openBlock(), createBlock(_sfc_main$d, {
            key: 1,
            type: "warningFill",
            width: "24",
            height: "24",
            color: "#f3a401"
          })) : __props.type === "alert" ? (openBlock(), createBlock(_sfc_main$d, {
            key: 2,
            type: "tipsFill",
            width: "24",
            height: "24",
            color: "#1b9fff"
          })) : __props.type === "error" ? (openBlock(), createBlock(_sfc_main$d, {
            key: 3,
            type: "closeFill",
            width: "24",
            height: "24",
            color: "#ff2a2d"
          })) : createCommentVNode("", true)
        ]),
        createElementVNode("p", _hoisted_2$a, toDisplayString(__props.message), 1)
      ], 2)) : createCommentVNode("", true);
    };
  }
});
let mountNode = null;
var WlNotice = (options) => {
  const duration = options.duration | 2e3;
  if (mountNode) {
    document.body.removeChild(mountNode);
    mountNode = null;
  }
  const app = createVNode(_sfc_main$c, {
    ...options,
    duration,
    show_toast: true
  });
  const timer = setTimeout(() => {
    if (mountNode) {
      document.body.removeChild(mountNode);
      mountNode = null;
    }
    clearTimeout(timer);
  }, duration);
  mountNode = document.createElement("div");
  render(app, mountNode);
  document.body.appendChild(mountNode);
};
const onDebounce = (fn, delay) => {
  let timer;
  return function(...args) {
    if (timer) {
      clearTimeout(timer);
    }
    timer = setTimeout(
      () => {
        typeof fn === "function" && fn.apply(null, [...args]);
        clearTimeout(timer);
      },
      delay > 0 ? delay : 100
    );
  };
};
const getQueryVariable = (variable) => {
  const query = window.location.search.substring(1);
  const vars = query.split("&");
  for (let i = 0; i < vars.length; i++) {
    const pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
  return "";
};
const loadImage = (url) => {
  return new Promise((resolve, reject) => {
    const newImg = new Image();
    newImg.src = url;
    newImg.onerror = () => {
      reject("failure");
    };
    newImg.onload = (e) => {
      resolve(e.target);
    };
  });
};
const isTencentCosPic = (url) => {
  return url.includes("wlmvp-cos.weiling.cn");
};
const isBase64 = (str) => {
  return str.indexOf("data:") != -1 && str.indexOf("base64") != -1;
};
const removeEmptyField = (obj) => {
  let newObj = {};
  if (typeof obj === "string") {
    obj = JSON.parse(obj);
  }
  if (obj instanceof Array) {
    newObj = [];
  }
  if (obj instanceof Object) {
    for (const attr in obj) {
      if (obj[attr] !== "" && obj[attr] !== null && obj[attr] !== void 0) {
        if (obj[attr] instanceof Object) {
          if (JSON.stringify(obj[attr]) === "{}" || JSON.stringify(obj[attr]) === "[]") {
            continue;
          }
          newObj[attr] = removeEmptyField(obj[attr]);
        } else if (typeof obj[attr] === "string" && (obj[attr].indexOf("{") > -1 && obj[attr].indexOf("}") > -1 || obj[attr].indexOf("[") > -1 && obj[attr].indexOf("]") > -1)) {
          try {
            const attrObj = JSON.parse(obj[attr]);
            if (attrObj instanceof Object) {
              newObj[attr] = removeEmptyField(attrObj);
            }
          } catch (e) {
            newObj[attr] = obj[attr];
          }
        } else {
          newObj[attr] = obj[attr];
        }
      }
    }
  }
  return newObj;
};
function obj2String(obj, arr = [], idx = 0) {
  for (const item in obj) {
    arr[idx++] = [item, obj[item]];
  }
  return new URLSearchParams(arr).toString();
}
function getOptions(options) {
  const { sid = "", corp_id = "", card_resource = "" } = Store$1 != null ? Store$1 : {};
  const params = {
    sid,
    corp_id,
    card_resource,
    ...options
  };
  return obj2String(params);
}
const onHandleUrl = (url) => {
  const { node_env } = Store$1;
  const isPersonMiniApp = node_env.includes("xsf");
  if (isPersonMiniApp) {
    return setPersonMiniAppUrl(url);
  }
  return url;
};
const setPersonMiniAppUrl = (url) => {
  let filterUrl = url;
  if (filterUrl.includes("/api/user/share/path")) {
    filterUrl = filterUrl.replace(
      "/api/user/share/path",
      "/apise/material/share/path"
    );
  } else if (filterUrl.includes("/interact/")) {
    filterUrl = filterUrl.replace("/interact/", "/apise/");
  } else if (filterUrl.includes("/api/")) {
    filterUrl = filterUrl.replace("/api/", "/apise/");
  } else if (filterUrl.includes("/wx/track")) {
    filterUrl = filterUrl.replace("/wx/track", "/apise/track/wx/track");
  }
  return filterUrl;
};
function request(url, options, method = "GET") {
  const staticOption = {
    sid: Store$1.sid,
    corp_id: Store$1.corp_id,
    tab_change: 0
  };
  const data = {
    ...staticOption,
    ...options
  };
  const searchStr = getOptions(removeEmptyField(data));
  const staticSearchStr = getOptions(removeEmptyField(staticOption));
  let initObj = {};
  let params = "";
  if (method === "GET") {
    initObj = {
      method,
      credentials: "include",
      headers: new Headers({
        "access-auth-token": getQueryVariable("msid"),
        [token_key[Store$1.node_env]]: Store$1.token
      })
    };
    params = searchStr;
  } else if (method === "FormPOST") {
    initObj = {
      method: "POST",
      credentials: "include",
      headers: new Headers({
        [token_key[Store$1.node_env]]: Store$1.token
      }),
      body: options
    };
    params = staticSearchStr;
  } else {
    initObj = {
      method,
      credentials: "include",
      headers: new Headers({
        "access-auth-token": getQueryVariable("msid"),
        Accept: "application/json, text/plain, */*",
        "Content-Type": "application/json",
        [token_key[Store$1.node_env]]: Store$1.token
      }),
      body: JSON.stringify(data)
    };
    params = staticSearchStr;
  }
  const filterUrl = onHandleUrl(url) + "?" + params;
  return fetch(filterUrl, initObj).then((res) => {
    const isArea = url.includes("region.json");
    return res.json().then((result) => {
      var _a;
      if (result.code === 200 || isArea) {
        return result;
      } else {
        WlNotice({
          message: (_a = result.msg) != null ? _a : "\u670D\u52A1\u5668\u5185\u90E8\u9519\u8BEF",
          type: "error",
          duration: 3e3
        });
        throw Error(result);
      }
    });
  }).then((res) => {
    return res;
  });
}
const POST = (url, options) => {
  return request(url, options, "POST");
};
var Api = {
  getSearchByType(paramas) {
    return POST(
      `${proxy_api[Store$1.node_env]}/crm_v2/web/search/global/search_by_type`,
      paramas
    );
  }
};
const _hoisted_1$9 = { class: "z-2 flex uno-min-w-44 uno-max-w-88" };
const _hoisted_2$9 = { class: "uno-elli-1 z-1 box-border flex-middle-center absolute text-center uno-l-44 uno-r-44" };
const _hoisted_3$8 = { class: "relative z-2 flex-middle-center uno-min-w-44" };
const __default__$6 = {
  name: "WlHeader"
};
const _sfc_main$b = /* @__PURE__ */ defineComponent({
  ...__default__$6,
  props: {
    title: { default: "" },
    showBack: { type: Boolean, default: false },
    showClose: { type: Boolean, default: false },
    needAutoBack: { type: Boolean, default: true },
    needBottomBorder: { type: Boolean, default: false }
  },
  emits: ["onBack", "onClose"],
  setup(__props, { emit }) {
    const props = __props;
    const onBackPage = () => {
      if (props.needAutoBack) {
        history.back();
      } else {
        emit("onBack");
      }
    };
    const onClose = () => {
      emit("onClose");
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(`uno-fs-16 uno-h-44 relative font-medium box-border text-base-color bg-white flex-between ${__props.needBottomBorder ? "border-bottom" : " "}`)
      }, [
        createElementVNode("div", _hoisted_1$9, [
          renderSlot(_ctx.$slots, "header_part_left", {}, () => [
            withDirectives(createElementVNode("div", {
              class: "box-content flex-middle-center cursor-pointer uno-h-44 uno-w-44",
              onClick: onBackPage
            }, [
              createVNode(_sfc_main$d, {
                type: "arrowTipLeft",
                width: "22",
                height: "22",
                color: "#000"
              })
            ], 512), [
              [vShow, __props.showBack]
            ])
          ])
        ]),
        createElementVNode("div", _hoisted_2$9, [
          renderSlot(_ctx.$slots, "default", {}, () => [
            createTextVNode(toDisplayString(__props.title), 1)
          ])
        ]),
        createElementVNode("div", _hoisted_3$8, [
          renderSlot(_ctx.$slots, "header_part_right", {}, () => [
            withDirectives(createElementVNode("div", {
              class: "box-content flex-middle-center cursor-pointer uno-h-44 uno-w-44",
              onClick: onClose
            }, [
              createVNode(_sfc_main$d, {
                type: "close",
                width: "22",
                height: "22",
                color: "#000"
              })
            ], 512), [
              [vShow, __props.showClose]
            ])
          ])
        ])
      ], 2);
    };
  }
});
var index_vue_vue_type_style_index_0_lang$3 = "";
const _hoisted_1$8 = {
  class: "popup-wrap",
  "data-weiling-mobile-ui-wl-popup": ""
};
const _hoisted_2$8 = { class: "popup-content" };
const __default__$5 = {
  name: "WlPopup"
};
const _sfc_main$a = /* @__PURE__ */ defineComponent({
  ...__default__$5,
  props: {
    modelValue: { type: Boolean, default: false },
    teleport: { default: "body" },
    position: { default: "bottom" },
    headerVisible: { type: Boolean, default: false },
    title: { default: "" },
    showRightClose: { type: Boolean, default: true },
    showBack: { type: Boolean, default: false },
    needAutoBack: { type: Boolean, default: true }
  },
  emits: ["update:modelValue", "onClose", "onBack"],
  setup(__props, { emit }) {
    const props = __props;
    const popUpVisible = ref(false);
    const popupStyle = computed(() => {
      return {
        height: "70%"
      };
    });
    const onClose = () => {
      emit("update:modelValue", false);
      emit("onClose");
    };
    const onOpen = () => {
      emit("update:modelValue", true);
    };
    const onBack = () => {
      emit("onBack");
    };
    watchEffect(() => {
      popUpVisible.value = props.modelValue;
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Popup), mergeProps({
        show: popUpVisible.value,
        "onUpdate:show": _cache[0] || (_cache[0] = ($event) => popUpVisible.value = $event),
        teleport: __props.teleport,
        position: __props.position,
        "close-on-popstate": true,
        style: unref(popupStyle)
      }, _ctx.$attrs, {
        onClose,
        onOpen
      }), {
        default: withCtx(() => [
          createElementVNode("div", _hoisted_1$8, [
            __props.headerVisible ? (openBlock(), createBlock(_sfc_main$b, {
              key: 0,
              title: __props.title,
              showClose: __props.showRightClose,
              onOnClose: onClose,
              onOnBack: onBack,
              showBack: __props.showBack,
              needAutoBack: __props.needAutoBack
            }, {
              header_part_left: withCtx(() => [
                renderSlot(_ctx.$slots, "header_part_left")
              ]),
              _: 3
            }, 8, ["title", "showClose", "showBack", "needAutoBack"])) : createCommentVNode("", true),
            createElementVNode("div", _hoisted_2$8, [
              renderSlot(_ctx.$slots, "default")
            ])
          ])
        ]),
        _: 3
      }, 16, ["show", "teleport", "position", "style"]);
    };
  }
});
var deleteIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOiSURBVHgBzZrdceIwFIWvneTd+5iZJAMVZFNBTAdJBZstgQoCFaSEsBUkWwFsB2wFkJ+ZPC7vCbDneGTGFrYl2QL8zRiB/7jHku69khyIZ2azWYSigy06OjpiKcvlcq4OT7vd7kI8EkhDaHAYhnfYroMg+L5erztV5+P4HOdNUf6GsAkEzaUBtQXA8Pj4+PgeX2NpxgRifl1cXIykBs4CPBqegzWDYugqxFrAx8dH5+vr61E8G64DISM0raFt07ISoJ76E75GsgdUbfRRG8+mc0PTCW9vb/cwfix7Mp6gk3ewPfG/jedWHVQ3GMhhGZyfnw/LDpYKaInxKaUiCgW8vr7esAqlXfQgYqLv3BJAbwMvMDYFpAOwgBe80r3TVif+/PwctNB4EsGZPOo7cwLQdO7QdH5Ie4nRN+PsjpwA5DNGt9UCcjZuBPDp12k6DDrYbvHVJctc8BrU9lzcydXCRkCdpkPj0eF7jJi4vid2IhY8l9cg3e7VFLGphcQLqTxnJg6kxme9wvv7O9PpqqidGH92djZNd9T1erD3G8cWSQ3A88TiCP60r7s0GlZRE1vGk9PT0/lqteqLIxyDJKX6fSOO0KXxiev7S0QUGk94Dxx7FEdwTcwyEQA1l+JOxOZiIaLSeEOTqyKxOeCQEE/zn9Sn0kCWOzA+gf0gULn+WJpRKqIIH8YT/OeVcTxgSWlz0vFlPMF9ojCd+vCAUYRP4wldr68aOBhhZtKpKcZ+YIgTzjCKhycnJz5uZt2JfYsIEYXn0oxKN+oQ7JyBG52Gaq7yRephDFKWwc4Z5mKbXAg/rPy3hm2EjXYk4i8/UgETcQTX/HSIsJUieC9x55kfiQBkgyNx5wFRvJPdYfDzhSKYTiMXexBHOLPNMhGg+sHE5QacPUMQHKciLINUTkTdsQDO/5Om8tlANhRHMiJuHCJsIoJzTw2mb0YbG7J7MdakEbG0GHofDEe76W89lXCuhQOQszEnQE3dTaSlcO1AXwDZSuYwNqBL87oQ5wM1ibDVQrYEcJCN4lbaR79o1aYwnVZNqU39YVi2WmNa4BiINpV3AIZ4oIOyg8Y1sgOLqDSeWC3yMegw3O9x2p1O5LZoQUPHakiZzmNyQVp2DNMELmTYGE+cF7o5i81peN+1QcORmgxsDU+p/aoBhaDggsi1NKCu4SmNX/ZgRqkmh9lPLi1q5oUDKI5BmMY3fXulsQAdNVWZpMupGM4eYFtw/O37dZv/XhxunoTWr/gAAAAASUVORK5CYII=";
const domain = "https://wlmvp-cos.weiling.cn";
const loadingPic = domain + "/frontend/weilingMobileUI/loading.png";
const loadingFailPic = domain + "/frontend/weilingMobileUI/loadingFail.png";
const _hoisted_1$7 = ["src", "alt"];
const _hoisted_2$7 = ["src"];
const _hoisted_3$7 = ["src"];
var ECosType = /* @__PURE__ */ ((ECosType2) => {
  ECosType2["normal"] = "imageView2/1/q/85";
  ECosType2["thumbnail"] = "imageView2/1/w/100/h/100/q/85";
  return ECosType2;
})(ECosType || {});
const __default__$4 = {
  name: "WlPic"
};
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
  ...__default__$4,
  props: {
    src: { default: "" },
    needCos: { type: Boolean, default: true },
    cosType: { default: "normal" },
    radius: { type: Boolean, default: false },
    round: { type: Boolean, default: false },
    needLoading: { type: Boolean, default: true },
    needMiddleCenter: { type: Boolean, default: true },
    needHeightAuto: { type: Boolean, default: false },
    fit: { default: "fill" }
  },
  setup(__props, { expose }) {
    const props = __props;
    const isLoading = ref(true);
    const isError = ref(false);
    const imgSrc = ref("");
    const imgWrapRef = ref("");
    const imgStyleComputed = computed(() => {
      return {
        "border-radius": props.round ? "50%" : "",
        "object-fit": props.fit
      };
    });
    const imgWrapClassComputed = computed(() => {
      return [
        "wl-img",
        "wh-full",
        "relative",
        "flex-col",
        props.needMiddleCenter ? "flex-middle-center" : ""
      ];
    });
    const onLoadImage = (url) => {
      return new Promise((resolve, reject) => {
        loadImage(url).then((elem) => {
          resolve(elem);
        }).catch((reason) => {
          reject(reason);
        }).finally(() => {
          isLoading.value = false;
        });
      });
    };
    const setImgSrc = (url) => {
      const needCos = isTencentCosPic(url) && props.needCos;
      const file_type = url.split(".").pop();
      let isSvg = file_type === "svg";
      let isBase64Bool = isBase64(url);
      if (isSvg || !needCos || isBase64Bool) {
        imgSrc.value = url;
        onLoadImage(imgSrc.value).catch(() => {
          isError.value = true;
        });
      } else {
        imgSrc.value = `${url}?${ECosType[props.cosType]}`;
        onLoadImage(imgSrc.value).catch(() => {
          imgSrc.value = url;
        });
      }
    };
    watch(
      () => props.src,
      (val) => {
        if (val) {
          isLoading.value = true;
          setImgSrc(props.src);
        }
      },
      { immediate: true }
    );
    expose({
      imgWrapRef
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(unref(imgWrapClassComputed)),
        ref_key: "imgWrapRef",
        ref: imgWrapRef
      }, [
        !isLoading.value && !isError.value ? (openBlock(), createElementBlock("img", {
          key: 0,
          src: imgSrc.value,
          style: normalizeStyle(unref(imgStyleComputed)),
          class: normalizeClass(`w-full block ${__props.needHeightAuto ? "h-auto" : "h-full"}`),
          alt: imgSrc.value
        }, null, 14, _hoisted_1$7)) : createCommentVNode("", true),
        isLoading.value && __props.needLoading ? (openBlock(), createElementBlock("img", {
          key: 1,
          src: unref(loadingPic),
          alt: "loading",
          class: "w-1/5 uno-min-w-20 uno-min-h-20 uno-max-w-60 uno-max-h-60 absolute-middle-center animate-spin"
        }, null, 8, _hoisted_2$7)) : createCommentVNode("", true),
        isError.value ? (openBlock(), createElementBlock("img", {
          key: 2,
          src: unref(loadingFailPic),
          alt: "failure",
          class: "w-1/5 uno-min-w-20 uno-min-h-20 uno-max-w-60 uno-max-h-60 absolute-middle-center"
        }, null, 8, _hoisted_3$7)) : createCommentVNode("", true),
        renderSlot(_ctx.$slots, "picFooter")
      ], 2);
    };
  }
});
var searchIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAASNSURBVHgB7ZqPddowEMYvZAE6Qb1B0gmACUInKJkgZIKSCZJMEJigdAJMFijdQJmgdICEfgdyHzWnv7YMDfze8zNPdiLr00k66Y7oxIkTJ46YM0rMbDa7xI2v7Ozs7OP2s9Vq9Rs3pa9Fr9dT1DC1C4AGt3Hro7FXuLr43Q74cwVRclwTiJFTA9QmADe81Wrd4OeQwhptQr29vd1BiDElpLIACRpeJqkQlQRA47to/BN+ZpQYDIsprtu654loAebz+VfcRr7v4+NfMCco2kx4TKbvF+RvOWwNLMKUaiJYADZ5NOQe18Dx6hLXBB/MH8sz/NLyP9crBaypj/sVuRl1Op07qoEgAfR4n9FmWTOxHrO4T22NttSRoY4Rfn5xvFqLCEEC5Hn+ZOl5buwjPmpENeApxAD1TagC3gI4xjz3ei+FIwMhhhCC6xbnCdT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+AzomWAQ4RCtcYzpWYrNHT5w4cTz8Aaz4M79MeVvFAAAAAElFTkSuQmCC";
var index_vue_vue_type_style_index_0_lang$2 = "";
const _hoisted_1$6 = {
  class: "search-wrap",
  "data-weiling-mobile-ui-wl-search": ""
};
const _hoisted_2$6 = { class: "search-icon" };
const _hoisted_3$6 = { class: "search-input" };
const _hoisted_4$5 = ["placeholder"];
const _hoisted_5$5 = { class: "action" };
const _hoisted_6$5 = { class: "default-search-content" };
const _hoisted_7$4 = { class: "search-text" };
const __default__$3 = {
  name: "WlSearch"
};
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  ...__default__$3,
  props: {
    modelValue: { default: "" },
    icon: { default: searchIcon },
    placeholder: { default: "\u641C\u7D22" },
    closable: { type: Boolean, default: true },
    needBorder: { type: Boolean, default: true },
    showType: { default: "search" }
  },
  emits: ["onClear", "onClickDefault", "onChange", "onBlurChange", "onChinaChange", "update:modelValue"],
  setup(__props, { expose, emit }) {
    const props = __props;
    const fieldValue = ref("");
    const is_focus = ref(false);
    const inputRef = ref(null);
    let isChinaInput = false;
    const searchClass = computed(() => {
      return {
        search: true,
        "search-focus": is_focus.value,
        "search-border": props.needBorder
      };
    });
    const onClickDefault = () => emit("onClickDefault");
    const onClear = () => {
      fieldValue.value = "";
      emit("update:modelValue", "");
      emit("onChange", "");
      emit("onClear");
    };
    const onDebounceSave = onDebounce((event) => {
      if (!isChinaInput) {
        const val = event.target.value;
        emit("update:modelValue", val);
        emit("onChange", val);
      }
    }, 300);
    const onContentChange = onDebounce((event) => {
      var _a;
      const val = (_a = event.target) == null ? void 0 : _a.value;
      emit("update:modelValue", val);
      emit("onBlurChange", val);
    }, 300);
    const compositionend = () => {
      isChinaInput = false;
    };
    const compositionstart = () => {
      isChinaInput = true;
    };
    const onFocus = () => {
      var _a;
      (_a = inputRef.value) == null ? void 0 : _a.focus();
    };
    expose({
      onFocus,
      inputEl: inputRef
    });
    watch(
      () => fieldValue.value,
      (val) => {
        emit("update:modelValue", val);
      }
    );
    watchEffect(() => {
      fieldValue.value = props.modelValue;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$6, [
        __props.showType === "search" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
          createElementVNode("div", {
            class: normalizeClass(unref(searchClass))
          }, [
            createElementVNode("div", _hoisted_2$6, [
              createVNode(_sfc_main$9, { src: __props.icon }, null, 8, ["src"])
            ]),
            createElementVNode("div", _hoisted_3$6, [
              withDirectives(createElementVNode("input", {
                type: "text",
                placeholder: __props.placeholder,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fieldValue.value = $event),
                ref_key: "inputRef",
                ref: inputRef,
                onInput: _cache[1] || (_cache[1] = (...args) => unref(onDebounceSave) && unref(onDebounceSave)(...args)),
                onChange: _cache[2] || (_cache[2] = (...args) => unref(onContentChange) && unref(onContentChange)(...args)),
                onFocus: _cache[3] || (_cache[3] = ($event) => is_focus.value = true),
                onBlur: _cache[4] || (_cache[4] = ($event) => is_focus.value = false),
                onCompositionend: compositionend,
                onCompositionstart: compositionstart
              }, null, 40, _hoisted_4$5), [
                [vModelText, fieldValue.value]
              ])
            ]),
            __props.closable && fieldValue.value ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "search-close-icon",
              onClick: onClear
            }, [
              createVNode(_sfc_main$9, { src: unref(deleteIcon) }, null, 8, ["src"])
            ])) : createCommentVNode("", true)
          ], 2),
          createElementVNode("div", _hoisted_5$5, [
            renderSlot(_ctx.$slots, "action")
          ])
        ], 64)) : createCommentVNode("", true),
        __props.showType === "default" ? (openBlock(), createElementBlock("div", {
          key: 1,
          class: "default-search",
          onClick: onClickDefault
        }, [
          createElementVNode("div", _hoisted_6$5, [
            createVNode(_sfc_main$d, {
              type: "search",
              width: "18",
              height: "18",
              color: "#c1c1c1"
            }),
            createElementVNode("span", _hoisted_7$4, toDisplayString(__props.placeholder), 1)
          ])
        ])) : createCommentVNode("", true)
      ]);
    };
  }
});
var GloCustomerList_vue_vue_type_style_index_0_scoped_true_lang = "";
var _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const _hoisted_1$5 = ["onClick"];
const _hoisted_2$5 = { class: "customer_user" };
const _hoisted_3$5 = { class: "customer-list-info" };
const _hoisted_4$4 = ["innerHTML"];
const _hoisted_5$4 = {
  key: 1,
  class: "info"
};
const _hoisted_6$4 = { key: 0 };
const _hoisted_7$3 = /* @__PURE__ */ createTextVNode(" \u5907\u6CE8: ");
const _hoisted_8$3 = ["innerHTML"];
const _hoisted_9$2 = { key: 1 };
const _hoisted_10$2 = /* @__PURE__ */ createTextVNode(" \u624B\u673A\u53F7: ");
const _hoisted_11$2 = ["innerHTML"];
const _hoisted_12$2 = { key: 2 };
const _hoisted_13$2 = /* @__PURE__ */ createTextVNode(" \u90AE\u7BB1: ");
const _hoisted_14$1 = ["innerHTML"];
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
  __name: "GloCustomerList",
  props: {
    list: { default: () => [] },
    keyword: { default: "" },
    search_type: null
  },
  emits: ["onSearchItemSelect"],
  setup(__props, { emit }) {
    const props = __props;
    const replaceKeyword = (str) => {
      if (!str)
        return "";
      if (!props.keyword)
        return str;
      const reg = new RegExp(props.keyword, "ig");
      return str.replace(reg, function(text) {
        return `<span style="color: var(--wl-primary-color)">${text}</span>`;
      });
    };
    const getImg = ({ type }) => {
      const fromAry = {
        1: "https://wlmvp-cos.weiling.cn/worktable-h5/icon/lxx-icon/wechat.png",
        2: "https://wlmvp-cos.weiling.cn/worktable-h5/icon/lxx-icon/qw.png"
      };
      return fromAry[type] || "";
    };
    const onHandleClick = (item) => {
      emit("onSearchItemSelect", {
        ...item,
        search_type: props.search_type
      });
    };
    return (_ctx, _cache) => {
      return openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (data) => {
        return openBlock(), createElementBlock("div", {
          class: "customer-list",
          "data-weiling-mobile-ui-customer-list": "",
          key: data.external_userid,
          onClick: withModifiers(($event) => onHandleClick(data), ["stop"])
        }, [
          createElementVNode("div", _hoisted_2$5, [
            createVNode(_sfc_main$9, {
              class: "head-img avatar",
              src: data.head_img_url || "https://wlmvp-cos.weiling.cn/worktable-h5/icon/lxx-icon/default_head.png",
              alt: ""
            }, null, 8, ["src"]),
            createVNode(_sfc_main$9, {
              class: "from-type",
              src: getImg(data)
            }, null, 8, ["src"])
          ]),
          createElementVNode("div", _hoisted_3$5, [
            createElementVNode("p", {
              class: "name",
              innerHTML: replaceKeyword((data == null ? void 0 : data.nick_name) || "-")
            }, null, 8, _hoisted_4$4),
            data.corp_name ? (openBlock(), createElementBlock("p", {
              key: 0,
              class: "crop_name",
              style: normalizeStyle({
                color: data.type == 1 ? "var(--wl-success-color)" : "var(--wl-warning-color)"
              })
            }, toDisplayString(data.corp_name), 5)) : createCommentVNode("", true),
            (data == null ? void 0 : data.remark_name) || (data == null ? void 0 : data.mobile) || (data == null ? void 0 : data.email) ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
              (data == null ? void 0 : data.remark_name) ? (openBlock(), createElementBlock("p", _hoisted_6$4, [
                _hoisted_7$3,
                createElementVNode("span", {
                  innerHTML: replaceKeyword(data == null ? void 0 : data.remark_name)
                }, null, 8, _hoisted_8$3)
              ])) : createCommentVNode("", true),
              (data == null ? void 0 : data.mobile) ? (openBlock(), createElementBlock("p", _hoisted_9$2, [
                _hoisted_10$2,
                createElementVNode("span", {
                  innerHTML: replaceKeyword(data == null ? void 0 : data.mobile)
                }, null, 8, _hoisted_11$2)
              ])) : createCommentVNode("", true),
              (data == null ? void 0 : data.email) ? (openBlock(), createElementBlock("p", _hoisted_12$2, [
                _hoisted_13$2,
                createElementVNode("span", {
                  innerHTML: replaceKeyword(data == null ? void 0 : data.email)
                }, null, 8, _hoisted_14$1)
              ])) : createCommentVNode("", true)
            ])) : createCommentVNode("", true)
          ])
        ], 8, _hoisted_1$5);
      }), 128);
    };
  }
});
var GloCustomerList = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-107e598c"]]);
var GloClueList_vue_vue_type_style_index_0_scoped_true_lang = "";
const _hoisted_1$4 = ["onClick"];
const _hoisted_2$4 = { class: "clue-img" };
const _hoisted_3$4 = ["innerHTML"];
const _hoisted_4$3 = {
  key: 0,
  class: "corp-name"
};
const _hoisted_5$3 = {
  key: 1,
  class: "info"
};
const _hoisted_6$3 = { key: 0 };
const _hoisted_7$2 = /* @__PURE__ */ createTextVNode(" \u5907\u6CE8: ");
const _hoisted_8$2 = ["innerHTML"];
const _hoisted_9$1 = { key: 1 };
const _hoisted_10$1 = /* @__PURE__ */ createTextVNode(" \u624B\u673A\u53F7: ");
const _hoisted_11$1 = ["innerHTML"];
const _hoisted_12$1 = { key: 2 };
const _hoisted_13$1 = /* @__PURE__ */ createTextVNode(" \u90AE\u7BB1: ");
const _hoisted_14 = ["innerHTML"];
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
  __name: "GloClueList",
  props: {
    list: { default: () => [] },
    keyword: { default: "" },
    search_type: null
  },
  emits: ["onSearchItemSelect"],
  setup(__props, { emit }) {
    const props = __props;
    const replaceKeyword = (str) => {
      if (!str)
        return "";
      if (!props.keyword)
        return str;
      const reg = new RegExp(props.keyword, "ig");
      return str.replace(reg, function(text) {
        return `<span style="color: var(--wl-primary-color)">${text}</span>`;
      });
    };
    const onHandleClick = (item) => {
      emit("onSearchItemSelect", {
        ...item,
        search_type: props.search_type
      });
    };
    return (_ctx, _cache) => {
      return openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (data) => {
        var _a;
        return openBlock(), createElementBlock("div", {
          class: "clue-list",
          "data-weiling-mobile-ui-clue-list": "",
          key: data.clue_id,
          onClick: withModifiers(($event) => onHandleClick(data), ["stop"])
        }, [
          createElementVNode("div", _hoisted_2$4, toDisplayString((_a = data == null ? void 0 : data.nick_name) == null ? void 0 : _a[0]), 1),
          createElementVNode("div", null, [
            createElementVNode("p", {
              class: "nick-name",
              innerHTML: replaceKeyword((data == null ? void 0 : data.nick_name) || "-")
            }, null, 8, _hoisted_3$4),
            data.corp_name ? (openBlock(), createElementBlock("p", _hoisted_4$3, toDisplayString(data.corp_name), 1)) : createCommentVNode("", true),
            (data == null ? void 0 : data.remark_name) || (data == null ? void 0 : data.mobile) || (data == null ? void 0 : data.email) ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
              (data == null ? void 0 : data.remark_name) ? (openBlock(), createElementBlock("p", _hoisted_6$3, [
                _hoisted_7$2,
                createElementVNode("span", {
                  innerHTML: replaceKeyword(data == null ? void 0 : data.remark_name)
                }, null, 8, _hoisted_8$2)
              ])) : createCommentVNode("", true),
              (data == null ? void 0 : data.mobile) ? (openBlock(), createElementBlock("p", _hoisted_9$1, [
                _hoisted_10$1,
                createElementVNode("span", {
                  innerHTML: replaceKeyword(data == null ? void 0 : data.mobile)
                }, null, 8, _hoisted_11$1)
              ])) : createCommentVNode("", true),
              (data == null ? void 0 : data.email) ? (openBlock(), createElementBlock("p", _hoisted_12$1, [
                _hoisted_13$1,
                createElementVNode("span", {
                  innerHTML: replaceKeyword(data == null ? void 0 : data.email)
                }, null, 8, _hoisted_14)
              ])) : createCommentVNode("", true)
            ])) : createCommentVNode("", true)
          ])
        ], 8, _hoisted_1$4);
      }), 128);
    };
  }
});
var GloClueList = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-17424a84"]]);
var GloCompanyList_vue_vue_type_style_index_0_scoped_true_lang = "";
const _hoisted_1$3 = ["onClick"];
const _hoisted_2$3 = ["innerHTML"];
const _hoisted_3$3 = ["innerHTML"];
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  __name: "GloCompanyList",
  props: {
    list: { default: () => [] },
    keyword: { default: "" },
    search_type: null
  },
  emits: ["onSearchItemSelect"],
  setup(__props, { emit }) {
    const props = __props;
    const replaceKeyword = (str) => {
      if (!str)
        return "";
      if (!props.keyword)
        return str;
      const reg = new RegExp(props.keyword, "ig");
      return str.replace(reg, function(text) {
        return `<span style="color: var(--wl-primary-color)">${text}</span>`;
      });
    };
    const onHandleClick = (item) => {
      emit("onSearchItemSelect", {
        ...item,
        search_type: props.search_type
      });
    };
    return (_ctx, _cache) => {
      return openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (data) => {
        return openBlock(), createElementBlock("div", {
          class: "glo-company-list",
          "data-weiling-mobile-ui-glo-company-list": "",
          key: data.company_id,
          onClick: withModifiers(($event) => onHandleClick(data), ["stop"])
        }, [
          createVNode(_sfc_main$9, {
            class: "company-img",
            src: data.image_url || "https://wlmvp-cos.weiling.cn/website/worktable-erp/images/default/overview-company-icon.png"
          }, null, 8, ["src"]),
          createElementVNode("div", null, [
            data.abbreviation || data.company_name ? (openBlock(), createElementBlock("p", {
              key: 0,
              class: "nick-name",
              innerHTML: replaceKeyword(data.abbreviation || data.company_name)
            }, null, 8, _hoisted_2$3)) : createCommentVNode("", true),
            data.company_name && data.abbreviation ? (openBlock(), createElementBlock("p", {
              key: 1,
              class: "company-name",
              innerHTML: replaceKeyword("\u5168\u540D: " + data.company_name)
            }, null, 8, _hoisted_3$3)) : createCommentVNode("", true)
          ])
        ], 8, _hoisted_1$3);
      }), 128);
    };
  }
});
var GloCompanyList = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-f7c0c442"]]);
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    search_type: { default: 1 }
  },
  setup(__props) {
    const props = __props;
    const SearchTypeEnum2 = {
      2: GloClueList,
      5: GloCompanyList,
      1: GloCustomerList,
      4: GloCustomerList
    };
    const com_name = computed(() => {
      return SearchTypeEnum2[props.search_type];
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(resolveDynamicComponent(unref(com_name)), mergeProps(_ctx.$attrs, { search_type: __props.search_type }), null, 16, ["search_type"]);
    };
  }
});
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
const _withScopeId = (n) => (pushScopeId("data-v-f229d250"), n = n(), popScopeId(), n);
const _hoisted_1$2 = {
  class: "all-result",
  "data-weiling-mobile-ui-all-result": ""
};
const _hoisted_2$2 = { class: "title" };
const _hoisted_3$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "label" }, "\u4E2A\u5FAE\u4EBA\u8109", -1));
const _hoisted_4$2 = { class: "title" };
const _hoisted_5$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "label" }, "\u4F01\u5FAE\u597D\u53CB", -1));
const _hoisted_6$2 = { class: "title" };
const _hoisted_7$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "label" }, "\u8054\u7CFB\u4EBA", -1));
const _hoisted_8$1 = { class: "title" };
const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "label" }, "\u4F01\u4E1A", -1));
const _hoisted_10 = {
  key: 4,
  class: "result_empty"
};
const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
  src: "https://wlmvp-cos.weiling.cn/worktable-h5/images/perch_default_no result.png",
  alt: ""
}, null, -1));
const _hoisted_12 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, "\u6682\u672A\u641C\u7D22\u5230\u76F8\u5173\u7ED3\u679C", -1));
const _hoisted_13 = [
  _hoisted_11,
  _hoisted_12
];
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    data: { default: null },
    keyword: { default: "" }
  },
  emits: ["onViewMoreModule", "onSearchItemSelect"],
  setup(__props, { emit }) {
    const props = __props;
    const com_company_data = computed(() => {
      var _a, _b, _c;
      return (_c = (_b = (_a = props.data) == null ? void 0 : _a.company_list) == null ? void 0 : _b.data_list) == null ? void 0 : _c.filter(
        (res) => res.permission
      );
    });
    const hasData = computed(() => {
      var _a, _b, _c, _d, _e, _f, _g, _h;
      return ((_b = (_a = props.data) == null ? void 0 : _a.wx_user_list) == null ? void 0 : _b.count) || ((_d = (_c = props.data) == null ? void 0 : _c.external_user_list) == null ? void 0 : _d.count) || ((_f = (_e = props.data) == null ? void 0 : _e.clue_list) == null ? void 0 : _f.count) || ((_h = (_g = props.data) == null ? void 0 : _g.company_list) == null ? void 0 : _h.count);
    });
    const onViewMoreModule = (search_type) => {
      emit("onViewMoreModule", search_type);
    };
    const onSearchItemSelect = (item) => {
      emit("onSearchItemSelect", item);
    };
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
      return openBlock(), createElementBlock("div", _hoisted_1$2, [
        ((_c = (_b = (_a = __props.data) == null ? void 0 : _a.wx_user_list) == null ? void 0 : _b.data_list) == null ? void 0 : _c.length) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
          createElementVNode("p", _hoisted_2$2, [
            _hoisted_3$2,
            ((_e = (_d = __props.data) == null ? void 0 : _d.wx_user_list) == null ? void 0 : _e.count) > 3 ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: "more_btn",
              onClick: _cache[0] || (_cache[0] = ($event) => onViewMoreModule(4))
            }, "\u67E5\u770B\u66F4\u591A")) : createCommentVNode("", true)
          ]),
          createVNode(_sfc_main$4, {
            list: (_g = (_f = __props.data) == null ? void 0 : _f.wx_user_list) == null ? void 0 : _g.data_list,
            onOnSearchItemSelect: onSearchItemSelect,
            keyword: __props.keyword,
            search_type: (_h = __props.data) == null ? void 0 : _h.wx_user_list.search_type
          }, null, 8, ["list", "keyword", "search_type"])
        ], 64)) : createCommentVNode("", true),
        ((_k = (_j = (_i = __props.data) == null ? void 0 : _i.external_user_list) == null ? void 0 : _j.data_list) == null ? void 0 : _k.length) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
          createElementVNode("p", _hoisted_4$2, [
            _hoisted_5$2,
            ((_m = (_l = __props.data) == null ? void 0 : _l.external_user_list) == null ? void 0 : _m.count) > 3 ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: "more_btn",
              onClick: _cache[1] || (_cache[1] = ($event) => onViewMoreModule(1))
            }, "\u67E5\u770B\u66F4\u591A")) : createCommentVNode("", true)
          ]),
          createVNode(_sfc_main$4, {
            list: (_o = (_n = __props.data) == null ? void 0 : _n.external_user_list) == null ? void 0 : _o.data_list,
            onOnSearchItemSelect: onSearchItemSelect,
            keyword: __props.keyword,
            search_type: (_p = __props.data) == null ? void 0 : _p.external_user_list.search_type
          }, null, 8, ["list", "keyword", "search_type"])
        ], 64)) : createCommentVNode("", true),
        ((_s = (_r = (_q = __props.data) == null ? void 0 : _q.clue_list) == null ? void 0 : _r.data_list) == null ? void 0 : _s.length) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
          createElementVNode("p", _hoisted_6$2, [
            _hoisted_7$1,
            ((_u = (_t = __props.data) == null ? void 0 : _t.clue_list) == null ? void 0 : _u.count) > 3 ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: "more_btn",
              onClick: _cache[2] || (_cache[2] = ($event) => onViewMoreModule(2))
            }, "\u67E5\u770B\u66F4\u591A")) : createCommentVNode("", true)
          ]),
          createVNode(_sfc_main$4, {
            list: (_w = (_v = __props.data) == null ? void 0 : _v.clue_list) == null ? void 0 : _w.data_list,
            onOnSearchItemSelect: onSearchItemSelect,
            keyword: __props.keyword,
            search_type: (_x = __props.data) == null ? void 0 : _x.clue_list.search_type
          }, null, 8, ["list", "keyword", "search_type"])
        ], 64)) : createCommentVNode("", true),
        ((_y = unref(com_company_data)) == null ? void 0 : _y.length) ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
          createElementVNode("p", _hoisted_8$1, [
            _hoisted_9,
            ((_A = (_z = __props.data) == null ? void 0 : _z.company_list) == null ? void 0 : _A.count) > 3 ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: "more_btn",
              onClick: _cache[3] || (_cache[3] = ($event) => onViewMoreModule(5))
            }, "\u67E5\u770B\u66F4\u591A")) : createCommentVNode("", true)
          ]),
          createVNode(_sfc_main$4, {
            list: unref(com_company_data),
            onOnSearchItemSelect: onSearchItemSelect,
            keyword: __props.keyword,
            search_type: (_C = (_B = __props.data) == null ? void 0 : _B.company_list) == null ? void 0 : _C.search_type
          }, null, 8, ["list", "keyword", "search_type"])
        ], 64)) : createCommentVNode("", true),
        !unref(hasData) && __props.keyword ? (openBlock(), createElementBlock("div", _hoisted_10, _hoisted_13)) : createCommentVNode("", true)
      ]);
    };
  }
});
var AllResult = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f229d250"]]);
const __default__$2 = {
  name: "WlLoadMore"
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  ...__default__$2,
  props: {
    modelValue: { type: Boolean, default: false },
    finished: { type: Boolean, default: false },
    finished_text: { default: "\u6CA1\u6709\u66F4\u591A\u4E86" }
  },
  emits: ["load", "update:modelValue"],
  setup(__props, { emit }) {
    const props = __props;
    const loadShow = ref(false);
    const onLoad = () => emit("load");
    watchEffect(() => {
      loadShow.value = props.modelValue;
    });
    watch(
      () => loadShow.value,
      (val) => {
        emit("update:modelValue", val);
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(List), {
        loading: loadShow.value,
        "onUpdate:loading": _cache[0] || (_cache[0] = ($event) => loadShow.value = $event),
        offset: 50,
        "immediate-check": false,
        finished: __props.finished,
        "finished-text": __props.finished_text,
        onLoad
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
      }, 8, ["loading", "finished", "finished-text"]);
    };
  }
});
const usePagination = () => {
  const State = reactive({
    limit: 10,
    page_count: 1,
    isLoading: false,
    isFinished: false
  });
  const onResetParams = () => {
    State.page_count = 1;
  };
  const judgeLoadStatus = (list, count) => {
    State.page_count++;
    State.isLoading = false;
    State.isFinished = (list == null ? void 0 : list.length) < State.limit || count === 10;
  };
  const onJudgeLoadStatus = (result) => {
    State.isLoading = false;
    const { cursor } = result;
    if (!cursor)
      State.isFinished = true;
  };
  return {
    ...toRefs(State),
    judgeLoadStatus,
    onResetParams,
    onJudgeLoadStatus
  };
};
var index_vue_vue_type_style_index_0_lang$1 = "";
const _hoisted_1$1 = {
  class: "bc-global-search-item",
  "data-weiling-mobile-ui-bc-global-search-item": ""
};
const _hoisted_2$1 = { class: "label" };
const _hoisted_3$1 = {
  key: 0,
  class: "result_empty"
};
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("img", {
  src: "https://wlmvp-cos.weiling.cn/worktable-h5/images/perch_default_no result.png",
  alt: ""
}, null, -1);
const _hoisted_5$1 = /* @__PURE__ */ createElementVNode("p", null, "\u6682\u672A\u641C\u7D22\u5230\u76F8\u5173\u7ED3\u679C", -1);
const _hoisted_6$1 = [
  _hoisted_4$1,
  _hoisted_5$1
];
var SearchTypeEnum = /* @__PURE__ */ ((SearchTypeEnum2) => {
  SearchTypeEnum2[SearchTypeEnum2["clue_list"] = 2] = "clue_list";
  SearchTypeEnum2[SearchTypeEnum2["company_list"] = 5] = "company_list";
  SearchTypeEnum2[SearchTypeEnum2["external_user_list"] = 1] = "external_user_list";
  SearchTypeEnum2[SearchTypeEnum2["wx_user_list"] = 4] = "wx_user_list";
  return SearchTypeEnum2;
})(SearchTypeEnum || {});
var SearchTitleEnum = /* @__PURE__ */ ((SearchTitleEnum2) => {
  SearchTitleEnum2[SearchTitleEnum2["\u8054\u7CFB\u4EBA"] = 2] = "\u8054\u7CFB\u4EBA";
  SearchTitleEnum2[SearchTitleEnum2["\u4F01\u4E1A"] = 5] = "\u4F01\u4E1A";
  SearchTitleEnum2[SearchTitleEnum2["\u4F01\u5FAE\u597D\u53CB"] = 1] = "\u4F01\u5FAE\u597D\u53CB";
  SearchTitleEnum2[SearchTitleEnum2["\u4E2A\u5FAE\u4EBA\u8109"] = 4] = "\u4E2A\u5FAE\u4EBA\u8109";
  return SearchTitleEnum2;
})(SearchTitleEnum || {});
const __default__$1 = {
  name: "BCGlobalSearchItem"
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  ...__default__$1,
  props: {
    modelValue: { type: Boolean, default: false },
    env_data: { default: () => {
      return {
        sid: "",
        domain: "",
        corp_id: "",
        node_env: "dev",
        app_id: "",
        token: "",
        card_resource: ""
      };
    } },
    title: { default: "\u9009\u62E9\u8DDF\u8FDB\u5BF9\u8C61" },
    search_type: { default: 1 },
    keyword: { default: "" }
  },
  emits: ["update:modelValue", "onSearchItemSelect"],
  setup(__props, { emit }) {
    const props = __props;
    const { limit, page_count, isLoading, isFinished, judgeLoadStatus } = usePagination();
    Store$1.corp_id = props.env_data.corp_id;
    Store$1.sid = props.env_data.sid;
    Store$1.node_env = props.env_data.node_env;
    Store$1.token = props.env_data.token;
    Store$1.card_resource = props.env_data.card_resource;
    let popUpVisible = ref(false);
    const searchKeyword = ref("");
    const result = ref([]);
    const initData = async () => {
      isLoading.value = true;
      if (page_count.value == 1) {
        result.value = [];
      }
      try {
        const { data } = await Api.getSearchByType({
          keyword: searchKeyword.value,
          page: page_count.value,
          limit: limit.value,
          search_type: props.search_type
        });
        const { data_list = [], count } = (data == null ? void 0 : data[SearchTypeEnum[props.search_type]]) || {};
        result.value = [...result.value, ...data_list];
        judgeLoadStatus(data_list, count);
        isLoading.value = false;
      } catch (error) {
        isLoading.value = false;
        isFinished.value = false;
      }
    };
    const onChange = (key) => {
      page_count.value = 1;
      if (!key) {
        result.value = [];
        searchKeyword.value = "";
        return;
      }
      initData();
    };
    const onSearchItemSelect = (item) => {
      popUpVisible.value = false;
      emit("onSearchItemSelect", item);
    };
    watch(
      () => props.modelValue,
      (bol) => {
        popUpVisible.value = bol;
        searchKeyword.value = props.keyword;
        if (props.keyword && bol) {
          page_count.value = 1;
          initData();
        }
      }
    );
    watch(
      () => popUpVisible.value,
      (bol) => {
        emit("update:modelValue", bol);
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$a, {
        modelValue: unref(popUpVisible),
        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(popUpVisible) ? popUpVisible.value = $event : popUpVisible = $event),
        showBack: "",
        round: "",
        position: "bottom",
        title: __props.title,
        headerVisible: "",
        teleport: "body",
        style: { "height": "90%" },
        closeOnClickAction: true,
        needAutoBack: false,
        onOnBack: _cache[3] || (_cache[3] = ($event) => isRef(popUpVisible) ? popUpVisible.value = false : popUpVisible = false)
      }, {
        default: withCtx(() => {
          var _a;
          return [
            createElementVNode("div", _hoisted_1$1, [
              createVNode(_sfc_main$8, {
                class: "key-input",
                modelValue: searchKeyword.value,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKeyword.value = $event),
                placeholder: "\u641C\u7D22",
                onOnChange: onChange
              }, null, 8, ["modelValue"]),
              createElementVNode("span", _hoisted_2$1, toDisplayString(SearchTitleEnum[__props.search_type]), 1),
              createVNode(_sfc_main$2, {
                class: "search-con",
                modelValue: unref(isLoading),
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(isLoading) ? isLoading.value = $event : null),
                finished: unref(isFinished),
                finished_text: ((_a = result.value) == null ? void 0 : _a.length) ? "\u6CA1\u6709\u66F4\u591A\u4E86" : "",
                onLoad: initData
              }, {
                default: withCtx(() => {
                  var _a2;
                  return [
                    createVNode(_sfc_main$4, {
                      list: result.value,
                      search_type: __props.search_type,
                      onOnSearchItemSelect: onSearchItemSelect,
                      keyword: searchKeyword.value
                    }, null, 8, ["list", "search_type", "keyword"]),
                    !((_a2 = result.value) == null ? void 0 : _a2.length) && searchKeyword.value && !unref(isLoading) ? (openBlock(), createElementBlock("div", _hoisted_3$1, _hoisted_6$1)) : createCommentVNode("", true)
                  ];
                }),
                _: 1
              }, 8, ["modelValue", "finished", "finished_text"])
            ])
          ];
        }),
        _: 1
      }, 8, ["modelValue", "title"]);
    };
  }
});
var loadingImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAACoCAMAAABDlVWGAAAAn1BMVEUAAADPz8/Pz8/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bRPDp/1Tn1Mf1p8BhCs1G6IVKeaMZU1dzlMoJZfe05ccaGPSuJyKCwN9i8jd2aBtnAkzKloo4zW7bdLBP7vZ2JE8jY0YTSsi5Ya78du9p6CtPdCbz9xVJz3Sh1AE2up+YDAQpte9PkfpSZr1X3pZDgNcgwzh6ZO3NazEXyKoQaazgtznA1nrDsPj3bIwtvG98RlbCjZW9fdOX4AcQSzK4mkwmOkGyQs91mXrtkjVGK3aBUXG1yM+FI5eyNJHl3yETk7Bb/dtCog1Pdmi0DUy3nYUyq0kc2HsoKxBSqYnX3sxwccyqr5ndAh8Fi1rku8pSWzl7Akn6aqw6ET3PlHzsrgPaxs83aY01+0bN4pSyE0M4HG3tF+wk7inuWlXs6NwAAAABJRU5ErkJggg==";
var index_vue_vue_type_style_index_0_lang = "";
const _hoisted_1 = {
  class: "bc-global-search",
  "data-weiling-mobile-ui-bc-global-search": ""
};
const _hoisted_2 = { class: "key-input" };
const _hoisted_3 = { class: "result_empty" };
const _hoisted_4 = /* @__PURE__ */ createElementVNode("img", {
  src: "https://wlmvp-cos.weiling.cn/worktable-h5/images/perch_default_no result.png",
  alt: ""
}, null, -1);
const _hoisted_5 = /* @__PURE__ */ createElementVNode("p", null, "\u53EF\u4EE5\u641C\u7D22\u627E\u5230\u5BF9\u5E94\u7684\u8054\u7CFB\u4EBA\u6216\u4F01\u4E1A", -1);
const _hoisted_6 = [
  _hoisted_4,
  _hoisted_5
];
const _hoisted_7 = {
  key: 0,
  class: "loading"
};
const _hoisted_8 = { class: "loading-pic" };
const __default__ = {
  name: "BCGlobalSearch"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    modelValue: { type: Boolean, default: false },
    env_data: { default: () => {
      return {
        sid: "",
        domain: "",
        corp_id: "",
        node_env: "dev",
        app_id: "",
        token: "",
        card_resource: ""
      };
    } },
    title: { default: "\u9009\u62E9\u8DDF\u8FDB\u5BF9\u8C61" }
  },
  emits: ["update:modelValue", "onSearchItemSelect"],
  setup(__props, { emit }) {
    const props = __props;
    Store$1.corp_id = props.env_data.corp_id;
    Store$1.sid = props.env_data.sid;
    Store$1.node_env = props.env_data.node_env;
    Store$1.token = props.env_data.token;
    Store$1.card_resource = props.env_data.card_resource;
    let popUpVisible = ref(false);
    const itemPopUpVisible = ref(false);
    const keyword = ref("");
    const result = ref({});
    const loading = ref(false);
    const search_type = ref(1);
    const initData = async () => {
      loading.value = true;
      try {
        const { data } = await Api.getSearchByType({
          keyword: keyword.value,
          page: 1,
          limit: 3,
          search_type: 0
        });
        result.value = data;
        loading.value = false;
      } catch (error) {
        loading.value = false;
      }
    };
    const onChange = (key) => {
      if (!key) {
        result.value = {};
        keyword.value = "";
        return;
      }
      initData();
    };
    const onSearchItemSelect = (item) => {
      popUpVisible.value = false;
      emit("onSearchItemSelect", item);
    };
    const onViewMoreModule = (type) => {
      itemPopUpVisible.value = true;
      search_type.value = type;
    };
    watch(
      () => props.modelValue,
      (bol) => {
        popUpVisible.value = bol;
      }
    );
    watch(
      () => popUpVisible.value,
      (bol) => {
        emit("update:modelValue", bol);
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_sfc_main$a, {
          modelValue: unref(popUpVisible),
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(popUpVisible) ? popUpVisible.value = $event : popUpVisible = $event),
          round: "",
          position: "bottom",
          title: __props.title,
          headerVisible: "",
          teleport: "body",
          style: { "height": "90%" },
          closeOnClickAction: true
        }, {
          header_part_left: withCtx(() => [
            renderSlot(_ctx.$slots, "header_part_left")
          ]),
          default: withCtx(() => [
            createElementVNode("div", _hoisted_1, [
              createElementVNode("div", _hoisted_2, [
                createVNode(_sfc_main$8, {
                  modelValue: keyword.value,
                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => keyword.value = $event),
                  placeholder: "\u641C\u7D22",
                  onOnChange: onChange
                }, null, 8, ["modelValue"])
              ]),
              withDirectives(createElementVNode("div", _hoisted_3, _hoisted_6, 512), [
                [vShow, !keyword.value]
              ]),
              createVNode(AllResult, {
                class: "search-con",
                data: result.value,
                keyword: keyword.value,
                onOnSearchItemSelect: onSearchItemSelect,
                onOnViewMoreModule: onViewMoreModule
              }, null, 8, ["data", "keyword"]),
              loading.value && keyword.value ? (openBlock(), createElementBlock("div", _hoisted_7, [
                createElementVNode("div", _hoisted_8, [
                  createVNode(_sfc_main$9, { src: unref(loadingImg) }, null, 8, ["src"])
                ])
              ])) : createCommentVNode("", true)
            ])
          ]),
          _: 3
        }, 8, ["modelValue", "title"]),
        createVNode(_sfc_main$1, {
          modelValue: itemPopUpVisible.value,
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => itemPopUpVisible.value = $event),
          keyword: keyword.value,
          env_data: __props.env_data,
          search_type: search_type.value,
          onOnSearchItemSelect: onSearchItemSelect
        }, null, 8, ["modelValue", "keyword", "env_data", "search_type"])
      ], 64);
    };
  }
});
_sfc_main.install = (app) => {
  app.component(_sfc_main.name, _sfc_main);
};
export { _sfc_main as default };
