Просмотр исходного кода

修改了 资源聊天的 删除bug

于添 6 месяцев назад
Родитель
Сommit
e3c4be6705

+ 4 - 4
.env.production

@@ -5,12 +5,12 @@ NODE_ENV = production
 VITE_TITLE = 飞行学院
 
 # 接口地址
-VITE_API_BASEURL = http://192.168.1.245:19003
+#VITE_API_BASEURL = http://192.168.1.245:19003
 #VITE_API_BASEURL = http://22.120.128.109:19003
-#VITE_API_BASEURL = http://192.168.31.56:19003
-VITE_FILEURL = http://192.168.1.245:10005/education/
+VITE_API_BASEURL = http://192.168.1.232:19004
+#VITE_FILEURL = http://192.168.1.245:10005/education/
 #VITE_FILEURL = http://22.120.128.108:10005/education/
-#VITE_FILEURL = http://192.168.31.56:10005/education/
+VITE_FILEURL = http://192.168.1.232:10005/education/
 # 本地端口
 VITE_PORT = 9000
 

+ 16 - 2
src/views/answerManagement/components/DialogView.vue

@@ -40,7 +40,7 @@ import TallItemView from './TallItemView.vue'
 import { QuillEditor } from '@vueup/vue-quill'
 import '@vueup/vue-quill/dist/vue-quill.snow.css'
 const recordList = ref([]) //专业
-const formRef = ref() //专业
+const formRef = ref(null) //专业
 const quillEditorRef = ref(null) // 预览回显
 const mode = ref('add') //专业
 import {addItem, detail, editItem} from '@/api/answer'
@@ -62,6 +62,7 @@ watch(
 	(newVal, oldVal) => {
 		if (newVal == false && formRef.value) {
 			formRef.value.resetFields()
+			formState.info = undefined
 		}
 	},
 	{deep: true, immediate: true}
@@ -69,10 +70,21 @@ watch(
 const open = () => {
 
 	visible.value = true
+	formState.info = undefined
+	// 重置富文本编辑器
+	if (quillEditorRef.value) {
+		quillEditorRef.value.setHTML('')
+	}
 	mode.value = 'add'
 }
 const edit = (item) => {
 	visible.value = true
+	formState.info = undefined
+	formState.info = undefined
+	// 重置富文本编辑器
+	if (quillEditorRef.value) {
+		quillEditorRef.value.setHTML('')
+	}
 	mode.value = 'edit'
 	console.log('编辑内容',item)
 	detail({id : item.id}).then((res)=>{
@@ -88,7 +100,7 @@ const edit = (item) => {
 const handleOk = (e) => {
 	formRef.value.validate().then(() => {
 		let json = JSON.parse(JSON.stringify(formState))
-		// formState.courseDesc = toRaw(quillEditorRef.value).getHTML()
+		json.info = toRaw(quillEditorRef.value).getHTML()
 
 		if (mode.value == 'add') {
 			addItem(json).then((res) => {
@@ -96,6 +108,7 @@ const handleOk = (e) => {
 						emit("handleAddItem")
 						visible.value = false
 					}
+				formRef.value.resetFields()
 			})
 		}
 		if (mode.value == 'edit') {
@@ -104,6 +117,7 @@ const handleOk = (e) => {
 					emit("handleAddItem")
 					visible.value = false
 				}
+				formRef.value.resetFields()
 			})
 		}
 	})

+ 7 - 2
src/views/answerManagement/components/TallItemView.vue

@@ -1,9 +1,11 @@
 <template>
 	<div style="display: flex; justify-content: space-between; align-items: center">
 		<div>
-			<span>{{ props.data.userIdName }}:{{ props.data.info }}</span>
+			<div><span style="font-weight: bold; color: blue">{{ props.data.userIdName }}:</span></div>
+<!--			<div v-html="richText"></div>-->
+			<div v-html="props.data.info"></div>
 			<div>
-				<span>{{props.data.gradesIdName}}</span>	<span>{{props.data.createTime}}</span>
+				<span >{{props.data.gradesIdName}}</span>	<span style="font-weight: bold; color: red">{{props.data.createTime}}</span>
 			</div>
 
 
@@ -34,6 +36,9 @@ const props = defineProps({
 	},
 })
 
+
+const richText = ref('<p>这是一段富文本内容</p>')
+
 // const onChangeCurrent = (current) => {
 // 	router.push({
 // 		path: '/' + current

+ 18 - 6
src/views/resourceDetails/components/TallItem.vue

@@ -26,11 +26,11 @@
 								<MessageOutlined style="cursor: pointer" @click="handerMessage" />
 								<span style="margin-left: 5px">{{ props.item.childSize }}</span>
 							</div>
-							<a-popover v-model:visible="popoverDelVisibles[item.id]" title="确定删除?" trigger="click">
+							<a-popover v-model:visible="popoverDelVisibles[props.item.id]" title="确定删除?" trigger="click">
 								<template #content>
-									<a-button style="margin-right: 10px" type="primary" @click="handerDel">确定
+									<a-button style="margin-right: 10px" type="primary" @click="handerDel(props.item.id)">确定
 									</a-button>
-									<a-button @click="()=>{	popoverDelVisibles[item.id] = false}">取消</a-button>
+									<a-button @click="()=>{	popoverDelVisibles[props.item.id] = false}">取消</a-button>
 								</template>
 								<!--					<a-button size="small" style="margin-right: 5px">选择</a-button>-->
 								<div v-if="item.isSelf" style="margin-left: 15px">
@@ -89,7 +89,18 @@
 									<span style="margin-left: 5px">{{ item.giveNum }}</span>
 								</div>
 								<div style="margin-left: 15px">
-									<DeleteOutlined style="cursor: pointer" @click="handerDel" />
+									<a-popover v-model:visible="popoverDelVisibles[item.id]" title="确定删除?" trigger="click">
+										<template #content>
+											<a-button style="margin-right: 10px" type="primary" @click="handerDel(item.id)">确定
+											</a-button>
+											<a-button @click="()=>{	popoverDelVisibles[item.id] = false}">取消</a-button>
+										</template>
+										<!--					<a-button size="small" style="margin-right: 5px">选择</a-button>-->
+										<div v-if="item.isSelf" style="margin-left: 15px">
+											<DeleteOutlined style="cursor: pointer" />
+										</div>
+									</a-popover>
+<!--									<DeleteOutlined style="cursor: pointer" @click="handerDel" />-->
 								</div>
 							</div>
 						</div>
@@ -160,6 +171,7 @@
 	const handerMessage = (form) => {
 		console.log('查询内容', form)
 		tallTag.value == true ? (tallTag.value = false) : (tallTag.value = true)
+		talk.value = ''
 		EventBus.emit('closeInput', null, props.item.id)
 
 		EventBus.emit('upDataDetailsNum')
@@ -205,8 +217,8 @@
 			tallTag.value = false
 		}
 	}
-	const handerDel = () => {
-		deleteComment([{ id: props.item.id }]).then(() => {
+	const handerDel = (id) => {
+		deleteComment([{ id: id }]).then(() => {
 			EventBus.emit('onGetPageComment')
 		})
 	}

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
stats.html


Некоторые файлы не были показаны из-за большого количества измененных файлов