import { defineComponent, openBlock, createBlock, unref, createElementBlock, normalizeClass, createElementVNode, renderSlot, withDirectives, createVNode, vShow, createTextVNode, toDisplayString, ref, computed, watchEffect, mergeProps, withCtx, createCommentVNode, defineAsyncComponent, watch, Fragment, isRef, withModifiers } from "vue";
import { Popup, Form, Field, RadioGroup, Radio, CheckboxGroup, Checkbox } from "vant";
import WlSvg from "@wltech/svg";
const domain = "https://wlmvp-cos.weiling.cn";
const loadingPic = domain + "/frontend/weilingMobileUI/loading.png";
const loadingFailPic = domain + "/frontend/weilingMobileUI/loadingFail.png";
const en_default_logo = domain + "/frontend/images/company-default-logo.png";
const en_default_avatar = domain + "/frontend/images/boy.png";
const search_no_result = domain + "/frontend/errorPage/search_no_result.png";
const __default__$3 = {
  name: "WlSvgIcon"
};
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  ...__default__$3,
  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"]);
    };
  }
});
const _hoisted_1$2 = { class: "z-2 flex uno-min-w-44 uno-max-w-88" };
const _hoisted_2$2 = { class: "uno-elli-1 z-1 box-border flex-middle-center absolute text-center uno-l-44 uno-r-44" };
const _hoisted_3$1 = { class: "relative z-2 flex-middle-center uno-min-w-44" };
const __default__$2 = {
  name: "WlHeader"
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  ...__default__$2,
  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$2, [
          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$3, {
                type: "arrowTipLeft",
                width: "22",
                height: "22",
                color: "#000"
              })
            ], 512), [
              [vShow, __props.showBack]
            ])
          ])
        ]),
        createElementVNode("div", _hoisted_2$2, [
          renderSlot(_ctx.$slots, "default", {}, () => [
            createTextVNode(toDisplayString(__props.title), 1)
          ])
        ]),
        createElementVNode("div", _hoisted_3$1, [
          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$3, {
                type: "close",
                width: "22",
                height: "22",
                color: "#000"
              })
            ], 512), [
              [vShow, __props.showClose]
            ])
          ])
        ])
      ], 2);
    };
  }
});
var index_vue_vue_type_style_index_0_lang$1 = "";
const _hoisted_1$1 = {
  class: "popup-wrap",
  "data-weiling-mobile-ui-wl-popup": ""
};
const _hoisted_2$1 = { class: "popup-content" };
const __default__$1 = {
  name: "WlPopup"
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  ...__default__$1,
  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$1, [
            __props.headerVisible ? (openBlock(), createBlock(_sfc_main$2, {
              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$1, [
              renderSlot(_ctx.$slots, "default")
            ])
          ])
        ]),
        _: 3
      }, 16, ["show", "teleport", "position", "style"]);
    };
  }
});
var index_vue_vue_type_style_index_0_lang = "";
const _hoisted_1 = {
  class: "enterprise-transfer",
  "data-weiling-mobile-ui-bc-enterprise-transfer": ""
};
const _hoisted_2 = { class: "flex-1" };
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u79FB\u51FA\u8BE5\u4F01\u4E1A\u76F8\u5173\u56E2\u961F");
const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u66F4\u6539\u4E3A\u4F01\u4E1A\u534F\u4F5C\u4EBA");
const _hoisted_5 = /* @__PURE__ */ createTextVNode("\u5546\u673A");
const _hoisted_6 = /* @__PURE__ */ createTextVNode("\u8054\u7CFB\u4EBA");
const _hoisted_7 = { class: "flex flex-row" };
const __default__ = {
  name: "BCEnterpriseList"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    modelValue: { type: Boolean, default: false },
    data: { default: () => [] },
    retract: { default: 2 },
    defaultAvatar: { default: en_default_logo },
    envData: null
  },
  emits: ["update:modelValue", "onConfimTransfer"],
  setup(__props, { emit }) {
    const props = __props;
    const BCEmployeeSelector = defineAsyncComponent(
      () => import("./index3.js")
    );
    let popupVisible = ref(false);
    const formData = ref({
      belong_user: {},
      type: "",
      checkboxList: []
    });
    const vanform = ref(null);
    const showPicker = ref(false);
    const onHandleSelectStaff = (res) => {
      formData.value.belong_user = res;
      showPicker.value = false;
    };
    const onSubmit = () => {
      const { checkboxList, belong_user, type } = formData.value;
      emit("onConfimTransfer", {
        belong_user_id: belong_user == null ? void 0 : belong_user.id,
        type,
        assign_business: (checkboxList == null ? void 0 : checkboxList.includes("assign_business")) ? 1 : 0,
        assign_clue: (checkboxList == null ? void 0 : checkboxList.includes("assign_clue")) ? 1 : 0
      });
      formData.value = {
        belong_user: {},
        type: "",
        checkboxList: []
      };
      popupVisible.value = false;
    };
    watch(
      () => props.modelValue,
      (val) => {
        if (val)
          popupVisible.value = val;
      }
    );
    watch(
      () => popupVisible.value,
      (val) => {
        if (!val)
          emit("update:modelValue", false);
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_sfc_main$1, {
          modelValue: unref(popupVisible),
          "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => isRef(popupVisible) ? popupVisible.value = $event : popupVisible = $event),
          position: "bottom",
          style: { height: "460px" },
          round: "",
          title: "\u4F01\u4E1A\u5F52\u5C5E\u4EBA\u8F6C\u79FB",
          headerVisible: true
        }, {
          default: withCtx(() => [
            createElementVNode("div", _hoisted_1, [
              createVNode(unref(Form), {
                onSubmit,
                ref_key: "vanform",
                ref: vanform,
                "label-width": "100%",
                style: { "height": "100%" },
                class: "flex flex-col"
              }, {
                default: withCtx(() => [
                  createElementVNode("div", _hoisted_2, [
                    createVNode(unref(Field), {
                      modelValue: formData.value.belong_user.name,
                      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.belong_user.name = $event),
                      name: "\u66F4\u6362\u5F52\u5C5E\u4EBA",
                      label: "\u66F4\u6362\u5F52\u5C5E\u4EBA",
                      placeholder: "\u8BF7\u9009\u62E9\u66F4\u6362\u5F52\u5C5E\u4EBA",
                      required: "",
                      readonly: "",
                      rules: [{ required: true, message: "\u66F4\u6362\u5F52\u5C5E\u4EBA\u4E0D\u80FD\u4E3A\u7A7A" }],
                      "right-icon": "arrow",
                      onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
                    }, null, 8, ["modelValue"]),
                    createVNode(unref(Field), {
                      type: "text",
                      name: "\u5C06\u4F01\u4E1A\u539F\u5F52\u5C5E\u4EBA",
                      label: "\u5C06\u4F01\u4E1A\u539F\u5F52\u5C5E\u4EBA",
                      required: "",
                      placeholder: "\u5C06\u4F01\u4E1A\u539F\u5F52\u5C5E\u4EBA",
                      rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u539F\u4F01\u4E1A\u5F52\u5C5E\u4EBA\u5206\u914D" }]
                    }, {
                      input: withCtx(() => [
                        createVNode(unref(RadioGroup), {
                          modelValue: formData.value.type,
                          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.value.type = $event)
                        }, {
                          default: withCtx(() => [
                            createVNode(unref(Radio), { name: 1 }, {
                              default: withCtx(() => [
                                _hoisted_3
                              ]),
                              _: 1
                            }),
                            createVNode(unref(Radio), {
                              name: 0,
                              class: "m-t-8px"
                            }, {
                              default: withCtx(() => [
                                _hoisted_4
                              ]),
                              _: 1
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    }),
                    createVNode(unref(Field), {
                      type: "text",
                      name: "\u540C\u65F6\u8F6C\u79FB\u539F\u5F52\u5C5E\u4EBA\u7684\u4EE5\u4E0B\u4F01\u4E1A\u6570\u636E",
                      label: "\u540C\u65F6\u8F6C\u79FB\u539F\u5F52\u5C5E\u4EBA\u7684\u4EE5\u4E0B\u4F01\u4E1A\u6570\u636E",
                      placeholder: "\u540C\u65F6\u8F6C\u79FB\u539F\u5F52\u5C5E\u4EBA\u7684\u4EE5\u4E0B\u4F01\u4E1A\u6570\u636E"
                    }, {
                      input: withCtx(() => [
                        createVNode(unref(CheckboxGroup), {
                          modelValue: formData.value.checkboxList,
                          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => formData.value.checkboxList = $event),
                          shape: "square"
                        }, {
                          default: withCtx(() => [
                            createVNode(unref(Checkbox), { name: "assign_business" }, {
                              default: withCtx(() => [
                                _hoisted_5
                              ]),
                              _: 1
                            }),
                            createVNode(unref(Checkbox), {
                              name: "assign_clue",
                              class: "m-t-8px"
                            }, {
                              default: withCtx(() => [
                                _hoisted_6
                              ]),
                              _: 1
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    })
                  ]),
                  createElementVNode("footer", null, [
                    createElementVNode("div", _hoisted_7, [
                      createElementVNode("div", {
                        class: "btn btn_cancel",
                        onClick: _cache[4] || (_cache[4] = ($event) => isRef(popupVisible) ? popupVisible.value = false : popupVisible = false)
                      }, "\u53D6\u6D88"),
                      createElementVNode("div", {
                        class: "btn active",
                        onClick: _cache[5] || (_cache[5] = withModifiers(
                          (...args) => vanform.value.submit && vanform.value.submit(...args),
                          ["stop"]
                        ))
                      }, "\u786E\u5B9A")
                    ])
                  ])
                ]),
                _: 1
              }, 512)
            ])
          ]),
          _: 1
        }, 8, ["modelValue"]),
        createVNode(_sfc_main$1, {
          show: showPicker.value,
          "onUpdate:show": _cache[7] || (_cache[7] = ($event) => showPicker.value = $event),
          round: "",
          style: { "height": "90%" },
          teleport: "body"
        }, {
          default: withCtx(() => [
            createVNode(unref(BCEmployeeSelector), {
              title: "\u9009\u62E9\u5458\u5DE5",
              isMultiple: false,
              envData: __props.envData,
              requestParams: {
                filter: {
                  role_types: [1],
                  status_set: [1],
                  saas_status_set: [1],
                  subscribe_status: 3
                }
              },
              onOnConfirm: onHandleSelectStaff
            }, null, 8, ["envData"])
          ]),
          _: 1
        }, 8, ["show"])
      ], 64);
    };
  }
});
var __uno = "";
_sfc_main.install = (app) => {
  app.component(_sfc_main.name, _sfc_main);
};
export { _sfc_main$3 as _, _sfc_main$2 as a, loadingFailPic as b, _sfc_main as c, en_default_avatar as e, loadingPic as l, search_no_result as s };
