|
@@ -91,13 +91,7 @@
|
|
|
<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">
|
|
|
- <!-- <Toolbar
|
|
|
- style="border-bottom: 1px solid #ccc"
|
|
|
- :editor="editorRef"
|
|
|
- :defaultConfig="{}"
|
|
|
- mode="simple"
|
|
|
- /> -->
|
|
|
+ <!-- <div style="border: 1px solid #ccc">
|
|
|
<Editor
|
|
|
style="height: 150px; overflow-y: hidden"
|
|
|
v-model="current.desc"
|
|
@@ -111,14 +105,14 @@
|
|
|
@onBlur="handleEditorOnBlur"
|
|
|
@customPaste="handleEditorCustomPaste"
|
|
|
/>
|
|
|
- </div>
|
|
|
- <!-- <a-textarea
|
|
|
+ </div> -->
|
|
|
+ <a-textarea
|
|
|
v-model:value="current.desc"
|
|
|
:placeholder="t('room.form.descplaceHolder')"
|
|
|
:maxlength="200"
|
|
|
show-count
|
|
|
:disabled="isRoomEnd"
|
|
|
- /> -->
|
|
|
+ />
|
|
|
</a-form-item>
|
|
|
<!-- <h4>{{ t('room.form.host') }}</h4> -->
|
|
|
|
|
@@ -192,16 +186,18 @@
|
|
|
style="margin-bottom: 2px"
|
|
|
>
|
|
|
<v-otp-input
|
|
|
+ ref="otpInput"
|
|
|
v-model:value="current.visitPassword"
|
|
|
class="otp-container"
|
|
|
input-classes="otp-input"
|
|
|
input-type="number"
|
|
|
separator="-"
|
|
|
:num-inputs="4"
|
|
|
- :should-auto-focus="false"
|
|
|
+ :should-auto-focus="true"
|
|
|
:class="{ disabled: isRoomEnd }"
|
|
|
:conditionalClass="['one', 'two', 'three', 'four']"
|
|
|
:placeholder="['-', '-', '-', '-']"
|
|
|
+ @on-change="handlePsOnChange"
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
<a-form-item name="scenes" style="margin-bottom: 2px">
|
|
@@ -347,8 +343,8 @@ import { useScript } from '@/hook/useScript'
|
|
|
import { onMounted, onBeforeUnmount } from 'vue'
|
|
|
import type { UploadChangeParam } from 'ant-design-vue'
|
|
|
import { watchEffect } from 'vue'
|
|
|
-import '@wangeditor/editor/dist/css/style.css' // 引入 css
|
|
|
-import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
|
|
+// import '@wangeditor/editor/dist/css/style.css' // 引入 css
|
|
|
+// import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
|
|
|
|
|
dayjs.extend(duration)
|
|
|
dayjs.extend(utc)
|
|
@@ -376,9 +372,9 @@ export default defineComponent({
|
|
|
VOtpInput,
|
|
|
EditAlbum,
|
|
|
EditAvatar,
|
|
|
- EditVideo,
|
|
|
- Editor,
|
|
|
- Toolbar
|
|
|
+ EditVideo
|
|
|
+ // Editor,
|
|
|
+ // Toolbar
|
|
|
},
|
|
|
props,
|
|
|
setup(props) {
|
|
@@ -472,6 +468,8 @@ export default defineComponent({
|
|
|
current.visitPassword.length > 0 &&
|
|
|
current.visitPassword.length < 4
|
|
|
) {
|
|
|
+
|
|
|
+ // otpInput.value?.clearInput();
|
|
|
return message.error(t('room.passwordError'))
|
|
|
} else {
|
|
|
current.takeLookLock = 1
|
|
@@ -723,10 +721,32 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
const handleEditorOnBlur = (editor: any) => {
|
|
|
- // debugger
|
|
|
+ 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 {
|
|
@@ -767,7 +787,8 @@ export default defineComponent({
|
|
|
handleAvatarSync,
|
|
|
handleVideoSync,
|
|
|
editorRef,
|
|
|
- handleEditorCreated
|
|
|
+ handleEditorCreated,
|
|
|
+ handlePsOnChange
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -884,7 +905,7 @@ export default defineComponent({
|
|
|
position: absolute;
|
|
|
bottom: 4px;
|
|
|
right: 8px;
|
|
|
- margin: 0;
|
|
|
+ margin: 0 !important;
|
|
|
}
|
|
|
}
|
|
|
|