"use strict"; const common_vendor = require("../../../../common/vendor.js"); require("../../../adapter-vue.js"); const common_assets = require("../../../../common/assets.js"); const TUIKit_utils_env = require("../../../utils/env.js"); if (!Math) { Icon(); } const Icon = () => "../Icon.js"; const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "index", props: { list: { type: Array, default: () => [] }, selectedList: { type: Array, default: () => [] }, isSearch: { type: Boolean, default: true }, isRadio: { type: Boolean, default: false }, isCustomItem: { type: Boolean, default: false }, title: { type: String, default: "" }, type: { type: String, default: "" }, resultShow: { type: Boolean, default: true }, total: { type: Number, default: 0 }, isHiddenBackIcon: { type: Boolean, default: false } }, emits: ["search", "submit", "cancel", "getMore"], setup(__props, { emit: __emit }) { const props = __props; const transferList = common_vendor.ref([]); const transferTotal = common_vendor.ref(0); const transferSelectedList = common_vendor.ref([]); const isTransferSearch = common_vendor.ref(true); const isTransferCustomItem = common_vendor.ref(false); const transferTitle = common_vendor.ref(""); const searchValue = common_vendor.ref(""); common_vendor.watchEffect(() => { if (props.isCustomItem) { for (let index = 0; index < props.list.length; index++) { if (props.list[index].conversationID.indexOf("@TIM#SYSTEM") > -1) { props.list.splice(index, 1); } transferList.value = props.list; } } else { transferList.value = props.list; } transferTotal.value = props.total ? props.total : props.list.length; transferSelectedList.value = props.selectedList && props.selectedList.length > 0 ? props.selectedList : transferSelectedList.value; isTransferSearch.value = props.isSearch; isTransferCustomItem.value = props.isCustomItem; transferTitle.value = props.title; }); const emit = __emit; const optional = common_vendor.computed( () => transferList.value.filter((item) => !item.isDisabled) ); const handleInput = (e) => { searchValue.value = e.target.value || e.detail.value; emit("search", searchValue.value); }; const selected = (item) => { if (item.isDisabled) { return; } let list = transferSelectedList.value; const index = list.indexOf(item); if (index > -1) { return transferSelectedList.value.splice(index, 1); } if (props.isRadio) { list = []; } list.push(item); transferSelectedList.value = list; }; const selectedAll = () => { if (transferSelectedList.value.length === optional.value.length) { transferSelectedList.value = []; } else { transferSelectedList.value = [...optional.value]; } }; const submit = () => { emit("submit", transferSelectedList.value); searchValue.value = ""; }; const cancel = () => { emit("cancel"); searchValue.value = ""; }; const getMore = () => { emit("getMore"); }; return (_ctx, _cache) => { return common_vendor.e({ a: !common_vendor.unref(TUIKit_utils_env.isPC) }, !common_vendor.unref(TUIKit_utils_env.isPC) ? common_vendor.e({ b: !props.isHiddenBackIcon }, !props.isHiddenBackIcon ? { c: common_vendor.p({ file: common_vendor.unref(common_assets.backIcon), width: "18px", height: "18px" }), d: common_vendor.o$1(cancel) } : {}, { e: common_vendor.t(common_vendor.unref(transferTitle)) }) : {}, { f: common_vendor.unref(TUIKit_utils_env.isPC) && common_vendor.unref(isTransferSearch) }, common_vendor.unref(TUIKit_utils_env.isPC) && common_vendor.unref(isTransferSearch) ? { g: common_vendor.unref(searchValue), h: common_vendor.unref(common_vendor.Wt).t("component.请输入userID"), i: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isUniFrameWork) ? "left-uniapp-input" : ""), j: common_vendor.o$1(handleInput) } : {}, { k: !common_vendor.unref(TUIKit_utils_env.isPC) && common_vendor.unref(isTransferSearch) }, !common_vendor.unref(TUIKit_utils_env.isPC) && common_vendor.unref(isTransferSearch) ? { l: common_vendor.unref(common_vendor.Wt).t("component.请输入userID"), m: common_vendor.unref(searchValue), n: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isUniFrameWork) ? "left-uniapp-input" : ""), o: common_vendor.o$1(handleInput), p: common_vendor.o$1(handleInput) } : {}, { q: common_vendor.unref(optional).length > 1 && !__props.isRadio }, common_vendor.unref(optional).length > 1 && !__props.isRadio ? common_vendor.e({ r: common_vendor.unref(transferSelectedList).length === common_vendor.unref(optional).length }, common_vendor.unref(transferSelectedList).length === common_vendor.unref(optional).length ? { s: common_vendor.p({ file: common_vendor.unref(common_assets.selectedIcon), width: "18px", height: "18px" }) } : {}, { t: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.全选")), v: common_vendor.o$1(selectedAll) }) : {}, { w: common_vendor.f(common_vendor.unref(transferList), (item, k0, i0) => { return common_vendor.e({ a: common_vendor.unref(transferSelectedList).indexOf(item) > -1 }, common_vendor.unref(transferSelectedList).indexOf(item) > -1 ? { b: common_vendor.n(item.isDisabled && "disabled"), c: "01b74c91-2-" + i0, d: common_vendor.p({ file: common_vendor.unref(common_assets.selectedIcon), width: "18px", height: "18px" }) } : { e: common_vendor.n(item.isDisabled && "disabled") }, !common_vendor.unref(isTransferCustomItem) ? common_vendor.e({ f: item.avatar || "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png", g: common_vendor.t(item.nick || item.userID), h: item.isDisabled }, item.isDisabled ? { i: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.已在群中")) } : {}) : { j: "left-" + i0, k: common_vendor.r("left", { data: item }, i0) }, { l: item.userID, m: common_vendor.o$1(($event) => selected(item), item.userID) }); }), x: !common_vendor.unref(isTransferCustomItem), y: common_vendor.unref(transferTotal) > common_vendor.unref(transferList).length }, common_vendor.unref(transferTotal) > common_vendor.unref(transferList).length ? { z: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.查看更多")), A: common_vendor.o$1(getMore) } : {}, { B: common_vendor.unref(TUIKit_utils_env.isPC) }, common_vendor.unref(TUIKit_utils_env.isPC) ? { C: common_vendor.t(common_vendor.unref(transferTitle)) } : {}, { D: __props.resultShow }, __props.resultShow ? common_vendor.e({ E: common_vendor.unref(transferSelectedList).length > 0 && common_vendor.unref(TUIKit_utils_env.isPC) }, common_vendor.unref(transferSelectedList).length > 0 && common_vendor.unref(TUIKit_utils_env.isPC) ? { F: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.已选中")), G: common_vendor.t(common_vendor.unref(transferSelectedList).length), H: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.人")) } : {}, { I: common_vendor.f(common_vendor.unref(transferSelectedList), (item, index, i0) => { return common_vendor.e(!common_vendor.unref(isTransferCustomItem) ? common_vendor.e({ a: item.avatar || "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png", b: common_vendor.unref(TUIKit_utils_env.isPC) }, common_vendor.unref(TUIKit_utils_env.isPC) ? { c: common_vendor.t(item.nick || item.userID) } : {}) : { d: "right-" + i0, e: common_vendor.r("right", { data: item }, i0) }, common_vendor.unref(TUIKit_utils_env.isPC) ? { f: "01b74c91-3-" + i0, g: common_vendor.p({ file: common_vendor.unref(common_assets.cancelIcon), width: "18px", height: "18px" }), h: common_vendor.o$1(($event) => selected(item), index) } : {}, { i: index }); }), J: !common_vendor.unref(isTransferCustomItem), K: common_vendor.unref(TUIKit_utils_env.isPC) }) : {}, { L: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.取消")), M: common_vendor.o$1(cancel), N: common_vendor.unref(transferSelectedList).length > 0 }, common_vendor.unref(transferSelectedList).length > 0 ? { O: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.完成")), P: common_vendor.o$1(submit) } : { Q: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("component.完成")), R: common_vendor.o$1(submit) }, { S: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) ? "transfer-h5" : ""), T: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isWeChat) ? "transfer-h5-wechat" : "") }); }; } }); const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-01b74c91"]]); wx.createComponent(Component); //# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/common/Transfer/index.js.map