|
@@ -134,7 +134,7 @@
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="授权" name="scenes" style="margin-bottom: 2px">
|
|
|
- <a-button type="primary" ghost>
|
|
|
+ <a-button type="primary" ghost @click="authvisible = true">
|
|
|
<template #icon><plus-outlined /></template>添加用户</a-button
|
|
|
>
|
|
|
</a-form-item>
|
|
@@ -158,16 +158,33 @@
|
|
|
</a-input-number>
|
|
|
</a-form-item>
|
|
|
|
|
|
- <a-form-item label="设置模式" name="mode" style="margin-bottom: 2px">
|
|
|
- <!-- v-model:value="value" -->
|
|
|
- <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-form-item>
|
|
|
+ <!-- <a-form-item label="设置模式" name="mode" style="margin-bottom: 2px">
|
|
|
+ <a-checkbox-group
|
|
|
+ v-model:value="current.isRoamMode"
|
|
|
+ :options="[
|
|
|
+ { label: '带看', value: 'Pear' },
|
|
|
+ { label: '自由观看模式', value: 'Apple' }
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+
|
|
|
+ </a-form-item> -->
|
|
|
</a-form>
|
|
|
</div>
|
|
|
</a-modal>
|
|
|
+
|
|
|
+ <a-modal
|
|
|
+ v-model:visible="authvisible"
|
|
|
+ title="添加用户"
|
|
|
+ centered
|
|
|
+ @ok="handleAuthConfirm"
|
|
|
+ >
|
|
|
+ <a-form-item label="用户账号" name="authTargetUser">
|
|
|
+ <a-input
|
|
|
+ v-model:value="authTargetUser"
|
|
|
+ placeholder="请输入完整的账号"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-modal>
|
|
|
</a-config-provider>
|
|
|
</template>
|
|
|
|
|
@@ -185,6 +202,7 @@ import type { FormInstance } from 'ant-design-vue'
|
|
|
import { useI18n } from '@/hook/useI18n'
|
|
|
import { useLocale } from '@/locales/useLocale'
|
|
|
import dayjs from 'dayjs'
|
|
|
+import { addAuthUser } from '@/api'
|
|
|
|
|
|
// const titleValidator = ref({
|
|
|
// validator: (_, value) =>
|
|
@@ -199,6 +217,8 @@ export default defineComponent({
|
|
|
props,
|
|
|
setup(props) {
|
|
|
const visible = ref(true)
|
|
|
+ const authvisible = ref(false)
|
|
|
+ const authTargetUser = ref('')
|
|
|
const { getAntdLocale } = useLocale()
|
|
|
const roomStore = useRoomStore()
|
|
|
const { getLocale } = useLocale()
|
|
@@ -229,6 +249,13 @@ export default defineComponent({
|
|
|
if (!current.scenes.length) {
|
|
|
return message.error(t('room.form.addLeastScene'))
|
|
|
}
|
|
|
+ if (
|
|
|
+ current.visitPassword?.length &&
|
|
|
+ current.visitPassword.length > 0 &&
|
|
|
+ current.visitPassword.length < 4
|
|
|
+ ) {
|
|
|
+ return message.error('密码缺失,请填写完整!')
|
|
|
+ }
|
|
|
current.cover = current.scenes[0].cover
|
|
|
console.log('current', current)
|
|
|
props.onSave && props.onSave(current)
|
|
@@ -251,6 +278,16 @@ export default defineComponent({
|
|
|
return Promise.resolve('')
|
|
|
}
|
|
|
|
|
|
+ const handleAuthConfirm = async () => {
|
|
|
+ if (unref(authTargetUser)?.length) {
|
|
|
+ const userName = unref(authTargetUser)
|
|
|
+ const res = await addAuthUser(userName)
|
|
|
+ console.log('res', res)
|
|
|
+ } else {
|
|
|
+ message.error('用户账号不能为空!')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
handleNickRegex,
|
|
|
returnLocale,
|
|
@@ -265,7 +302,10 @@ export default defineComponent({
|
|
|
unScenePng,
|
|
|
getAntdLocale,
|
|
|
dayjs,
|
|
|
- otpInput
|
|
|
+ otpInput,
|
|
|
+ authvisible,
|
|
|
+ handleAuthConfirm,
|
|
|
+ authTargetUser
|
|
|
}
|
|
|
}
|
|
|
})
|