|
@@ -17,13 +17,19 @@ const emits = defineEmits<{
|
|
|
(event: 'openRtcDialog', dyaw_xlfw_zxhd: type_dyaw_xlfw_zxhd, type: 'audio' | 'video'): void;
|
|
|
}>()
|
|
|
|
|
|
-const props = defineProps<{updateFnList:Function[]}>()
|
|
|
+const props = defineProps<{ updateFnList: Function[] }>()
|
|
|
+
|
|
|
+function formatter(e: string) {
|
|
|
+ if (!e) return e
|
|
|
+ // 转义字符串中的危险字符
|
|
|
+ return e.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
|
|
+}
|
|
|
|
|
|
let infoList = $ref<Array<type_dyaw_xlfw_zxhd_log>>([])
|
|
|
let inputValue = $ref('')
|
|
|
let isSending = $ref(false)
|
|
|
let TinyRef = $ref<typeof import('~/components/tinymce-area/index.vue')['default']>()
|
|
|
-async function handleClickSend() {
|
|
|
+async function handleClickSend(val?: string) {
|
|
|
if (!dyaw_xlfw_zxhd) return;
|
|
|
if (isSending) return;
|
|
|
isSending = true
|
|
@@ -33,9 +39,18 @@ async function handleClickSend() {
|
|
|
dxzl_stu_user_realname: dyaw_xlfw_zxhd.dxz_stu_user_realname,
|
|
|
dxzl_tea_user_id: dyaw_xlfw_zxhd.dxz_tea_user_id,
|
|
|
dxzl_tea_user_realname: dyaw_xlfw_zxhd.dxz_tea_user_realname,
|
|
|
- dxzl_last_msg_content: encodeURIComponent(inputValue),
|
|
|
- dxzl_type: inputValue.includes('><img') ? '2' : '1'
|
|
|
+ dxzl_last_msg_content: encodeURIComponent(val || formatter(inputValue)),
|
|
|
+ dxzl_type: (val || formatter(inputValue)).includes('<img') ? '2' : '1'
|
|
|
}
|
|
|
+ // const reqDate = {
|
|
|
+ // dxz_id: dyaw_xlfw_zxhd.dxz_id,
|
|
|
+ // dxzl_stu_user_id: dyaw_xlfw_zxhd.dxz_stu_user_id,
|
|
|
+ // dxzl_stu_user_realname: dyaw_xlfw_zxhd.dxz_stu_user_realname,
|
|
|
+ // dxzl_tea_user_id: dyaw_xlfw_zxhd.dxz_tea_user_id,
|
|
|
+ // dxzl_tea_user_realname: dyaw_xlfw_zxhd.dxz_tea_user_realname,
|
|
|
+ // dxzl_last_msg_content: encodeURIComponent(inputValue),
|
|
|
+ // dxzl_type: inputValue.includes('><img') ? '2' : '1'
|
|
|
+ // }
|
|
|
|
|
|
// infoList.push({
|
|
|
// create_user_id: user.user_id,
|
|
@@ -350,10 +365,10 @@ let showRightArchives = $ref(false)
|
|
|
|
|
|
</div>
|
|
|
<div class="bg-hex-e4e6eb p-5px flex justify-between space-x-2 items-end">
|
|
|
- <tinymce-area v-model="inputValue" ref="TinyRef" @click:audio="handleAudioChatStart" class="flex-auto"
|
|
|
- @click:video="handleVideoChatStart" @click:submit="handleClickSend"></tinymce-area>
|
|
|
+ <tinymce-area-m v-model="inputValue" ref="TinyRef" @click:audio="handleAudioChatStart" class="flex-auto"
|
|
|
+ @click:video="handleVideoChatStart" @click:submit="handleClickSend"></tinymce-area-m>
|
|
|
|
|
|
- <van-button type="primary" @click="handleClickSend">发送</van-button>
|
|
|
+ <van-button type="primary" @click="handleClickSend()">发送</van-button>
|
|
|
|
|
|
</div>
|
|
|
</template>
|