|
@@ -146,12 +146,12 @@
|
|
|
name="scenes"
|
|
|
style="margin-bottom: 2px"
|
|
|
>
|
|
|
- <template #slot="label">
|
|
|
- {{ t('room.authorize') }}
|
|
|
- <a-tooltip title="Tooltip with customize">
|
|
|
- <InfoCircleOutlined />
|
|
|
- </a-tooltip>
|
|
|
- </template>
|
|
|
+ <template #slot="label">
|
|
|
+ {{ t('room.authorize') }}
|
|
|
+ <a-tooltip title="Tooltip with customize">
|
|
|
+ <InfoCircleOutlined />
|
|
|
+ </a-tooltip>
|
|
|
+ </template>
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
@@ -199,6 +199,7 @@
|
|
|
v-model:visible="authvisible"
|
|
|
:title="t('room.addUser')"
|
|
|
centered
|
|
|
+ @cancel="authformState.userName = ''"
|
|
|
@ok="handleAuthConfirm"
|
|
|
>
|
|
|
<a-form layout="inline" :model="authformState">
|
|
@@ -232,7 +233,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { ref, UnwrapRef, defineComponent, reactive, computed, unref } from 'vue'
|
|
|
+import {
|
|
|
+ ref,
|
|
|
+ UnwrapRef,
|
|
|
+ toRaw,
|
|
|
+ defineComponent,
|
|
|
+ reactive,
|
|
|
+ computed,
|
|
|
+ unref
|
|
|
+} from 'vue'
|
|
|
import { createRoom, useRoomStore } from '@/store/modules/room'
|
|
|
import { props } from './props'
|
|
|
import { message } from 'ant-design-vue'
|
|
@@ -275,7 +284,7 @@ export default defineComponent({
|
|
|
const roomStore = useRoomStore()
|
|
|
const isRoomEnd = computed(() => roomStore.roomStatus === 2)
|
|
|
const { getLocale } = useLocale()
|
|
|
- const { t } = useI18n();
|
|
|
+ const { t } = useI18n()
|
|
|
const returnLocale = computed(() => {
|
|
|
if (unref(getLocale).includes('zh')) {
|
|
|
return 'zh'
|
|
@@ -342,7 +351,7 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const handleAuthConfirm = async () => {
|
|
|
- const { t } = useI18n();
|
|
|
+ const { t } = useI18n()
|
|
|
if (authformState.userName?.length) {
|
|
|
const userName = authformState.userName
|
|
|
const res = await addAuthUser(userName)
|
|
@@ -352,14 +361,15 @@ export default defineComponent({
|
|
|
)
|
|
|
console.log('isExist', isExist === -1)
|
|
|
if (isExist === -1) {
|
|
|
- current.userObjList?.push(authformState)
|
|
|
+ const dup = structuredClone(toRaw(authformState));
|
|
|
+ console.log('dup',dup);
|
|
|
+ current.userObjList?.push(dup)
|
|
|
}
|
|
|
|
|
|
authvisible.value = false
|
|
|
console.log('current', current)
|
|
|
} else {
|
|
|
-
|
|
|
- message.error(t('room.authUserError'));
|
|
|
+ message.error(t('room.authUserError'))
|
|
|
}
|
|
|
} else {
|
|
|
message.error('用户账号不能为空!')
|