@tencentcloud/roomkit-electron-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,
111 lines (110 loc) • 4.25 kB
JavaScript
import { defineComponent, ref, watch, createElementBlock, openBlock, createVNode, unref, withCtx, createElementVNode, toDisplayString, Fragment, renderList, createBlock, normalizeClass, createTextVNode } from "vue";
import renderMsg from "../../common/base/Message/Message.mjs";
import ScreenWindowPreviewer from "./ScreenWindowPreviewer.vue.mjs";
import { MESSAGE_DURATION } from "../../../constants/message.mjs";
import { useI18n } from "../../../locales/index.mjs";
import Dialog from "../../common/base/Dialog/index.vue.mjs";
import TuiButton from "../../common/base/Button.vue.mjs";
const _hoisted_1 = { class: "screen-content" };
const _hoisted_2 = { class: "screen-title" };
const _hoisted_3 = { class: "screen-list" };
const _hoisted_4 = { class: "window-title" };
const _hoisted_5 = { class: "window-list" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "ScreenWindowSelectDialog",
props: {
visible: { type: Boolean },
screenList: {},
windowList: {}
},
emits: ["on-confirm", "on-close"],
setup(__props, { emit: __emit }) {
const { t } = useI18n();
const props = __props;
const emit = __emit;
const selected = ref(null);
watch(
() => props.screenList.length,
() => {
if (props.screenList.length > 0) {
onSelect(props.screenList[0]);
}
}
);
function onSelect(screenInfo) {
selected.value = screenInfo;
}
function start() {
if (selected == null ? void 0 : selected.value) {
emit("on-confirm", selected.value);
} else {
renderMsg({
type: "warning",
message: t("Select a screen or window first"),
duration: MESSAGE_DURATION.LONG
});
}
}
function onClose() {
emit("on-close", props.visible);
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, [
createVNode(Dialog, {
"model-value": _ctx.visible,
title: unref(t)("Select a screen or window first"),
modal: true,
"append-to-body": true,
width: "960px",
onClose
}, {
footer: withCtx(() => [
createVNode(TuiButton, {
size: "default",
onClick: start
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("Share")), 1)
]),
_: 1
})
]),
default: withCtx(() => [
createElementVNode("div", _hoisted_1, [
createElementVNode("div", _hoisted_2, toDisplayString(unref(t)("Screen")), 1),
createElementVNode("ul", _hoisted_3, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.screenList, (item) => {
var _a;
return openBlock(), createBlock(ScreenWindowPreviewer, {
key: item.sourceId,
data: item,
class: normalizeClass({ selected: item.sourceId === ((_a = selected.value) == null ? void 0 : _a.sourceId) }),
title: item.sourceName,
onClick: ($event) => onSelect(item)
}, null, 8, ["data", "class", "title", "onClick"]);
}), 128))
]),
createElementVNode("div", _hoisted_4, toDisplayString(unref(t)("Window")), 1),
createElementVNode("ul", _hoisted_5, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.windowList, (item) => {
var _a;
return openBlock(), createBlock(ScreenWindowPreviewer, {
key: item.sourceId,
data: item,
class: normalizeClass({ selected: item.sourceId === ((_a = selected.value) == null ? void 0 : _a.sourceId) }),
title: item.sourceName,
onClick: ($event) => onSelect(item)
}, null, 8, ["data", "class", "title", "onClick"]);
}), 128))
])
])
]),
_: 1
}, 8, ["model-value", "title"])
]);
};
}
});
export {
_sfc_main as default
};