@tencentcloud/roomkit-web-vue3
Version:
<h1 align="center"> TUIRoomKit</h1> Conference (TUIRoomKit) is a product suitable for multi-person audio and video conversation scenarios such as business meetings, webinars, and online education. By integrating this product, you can add room management,
233 lines (232 loc) • 9.56 kB
JavaScript
import { defineComponent, createElementBlock, openBlock, createElementVNode, createCommentVNode, createVNode, withDirectives, unref, isRef, vModelText, Fragment, renderList, normalizeClass, toDisplayString, createBlock, withCtx, createTextVNode, vShow } from "vue";
import { storeToRefs } from "pinia";
import index from "./MemberItem/index.mjs";
import { IconSearch, IconApplyTips, TUIButton, IconArrowUp, TUIIcon } from "@tencentcloud/uikit-base-component-vue3";
import Dialog from "../common/base/Dialog/index.mjs";
import { useRoomStore } from "../../stores/room.mjs";
import useIndex from "./useIndexHooks.mjs";
import vClickOutside from "../../directives/vClickOutside.mjs";
import { USERS_STATUS } from "../../constants/room.mjs";
const _hoisted_1 = { class: "manage-member-container" };
const _hoisted_2 = { class: "manage-member-header" };
const _hoisted_3 = { class: "search-container" };
const _hoisted_4 = ["placeholder"];
const _hoisted_5 = { class: "apply-count" };
const _hoisted_6 = { class: "user-status" };
const _hoisted_7 = ["onClick"];
const _hoisted_8 = { class: "apply-staged" };
const _hoisted_9 = {
key: 0,
class: "apply-on-stage-info"
};
const _hoisted_10 = { class: "apply-info" };
const _hoisted_11 = {
id: "memberListContainer",
class: "member-list-container"
};
const _hoisted_12 = {
key: 1,
class: "global-setting"
};
const _hoisted_13 = { class: "more-container" };
const _hoisted_14 = { class: "drop-down" };
const _hoisted_15 = ["onClick"];
const _hoisted_16 = { class: "operate-text" };
const _hoisted_17 = {
key: 2,
class: "global-setting"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "indexPC",
setup(__props) {
const roomStore = useRoomStore();
const { applyToAnchorList, isGeneralUser } = storeToRefs(roomStore);
const {
t,
searchText,
showApplyUserList,
showManageAllUserDialog,
dialogTitle,
dialogContent,
toggleManageAllMember,
doToggleManageAllMember,
ManageControlType,
handleToggleStaged,
applyToAnchorUserContent,
audioManageInfo,
videoManageInfo,
toggleClickMoreBtn,
showMoreControl,
moreControlList,
userStatusList,
currentActiveTabName,
filteredUserStatusList,
handleCallAllInvitee
} = useIndex();
const handleShowMoreControl = () => {
if (showMoreControl.value) {
showMoreControl.value = false;
}
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
createElementVNode("div", _hoisted_2, [
createElementVNode("div", _hoisted_3, [
createVNode(unref(IconSearch), { size: "20" }),
withDirectives(createElementVNode("input", {
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchText) ? searchText.value = $event : null),
class: "search-input",
placeholder: unref(t)("Search Member")
}, null, 8, _hoisted_4), [
[vModelText, unref(searchText)]
])
])
]),
createElementVNode("div", _hoisted_5, [
createElementVNode("div", _hoisted_6, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(userStatusList), (item, index2) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass([
"user-status-container",
{
"apply-count-active": item.status === unref(currentActiveTabName)
}
]),
key: index2,
onClick: ($event) => unref(handleToggleStaged)(item)
}, [
createElementVNode("span", _hoisted_8, toDisplayString(item.title), 1)
], 10, _hoisted_7);
}), 128))
])
]),
unref(applyToAnchorList).length > 0 && !unref(isGeneralUser) ? (openBlock(), createElementBlock("div", _hoisted_9, [
createVNode(unref(IconApplyTips), { class: "apply-icon" }),
createElementVNode("div", _hoisted_10, toDisplayString(unref(applyToAnchorUserContent)), 1),
createElementVNode("div", {
class: "apply-check",
onClick: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(showApplyUserList) && unref(showApplyUserList)(...args))
}, toDisplayString(unref(t)("Check")), 1)
])) : createCommentVNode("", true),
createElementVNode("div", _hoisted_11, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredUserStatusList), (userInfo) => {
return openBlock(), createBlock(unref(index), {
key: userInfo.userId,
"user-info": userInfo
}, null, 8, ["user-info"]);
}), 128))
]),
!unref(isGeneralUser) && unref(currentActiveTabName) !== unref(USERS_STATUS).NOT_ENTER ? (openBlock(), createElementBlock("div", _hoisted_12, [
createVNode(unref(TUIButton), {
type: "primary",
color: "gray",
onClick: _cache[2] || (_cache[2] = ($event) => unref(toggleManageAllMember)(unref(ManageControlType).AUDIO)),
style: { "min-width": "118px" }
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(audioManageInfo)), 1)
]),
_: 1
}),
createVNode(unref(TUIButton), {
type: "primary",
color: "gray",
onClick: _cache[3] || (_cache[3] = ($event) => unref(toggleManageAllMember)(unref(ManageControlType).VIDEO)),
style: { "min-width": "118px" }
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(videoManageInfo)), 1)
]),
_: 1
}),
withDirectives((openBlock(), createElementBlock("div", _hoisted_13, [
createVNode(unref(TUIButton), {
onClick: unref(toggleClickMoreBtn),
color: "gray",
type: "primary",
style: { "min-width": "108px" }
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("More")) + " ", 1),
createVNode(unref(IconArrowUp), {
size: "12",
class: normalizeClass(["more-arrow", unref(showMoreControl) ? "up" : "down"])
}, null, 8, ["class"])
]),
_: 1
}, 8, ["onClick"]),
withDirectives(createElementVNode("div", _hoisted_14, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(moreControlList), (item) => {
return openBlock(), createElementBlock("div", {
key: item.type,
class: "user-operate-item",
onClick: ($event) => item.func(item.type)
}, [
createVNode(unref(TUIIcon), {
icon: item.icon
}, null, 8, ["icon"]),
createElementVNode("span", _hoisted_16, toDisplayString(item.title), 1)
], 8, _hoisted_15);
}), 128))
], 512), [
[vShow, unref(showMoreControl)]
])
])), [
[unref(vClickOutside), handleShowMoreControl]
])
])) : createCommentVNode("", true),
unref(currentActiveTabName) === unref(USERS_STATUS).NOT_ENTER ? (openBlock(), createElementBlock("div", _hoisted_17, [
unref(filteredUserStatusList).length > 0 ? (openBlock(), createBlock(unref(TUIButton), {
key: 0,
type: "primary",
onClick: unref(handleCallAllInvitee),
style: { minWidth: "80%" }
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("Call all")), 1)
]),
_: 1
}, 8, ["onClick"])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
createVNode(unref(Dialog), {
modelValue: unref(showManageAllUserDialog),
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(showManageAllUserDialog) ? showManageAllUserDialog.value = $event : null),
title: unref(dialogTitle),
width: "480px",
modal: true,
"append-to-room-container": true
}, {
footer: withCtx(() => [
createVNode(unref(TUIButton), {
onClick: unref(doToggleManageAllMember),
type: "primary",
style: { "min-width": "88px" }
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("Confirm")), 1)
]),
_: 1
}, 8, ["onClick"]),
createVNode(unref(TUIButton), {
onClick: _cache[4] || (_cache[4] = ($event) => showManageAllUserDialog.value = false),
style: { "min-width": "88px" }
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("Cancel")), 1)
]),
_: 1
})
]),
default: withCtx(() => [
createElementVNode("span", null, toDisplayString(unref(dialogContent)), 1)
]),
_: 1
}, 8, ["modelValue", "title"])
]);
};
}
});
export {
_sfc_main as default
};