|
@@ -27,6 +27,7 @@
|
|
class="action-bottom"
|
|
class="action-bottom"
|
|
type="primary"
|
|
type="primary"
|
|
size="middle"
|
|
size="middle"
|
|
|
|
+ :disabled="isLive"
|
|
@click="saveRoom"
|
|
@click="saveRoom"
|
|
>
|
|
>
|
|
{{ t('base.save') }}
|
|
{{ t('base.save') }}
|
|
@@ -106,6 +107,9 @@
|
|
}"
|
|
}"
|
|
mode="simple"
|
|
mode="simple"
|
|
@onCreated="handleEditorCreated"
|
|
@onCreated="handleEditorCreated"
|
|
|
|
+ @onMaxLength="handleEditorOnMaxLength"
|
|
|
|
+ @onBlur="handleEditorOnBlur"
|
|
|
|
+ @customPaste="handleEditorCustomPaste"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
<!-- <a-textarea
|
|
<!-- <a-textarea
|
|
@@ -139,7 +143,7 @@
|
|
<EditAvatar :data="current.scenesAvatar" @sync="handleAvatarSync" />
|
|
<EditAvatar :data="current.scenesAvatar" @sync="handleAvatarSync" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<!-- 相册 -->
|
|
<!-- 相册 -->
|
|
- <a-form-item label="相册" name="title">
|
|
|
|
|
|
+ <!-- <a-form-item label="相册" name="title">
|
|
<EditAlbum
|
|
<EditAlbum
|
|
:data="current.scenesAlbum || []"
|
|
:data="current.scenesAlbum || []"
|
|
@sync-list="handleAlbumSync"
|
|
@sync-list="handleAlbumSync"
|
|
@@ -147,7 +151,7 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item label="视频" name="title">
|
|
<a-form-item label="视频" name="title">
|
|
<EditVideo :data="current.scenesVideo" @sync="handleVideoSync" />
|
|
<EditVideo :data="current.scenesVideo" @sync="handleVideoSync" />
|
|
- </a-form-item>
|
|
|
|
|
|
+ </a-form-item> -->
|
|
|
|
|
|
<a-form-item
|
|
<a-form-item
|
|
:label="t('room.form.addScene')"
|
|
:label="t('room.form.addScene')"
|
|
@@ -173,8 +177,8 @@
|
|
>
|
|
>
|
|
<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"
|
|
@@ -196,7 +200,6 @@
|
|
:num-inputs="4"
|
|
:num-inputs="4"
|
|
:should-auto-focus="false"
|
|
:should-auto-focus="false"
|
|
:class="{ disabled: isRoomEnd }"
|
|
:class="{ disabled: isRoomEnd }"
|
|
- :is-input-num="true"
|
|
|
|
:conditionalClass="['one', 'two', 'three', 'four']"
|
|
:conditionalClass="['one', 'two', 'three', 'four']"
|
|
:placeholder="['-', '-', '-', '-']"
|
|
:placeholder="['-', '-', '-', '-']"
|
|
/>
|
|
/>
|
|
@@ -334,7 +337,11 @@ 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 { useScript } from '@/hook/useScript'
|
|
import { onMounted, onBeforeUnmount } from 'vue'
|
|
import { onMounted, onBeforeUnmount } from 'vue'
|
|
@@ -344,6 +351,10 @@ import '@wangeditor/editor/dist/css/style.css' // 引入 css
|
|
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
|
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) =>
|
|
@@ -355,6 +366,7 @@ dayjs.extend(duration)
|
|
interface AuthUserFormState {
|
|
interface AuthUserFormState {
|
|
userName: string
|
|
userName: string
|
|
useTimeList?: [Dayjs, Dayjs]
|
|
useTimeList?: [Dayjs, Dayjs]
|
|
|
|
+ // useTimeList?: [string, string]
|
|
}
|
|
}
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
@@ -383,7 +395,7 @@ export default defineComponent({
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
|
|
|
|
const avatarFile = ref<any[]>([])
|
|
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'
|
|
@@ -394,19 +406,40 @@ export default defineComponent({
|
|
|
|
|
|
const otpInput = ref('')
|
|
const otpInput = ref('')
|
|
const formRef = ref<FormInstance>()
|
|
const formRef = ref<FormInstance>()
|
|
- const current = reactive(createRoom(props.room || {}))
|
|
|
|
- // current.scenesAlbum = []
|
|
|
|
- if (current.useTimeList?.length) {
|
|
|
|
- current.useTimeList = current.useTimeList?.map(i =>
|
|
|
|
- dayjs(i)
|
|
|
|
- ) as unknown as [Dayjs, Dayjs]
|
|
|
|
- }
|
|
|
|
|
|
+ const current = reactive({
|
|
|
|
+ ...createRoom(props.room || {}),
|
|
|
|
+ scenesAvatar: ''
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ watchEffect(async () => {
|
|
|
|
+ if (props.room?.head) {
|
|
|
|
+ // debugger
|
|
|
|
+ current.scenesAvatar = props.room.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)
|
|
@@ -678,8 +711,29 @@ export default defineComponent({
|
|
// const curToolbarConfig = toolbar.getConfig()
|
|
// const curToolbarConfig = toolbar.getConfig()
|
|
// console.log(curToolbarConfig.toolbarKeys) // 当前菜单排序和分组
|
|
// 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) => {
|
|
|
|
+ // debugger
|
|
|
|
+ }
|
|
|
|
+ const handleEditorCustomPaste = (editor: any) => {
|
|
|
|
+ // debugger
|
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
return {
|
|
|
|
+ isLive,
|
|
|
|
+ handleEditorOnMaxLength,
|
|
|
|
+ handleEditorCustomPaste,
|
|
|
|
+ handleEditorOnBlur,
|
|
handleNickRegex,
|
|
handleNickRegex,
|
|
returnLocale,
|
|
returnLocale,
|
|
t,
|
|
t,
|