|
@@ -1,7 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<a-config-provider :locale="getAntdLocale">
|
|
<a-config-provider :locale="getAntdLocale">
|
|
- <a-modal
|
|
|
|
|
|
+ <a-drawer
|
|
:visible="visible"
|
|
:visible="visible"
|
|
|
|
+ placement="right"
|
|
:title="
|
|
:title="
|
|
isRoomEnd
|
|
isRoomEnd
|
|
? t('room.endRoomTitle')
|
|
? t('room.endRoomTitle')
|
|
@@ -9,27 +10,30 @@
|
|
? t('room.createRoom')
|
|
? t('room.createRoom')
|
|
: t('room.editRoom')
|
|
: t('room.editRoom')
|
|
"
|
|
"
|
|
- :after-close="onCancel"
|
|
|
|
- width="912px"
|
|
|
|
- :style="{
|
|
|
|
- top: '10px',
|
|
|
|
- minWidth: '912px'
|
|
|
|
- }"
|
|
|
|
- @cancel="visible = false"
|
|
|
|
|
|
+ @close="onCancel"
|
|
|
|
+ width="476px"
|
|
>
|
|
>
|
|
<template #footer>
|
|
<template #footer>
|
|
- <a-button class="action-bottom" size="middle" @click="visible = false">
|
|
|
|
- {{ t('base.cancel') }}
|
|
|
|
- </a-button>
|
|
|
|
- <a-button
|
|
|
|
- v-if="!isRoomEnd"
|
|
|
|
- class="action-bottom"
|
|
|
|
- type="primary"
|
|
|
|
- size="middle"
|
|
|
|
- @click="saveRoom"
|
|
|
|
- >
|
|
|
|
- {{ t('base.save') }}
|
|
|
|
- </a-button>
|
|
|
|
|
|
+ <div class="footer">
|
|
|
|
+ <a-button
|
|
|
|
+ class="action-bottom"
|
|
|
|
+ size="middle"
|
|
|
|
+ @click="visible = false"
|
|
|
|
+ >
|
|
|
|
+ {{ t('base.cancel') }}
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ v-if="!isRoomEnd"
|
|
|
|
+ class="action-bottom"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="middle"
|
|
|
|
+ :disabled="isLive"
|
|
|
|
+ @click="saveRoom"
|
|
|
|
+ >
|
|
|
|
+ {{ t('base.save') }}
|
|
|
|
+ </a-button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<!-- <a-button
|
|
<!-- <a-button
|
|
v-if="room"
|
|
v-if="room"
|
|
class="action-bottom"
|
|
class="action-bottom"
|
|
@@ -70,7 +74,38 @@
|
|
:disabled="isRoomEnd"
|
|
:disabled="isRoomEnd"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
+
|
|
|
|
+ <!-- <a-form-item label="位置" name="map">
|
|
|
|
+ <a-input
|
|
|
|
+ v-model:value.trim="current.location"
|
|
|
|
+ placeholder=""
|
|
|
|
+ :maxlength="50"
|
|
|
|
+ show-count
|
|
|
|
+ id="location"
|
|
|
|
+ :disabled="isRoomEnd"
|
|
|
|
+ />
|
|
|
|
+ <div style="margin: 10px 0"></div>
|
|
|
|
+ <div ref="mapRef" style="width: 100%; height: 194px"></div>
|
|
|
|
+ </a-form-item> -->
|
|
|
|
+
|
|
<a-form-item :label="t('room.form.desc')" name="desc">
|
|
<a-form-item :label="t('room.form.desc')" name="desc">
|
|
|
|
+ <!-- <QuillEditor style="{minHeight: '400px';}" theme="snow" v-model:content="current.desc" /> -->
|
|
|
|
+
|
|
|
|
+ <!-- <div style="border: 1px solid #ccc">
|
|
|
|
+ <Editor
|
|
|
|
+ style="height: 150px; overflow-y: hidden"
|
|
|
|
+ v-model="current.desc"
|
|
|
|
+ :defaultConfig="{
|
|
|
|
+ maxLength: 200,
|
|
|
|
+ placeholder: t('room.form.descplaceHolder')
|
|
|
|
+ }"
|
|
|
|
+ mode="simple"
|
|
|
|
+ @onCreated="handleEditorCreated"
|
|
|
|
+ @onMaxLength="handleEditorOnMaxLength"
|
|
|
|
+ @onBlur="handleEditorOnBlur"
|
|
|
|
+ @customPaste="handleEditorCustomPaste"
|
|
|
|
+ />
|
|
|
|
+ </div> -->
|
|
<a-textarea
|
|
<a-textarea
|
|
v-model:value="current.desc"
|
|
v-model:value="current.desc"
|
|
:placeholder="t('room.form.descplaceHolder')"
|
|
:placeholder="t('room.form.descplaceHolder')"
|
|
@@ -80,6 +115,7 @@
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<!-- <h4>{{ t('room.form.host') }}</h4> -->
|
|
<!-- <h4>{{ t('room.form.host') }}</h4> -->
|
|
|
|
+
|
|
<a-form-item
|
|
<a-form-item
|
|
:label="t('room.form.nickname')"
|
|
:label="t('room.form.nickname')"
|
|
name="leaderName"
|
|
name="leaderName"
|
|
@@ -96,7 +132,24 @@
|
|
:disabled="isRoomEnd"
|
|
:disabled="isRoomEnd"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <!-- <h4>{{ t('room.form.selectScene') }}</h4> -->
|
|
|
|
|
|
+
|
|
|
|
+ <a-form-item label="头像" name="head">
|
|
|
|
+ <EditAvatar
|
|
|
|
+ v-model:value.trim="current.head"
|
|
|
|
+ @sync="handleAvatarSync"
|
|
|
|
+ />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <!-- 相册 -->
|
|
|
|
+ <!-- <a-form-item label="相册" name="title">
|
|
|
|
+ <EditAlbum
|
|
|
|
+ :data="current.scenesAlbum || []"
|
|
|
|
+ @sync-list="handleAlbumSync"
|
|
|
|
+ />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="视频" name="title">
|
|
|
|
+ <EditVideo :data="current.scenesVideo" @sync="handleVideoSync" />
|
|
|
|
+ </a-form-item> -->
|
|
|
|
+
|
|
<a-form-item
|
|
<a-form-item
|
|
:label="t('room.form.addScene')"
|
|
:label="t('room.form.addScene')"
|
|
class="select-scene"
|
|
class="select-scene"
|
|
@@ -104,6 +157,7 @@
|
|
style="margin-bottom: 2px"
|
|
style="margin-bottom: 2px"
|
|
>
|
|
>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
+
|
|
<EditScenes
|
|
<EditScenes
|
|
:class="{ disabled: isRoomEnd }"
|
|
:class="{ disabled: isRoomEnd }"
|
|
:scenes="current.scenes"
|
|
:scenes="current.scenes"
|
|
@@ -120,12 +174,11 @@
|
|
>
|
|
>
|
|
<a-range-picker
|
|
<a-range-picker
|
|
:show-time="{ format: 'HH:mm' }"
|
|
:show-time="{ format: 'HH:mm' }"
|
|
- format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
- style="width: 80%"
|
|
|
|
|
|
+ format="YYYY-MM-DD HH:mm"
|
|
|
|
+ style="width: 85%"
|
|
:disabled="isRoomEnd"
|
|
:disabled="isRoomEnd"
|
|
:disabledDate="disabledDate"
|
|
:disabledDate="disabledDate"
|
|
:disabledTime="disabledTime"
|
|
:disabledTime="disabledTime"
|
|
- @calendarChange="onRangeChange"
|
|
|
|
v-model:value="current.useTimeList"
|
|
v-model:value="current.useTimeList"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -136,17 +189,19 @@
|
|
style="margin-bottom: 2px"
|
|
style="margin-bottom: 2px"
|
|
>
|
|
>
|
|
<v-otp-input
|
|
<v-otp-input
|
|
|
|
+ ref="otpInput"
|
|
v-model:value="current.visitPassword"
|
|
v-model:value="current.visitPassword"
|
|
class="otp-container"
|
|
class="otp-container"
|
|
input-classes="otp-input"
|
|
input-classes="otp-input"
|
|
input-type="number"
|
|
input-type="number"
|
|
separator="-"
|
|
separator="-"
|
|
:num-inputs="4"
|
|
:num-inputs="4"
|
|
- :should-auto-focus="false"
|
|
|
|
|
|
+ :should-auto-focus="true"
|
|
|
|
+ :should-focus-order="true"
|
|
:class="{ disabled: isRoomEnd }"
|
|
:class="{ disabled: isRoomEnd }"
|
|
- :is-input-num="true"
|
|
|
|
:conditionalClass="['one', 'two', 'three', 'four']"
|
|
:conditionalClass="['one', 'two', 'three', 'four']"
|
|
:placeholder="['-', '-', '-', '-']"
|
|
:placeholder="['-', '-', '-', '-']"
|
|
|
|
+ @on-change="handlePsOnChange"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item name="scenes" style="margin-bottom: 2px">
|
|
<a-form-item name="scenes" style="margin-bottom: 2px">
|
|
@@ -214,7 +269,7 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
- </a-modal>
|
|
|
|
|
|
+ </a-drawer>
|
|
|
|
|
|
<a-modal
|
|
<a-modal
|
|
v-model:visible="authvisible"
|
|
v-model:visible="authvisible"
|
|
@@ -262,7 +317,8 @@ import {
|
|
reactive,
|
|
reactive,
|
|
computed,
|
|
computed,
|
|
unref,
|
|
unref,
|
|
- createVNode
|
|
|
|
|
|
+ createVNode,
|
|
|
|
+ shallowRef
|
|
} from 'vue'
|
|
} from 'vue'
|
|
|
|
|
|
import { createRoom, useRoomStore } from '@/store/modules/room'
|
|
import { createRoom, useRoomStore } from '@/store/modules/room'
|
|
@@ -270,6 +326,9 @@ import { props } from './props'
|
|
import { message, Modal } from 'ant-design-vue'
|
|
import { message, Modal } from 'ant-design-vue'
|
|
import { mainURL } from '@/env'
|
|
import { mainURL } from '@/env'
|
|
import EditScenes from './scene-list.vue'
|
|
import EditScenes from './scene-list.vue'
|
|
|
|
+import EditAlbum from './album-list.vue'
|
|
|
|
+import EditAvatar from './avatar.vue'
|
|
|
|
+import EditVideo from './video.vue'
|
|
import unScenePng from '@/assets/images/un-scene.png'
|
|
import unScenePng from '@/assets/images/un-scene.png'
|
|
import VOtpInput from 'vue3-otp-input'
|
|
import VOtpInput from 'vue3-otp-input'
|
|
import type { Scene } from '@/store/modules/scene'
|
|
import type { Scene } from '@/store/modules/scene'
|
|
@@ -278,9 +337,31 @@ import { useI18n } from '@/hook/useI18n'
|
|
import { useLocale } from '@/locales/useLocale'
|
|
import { useLocale } from '@/locales/useLocale'
|
|
import dayjs, { Dayjs } from 'dayjs'
|
|
import dayjs, { Dayjs } from 'dayjs'
|
|
import duration from 'dayjs/plugin/duration'
|
|
import duration from 'dayjs/plugin/duration'
|
|
-import { addAuthUser } from '@/api'
|
|
|
|
|
|
+import utc from 'dayjs/plugin/utc'
|
|
|
|
+import localizedFormat from 'dayjs/plugin/localizedFormat'
|
|
|
|
+import customParseFormat from 'dayjs/plugin/customParseFormat'
|
|
|
|
+import timezone from 'dayjs/plugin/timezone'
|
|
|
|
+import { addAuthUser, checkRoomEditOrDel } from '@/api'
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'
|
|
|
|
+import { useScript } from '@/hook/useScript'
|
|
|
|
+import type { UploadChangeParam } from 'ant-design-vue'
|
|
|
|
+import {
|
|
|
|
+ watchEffect,
|
|
|
|
+ getCurrentInstance,
|
|
|
|
+ onMounted,
|
|
|
|
+ onBeforeUnmount
|
|
|
|
+} from 'vue'
|
|
|
|
+import { nextTick } from 'vue'
|
|
|
|
+
|
|
|
|
+// import '@wangeditor/editor/dist/css/style.css' // 引入 css
|
|
|
|
+// import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
|
|
|
+
|
|
dayjs.extend(duration)
|
|
dayjs.extend(duration)
|
|
|
|
+dayjs.extend(utc)
|
|
|
|
+dayjs.extend(localizedFormat)
|
|
|
|
+dayjs.extend(customParseFormat)
|
|
|
|
+dayjs.extend(timezone)
|
|
|
|
+
|
|
// const titleValidator = ref({
|
|
// const titleValidator = ref({
|
|
// validator: (_, value) =>
|
|
// validator: (_, value) =>
|
|
// !value.includes(' ')
|
|
// !value.includes(' ')
|
|
@@ -290,45 +371,81 @@ dayjs.extend(duration)
|
|
|
|
|
|
interface AuthUserFormState {
|
|
interface AuthUserFormState {
|
|
userName: string
|
|
userName: string
|
|
- useTimeList?: Dayjs[]
|
|
|
|
|
|
+ useTimeList?: [Dayjs, Dayjs]
|
|
|
|
+ // useTimeList?: [string, string]
|
|
}
|
|
}
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'EditRoom',
|
|
name: 'EditRoom',
|
|
- components: { EditScenes, VOtpInput },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ EditScenes,
|
|
|
|
+ VOtpInput,
|
|
|
|
+ EditAlbum,
|
|
|
|
+ EditAvatar,
|
|
|
|
+ EditVideo
|
|
|
|
+ // Editor,
|
|
|
|
+ // Toolbar
|
|
|
|
+ },
|
|
props,
|
|
props,
|
|
setup(props) {
|
|
setup(props) {
|
|
const visible = ref(true)
|
|
const visible = ref(true)
|
|
const authvisible = ref(false)
|
|
const authvisible = ref(false)
|
|
-
|
|
|
|
|
|
+ const mapRef = ref<HTMLDivElement | null>(null)
|
|
const authformState: UnwrapRef<AuthUserFormState> = reactive({
|
|
const authformState: UnwrapRef<AuthUserFormState> = reactive({
|
|
userName: ''
|
|
userName: ''
|
|
- // useTimeList: []
|
|
|
|
})
|
|
})
|
|
const { getAntdLocale } = useLocale()
|
|
const { getAntdLocale } = useLocale()
|
|
const roomStore = useRoomStore()
|
|
const roomStore = useRoomStore()
|
|
const isRoomEnd = computed(() => props.room?.roomStatus === 2)
|
|
const isRoomEnd = computed(() => props.room?.roomStatus === 2)
|
|
const { getLocale } = useLocale()
|
|
const { getLocale } = useLocale()
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
|
|
+ const {
|
|
|
|
+ proxy: { $forceUpdate }
|
|
|
|
+ }: any = getCurrentInstance()
|
|
|
|
+ const avatarFile = ref<any[]>([])
|
|
|
|
+ const isLive = ref(false)
|
|
const returnLocale = computed(() => {
|
|
const returnLocale = computed(() => {
|
|
if (unref(getLocale).includes('zh')) {
|
|
if (unref(getLocale).includes('zh')) {
|
|
return 'zh'
|
|
return 'zh'
|
|
}
|
|
}
|
|
return unref(getLocale)
|
|
return unref(getLocale)
|
|
})
|
|
})
|
|
|
|
+ const editorRef = shallowRef()
|
|
|
|
|
|
const otpInput = ref('')
|
|
const otpInput = ref('')
|
|
const formRef = ref<FormInstance>()
|
|
const formRef = ref<FormInstance>()
|
|
- const current = reactive(createRoom(props.room || {}))
|
|
|
|
- if (current.useTimeList?.length) {
|
|
|
|
- current.useTimeList = current.useTimeList?.map(i => dayjs(i))
|
|
|
|
- }
|
|
|
|
|
|
+ const current = reactive({
|
|
|
|
+ ...createRoom(props.room || {})
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ watchEffect(async () => {
|
|
|
|
+ if(typeof current.head === 'undefined'){
|
|
|
|
+ current.head = ''
|
|
|
|
+ }
|
|
|
|
+ if (current.useTimeList?.length) {
|
|
|
|
+ // debugger
|
|
|
|
+ current.useTimeList = current.useTimeList
|
|
|
|
+ .filter(i => i)
|
|
|
|
+ .map(i => dayjs(i)) as unknown as [Dayjs, Dayjs]
|
|
|
|
+ }
|
|
|
|
+ if (props.room?.id) {
|
|
|
|
+ const res = await checkRoomEditOrDel(props.room)
|
|
|
|
+ if (props.room.hostStatus === 1 || !res) {
|
|
|
|
+ console.error('当前场景已在直播中或不能删除。。。。。')
|
|
|
|
+ isLive.value = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
if (!current.visitPassword) {
|
|
if (!current.visitPassword) {
|
|
current.visitPassword = ''
|
|
current.visitPassword = ''
|
|
}
|
|
}
|
|
if (!current.userObjList) {
|
|
if (!current.userObjList) {
|
|
current.userObjList = []
|
|
current.userObjList = []
|
|
}
|
|
}
|
|
|
|
+ if (!current.userObjList) {
|
|
|
|
+ current.userObjList = []
|
|
|
|
+ }
|
|
|
|
|
|
const deleteScene = (scene: Scene) => {
|
|
const deleteScene = (scene: Scene) => {
|
|
const index = current.scenes.indexOf(scene)
|
|
const index = current.scenes.indexOf(scene)
|
|
@@ -361,6 +478,7 @@ export default defineComponent({
|
|
current.visitPassword.length > 0 &&
|
|
current.visitPassword.length > 0 &&
|
|
current.visitPassword.length < 4
|
|
current.visitPassword.length < 4
|
|
) {
|
|
) {
|
|
|
|
+ // otpInput.value?.clearInput();
|
|
return message.error(t('room.passwordError'))
|
|
return message.error(t('room.passwordError'))
|
|
} else {
|
|
} else {
|
|
current.takeLookLock = 1
|
|
current.takeLookLock = 1
|
|
@@ -374,13 +492,14 @@ export default defineComponent({
|
|
props.onSave && props.onSave(current)
|
|
props.onSave && props.onSave(current)
|
|
visible.value = false
|
|
visible.value = false
|
|
}
|
|
}
|
|
|
|
+
|
|
// const startSync = () => {
|
|
// const startSync = () => {
|
|
// window.open(roomStore.getShareUrl({
|
|
// window.open(roomStore.getShareUrl({
|
|
|
|
|
|
// }))
|
|
// }))
|
|
// }
|
|
// }
|
|
|
|
|
|
- const handleNickRegex = async (_: any, value: string) => {
|
|
|
|
|
|
+ const handleNickRegex = async (_: any, value: string): Promise<void> => {
|
|
console.log('value', value)
|
|
console.log('value', value)
|
|
const regex = new RegExp(
|
|
const regex = new RegExp(
|
|
'^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9_]){1,15}$'
|
|
'^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9_]){1,15}$'
|
|
@@ -388,7 +507,7 @@ export default defineComponent({
|
|
if (value?.length && !regex.test(value)) {
|
|
if (value?.length && !regex.test(value)) {
|
|
return Promise.reject(t('room.nickNameRegrexError'))
|
|
return Promise.reject(t('room.nickNameRegrexError'))
|
|
}
|
|
}
|
|
- return Promise.resolve('')
|
|
|
|
|
|
+ return Promise.resolve()
|
|
}
|
|
}
|
|
|
|
|
|
const handleAuthConfirm = async () => {
|
|
const handleAuthConfirm = async () => {
|
|
@@ -437,7 +556,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- const onRangeChange = (range: Dayjs[]) => {
|
|
|
|
|
|
+ const onRangeChange = (range: [Dayjs, Dayjs]): void => {
|
|
const select = range.map((i, index) => {
|
|
const select = range.map((i, index) => {
|
|
if (i) {
|
|
if (i) {
|
|
const diff = i.diff(dayjs(), 'minutes')
|
|
const diff = i.diff(dayjs(), 'minutes')
|
|
@@ -451,8 +570,202 @@ export default defineComponent({
|
|
})
|
|
})
|
|
console.log('onRangeChange', event)
|
|
console.log('onRangeChange', event)
|
|
}
|
|
}
|
|
|
|
+ const onCancel = () => {
|
|
|
|
+ visible.value = false
|
|
|
|
+ }
|
|
|
|
+ ;(window as any)._AMapSecurityConfig = {
|
|
|
|
+ securityJsCode: 'cbac8ddaf1e7346784b24f10cae245a3'
|
|
|
|
+ }
|
|
|
|
+ const A_MAP_URL =
|
|
|
|
+ 'https://webapi.amap.com/maps?v=2.0&key=5a2d384532ae531bf99bd8487c4f03d2'
|
|
|
|
+ const UI = 'https://webapi.amap.com/ui/1.0/main.js?v=1.0.11'
|
|
|
|
+ // const { toPromise: toUIPromise } = useScript({ src: UI })
|
|
|
|
+ const { toPromise } = useScript({ src: A_MAP_URL })
|
|
|
|
+
|
|
|
|
+ const initMap = async () => {
|
|
|
|
+ await toPromise()
|
|
|
|
+ // await toUIPromise();
|
|
|
|
+
|
|
|
|
+ console.log('mapRef', unref(mapRef))
|
|
|
|
+ const AMap = (window as any).AMap
|
|
|
|
+ // console.log('AMap', AMap)
|
|
|
|
+ // ** 有数据时默认位置
|
|
|
|
+ // const center = [113.549574, 22.215372]
|
|
|
|
+
|
|
|
|
+ // var icon = new AMap.Icon({
|
|
|
|
+ // size: new AMap.Size(40, 50), // 图标尺寸
|
|
|
|
+ // image: '//webapi.amap.com/theme/v1.3/images/newpc/way_btn2.png', // Icon的图像
|
|
|
|
+ // imageOffset: new AMap.Pixel(0, -60), // 图像相对展示区域的偏移量,适于雪碧图等
|
|
|
|
+ // imageSize: new AMap.Size(40, 50) // 根据所设置的大小拉伸或压缩图片
|
|
|
|
+ // })
|
|
|
|
+ var marker = new AMap.Marker({
|
|
|
|
+ position: new AMap.LngLat(113.549574, 22.215372),
|
|
|
|
+ title: current.location,
|
|
|
|
+ zoom: 13
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ const map = new AMap.Map(unref(mapRef), {
|
|
|
|
+ zoom: 15,
|
|
|
|
+ resizeEnable: true
|
|
|
|
+ // center: center
|
|
|
|
+ // resizeEnable: true
|
|
|
|
+ // viewMode: '3D',
|
|
|
|
+ // resizeEnable: true
|
|
|
|
+ // floorControl: true,
|
|
|
|
+ // showIndoorMap: true
|
|
|
|
+ })
|
|
|
|
+ map.add(marker)
|
|
|
|
+
|
|
|
|
+ AMap.plugin(
|
|
|
|
+ [
|
|
|
|
+ 'AMap.Scale',
|
|
|
|
+ 'AMap.Geocoder',
|
|
|
|
+ 'AMap.Toolbar',
|
|
|
|
+ 'AMap.AutoComplete',
|
|
|
|
+ 'AMap.PlaceSearch',
|
|
|
|
+ 'AMap.Geolocation'
|
|
|
|
+ ],
|
|
|
|
+ function () {
|
|
|
|
+ const autoOptions = {
|
|
|
|
+ // city: '珠海',
|
|
|
|
+ input: 'location'
|
|
|
|
+ }
|
|
|
|
+ const autocomplete = new AMap.Autocomplete(autoOptions)
|
|
|
|
+ const placeSearch = new AMap.PlaceSearch({
|
|
|
|
+ // city: '珠海', // 默认城市,一定要有,不然没有放大效果
|
|
|
|
+ map: map // 地图,选中会有放大功能,绑定上面创建的地图即可
|
|
|
|
+ })
|
|
|
|
+ AMap.Event.addListener(autocomplete, 'select', function (e: any) {
|
|
|
|
+ placeSearch.search(e.poi.name)
|
|
|
|
+ // console.log('location', e.poi.location) // 获取选中的的地址的经纬度
|
|
|
|
+ console.log('select', e.poi) // 获取选中的的地址的经纬度
|
|
|
|
+ if (e.poi.name) {
|
|
|
|
+ current.location = e.poi.name
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ AMap.Event.addListener(autocomplete, 'click', function (e: any) {
|
|
|
|
+ console.log('click', e)
|
|
|
|
+ })
|
|
|
|
+ // var geolocation = new AMap.Geolocation({
|
|
|
|
+ // // 是否使用高精度定位,默认:true
|
|
|
|
+ // enableHighAccuracy: true,
|
|
|
|
+ // // 设置定位超时时间,默认:无穷大
|
|
|
|
+ // timeout: 10000,
|
|
|
|
+ // // 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
|
|
|
|
+ // buttonOffset: new AMap.Pixel(10, 20),
|
|
|
|
+ // // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
|
|
|
|
+ // zoomToAccuracy: true,
|
|
|
|
+ // // 定位按钮的排放位置, RB表示右下
|
|
|
|
+ // buttonPosition: 'RB'
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // geolocation.getCurrentPosition()
|
|
|
|
+ // AMap.Event.addListener(geolocation, 'complete', onComplete)
|
|
|
|
+ // AMap.Event.addListener(geolocation, 'error', onError)
|
|
|
|
+
|
|
|
|
+ // function onComplete(data: any) {
|
|
|
|
+ // console.log('onComplete-data', data)
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ function onError(data: any) {
|
|
|
|
+ console.log('onError-data', data)
|
|
|
|
+ // 定位出错
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ // initMap()
|
|
|
|
+ })
|
|
|
|
+ onBeforeUnmount(() => {
|
|
|
|
+ const editor = editorRef.value
|
|
|
|
+ if (editor == null) return
|
|
|
|
+ editor.destroy()
|
|
|
|
+ })
|
|
|
|
+ const handleAvatarChange = (info: UploadChangeParam) => {
|
|
|
|
+ // if (info.file.status !== 'uploading') {
|
|
|
|
+ // console.log(info.file, info.fileList)
|
|
|
|
+ // }
|
|
|
|
+ if (info.file.status === 'done') {
|
|
|
|
+ console.log('info.file', info.file)
|
|
|
|
+ if (info.file.response) {
|
|
|
|
+ const { code, data } = info.file.response
|
|
|
|
+ if (code === 0) {
|
|
|
|
+ current.head = data
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // message.success(`${info.file.name} file uploaded successfully`)
|
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
|
+ message.error(`${info.file.name} file upload failed.`)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const handleAlbumSync = (list: any[]) => {
|
|
|
|
+ current.scenesAlbum = list
|
|
|
|
+ // console.log('handleAlbumSync', list)
|
|
|
|
+ }
|
|
|
|
+ const handleVideoSync = (link: any) => {
|
|
|
|
+ // debugger
|
|
|
|
+ current.scenesVideo = link
|
|
|
|
+ }
|
|
|
|
+ const handleAvatarSync = (avatarURL: string) => {
|
|
|
|
+ if (unref(formRef)) {
|
|
|
|
+ current.head = avatarURL || ''
|
|
|
|
+ console.log('avatarURL-更新后', unref(formRef)?.getFieldsValue())
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const handleEditorCreated = (editor: any) => {
|
|
|
|
+ editorRef.value = editor // 记录 editor 实例,重要!
|
|
|
|
+ // const toolbar = DomEditor.getToolbar(editor)
|
|
|
|
+ // const curToolbarConfig = toolbar.getConfig()
|
|
|
|
+ // console.log(curToolbarConfig.toolbarKeys) // 当前菜单排序和分组
|
|
|
|
+ }
|
|
|
|
+ const handleEditorOnMaxLength = (editor: any) => {
|
|
|
|
+ const text = editor.getText()
|
|
|
|
+ if (text.length > 200) {
|
|
|
|
+ const html = text
|
|
|
|
+ .substring(0, 200)
|
|
|
|
+ .split(/\n/)
|
|
|
|
+ .map((line: string) => `<p>${line}</p>`)
|
|
|
|
+ .join('\n')
|
|
|
|
+ current.desc = html
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const handleEditorOnBlur = (editor: any) => {
|
|
|
|
+ const text = editor.getText()
|
|
|
|
+
|
|
|
|
+ if (text.length > 200) {
|
|
|
|
+ debugger
|
|
|
|
+ // const html = text
|
|
|
|
+ // .substring(0, 200)
|
|
|
|
+ // .split(/\n/)
|
|
|
|
+ // .map((line: string) => `<p>${line}</p>`)
|
|
|
|
+ // .join('\n')
|
|
|
|
+ // current.desc = html
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const handleEditorCustomPaste = (editor: any) => {
|
|
|
|
+ // debugger
|
|
|
|
+ // const text = editor.getText()
|
|
|
|
+ // if (text.length > 200) {
|
|
|
|
+ // const html = text
|
|
|
|
+ // .substring(0, 200)
|
|
|
|
+ // .split(/\n/)
|
|
|
|
+ // .map((line: string) => `<p>${line}</p>`)
|
|
|
|
+ // .join('\n')
|
|
|
|
+ // current.desc = html
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ const handlePsOnChange = (value: string) => {
|
|
|
|
+ console.log('OTP changed: ', value)
|
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
return {
|
|
|
|
+ isLive,
|
|
|
|
+ handleEditorOnMaxLength,
|
|
|
|
+ handleEditorCustomPaste,
|
|
|
|
+ handleEditorOnBlur,
|
|
handleNickRegex,
|
|
handleNickRegex,
|
|
returnLocale,
|
|
returnLocale,
|
|
t,
|
|
t,
|
|
@@ -477,9 +790,17 @@ export default defineComponent({
|
|
createVNode,
|
|
createVNode,
|
|
Modal,
|
|
Modal,
|
|
ExclamationCircleOutlined,
|
|
ExclamationCircleOutlined,
|
|
- onRangeChange
|
|
|
|
- // authTargetUser,
|
|
|
|
- // authTargetUserTime
|
|
|
|
|
|
+ onRangeChange,
|
|
|
|
+ onCancel,
|
|
|
|
+ mapRef,
|
|
|
|
+ avatarFile,
|
|
|
|
+ handleAvatarChange,
|
|
|
|
+ handleAlbumSync,
|
|
|
|
+ handleAvatarSync,
|
|
|
|
+ handleVideoSync,
|
|
|
|
+ editorRef,
|
|
|
|
+ handleEditorCreated,
|
|
|
|
+ handlePsOnChange
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -488,12 +809,16 @@ export default defineComponent({
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.edit-room-layout {
|
|
.edit-room-layout {
|
|
display: flex;
|
|
display: flex;
|
|
- max-height: 700px;
|
|
|
|
- overflow: hidden;
|
|
|
|
|
|
+ // max-height: 700px;
|
|
|
|
+ min-height: 100%;
|
|
|
|
+ width: 100%;
|
|
|
|
+ // overflow: hidden;
|
|
|
|
|
|
.info {
|
|
.info {
|
|
- max-height: 700px;
|
|
|
|
|
|
+ // max-height: 700px;
|
|
|
|
+ width: 100%;
|
|
overflow-y: scroll;
|
|
overflow-y: scroll;
|
|
|
|
+ min-height: 100%;
|
|
overflow-x: hidden;
|
|
overflow-x: hidden;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -506,6 +831,7 @@ export default defineComponent({
|
|
background: #f7f8fa;
|
|
background: #f7f8fa;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
+ display: none;
|
|
|
|
|
|
iframe {
|
|
iframe {
|
|
width: 320px;
|
|
width: 320px;
|
|
@@ -549,11 +875,23 @@ export default defineComponent({
|
|
opacity: 0.5;
|
|
opacity: 0.5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.footer {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ align-items: center;
|
|
|
|
+ > button {
|
|
|
|
+ &:first-child {
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.edit-room-layout {
|
|
.edit-room-layout {
|
|
- min-width: 864px;
|
|
|
|
|
|
+ // min-width: 864px;
|
|
|
|
+
|
|
.ant-form-item {
|
|
.ant-form-item {
|
|
margin-bottom: 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
}
|
|
@@ -579,7 +917,7 @@ export default defineComponent({
|
|
position: absolute;
|
|
position: absolute;
|
|
bottom: 4px;
|
|
bottom: 4px;
|
|
right: 8px;
|
|
right: 8px;
|
|
- margin: 0;
|
|
|
|
|
|
+ margin: 0 !important;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|