Prechádzať zdrojové kódy

合并论坛文件与api

tanshanming 7 mesiacov pred
rodič
commit
bd8be55e8a

+ 1 - 1
src/api/forum/forumApi.js

@@ -40,7 +40,7 @@ export default {
 	},
 	// 所有用户
 	allUserList(data) {
-		return request('sys/user/allList', data, 'get')
+		return request('bus/user/allList', data, 'get')
 	},
 	// 后台-管理员是否关闭帖子接口
 	postinfoStatus(data) {

+ 11 - 7
src/views/forum/addForum.vue

@@ -35,7 +35,7 @@
 					</a-col>
 					<a-col :span="24">
 						<a-form-item label="内容:" name="postContent">
-							<xn-editor v-model="formData.postContent" placeholder="请输入内容" :height="400"></xn-editor>
+							<xn-editor v-model="formData.postContent" placeholder="请输入内容" :height="600"></xn-editor>
 						</a-form-item>
 					</a-col>
 				</a-row>
@@ -56,6 +56,7 @@
 	import XnEditor from '@/components/Editor/index.vue'
 	import Bowser from 'bowser'
 	import { useRoute, useRouter } from 'vue-router'
+	import sysConfig from '@/config/index'
 	const route = useRoute()
 	const router = useRouter()
 	const { proxy } = getCurrentInstance()
@@ -77,8 +78,7 @@
 		return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
 	}
 
-	// 打开抽屉
-	const onOpen = () => {
+	const getData = () => {
 		forumApi.forumTypeList().then((data) => {
 			typeOptions.value = data.map((r) => {
 				return {
@@ -104,13 +104,12 @@
 			errorCorrection()
 		}
 	}
-	setTimeout(() => {
-		onOpen()
-	}, 0)
+	onMounted(() => {
+		getData()
+	})
 	// 关闭抽屉
 	const onClose = () => {
 		formRef.value.resetFields()
-		window.close()
 		router.push({
 			path: '/forum'
 		})
@@ -180,5 +179,10 @@
 				resourceId: route.query.id
 			}
 		}
+		let videoUrl = route.query.videoUrl ? decodeURIComponent(atob(route.query.videoUrl)) : ''
+		if (videoUrl) {
+			let html = `<p>${route.query.title}</p><video controls name="media" style="width:100%; height: auto;"><source src="${videoUrl}"></video>`
+			formData.value.postContent = html
+		}
 	}
 </script>

+ 4 - 1
src/views/forum/detail.vue

@@ -125,7 +125,10 @@
 		moreType.value = true
 		getDetail()
 	}
-	getDetail()
+	
+	onMounted(() => {
+		getDetail()
+	})
 </script>
 
 <style scoped>

+ 4 - 8
src/views/forum/index.vue

@@ -193,7 +193,7 @@
 			})
 		})
 	}
-	getTypeList()
+	
 
 	const exType = ref(false)
 	const tableData = ref([])
@@ -232,7 +232,7 @@
 		current: 1,
 		size: 10
 	})
-	loadData(pagination.value)
+	
 	// 切换应用标签查询菜单列表
 	const moduleClock = (value, t) => {
 		exType.value = false
@@ -260,13 +260,7 @@
 	const handleScroll = () => {
 		const tableContainer = window.document.querySelector('.main-content-wrapper')
 		const scrollPosition = tableContainer.scrollTop
-		const isTop = scrollPosition === 0
 		const isBottom = tableContainer.scrollHeight - scrollPosition - 20 < tableContainer.clientHeight
-		if (isTop) {
-			// pagination.value.current = 1
-			// loadData(pagination.value);
-			console.log('重新加载')
-		}
 		if (isBottom) {
 			if (tableTotal.value > pagination.value.current * pagination.value.size) {
 				pagination.value.current += 1
@@ -281,6 +275,8 @@
 
 	// 添加scroll监听
 	onMounted(() => {
+		getTypeList()
+		loadData(pagination.value)
 		nextTick(() => {
 			if (table.value) {
 				const tableContainer = window.document.querySelector('.main-content-wrapper')