|
@@ -1,28 +1,18 @@
|
|
|
<template>
|
|
|
- <ui-group-option class="sign-guide" :class="{ search }">
|
|
|
+ <ui-group-option v-if="position" class="sign-position" :class="{ search }">
|
|
|
<div class="info">
|
|
|
- <div class="guide-cover">
|
|
|
- <img :src="getResource(getFileUrl(guide.cover))" />
|
|
|
- <ui-icon
|
|
|
+ <div class="position-cover">
|
|
|
+ <img src="@/assets/equipment_e.svg" />
|
|
|
+ <!-- <ui-icon
|
|
|
type="preview"
|
|
|
class="icon"
|
|
|
ctrl
|
|
|
- @click="flyPlayGuide(guide)"
|
|
|
- v-if="paths.length"
|
|
|
- />
|
|
|
+ @click="flyPlayGuide(position)"
|
|
|
+ v-if="positionList.length"
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
<div>
|
|
|
- <p>{{ guide.title }}</p>
|
|
|
- <!-- <ui-input
|
|
|
- class="view-title-input"
|
|
|
- type="text"
|
|
|
- :modelValue="guide.title"
|
|
|
- :maxlength="15"
|
|
|
- @update:modelValue="(title: string) => $emit('updateTitle', title.trim())"
|
|
|
- v-show="isEditTitle"
|
|
|
- ref="inputRef"
|
|
|
- height="28px"
|
|
|
- /> -->
|
|
|
+ <p>{{ position.deviceName }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="actions" v-if="edit">
|
|
@@ -36,18 +26,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { Guide, getGuidePaths } from "@/store";
|
|
|
- import { getFileUrl, saveAs } from "@/utils";
|
|
|
- import { getResource } from "@/env";
|
|
|
+ import { Position, positionList } from "@/store";
|
|
|
import { computed, watchEffect, nextTick, ref } from "vue";
|
|
|
import { playSceneGuide, isScenePlayIng, pauseSceneGuide } from "@/sdk";
|
|
|
- import { VideoRecorder } from "simaqcore";
|
|
|
import useFocus from "bill/hook/useFocus";
|
|
|
import { Message } from "bill/expose-common";
|
|
|
import { flyPlayGuide } from "@/hook/use-fly";
|
|
|
|
|
|
const props = withDefaults(
|
|
|
- defineProps<{ guide: Guide; edit?: boolean; search?: boolean }>(),
|
|
|
+ defineProps<{ position: Position; edit?: boolean; search?: boolean }>(),
|
|
|
{
|
|
|
edit: true,
|
|
|
search: false,
|
|
@@ -57,7 +44,7 @@
|
|
|
const inputRef = ref();
|
|
|
const isEditTitle = useFocus(computed(() => inputRef.value?.vmRef.root));
|
|
|
watchEffect(() => {
|
|
|
- if (!isEditTitle.value && !props.guide.title.length) {
|
|
|
+ if (!isEditTitle.value && !props.position.deviceName.length) {
|
|
|
isEditTitle.value = true;
|
|
|
Message.warning("导览名称不可为空");
|
|
|
}
|
|
@@ -70,79 +57,20 @@
|
|
|
(e: "edit"): void;
|
|
|
(e: "record"): void;
|
|
|
}>();
|
|
|
-
|
|
|
-// const menus = [
|
|
|
-// { label: "重命名", value: "editTitle" },
|
|
|
-// { label: "编辑", value: "edit" },
|
|
|
-// { label: "删除", value: "delete" },
|
|
|
-// ];
|
|
|
- const menus = [
|
|
|
- { label: "编辑", value: "edit" },
|
|
|
- { label: "录制", value: "record" },
|
|
|
- ];
|
|
|
+ const menus = [
|
|
|
+ { label: "编辑", value: "edit" },
|
|
|
+ ];
|
|
|
const actions = {
|
|
|
edit: () => emit("edit"),
|
|
|
- record: () => emit("record"),
|
|
|
- delete: () => emit("delete"),
|
|
|
- download: () => {
|
|
|
- const config: any = {
|
|
|
- // uploadUrl: '',
|
|
|
- // resolution: '4k',
|
|
|
- // autoDownload: false,
|
|
|
- // systemAudio: true,
|
|
|
- // debug: true,
|
|
|
- resolution: "4k",
|
|
|
- autoDownload: false,
|
|
|
- platform: "canvas",
|
|
|
-
|
|
|
- config: {
|
|
|
- frameRate: 60,
|
|
|
- canvasId: ".scene-canvas > canvas",
|
|
|
- },
|
|
|
- disbaledAudio: false,
|
|
|
- systemAudio: false,
|
|
|
- debug: false,
|
|
|
- };
|
|
|
-
|
|
|
- const videoRecorder = new VideoRecorder(config);
|
|
|
- videoRecorder.startRecord();
|
|
|
-
|
|
|
- let stopWatch: () => void;
|
|
|
- const stopRecord = () => {
|
|
|
- stopWatch && stopWatch();
|
|
|
- pauseSceneGuide();
|
|
|
- };
|
|
|
-
|
|
|
- videoRecorder.on("record", (blob) => {
|
|
|
- saveAs(
|
|
|
- new File([blob], "录屏.mp4", { type: "video/mp4; codecs=h264" }),
|
|
|
- props.guide.title + ".mp4"
|
|
|
- );
|
|
|
- });
|
|
|
-
|
|
|
- videoRecorder.off("*");
|
|
|
- videoRecorder.on("startRecord", () => {
|
|
|
- flyPlayGuide(props.guide);
|
|
|
- stopWatch = watchEffect(() => {
|
|
|
- if (!isScenePlayIng.value) {
|
|
|
- videoRecorder.endRecord();
|
|
|
- nextTick(stopWatch);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- videoRecorder.on("cancelRecord", stopRecord);
|
|
|
- videoRecorder.on("endRecord", stopRecord);
|
|
|
- },
|
|
|
};
|
|
|
- const paths = computed(() => getGuidePaths(props.guide));
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .sign-guide {
|
|
|
+ .sign-position {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- padding: 20px 0;
|
|
|
+ padding: 16px 0;
|
|
|
border-bottom: 1px solid var(--colors-border-color);
|
|
|
|
|
|
&.search {
|
|
@@ -157,7 +85,7 @@
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
|
|
|
- .guide-cover {
|
|
|
+ .position-cover {
|
|
|
position: relative;
|
|
|
&::after {
|
|
|
content: "";
|
|
@@ -176,8 +104,8 @@
|
|
|
}
|
|
|
|
|
|
img {
|
|
|
- width: 48px;
|
|
|
- height: 48px;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
object-fit: cover;
|
|
|
border-radius: 4px;
|
|
|
overflow: hidden;
|
|
@@ -192,7 +120,7 @@
|
|
|
p {
|
|
|
color: #fff;
|
|
|
font-size: 14px;
|
|
|
- margin-bottom: 6px;
|
|
|
+ // margin-bottom: 6px;
|
|
|
}
|
|
|
}
|
|
|
}
|