@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.38 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const Message = require("../../common/base/Message/Message.js");
const ScreenWindowPreviewer = require("./ScreenWindowPreviewer.vue.js");
const message = require("../../../constants/message.js");
const index = require("../../../locales/index.js");
const index$1 = require("../../common/base/Dialog/index.vue.js");
const Button = require("../../common/base/Button.vue.js");
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__ */ Vue.defineComponent({
__name: "ScreenWindowSelectDialog",
props: {
visible: { type: Boolean },
screenList: {},
windowList: {}
},
emits: ["on-confirm", "on-close"],
setup(__props, { emit: __emit }) {
const { t } = index.useI18n();
const props = __props;
const emit = __emit;
const selected = Vue.ref(null);
Vue.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 {
Message.default({
type: "warning",
message: t("Select a screen or window first"),
duration: message.MESSAGE_DURATION.LONG
});
}
}
function onClose() {
emit("on-close", props.visible);
}
return (_ctx, _cache) => {
return Vue.openBlock(), Vue.createElementBlock("div", null, [
Vue.createVNode(index$1.default, {
"model-value": _ctx.visible,
title: Vue.unref(t)("Select a screen or window first"),
modal: true,
"append-to-body": true,
width: "960px",
onClose
}, {
footer: Vue.withCtx(() => [
Vue.createVNode(Button.default, {
size: "default",
onClick: start
}, {
default: Vue.withCtx(() => [
Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Share")), 1)
]),
_: 1
})
]),
default: Vue.withCtx(() => [
Vue.createElementVNode("div", _hoisted_1, [
Vue.createElementVNode("div", _hoisted_2, Vue.toDisplayString(Vue.unref(t)("Screen")), 1),
Vue.createElementVNode("ul", _hoisted_3, [
(Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(_ctx.screenList, (item) => {
var _a;
return Vue.openBlock(), Vue.createBlock(ScreenWindowPreviewer.default, {
key: item.sourceId,
data: item,
class: Vue.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))
]),
Vue.createElementVNode("div", _hoisted_4, Vue.toDisplayString(Vue.unref(t)("Window")), 1),
Vue.createElementVNode("ul", _hoisted_5, [
(Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(_ctx.windowList, (item) => {
var _a;
return Vue.openBlock(), Vue.createBlock(ScreenWindowPreviewer.default, {
key: item.sourceId,
data: item,
class: Vue.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"])
]);
};
}
});
exports.default = _sfc_main;