import { defineComponent, openBlock, createBlock, unref, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, createVNode, render, reactive, toRefs, ref, computed, pushScopeId, popScopeId, watch, normalizeStyle, renderSlot, watchEffect, Fragment, withDirectives, vModelText, useSlots, createSlots, withCtx, toRaw, vShow, createTextVNode, mergeProps, withModifiers, isRef, withKeys, renderList } from "vue";
import WlSvg from "@wltech/svg";
import { Popover, List, Popup, showConfirmDialog, closeDialog, ActionSheet, Dialog, Checkbox, Tabs, Tab } from "vant";
import vuedraggable from "vuedraggable";
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__$i = {
  name: "WlSvgIcon"
};
const _sfc_main$j = /* @__PURE__ */ defineComponent({
  ...__default__$i,
  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$5 = "";
const _hoisted_1$e = { class: "icon" };
const _hoisted_2$e = { class: "text" };
const __default__$h = {
  name: "WlNotice"
};
const _sfc_main$i = /* @__PURE__ */ defineComponent({
  ...__default__$h,
  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$e, [
          __props.type === "success" ? (openBlock(), createBlock(_sfc_main$j, {
            key: 0,
            type: "successFill",
            width: "24",
            height: "24",
            color: "#45ce03"
          })) : __props.type === "warning" ? (openBlock(), createBlock(_sfc_main$j, {
            key: 1,
            type: "warningFill",
            width: "24",
            height: "24",
            color: "#f3a401"
          })) : __props.type === "alert" ? (openBlock(), createBlock(_sfc_main$j, {
            key: 2,
            type: "tipsFill",
            width: "24",
            height: "24",
            color: "#1b9fff"
          })) : __props.type === "error" ? (openBlock(), createBlock(_sfc_main$j, {
            key: 3,
            type: "closeFill",
            width: "24",
            height: "24",
            color: "#ff2a2d"
          })) : createCommentVNode("", true)
        ]),
        createElementVNode("p", _hoisted_2$e, 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$i, {
    ...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 isEmpty = (value) => {
  if (value === null || value === "" || value === void 0 || value === "null" || value === "0") {
    return true;
  } else if (typeof value === "string") {
    value = value.replace(/\s/g, "");
    if (value === "") {
      return true;
    }
    return false;
  }
  return false;
};
const sizeTostr = (bytes) => {
  if (isEmpty(bytes))
    return "0 B";
  const k = 1024, sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], i = Math.floor(Math.log(bytes) / Math.log(k));
  return (bytes / Math.pow(k, i)).toPrecision(3) + " " + sizes[i];
};
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 GET = (url, options) => {
  return request(url, options, "GET");
};
const POST = (url, options) => {
  return request(url, options, "POST");
};
var Api$2 = {
  getMaterialList(paramas) {
    return POST(`${proxy_api[Store$1.node_env]}/interact/material/list`, paramas);
  },
  getGroupList(params) {
    return POST(
      `${proxy_api[Store$1.node_env]}/interact/material/group/list`,
      params
    );
  },
  getMaterialGroupCount(paramas) {
    return GET(`${proxy_api[Store$1.node_env]}/interact/material/count`, paramas);
  }
};
const materialSearchDict = [
  {
    text: "\u5168\u90E8",
    value: 0,
    className: "popover-active"
  },
  {
    text: "\u94FE\u63A5",
    value: 1
  },
  {
    text: "\u6587\u4EF6",
    value: 2
  }
];
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_scoped_true_lang$6 = "";
var _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const _hoisted_1$d = { class: "flex-row" };
const _hoisted_2$d = { class: "file_logo" };
const _hoisted_3$c = ["src"];
const _hoisted_4$6 = { class: "flex-center" };
const _hoisted_5$6 = { key: 0 };
const _hoisted_6$4 = { class: "file_info" };
const _hoisted_7$1 = { class: "size" };
const _hoisted_8 = { class: "view_count" };
const _sfc_main$h = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    data: { default: () => {
    } },
    disabled: { type: Boolean, default: false },
    sub_type_not_allow: { type: Boolean, default: true }
  },
  setup(__props) {
    const props = __props;
    const refName = ref(null);
    const statis = computed(() => {
      var _a;
      return (_a = props.data) == null ? void 0 : _a.statis;
    });
    const material = computed(() => {
      var _a;
      return ((_a = props.data) == null ? void 0 : _a.material) || {};
    });
    const size = computed(() => {
      var _a, _b, _c, _d;
      if (((_b = (_a = props.data) == null ? void 0 : _a.material) == null ? void 0 : _b.material_type) == 1) {
        return props.data.material.material_subtitle;
      } else {
        return sizeTostr((_d = (_c = props.data) == null ? void 0 : _c.material) == null ? void 0 : _d.material_size);
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["file_item", {
          disabled: __props.disabled || __props.sub_type_not_allow,
          "need-opacity": __props.sub_type_not_allow
        }])
      }, [
        createElementVNode("div", _hoisted_1$d, [
          createElementVNode("div", _hoisted_2$d, [
            createElementVNode("img", {
              src: unref(material).material_logo,
              alt: ""
            }, null, 8, _hoisted_3$c),
            createElementVNode("div", _hoisted_4$6, [
              !__props.sub_type_not_allow ? (openBlock(), createElementBlock("p", _hoisted_5$6, "\u5DF2\u9009\u62E9")) : createCommentVNode("", true)
            ])
          ]),
          createElementVNode("div", _hoisted_6$4, [
            createElementVNode("p", {
              class: "name",
              ref_key: "refName",
              ref: refName
            }, toDisplayString(unref(material).material_name), 513),
            createElementVNode("p", _hoisted_7$1, toDisplayString(unref(size)), 1)
          ])
        ]),
        createElementVNode("div", _hoisted_8, "\u6D4F\u89C8\u91CF" + toDisplayString(unref(statis).view_count), 1)
      ], 2);
    };
  }
});
var MaterialCell = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-b9a1294c"]]);
var index_vue_vue_type_style_index_0_scoped_true_lang$5 = "";
const _withScopeId$3 = (n) => (pushScopeId("data-v-1de00fd4"), n = n(), popScopeId(), n);
const _hoisted_1$c = { class: "material-title" };
const _hoisted_2$c = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("span", null, "\u5206\u7EC4\uFF1A", -1));
const _hoisted_3$b = { class: "group-name" };
const _hoisted_4$5 = { class: "group-name-text" };
const _hoisted_5$5 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("span", { class: "arrow-icon" }, null, -1));
const _hoisted_6$3 = { key: 0 };
const __default__$g = {
  name: "MaterialTitle"
};
const _sfc_main$g = /* @__PURE__ */ defineComponent({
  ...__default__$g,
  props: {
    group_name: { default: "\u5168\u90E8" },
    total: { default: "0" }
  },
  emits: ["onToggleGroup"],
  setup(__props, { emit }) {
    const onToggleGroup = () => {
      emit("onToggleGroup");
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$c, [
        createElementVNode("div", {
          class: "group-name-wrap",
          onClick: onToggleGroup
        }, [
          _hoisted_2$c,
          createElementVNode("p", _hoisted_3$b, [
            createElementVNode("span", _hoisted_4$5, toDisplayString(__props.group_name), 1),
            _hoisted_5$5
          ]),
          __props.total || __props.total == 0 ? (openBlock(), createElementBlock("span", _hoisted_6$3, "\xB7" + toDisplayString(__props.total), 1)) : createCommentVNode("", true)
        ])
      ]);
    };
  }
});
var MaterialTitle = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-1de00fd4"]]);
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$b = ["src", "alt"];
const _hoisted_2$b = ["src"];
const _hoisted_3$a = ["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__$f = {
  name: "WlPic"
};
const _sfc_main$f = /* @__PURE__ */ defineComponent({
  ...__default__$f,
  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$b)) : 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$b)) : 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$a)) : createCommentVNode("", true),
        renderSlot(_ctx.$slots, "picFooter")
      ], 2);
    };
  }
});
var searchIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAASNSURBVHgB7ZqPddowEMYvZAE6Qb1B0gmACUInKJkgZIKSCZJMEJigdAJMFijdQJmgdICEfgdyHzWnv7YMDfze8zNPdiLr00k66Y7oxIkTJ46YM0rMbDa7xI2v7Ozs7OP2s9Vq9Rs3pa9Fr9dT1DC1C4AGt3Hro7FXuLr43Q74cwVRclwTiJFTA9QmADe81Wrd4OeQwhptQr29vd1BiDElpLIACRpeJqkQlQRA47to/BN+ZpQYDIsprtu654loAebz+VfcRr7v4+NfMCco2kx4TKbvF+RvOWwNLMKUaiJYADZ5NOQe18Dx6hLXBB/MH8sz/NLyP9crBaypj/sVuRl1Op07qoEgAfR4n9FmWTOxHrO4T22NttSRoY4Rfn5xvFqLCEEC5Hn+ZOl5buwjPmpENeApxAD1TagC3gI4xjz3ei+FIwMhhhCC6xbnCdT7CfUuKBIvAfARfXzEN8PjhW58sLn7wnOErj8THistQlT9LdcL2hTvDY+TN57hHuZ6aDPMymTaQqJwCqCdnEx4pJpofAEPL9T32fB4yD4JRWAVgHufNh7eDk02voD3B+wHSM/Oz8+jrMBlASND+d0+dm4M6n3ASpSXy+FodWOswCoAzL8jFKu6lrpYXl9fxfUfwtxQIEYBoOaAhLGvnZy9wkNBsgLefuvtuDc2C+gLZSr19tQXgxWszyIoAKMAkvlLqu8LfWCyMwnjGzsUgCiA3pzsmBJU/04HBIbjzvfoUyhvTBaQGcpzOixyoSwLmQdMAki7PdX0uu+BaQ9QWYBMKHuhw8PUIRl54nSFPSrbGxZnLCNPvAWAp/WL3iHeAmB2/UD/D8r3RZMAkrl/pANDb9YqYRJACWUZHR6ZoVyRJyECtOtQvGbEw9mQnapJANP6GuRnp4bjj0LxnAIQBWAFOZBRLsehg8+ZfSOwNUpuL9zjoANS4yrAoSihLHi7mZCuoTwoamRbBk3/aEgHgOEgVIWG1Y0C6H+0ECq+2fdkaDqsidmuWx0hjCcp6tLGXHBPe0If04sHoKajMhsuT3BMwpKIuaDPERvaAxyYJbn3xzEHtVYBePtrOgPkXtAHJ43B4Tk0VDyqi+l9xis09vz8POMVQHiULCZYxhabxDdcx55Vem2GoO41mcNSs9SWYGu8Nv0xReIlgCMsxSL80B9ZK+xzICTP+Qgj0zvonJ9UgdAEiaElUMrUNiRcYfES0XkCwSky6OkRbtbe1rl+j6G5PNrLHFgCsjaiRIhKkvKwhIIi8ZE3KIpKuULaoSqySDmxUjyODyBYhOgsMUfSQirmnHTlED9IhJBD0X/YSlqolKPjyRLWcYuGdTk6zMue5d0xhqkrweov0RawjXZPx/gZFJbyYJ14hQY/lGMSvB/QSZomvCyhFgEKdObogNwpbi6MDS/VV1mEWgUo0LM5i9HHBHgJ871w/Ak3ktdzHlbTkC1tVRGSCCCxFXAtrqW+VFW/oYoIjQmQmlgR3o0AjEsE7aXm22XRy+AhwpsiyxI5keaWd2UBBYIlTGD+AzomWAQ4RCtcYzpWYrNHT5w4cTz8Aaz4M79MeVvFAAAAAElFTkSuQmCC";
var index_vue_vue_type_style_index_0_lang$4 = "";
const _hoisted_1$a = {
  class: "search-wrap",
  "data-weiling-mobile-ui-wl-search": ""
};
const _hoisted_2$a = { class: "search-icon" };
const _hoisted_3$9 = { class: "search-input" };
const _hoisted_4$4 = ["placeholder"];
const _hoisted_5$4 = { class: "action" };
const _hoisted_6$2 = { class: "default-search-content" };
const _hoisted_7 = { class: "search-text" };
const __default__$e = {
  name: "WlSearch"
};
const _sfc_main$e = /* @__PURE__ */ defineComponent({
  ...__default__$e,
  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$a, [
        __props.showType === "search" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
          createElementVNode("div", {
            class: normalizeClass(unref(searchClass))
          }, [
            createElementVNode("div", _hoisted_2$a, [
              createVNode(_sfc_main$f, { src: __props.icon }, null, 8, ["src"])
            ]),
            createElementVNode("div", _hoisted_3$9, [
              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$4), [
                [vModelText, fieldValue.value]
              ])
            ]),
            __props.closable && fieldValue.value ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "search-close-icon",
              onClick: onClear
            }, [
              createVNode(_sfc_main$f, { src: unref(deleteIcon) }, null, 8, ["src"])
            ])) : createCommentVNode("", true)
          ], 2),
          createElementVNode("div", _hoisted_5$4, [
            renderSlot(_ctx.$slots, "action")
          ])
        ], 64)) : createCommentVNode("", true),
        __props.showType === "default" ? (openBlock(), createElementBlock("div", {
          key: 1,
          class: "default-search",
          onClick: onClickDefault
        }, [
          createElementVNode("div", _hoisted_6$2, [
            createVNode(_sfc_main$j, {
              type: "search",
              width: "18",
              height: "18",
              color: "#c1c1c1"
            }),
            createElementVNode("span", _hoisted_7, toDisplayString(__props.placeholder), 1)
          ])
        ])) : createCommentVNode("", true)
      ]);
    };
  }
});
const __default__$d = {
  name: "WlPopover"
};
const _sfc_main$d = /* @__PURE__ */ defineComponent({
  ...__default__$d,
  props: {
    actions: { default: null },
    modelValue: { type: Boolean, default: false }
  },
  emits: ["update:modelValue", "onSelect"],
  setup(__props, { emit }) {
    const props = __props;
    const slots = useSlots();
    const hasDefault = ref(slots.default !== void 0);
    const slotName = computed(() => hasDefault.value ? "default" : "content");
    const popoverVisible = ref(false);
    const onTogglePopover = (bool) => {
      popoverVisible.value = bool;
      emit("update:modelValue", bool);
    };
    const onSelect = (val) => {
      emit("onSelect", val);
      onTogglePopover(false);
    };
    watchEffect(() => {
      popoverVisible.value = props.modelValue;
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Popover), {
        show: popoverVisible.value,
        "onUpdate:show": _cache[1] || (_cache[1] = ($event) => popoverVisible.value = $event),
        actions: __props.actions,
        onSelect
      }, createSlots({
        reference: withCtx(() => [
          renderSlot(_ctx.$slots, "reference")
        ]),
        _: 2
      }, [
        hasDefault.value ? {
          name: unref(slotName),
          fn: withCtx(() => [
            createElementVNode("div", {
              onClick: _cache[0] || (_cache[0] = ($event) => popoverVisible.value = false)
            }, [
              renderSlot(_ctx.$slots, "default")
            ])
          ])
        } : void 0
      ]), 1032, ["show", "actions"]);
    };
  }
});
var index_vue_vue_type_style_index_0_lang$3 = "";
const _hoisted_1$9 = {
  class: "bc-search",
  "data-weiling-mobile-ui-bc-search": ""
};
const _hoisted_2$9 = { class: "dropdown" };
const _hoisted_3$8 = { class: "text" };
const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("div", { class: "icon" }, null, -1);
const _hoisted_5$3 = { class: "search-wrap" };
const __default__$c = {
  name: "BCSearch"
};
const _sfc_main$c = /* @__PURE__ */ defineComponent({
  ...__default__$c,
  props: {
    filterOptions: { default: () => [] },
    groupBtnVisible: { type: Boolean, default: false },
    placeholder: { default: "" }
  },
  emits: ["onChange", "onMaterialTypeChange", "onClear"],
  setup(__props, { emit }) {
    const props = __props;
    const searchValue = ref("");
    const popOverValue = ref("\u5168\u90E8");
    const popOverVisible = ref(false);
    const popOverActions = ref(null);
    const onSearchChange = (val) => emit("onChange", val);
    const onClear = () => {
      emit("onClear");
    };
    const onPopOverSelect = (val) => {
      popOverActions.value.forEach((res) => res.className = "");
      const idx = popOverActions.value.findIndex((res) => res.value === val.value);
      popOverActions.value[idx].className = "popover-active";
      popOverValue.value = val.text;
      emit("onMaterialTypeChange", toRaw(val));
    };
    watchEffect(() => {
      popOverActions.value = props.filterOptions.reduce((acc, item, index) => {
        if (index === 0) {
          acc.push({ ...item, className: "popover-active" });
        } else {
          acc.push(item);
        }
        return acc;
      }, []);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$9, [
        createVNode(_sfc_main$d, {
          overlay: "",
          offset: [0, 10],
          modelValue: popOverVisible.value,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => popOverVisible.value = $event),
          placement: "bottom-start",
          actions: popOverActions.value,
          onSelect: onPopOverSelect
        }, {
          reference: withCtx(() => [
            createElementVNode("div", _hoisted_2$9, [
              createElementVNode("div", _hoisted_3$8, toDisplayString(popOverValue.value), 1),
              _hoisted_4$3
            ])
          ]),
          _: 1
        }, 8, ["modelValue", "actions"]),
        createElementVNode("div", _hoisted_5$3, [
          createVNode(_sfc_main$e, {
            modelValue: searchValue.value,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchValue.value = $event),
            needBorder: false,
            placeholder: __props.placeholder,
            onOnChange: onSearchChange,
            onOnClear: onClear
          }, null, 8, ["modelValue", "placeholder"])
        ])
      ]);
    };
  }
});
const __default__$b = {
  name: "WlLoadMore"
};
const _sfc_main$b = /* @__PURE__ */ defineComponent({
  ...__default__$b,
  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"]);
    };
  }
});
var Api$1 = {
  getMaterialList(params, type) {
    return POST(
      `${proxy_api[Store$1.node_env]}/api/${type}/material/list`,
      params
    );
  },
  getGroupList(params) {
    return POST(
      `${proxy_api[Store$1.node_env]}/interact/material/group/list`,
      params
    );
  },
  getMaterialGroupCount(params) {
    return GET(`${proxy_api[Store$1.node_env]}/api/user/material/count`, params);
  }
};
const allChooseItem$1 = {
  id: "",
  level: 0,
  root_id: "0",
  group_name: "\u5168\u90E8",
  parent_id: "",
  is_default: true,
  group_scope: 1,
  child_group: []
};
const _hoisted_1$8 = { class: "z-2 flex uno-min-w-44 uno-max-w-88" };
const _hoisted_2$8 = { class: "uno-elli-1 z-1 box-border flex-middle-center absolute text-center uno-l-44 uno-r-44" };
const _hoisted_3$7 = { class: "relative z-2 flex-middle-center uno-min-w-44" };
const __default__$a = {
  name: "WlHeader"
};
const _sfc_main$a = /* @__PURE__ */ defineComponent({
  ...__default__$a,
  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$8, [
          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$j, {
                type: "arrowTipLeft",
                width: "22",
                height: "22",
                color: "#000"
              })
            ], 512), [
              [vShow, __props.showBack]
            ])
          ])
        ]),
        createElementVNode("div", _hoisted_2$8, [
          renderSlot(_ctx.$slots, "default", {}, () => [
            createTextVNode(toDisplayString(__props.title), 1)
          ])
        ]),
        createElementVNode("div", _hoisted_3$7, [
          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$j, {
                type: "close",
                width: "22",
                height: "22",
                color: "#000"
              })
            ], 512), [
              [vShow, __props.showClose]
            ])
          ])
        ])
      ], 2);
    };
  }
});
var index_vue_vue_type_style_index_0_lang$2 = "";
const _hoisted_1$7 = {
  class: "popup-wrap",
  "data-weiling-mobile-ui-wl-popup": ""
};
const _hoisted_2$7 = { class: "popup-content" };
const __default__$9 = {
  name: "WlPopup"
};
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
  ...__default__$9,
  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$7, [
            __props.headerVisible ? (openBlock(), createBlock(_sfc_main$a, {
              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$7, [
              renderSlot(_ctx.$slots, "default")
            ])
          ])
        ]),
        _: 3
      }, 16, ["show", "teleport", "position", "style"]);
    };
  }
});
var index_vue_vue_type_style_index_0_scoped_true_lang$4 = "";
const _withScopeId$2 = (n) => (pushScopeId("data-v-4245f773"), n = n(), popScopeId(), n);
const _hoisted_1$6 = { class: "choose-group-item" };
const _hoisted_2$6 = { class: "search-list-text-wrap" };
const _hoisted_3$6 = { class: "search-list-text" };
const _hoisted_4$2 = ["onClick"];
const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", null, "\u4E0B\u7EA7", -1));
const __default__$8 = {
  name: "ChooseGroupItem"
};
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  ...__default__$8,
  props: {
    data: { default: null }
  },
  emits: ["onClickArrow"],
  setup(__props, { emit }) {
    const props = __props;
    const onClickArrow = () => {
      emit("onClickArrow", props.data);
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$6, [
        createElementVNode("div", _hoisted_2$6, [
          createVNode(_sfc_main$j, {
            type: "folderFill",
            width: "20",
            height: "20",
            color: "#1C9FFF",
            class: "search-list-icon"
          }),
          createElementVNode("span", _hoisted_3$6, toDisplayString(__props.data.group_name), 1)
        ]),
        __props.data.child_group && __props.data.child_group.length > 0 ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: "uno-p-10-10 color-theme-color uno-fs-14 font-normal flex-middle",
          onClick: withModifiers(onClickArrow, ["stop"])
        }, [
          _hoisted_5$2,
          createVNode(_sfc_main$j, {
            type: "arrowRight",
            width: "20",
            height: "20",
            color: "var(--wl-primary-color, #1C9FFF);"
          })
        ], 8, _hoisted_4$2)) : createCommentVNode("", true)
      ]);
    };
  }
});
var ChooseGroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-4245f773"]]);
var index_vue_vue_type_style_index_0_lang$1 = "";
const _hoisted_1$5 = { class: "header-part-left" };
const _hoisted_2$5 = { class: "header-part-right" };
const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("p", { class: "group-btn-text" }, "\u7BA1\u7406\u5206\u7EC4", -1);
const __default__$7 = {
  name: "ChooseGroupHeader"
};
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
  ...__default__$7,
  props: {
    showBtn: { type: Boolean, default: false },
    showBack: { type: Boolean, default: false }
  },
  emits: ["onBack", "onClose", "onTurnGroupManage"],
  setup(__props, { emit }) {
    const onBack = () => emit("onBack");
    const onClose = () => emit("onClose");
    const onGroupManage = () => emit("onTurnGroupManage");
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$a, { title: "\u9009\u62E9\u5206\u7EC4" }, {
        header_part_left: withCtx(() => [
          createElementVNode("div", _hoisted_1$5, [
            __props.showBack ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "back-icon",
              onClick: onBack
            }, [
              createVNode(_sfc_main$j, {
                type: "arrowTipLeft",
                width: "30",
                height: "30",
                color: "#000"
              })
            ])) : createCommentVNode("", true),
            createElementVNode("div", {
              class: "close-icon",
              onClick: onClose
            }, [
              createVNode(_sfc_main$j, {
                type: "close",
                width: "30",
                height: "30",
                color: "#000"
              })
            ])
          ])
        ]),
        header_part_right: withCtx(() => [
          createElementVNode("div", _hoisted_2$5, [
            __props.showBtn ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "group-btn",
              onClick: onGroupManage
            }, [
              createVNode(_sfc_main$j, {
                type: "menuSetting",
                width: "20",
                height: "20",
                color: "#000"
              }),
              _hoisted_3$5
            ])) : createCommentVNode("", true)
          ])
        ]),
        _: 1
      });
    };
  }
});
var Api = {
  getMaterialList(paramas, type) {
    return POST(
      `${proxy_api[Store$1.node_env]}/api/${type}/material/list`,
      paramas
    );
  },
  getGroupList(params) {
    return POST(
      `${proxy_api[Store$1.node_env]}/interact/material/group/list`,
      params
    );
  },
  getMaterialGroupCount(paramas) {
    return GET(`${proxy_api[Store$1.node_env]}/interact/material/count`, paramas);
  },
  materialGroupAdd(paramas) {
    return POST(
      `${proxy_api[Store$1.node_env]}/interact/material/group/tree/add`,
      paramas
    );
  },
  materialGroupEdit(paramas) {
    return POST(
      `${proxy_api[Store$1.node_env]}/interact/material/group/edit`,
      paramas
    );
  },
  materialGroupDelete(paramas) {
    return POST(
      `${proxy_api[Store$1.node_env]}/interact/material/group/del`,
      paramas
    );
  },
  materialGroupSort(paramas) {
    return POST(
      `${proxy_api[Store$1.node_env]}/interact/material/group/tree/sort`,
      paramas
    );
  }
};
const allChooseItem = {
  id: "",
  level: 0,
  root_id: "0",
  group_name: "\u5168\u90E8",
  parent_id: "",
  is_default: true,
  group_scope: 1,
  child_group: []
};
const useMessage = () => {
  const duration = 3e3;
  const onNotify = (message) => {
    WlNotice({ message, type: "success", duration });
  };
  const onError = (message) => {
    WlNotice({ message, type: "error", duration });
  };
  const onWarning = (message) => {
    WlNotice({ message, type: "warning", duration });
  };
  const onConfirm = (params) => {
    return new Promise((resolve, reject) => {
      const filter_params = {
        className: "vant-confirm-z-index",
        overlayClass: "vant-overlay-z-index",
        ...params
      };
      showConfirmDialog(filter_params).then(resolve, reject);
    });
  };
  const onConfirmCancel = () => {
    closeDialog();
  };
  return {
    onNotify,
    onError,
    onConfirm,
    onWarning,
    onConfirmCancel
  };
};
var __uno = "";
_sfc_main$a.install = (app) => {
  app.component(_sfc_main$a.name, _sfc_main$a);
};
const __default__$6 = {
  name: "WlActionSheet"
};
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
  ...__default__$6,
  props: {
    title: { default: "" },
    cancelText: { default: "\u53D6\u6D88" },
    modelValue: { type: Boolean, default: false },
    showClose: { type: Boolean, default: true },
    showBack: { type: Boolean, default: false },
    headerVisible: { type: Boolean, default: false },
    actions: { default: () => [] },
    teleport: { default: "" }
  },
  emits: ["update:modelValue", "onClose", "onSelect"],
  setup(__props, { emit }) {
    const props = __props;
    let actionSheetVisible = ref(false);
    const onClose = () => {
      emit("update:modelValue", false);
      emit("onClose");
    };
    const onSelect = (val) => {
      emit("onSelect", val);
      onClose();
    };
    watchEffect(() => {
      actionSheetVisible.value = props.modelValue;
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(ActionSheet), {
        show: unref(actionSheetVisible),
        "onUpdate:show": _cache[0] || (_cache[0] = ($event) => isRef(actionSheetVisible) ? actionSheetVisible.value = $event : actionSheetVisible = $event),
        "cancel-text": __props.cancelText,
        "close-on-click-action": "",
        "close-on-popstate": "",
        actions: __props.actions,
        teleport: __props.teleport,
        onCancel: onClose,
        onClickOverlay: onClose,
        onSelect
      }, {
        default: withCtx(() => [
          __props.headerVisible ? (openBlock(), createBlock(_sfc_main$a, {
            key: 0,
            title: __props.title,
            showClose: __props.showClose,
            showBack: __props.showBack,
            onOnClose: onClose
          }, null, 8, ["title", "showClose", "showBack"])) : createCommentVNode("", true),
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
      }, 8, ["show", "cancel-text", "actions", "teleport"]);
    };
  }
});
_sfc_main$6.install = (app) => {
  app.component(_sfc_main$6.name, _sfc_main$6);
};
const __default__$5 = {
  name: "OperationActionSheet"
};
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  ...__default__$5,
  props: {
    modelValue: { type: Boolean, default: false }
  },
  emits: ["update:modelValue", "onChange"],
  setup(__props, { emit }) {
    const props = __props;
    const State = reactive({
      actionsheetData: [
        {
          name: "\u7F16\u8F91",
          value: "edit"
        },
        {
          name: "\u5220\u9664",
          value: "delete"
        }
      ],
      actionSheetVisible: false
    });
    const onCancel = () => {
      emit("update:modelValue", false);
      State.actionSheetVisible = false;
    };
    const onActionsheetChange = (item) => {
      onCancel();
      emit("onChange", item);
    };
    watchEffect(() => {
      State.actionSheetVisible = props.modelValue;
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(_sfc_main$6), {
        "cancel-text": "\u53D6\u6D88",
        modelValue: State.actionSheetVisible,
        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => State.actionSheetVisible = $event),
        actions: State.actionsheetData,
        headerVisible: false,
        onSelect: onActionsheetChange,
        onOnClose: onCancel
      }, null, 8, ["modelValue", "actions"]);
    };
  }
});
var index_vue_vue_type_style_index_0_scoped_true_lang$3 = "";
const _withScopeId$1 = (n) => (pushScopeId("data-v-716a3c51"), n = n(), popScopeId(), n);
const _hoisted_1$4 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("p", { class: "title" }, "\u5220\u9664\u5206\u7EC4\uFF0C\u5206\u7EC4\u4E2D\u7684\u8D44\u6599\u5C06\u5F52\u7C7B\u5230\u9ED8\u8BA4\u5206\u7EC4\u4E2D", -1));
const _hoisted_2$4 = { class: "checkbox-wrap" };
const _hoisted_3$4 = /* @__PURE__ */ createTextVNode("\u540C\u65F6\u5220\u9664\u5206\u7EC4\u4E2D\u7684\u8D44\u6599");
const __default__$4 = {
  name: "DeleteDialog"
};
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  ...__default__$4,
  props: {
    show: { type: Boolean, default: false }
  },
  emits: ["onConfirm", "update:show"],
  setup(__props, { emit }) {
    const props = __props;
    const dialogVisible = ref(false);
    const checkboxValue = ref(false);
    const onComfirm = () => emit("onConfirm", checkboxValue.value);
    watchEffect(() => {
      dialogVisible.value = props.show;
    });
    watch(
      () => dialogVisible.value,
      (val) => {
        dialogVisible.value = val;
        checkboxValue.value = false;
        emit("update:show", val);
      },
      { immediate: true }
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Dialog), {
        show: dialogVisible.value,
        "onUpdate:show": _cache[1] || (_cache[1] = ($event) => dialogVisible.value = $event),
        "show-cancel-button": "",
        "get-container": "body",
        teleport: "body",
        onConfirm: onComfirm,
        className: "vant-confirm-z-index",
        overlayClass: "vant-overlay-z-index"
      }, {
        title: withCtx(() => [
          _hoisted_1$4
        ]),
        default: withCtx(() => [
          createElementVNode("div", _hoisted_2$4, [
            createVNode(unref(Checkbox), {
              modelValue: checkboxValue.value,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checkboxValue.value = $event)
            }, {
              default: withCtx(() => [
                _hoisted_3$4
              ]),
              _: 1
            }, 8, ["modelValue"])
          ])
        ]),
        _: 1
      }, 8, ["show"]);
    };
  }
});
var DeleteDialog = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-716a3c51"]]);
var index_vue_vue_type_style_index_0_scoped_true_lang$2 = "";
const _hoisted_1$3 = { class: "form-wrap" };
const _hoisted_2$3 = { class: "form-item-input" };
const _hoisted_3$3 = ["onKeydown"];
const __default__$3 = {
  name: "OperGroupDialog"
};
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  ...__default__$3,
  props: {
    show: { type: Boolean, default: false },
    groupName: { default: "" }
  },
  emits: ["update:show", "update:groupName", "onConfirm"],
  setup(__props, { emit }) {
    const props = __props;
    const { onWarning } = useMessage();
    const dialogVisible = ref(false);
    const groupNameValue = ref("");
    const onClose = () => {
      emit("update:show", false);
      dialogVisible.value = false;
    };
    const onComfirm = () => {
      const groupNameTrim = groupNameValue.value.trim();
      if (!groupNameTrim) {
        onWarning("\u5206\u7EC4\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");
      } else if (groupNameTrim.length > 30) {
        onWarning("\u5206\u7EC4\u540D\u79F0\u6700\u5927\u4E3A30\u4E2A\u5B57\u7B26");
      } else {
        emit("onConfirm", groupNameTrim);
      }
    };
    const onBeforeClose = (action) => {
      if (action === "confirm") {
        if (dialogVisible.value)
          return false;
      } else {
        return true;
      }
    };
    const onKeyDown = () => {
      onComfirm();
      onClose();
    };
    watchEffect(() => {
      if (props.show)
        groupNameValue.value = "";
      dialogVisible.value = props.show;
      groupNameValue.value = props.groupName;
    });
    watch(
      () => groupNameValue.value,
      (val) => emit("update:groupName", val)
    );
    watch(
      () => dialogVisible.value,
      (val) => emit("update:show", val)
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Dialog), {
        show: dialogVisible.value,
        "onUpdate:show": _cache[1] || (_cache[1] = ($event) => dialogVisible.value = $event),
        "show-cancel-button": "",
        "get-container": "body",
        "before-close": onBeforeClose,
        onClose,
        onConfirm: onComfirm,
        teleport: "body",
        className: "vant-confirm-z-index",
        overlayClass: "vant-overlay-z-index",
        confirmButtonColor: "var(--wl-primary-color)"
      }, {
        default: withCtx(() => [
          createVNode(unref(_sfc_main$a), { title: "\u5206\u7EC4\u540D\u79F0" }),
          createElementVNode("div", _hoisted_1$3, [
            createElementVNode("div", _hoisted_2$3, [
              withDirectives(createElementVNode("input", {
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => groupNameValue.value = $event),
                label: "",
                placeholder: "\u5206\u7EC4\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",
                maxlength: "50",
                onKeydown: withKeys(onKeyDown, ["enter"])
              }, null, 40, _hoisted_3$3), [
                [vModelText, groupNameValue.value]
              ])
            ])
          ])
        ]),
        _: 1
      }, 8, ["show"]);
    };
  }
});
var OperGroupDialog = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-53498e52"]]);
var index_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
const _withScopeId = (n) => (pushScopeId("data-v-0f2ceaae"), n = n(), popScopeId(), n);
const _hoisted_1$2 = { class: "material-group" };
const _hoisted_2$2 = { class: "material-group-main" };
const _hoisted_3$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", { class: "add-text" }, "\u6DFB\u52A0\u5206\u7EC4", -1));
const _hoisted_4$1 = { class: "operation" };
const _hoisted_5$1 = { class: "operation-icon sort-icon" };
const _hoisted_6$1 = ["onClick"];
const __default__$2 = {
  name: "BCGroupManagePopup"
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  ...__default__$2,
  props: {
    show: { type: Boolean, default: false },
    showBack: { type: Boolean, default: false },
    showClose: { type: Boolean, default: true },
    groupList: { default: () => {
      return allChooseItem;
    } },
    group_scope: { default: 1 },
    env_data: { default: () => {
      return {
        sid: "",
        domain: "",
        corp_id: "",
        node_env: "uat",
        app_id: "",
        token: "",
        card_resource: ""
      };
    } }
  },
  emits: ["update:show", "onChange", "onOperSuccess"],
  setup(__props, { emit }) {
    const props = __props;
    Store$1.corp_id = props.env_data.corp_id;
    Store$1.node_env = props.env_data.node_env;
    Store$1.sid = props.env_data.sid;
    Store$1.token = props.env_data.token;
    Store$1.card_resource = props.env_data.card_resource;
    const { onNotify, onWarning } = useMessage();
    const chooseGroupList = ref(null);
    const chosedItem = ref(null);
    const operStatus = ref("pending");
    const hasOperStatus = ref("pending");
    const currentGroupName = ref("");
    const deleteDialogVisible = ref(false);
    const operDialogVisible = ref(false);
    const actionSheetVisible = ref(false);
    const popupVisible = ref(false);
    const groupItemClass = computed(() => {
      return (item) => {
        return {
          "material-group-main-item": true,
          "material-group-main-item-style": true,
          disabled: item.is_default
        };
      };
    });
    const upperGroupData = computed(() => {
      var _a;
      return (_a = props.groupList[0]) != null ? _a : allChooseItem;
    });
    const onClose = () => {
      emit("update:show", false);
      popupVisible.value = false;
      if (hasOperStatus.value !== "pending") {
        emit("onOperSuccess", {
          status: hasOperStatus.value,
          data: chosedItem.value
        });
      }
    };
    const onGetData = async () => {
      const { parent_id, level } = upperGroupData.value;
      const upperGroupId = level === 1 ? "" : parent_id;
      const res = await Api.getGroupList({
        group_scope: props.group_scope,
        group_id: upperGroupId
      });
      const { data } = res || {};
      const { data_list = [] } = data;
      if (upperGroupId === "") {
        chooseGroupList.value = [allChooseItem, ...data_list];
      } else {
        const { child_group } = data_list[0];
        chooseGroupList.value = child_group;
      }
    };
    const onJudgeBlank = (group_name) => {
      let bool = true;
      if (group_name.length > 30) {
        onWarning("\u5206\u7EC4\u540D\u5B57\u4E0D\u80FD\u5927\u4E8E30\u4E2A\u5B57");
        bool = false;
      }
      return bool;
    };
    const onAddGroup = () => {
      currentGroupName.value = "";
      operDialogVisible.value = true;
      operStatus.value = "add";
    };
    const onActionSheetClick = (item) => {
      chosedItem.value = item;
      actionSheetVisible.value = true;
    };
    const onActionSheetChange = (item) => {
      if (item.value === "delete") {
        deleteDialogVisible.value = true;
      } else if (item.value === "edit") {
        operStatus.value = "edit";
        operDialogVisible.value = true;
        currentGroupName.value = chosedItem.value.group_name;
      }
    };
    const onAddDialogConfirm = (group_name) => {
      if (!onJudgeBlank(group_name))
        return;
      const interfaceDict = {
        add: "materialGroupAdd",
        edit: "materialGroupEdit"
      };
      const toastDict = {
        add: "\u65B0\u5EFA\u5206\u7EC4\u6210\u529F",
        edit: "\u7F16\u8F91\u5206\u7EC4\u6210\u529F"
      };
      const { parent_id, level, root_id } = upperGroupData.value;
      const levelValue = level === 1 ? "1" : level + 1;
      const params = operStatus.value === "add" ? {
        parent_id,
        level: levelValue,
        root_id,
        group_name,
        group_scope: props.group_scope
      } : {
        id: chosedItem.value.id,
        group_name
      };
      Api[interfaceDict[operStatus.value]](params).then(async () => {
        onNotify(toastDict[operStatus.value]);
        hasOperStatus.value = operStatus.value;
        await onGetData();
        if (operStatus.value === "edit") {
          chosedItem.value.group_name = currentGroupName.value;
        }
        operDialogVisible.value = false;
        currentGroupName.value = "";
      });
    };
    const onDeleteDialogConfirm = (delete_all) => {
      const { id, group_scope } = chosedItem.value;
      Api.materialGroupDelete({ id, group_scope, delete_all }).then(() => {
        hasOperStatus.value = "delete";
        onNotify("\u5220\u9664\u6210\u529F");
        onGetData();
      });
    };
    const onGroupSort = (event) => {
      const movedItem = chooseGroupList.value[event.newIndex];
      const targetItem = chooseGroupList.value[event.oldIndex];
      const sortList = chooseGroupList.value.map((res) => res.id).filter((res) => res);
      Api.materialGroupSort({
        moved_id: movedItem.id,
        moved_parent_id: movedItem.parent_id,
        target_id: targetItem.parent_id,
        target_parent_id: targetItem.parent_id,
        group_scope: props.group_scope,
        sort_list: sortList
      }).then(() => {
        hasOperStatus.value = "sort";
        onNotify("\u79FB\u52A8\u5206\u7EC4\u6210\u529F");
        onGetData();
      });
    };
    watchEffect(() => {
      popupVisible.value = props.show;
      if (props.show) {
        onGetData();
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$9, {
        class: "choose-group-popup",
        "data-weiling-mobile-ui-bc-group-manage-popup": "",
        modelValue: popupVisible.value,
        "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => popupVisible.value = $event),
        overlay: false,
        round: false,
        duration: "0",
        style: { height: "100%" },
        position: "bottom",
        onClosed: onClose
      }, {
        default: withCtx(() => [
          createElementVNode("div", _hoisted_1$2, [
            createVNode(unref(_sfc_main$a), {
              showBack: __props.showBack,
              showClose: __props.showClose,
              onOnClose: _cache[0] || (_cache[0] = ($event) => popupVisible.value = false),
              title: "\u7BA1\u7406\u5206\u7EC4"
            }, null, 8, ["showBack", "showClose"]),
            createElementVNode("div", _hoisted_2$2, [
              createElementVNode("div", {
                class: "material-group-main-item-style material-group-main-add-item",
                onClick: onAddGroup
              }, [
                createVNode(_sfc_main$j, {
                  type: "add",
                  width: "24",
                  height: "24",
                  color: "#979797"
                }),
                _hoisted_3$2
              ]),
              createVNode(unref(vuedraggable), {
                modelValue: chooseGroupList.value,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => chooseGroupList.value = $event),
                handle: ".sort-icon",
                chosenClass: "chosenClass",
                ghostClass: "ghostClass",
                "item-key": "id",
                onUpdate: onGroupSort
              }, {
                item: withCtx(({ element }) => [
                  createElementVNode("div", {
                    class: normalizeClass(unref(groupItemClass)(element))
                  }, [
                    createElementVNode("div", null, toDisplayString(element.group_name), 1),
                    withDirectives(createElementVNode("div", _hoisted_4$1, [
                      createElementVNode("div", _hoisted_5$1, [
                        createVNode(_sfc_main$j, {
                          type: "sort",
                          width: "24",
                          height: "24",
                          color: "#1C9FFF"
                        })
                      ]),
                      createElementVNode("div", {
                        class: "operation-icon",
                        onClick: ($event) => onActionSheetClick(element)
                      }, [
                        createVNode(_sfc_main$j, {
                          type: "moreHorizontal",
                          width: "24",
                          height: "24",
                          color: "#1C9FFF"
                        })
                      ], 8, _hoisted_6$1)
                    ], 512), [
                      [vShow, !element.is_default]
                    ])
                  ], 2)
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            createVNode(_sfc_main$5, {
              modelValue: actionSheetVisible.value,
              "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => actionSheetVisible.value = $event),
              onOnChange: onActionSheetChange
            }, null, 8, ["modelValue"]),
            createVNode(DeleteDialog, {
              show: deleteDialogVisible.value,
              "onUpdate:show": _cache[3] || (_cache[3] = ($event) => deleteDialogVisible.value = $event),
              onOnConfirm: onDeleteDialogConfirm
            }, null, 8, ["show"]),
            createVNode(OperGroupDialog, {
              show: operDialogVisible.value,
              "onUpdate:show": _cache[4] || (_cache[4] = ($event) => operDialogVisible.value = $event),
              groupName: currentGroupName.value,
              "onUpdate:groupName": _cache[5] || (_cache[5] = ($event) => currentGroupName.value = $event),
              onOnConfirm: onAddDialogConfirm
            }, null, 8, ["show", "groupName"])
          ])
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
});
var BCGroupManagePopup = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0f2ceaae"]]);
var index_vue_vue_type_style_index_0_lang = "";
const _hoisted_1$1 = { class: "popup-container" };
const _hoisted_2$1 = { class: "search-list" };
const _hoisted_3$1 = ["onClick"];
const __default__$1 = {
  name: "BCGroupChoosePopup"
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  ...__default__$1,
  props: {
    modelValue: { type: Boolean, default: false },
    showBtn: { type: Boolean, default: false },
    showClose: { type: Boolean, default: true },
    showAllItem: { type: Boolean, default: false },
    group_scope: { default: 1 },
    env_data: { default: () => {
      return {
        sid: "",
        domain: "",
        corp_id: "",
        node_env: "uat",
        app_id: "",
        token: "",
        card_resource: ""
      };
    } }
  },
  emits: ["onClose", "update:modelValue", "onChange", "onOperSuccess"],
  setup(__props, { expose, emit }) {
    const props = __props;
    Store$1.corp_id = props.env_data.corp_id;
    Store$1.node_env = props.env_data.node_env;
    Store$1.sid = props.env_data.sid;
    Store$1.token = props.env_data.token;
    Store$1.card_resource = props.env_data.card_resource;
    let stack = ref([]);
    let popupVisible = ref(false);
    const groupManagePopupVisible = ref(false);
    const showBack = computed(() => stack.value.length > 1);
    const showAllItemBool = computed(
      () => props.showAllItem && stack.value.length === 1
    );
    const currentGroupList = computed(() => stack.value[stack.value.length - 1]);
    const onClose = () => {
      emit("onClose");
      emit("update:modelValue", false);
      popupVisible.value = false;
    };
    const onChooseGroup = (item) => {
      emit("onChange", item);
      onClose();
    };
    const onGetGroupList = async (group_id = "0") => {
      const res = await Api$1.getGroupList({
        group_id,
        group_scope: props.group_scope
      });
      const { data } = res || {};
      return (data == null ? void 0 : data.data_list) || [];
    };
    const onBack = () => {
      stack.value.pop();
    };
    const onShowGroupManagePopup = () => {
      groupManagePopupVisible.value = true;
    };
    const onTurnSubGroup = (item) => {
      stack.value.push(item == null ? void 0 : item.child_group);
    };
    const onRefreshGroupData = (data) => {
      const group_stack = stack.value.map((res) => {
        var _a;
        const { parent_id, level } = (_a = res[0]) != null ? _a : {};
        return {
          level,
          parent_id
        };
      });
      onGetGroupList("").then((list) => {
        group_stack.reduce((acc, item) => {
          var _a, _b;
          if (item.level === 1) {
            stack.value = [acc];
          } else {
            let order = acc.findIndex((res) => res.id === item.parent_id);
            stack.value.push((_a = acc[order]) == null ? void 0 : _a.child_group);
            acc = (_b = acc[order]) == null ? void 0 : _b.child_group;
          }
          return acc;
        }, list);
        emit("onOperSuccess", data);
      });
    };
    watchEffect(() => {
      popupVisible.value = props.modelValue;
    });
    const onResetData = () => {
      onGetGroupList("").then((list) => {
        stack.value = [list];
      });
    };
    onResetData();
    expose({
      onResetData
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_sfc_main$9, {
          class: "choose-group-popup",
          "data-weiling-mobile-ui-bc-choose-group-popup": "",
          modelValue: unref(popupVisible),
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(popupVisible) ? popupVisible.value = $event : popupVisible = $event),
          style: { height: "90%" },
          position: "bottom",
          round: "",
          onClosed: onClose
        }, {
          default: withCtx(() => [
            createElementVNode("div", _hoisted_1$1, [
              createVNode(_sfc_main$7, {
                showBtn: __props.showBtn,
                showBack: unref(showBack),
                onOnBack: onBack,
                onOnClose: onClose,
                onOnTurnGroupManage: onShowGroupManagePopup
              }, null, 8, ["showBtn", "showBack"]),
              createElementVNode("div", _hoisted_2$1, [
                createElementVNode("div", {
                  onClick: _cache[0] || (_cache[0] = ($event) => onChooseGroup(unref(allChooseItem$1)))
                }, [
                  unref(showAllItemBool) ? (openBlock(), createBlock(ChooseGroupItem, {
                    key: 0,
                    data: unref(allChooseItem$1)
                  }, null, 8, ["data"])) : createCommentVNode("", true)
                ]),
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(currentGroupList), (item) => {
                  return openBlock(), createElementBlock("div", {
                    key: item.id,
                    onClick: ($event) => onChooseGroup(item)
                  }, [
                    createVNode(ChooseGroupItem, {
                      data: item,
                      onOnClickArrow: ($event) => onTurnSubGroup(item)
                    }, null, 8, ["data", "onOnClickArrow"])
                  ], 8, _hoisted_3$1);
                }), 128))
              ])
            ])
          ]),
          _: 1
        }, 8, ["modelValue"]),
        createVNode(BCGroupManagePopup, {
          show: groupManagePopupVisible.value,
          "onUpdate:show": _cache[2] || (_cache[2] = ($event) => groupManagePopupVisible.value = $event),
          groupList: unref(currentGroupList),
          env_data: __props.env_data,
          group_scope: __props.group_scope,
          onOnOperSuccess: onRefreshGroupData
        }, null, 8, ["show", "groupList", "env_data", "group_scope"])
      ], 64);
    };
  }
});
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
const _hoisted_1 = { class: "material-list-wrap" };
const _hoisted_2 = { class: "search-container" };
const _hoisted_3 = { class: "tabs_header" };
const _hoisted_4 = { class: "material-title-wrap" };
const _hoisted_5 = { class: "material_wrap" };
const _hoisted_6 = ["onClick"];
const __default__ = {
  name: "BCMaterialList"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    checkedData: { default: () => [] },
    env_data: { default: () => {
      return {
        sid: "",
        domain: "",
        corp_id: "",
        node_env: "uat",
        app_id: "",
        token: "",
        card_resource: ""
      };
    } },
    not_allow_sub_type_arr: { default: () => [] }
  },
  emits: ["onHandleChecked"],
  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.node_env = props.env_data.node_env;
    Store$1.sid = props.env_data.sid;
    Store$1.token = props.env_data.token;
    Store$1.card_resource = props.env_data.card_resource;
    const keyword = ref("");
    const materials = ref([]);
    const materialGroupCount = ref(0);
    const groupChoosePopupRef = ref();
    const headerNavActive = ref("corp");
    const chooseGroupPopupVisible = ref(false);
    const chosedGroupData = ref(null);
    const materialTypeList = ref(null);
    const materialGroupCountDict = ref({});
    const onToggleGroup = () => {
      chooseGroupPopupVisible.value = true;
      groupChoosePopupRef.value.onResetData();
    };
    const onGetGroupTotal = () => {
      const { id: group_id } = chosedGroupData.value || {};
      const { corp_count_dict, user_count_dict, user_count, corp_count } = materialGroupCountDict.value;
      let total = 0;
      if (headerNavActive.value === "user") {
        total = group_id ? user_count_dict[group_id] : user_count;
      } else {
        total = group_id ? corp_count_dict[group_id] : corp_count;
      }
      materialGroupCount.value = total;
    };
    const onCheckedFile = (item) => {
      var _a;
      return !!((_a = props.checkedData) == null ? void 0 : _a.find(
        (res) => {
          var _a2, _b;
          return ((_a2 = res == null ? void 0 : res.link) == null ? void 0 : _a2.title) == (item == null ? void 0 : item.material_name) && ((_b = res == null ? void 0 : res.link) == null ? void 0 : _b.picurl) == (item == null ? void 0 : item.material_logo);
        }
      ));
    };
    const sub_type_not_allow = computed(
      () => (material) => props.not_allow_sub_type_arr.includes(material.material_subtype)
    );
    const getMaterial = async () => {
      var _a;
      const { data } = await Api$2.getMaterialList(
        {
          sort_list: {
            page_count: page_count.value,
            limit: limit.value,
            sort: [],
            keyword: keyword.value
          },
          group_id: (_a = chosedGroupData.value) == null ? void 0 : _a.id,
          material_type: materialTypeList.value,
          only_person: headerNavActive.value === "user",
          scope: headerNavActive.value === "user" ? 1 : 2
        },
        headerNavActive.value
      );
      if (page_count.value == 1) {
        materials.value = [];
      }
      materials.value = [...materials.value, ...data.materials || []];
      judgeLoadStatus(data.materials || [], data.count);
    };
    const onGetMaterialGroupCount = async () => {
      const { data } = await Api$2.getMaterialGroupCount({
        ctxenv: 1,
        keyword: keyword.value,
        material_type: materialTypeList.value || ""
      });
      const {
        corp_count = 0,
        corp_count_list = [],
        person_count = 0,
        person_count_list = []
      } = data;
      materialGroupCountDict.value = {
        corp_count,
        user_count: person_count,
        corp_count_dict: corp_count_list.reduce((acc, item) => {
          acc[item.group_id] = item.count;
          return acc;
        }, {}),
        user_count_dict: person_count_list.reduce((acc, item) => {
          acc[item.group_id] = item.count;
          return acc;
        }, {})
      };
      onGetGroupTotal();
    };
    const onSearch = (val) => {
      keyword.value = val;
      onResetData();
      onGetMaterialGroupCount();
    };
    const onMaterialTypeChange = (val) => {
      materialTypeList.value = val.value === 0 ? [] : [val.value];
      onResetData();
    };
    const onNavChange = () => {
      chosedGroupData.value = {};
      onResetData();
    };
    const onResetData = () => {
      page_count.value = 1;
      materials.value = [];
      isLoading.value = true;
      isFinished.value = false;
      getMaterial();
      onGetMaterialGroupCount();
    };
    const onGetGroupData = (item) => {
      chosedGroupData.value = item;
      onResetData();
    };
    const handleChoose = (item) => {
      if (onCheckedFile(item))
        return;
      else if (sub_type_not_allow.value(item)) {
        WlNotice({
          message: "\u56E0\u5C0F\u7A0B\u5E8F\u9650\u5236\uFF0C\u6B64\u94FE\u63A5\u6682\u4E0D\u652F\u6301\u6DFB\u52A0\u81F3\u540D\u7247",
          type: "warning",
          duration: 5
        });
        return;
      }
      emit("onHandleChecked", { ...item });
    };
    onResetData();
    return (_ctx, _cache) => {
      var _a;
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createVNode(_sfc_main$c, {
            filterOptions: unref(materialSearchDict),
            placeholder: "\u641C\u7D22\u6807\u9898\u6216\u6458\u8981",
            onOnChange: onSearch,
            onOnMaterialTypeChange: onMaterialTypeChange
          }, null, 8, ["filterOptions"])
        ]),
        createElementVNode("nav", null, [
          createElementVNode("div", _hoisted_3, [
            createVNode(unref(Tabs), {
              active: headerNavActive.value,
              "onUpdate:active": _cache[0] || (_cache[0] = ($event) => headerNavActive.value = $event),
              onClick: onNavChange,
              "line-width": "20"
            }, {
              default: withCtx(() => [
                createVNode(unref(Tab), {
                  name: "user",
                  title: "\u4E2A\u4EBA\u5E93"
                }),
                createVNode(unref(Tab), {
                  name: "corp",
                  title: "\u4F01\u4E1A\u5E93"
                })
              ]),
              _: 1
            }, 8, ["active"])
          ])
        ]),
        createElementVNode("div", _hoisted_4, [
          createVNode(MaterialTitle, {
            group_name: (_a = chosedGroupData.value) == null ? void 0 : _a.group_name,
            env_data: __props.env_data,
            total: materialGroupCount.value,
            group_scope: headerNavActive.value === "corp" ? 2 : 1,
            onOnToggleGroup: onToggleGroup
          }, null, 8, ["group_name", "env_data", "total", "group_scope"])
        ]),
        createElementVNode("main", null, [
          createVNode(_sfc_main$b, {
            modelValue: unref(isLoading),
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(isLoading) ? isLoading.value = $event : null),
            finished: unref(isFinished),
            onLoad: getMaterial
          }, {
            default: withCtx(() => [
              createElementVNode("ul", _hoisted_5, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(materials.value, (item) => {
                  return openBlock(), createElementBlock("li", {
                    key: item.material.id,
                    onClick: ($event) => handleChoose(item.material)
                  }, [
                    createVNode(MaterialCell, {
                      data: item,
                      disabled: onCheckedFile(item.material),
                      sub_type_not_allow: unref(sub_type_not_allow)(item.material)
                    }, null, 8, ["data", "disabled", "sub_type_not_allow"])
                  ], 8, _hoisted_6);
                }), 128))
              ])
            ]),
            _: 1
          }, 8, ["modelValue", "finished"])
        ]),
        createVNode(_sfc_main$1, {
          modelValue: chooseGroupPopupVisible.value,
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => chooseGroupPopupVisible.value = $event),
          ref_key: "groupChoosePopupRef",
          ref: groupChoosePopupRef,
          showAllItem: true,
          env_data: __props.env_data,
          group_scope: headerNavActive.value === "corp" ? 2 : 1,
          onOnChange: onGetGroupData
        }, null, 8, ["modelValue", "env_data", "group_scope"])
      ]);
    };
  }
});
var Comp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-19626d0e"]]);
Comp.install = (app) => {
  app.component(Comp.name, Comp);
};
export { Comp as default };
