|
@@ -103,52 +103,50 @@
|
|
<a-form-item
|
|
<a-form-item
|
|
label="使用时间"
|
|
label="使用时间"
|
|
class="select-scene"
|
|
class="select-scene"
|
|
- name="scenes"
|
|
|
|
|
|
+ name="useTimeList"
|
|
style="margin-bottom: 2px"
|
|
style="margin-bottom: 2px"
|
|
|
|
+ :rules="[{ required: true, message: `请输入房间使用时间` }]"
|
|
>
|
|
>
|
|
<a-range-picker
|
|
<a-range-picker
|
|
:show-time="{ format: 'HH:mm' }"
|
|
:show-time="{ format: 'HH:mm' }"
|
|
- format="YYYY-MM-DD HH:mm"
|
|
|
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
style="width: 80%"
|
|
style="width: 80%"
|
|
- v-model:value="current.period"
|
|
|
|
|
|
+ v-model:value="current.useTimeList"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
|
<a-form-item
|
|
<a-form-item
|
|
label="设置密码"
|
|
label="设置密码"
|
|
- class="select-scene"
|
|
|
|
- name="scenes"
|
|
|
|
|
|
+ name="visitPassword"
|
|
style="margin-bottom: 2px"
|
|
style="margin-bottom: 2px"
|
|
>
|
|
>
|
|
<v-otp-input
|
|
<v-otp-input
|
|
|
|
+ v-model:value="current.visitPassword"
|
|
class="otp-container"
|
|
class="otp-container"
|
|
- ref="otpInput"
|
|
|
|
input-classes="otp-input"
|
|
input-classes="otp-input"
|
|
|
|
+ input-type="number"
|
|
separator="-"
|
|
separator="-"
|
|
:num-inputs="4"
|
|
:num-inputs="4"
|
|
- :should-auto-focus="true"
|
|
|
|
|
|
+ :should-auto-focus="false"
|
|
:is-input-num="true"
|
|
:is-input-num="true"
|
|
:conditionalClass="['one', 'two', 'three', 'four']"
|
|
:conditionalClass="['one', 'two', 'three', 'four']"
|
|
:placeholder="['-', '-', '-', '-']"
|
|
:placeholder="['-', '-', '-', '-']"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item
|
|
|
|
- label="授权"
|
|
|
|
- class="select-scene"
|
|
|
|
- name="scenes"
|
|
|
|
- style="margin-bottom: 2px"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-form-item label="授权" name="scenes" style="margin-bottom: 2px">
|
|
<a-button type="primary" ghost>
|
|
<a-button type="primary" ghost>
|
|
<template #icon><plus-outlined /></template>添加用户</a-button
|
|
<template #icon><plus-outlined /></template>添加用户</a-button
|
|
>
|
|
>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="设置房间人数"
|
|
label="设置房间人数"
|
|
- class="select-scene"
|
|
|
|
- name="scenes"
|
|
|
|
|
|
+ class="maxMan"
|
|
|
|
+ name="maxMan"
|
|
style="margin-bottom: 2px"
|
|
style="margin-bottom: 2px"
|
|
|
|
+ :rules="[{ required: true, message: t('room.form.titleRequired') }]"
|
|
>
|
|
>
|
|
<a-input-number
|
|
<a-input-number
|
|
|
|
+ v-model:value.trim="current.maxMan"
|
|
placeholder="请输入房间人数"
|
|
placeholder="请输入房间人数"
|
|
:min="5"
|
|
:min="5"
|
|
:max="50"
|
|
:max="50"
|
|
@@ -160,16 +158,11 @@
|
|
</a-input-number>
|
|
</a-input-number>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
|
- <a-form-item
|
|
|
|
- label="设置模式"
|
|
|
|
- class="select-scene"
|
|
|
|
- name="mode"
|
|
|
|
- style="margin-bottom: 2px"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-form-item label="设置模式" name="mode" style="margin-bottom: 2px">
|
|
<!-- v-model:value="value" -->
|
|
<!-- v-model:value="value" -->
|
|
- <a-radio-group name="radioGroup">
|
|
|
|
- <a-radio value="1">带看</a-radio>
|
|
|
|
- <a-radio value="2">自由观看模式</a-radio>
|
|
|
|
|
|
+ <a-radio-group name="radioGroup" v-model:value="current.isRoamMode">
|
|
|
|
+ <a-radio :value="0">带看</a-radio>
|
|
|
|
+ <a-radio :value="1">自由观看模式</a-radio>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-form>
|
|
</a-form>
|
|
@@ -191,6 +184,7 @@ import type { Scene } from '@/store/modules/scene'
|
|
import type { FormInstance } from 'ant-design-vue'
|
|
import type { FormInstance } from 'ant-design-vue'
|
|
import { useI18n } from '@/hook/useI18n'
|
|
import { useI18n } from '@/hook/useI18n'
|
|
import { useLocale } from '@/locales/useLocale'
|
|
import { useLocale } from '@/locales/useLocale'
|
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
// const titleValidator = ref({
|
|
// const titleValidator = ref({
|
|
// validator: (_, value) =>
|
|
// validator: (_, value) =>
|
|
@@ -215,9 +209,15 @@ export default defineComponent({
|
|
}
|
|
}
|
|
return unref(getLocale)
|
|
return unref(getLocale)
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ const otpInput = ref('')
|
|
const formRef = ref<FormInstance>()
|
|
const formRef = ref<FormInstance>()
|
|
const current = reactive(createRoom(props.room || {}))
|
|
const current = reactive(createRoom(props.room || {}))
|
|
|
|
+ if (current.useTimeList?.length) {
|
|
|
|
+ current.useTimeList = current.useTimeList?.map(i => dayjs(i))
|
|
|
|
+ }
|
|
|
|
+ if (!current.visitPassword?.length) {
|
|
|
|
+ current.visitPassword = ''
|
|
|
|
+ }
|
|
const deleteScene = (scene: Scene) => {
|
|
const deleteScene = (scene: Scene) => {
|
|
const index = current.scenes.indexOf(scene)
|
|
const index = current.scenes.indexOf(scene)
|
|
if (~index) {
|
|
if (~index) {
|
|
@@ -230,6 +230,7 @@ export default defineComponent({
|
|
return message.error(t('room.form.addLeastScene'))
|
|
return message.error(t('room.form.addLeastScene'))
|
|
}
|
|
}
|
|
current.cover = current.scenes[0].cover
|
|
current.cover = current.scenes[0].cover
|
|
|
|
+ console.log('current', current)
|
|
props.onSave && props.onSave(current)
|
|
props.onSave && props.onSave(current)
|
|
visible.value = false
|
|
visible.value = false
|
|
}
|
|
}
|
|
@@ -262,7 +263,9 @@ export default defineComponent({
|
|
// startSync,
|
|
// startSync,
|
|
mainURL,
|
|
mainURL,
|
|
unScenePng,
|
|
unScenePng,
|
|
- getAntdLocale
|
|
|
|
|
|
+ getAntdLocale,
|
|
|
|
+ dayjs,
|
|
|
|
+ otpInput
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|