canghailong 4 ماه پیش
والد
کامیت
ad1fc27841
2فایلهای تغییر یافته به همراه85 افزوده شده و 100 حذف شده
  1. 84 100
      src/views/forum/reportForm.vue
  2. 1 0
      src/views/sys/user/userTab/userMessage/detail.vue

+ 84 - 100
src/views/forum/reportForm.vue

@@ -1,25 +1,10 @@
 <template>
-	<xn-form-container
-		title="举报"
-		:height="500"
-		placement="bottom"
-		:mask="false"
-		style="width: 960px; left: calc(50% - 960px / 2)"
-		:visible="visible"
-		:destroy-on-close="true"
-		@close="onClose"
-	>
+	<xn-form-container title="举报" :height="500" placement="bottom" :mask="false" style="width: 960px; left: calc(50% - 960px / 2)" :visible="visible" :destroy-on-close="true" @close="onClose">
 		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
 			<a-row :gutter="16">
 				<a-col :span="12">
 					<a-form-item label="举报类型:" name="reportReasonType">
-						<a-select
-							v-model:value="formData.reportReasonType"
-							placeholder="所有分类"
-							style="width: 100%"
-							:options="typeOptions"
-							@change="handleChange"
-						></a-select>
+						<a-select v-model:value="formData.reportReasonType" placeholder="所有分类" style="width: 100%" :options="typeOptions" @change="handleChange"></a-select>
 					</a-form-item>
 				</a-col>
 				<a-col :span="12">
@@ -29,13 +14,7 @@
 				</a-col>
 				<a-col :span="24">
 					<a-form-item label="举报原因:" name="reportDetail">
-						<a-textarea
-							v-model:value="formData.reportDetail"
-							placeholder="请输入举报原因"
-							:rows="4"
-							show-count
-							:maxlength="500"
-						/>
+						<a-textarea v-model:value="formData.reportDetail" placeholder="请输入举报原因" :rows="4" show-count :maxlength="500" />
 					</a-form-item>
 				</a-col>
 			</a-row>
@@ -48,80 +27,82 @@
 </template>
 
 <script setup>
-	import { required } from '@/utils/formRules'
-	import SnowflakeId from 'snowflake-id'
-	import tool from '@/utils/tool'
-	import forumApi from '@/api/forum/forumApi'
-	import XnEditor from '@/components/Editor/index.vue'
-	// 默认是关闭状态
-	const visible = ref(false)
-	const emit = defineEmits({ successful: null })
-	const formRef = ref()
-	const treeData = ref([])
-	// 表单数据,也就是默认给一些数据
-	const formData = ref({})
-	// 默认展开的节点(顶级)
-	const submitLoading = ref(false)
-	// 模块ID
-	const moduleId = ref('')
-	//回复ID
-	const replyid = ref('')
-	//类型
-	const typeOptions = ref([
-		{
-			label: '垃圾广告',
-			value: 0
-		},
-		{
-			label: '色情内容',
-			value: 1
-		},
-		{
-			label: '人身攻击',
-			value: 2
-		},
-		{
-			label: '整治敏感',
-			value: 3
-		},
-		{
-			label: '其他',
-			value: 4
-		}
-	])
-	const handleChange = (value) => {
-		formData.value.reportReasonType = value
-	}
-	const filterOption = (input, option) => {
-		return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
-	}
-	const handlerUpImage = (id) => {
-		formData.value.evidenceScreenshot = id
-	}
-	// 打开抽屉
-	const onOpen = (record, module) => {
-		moduleId.value = module
-		visible.value = true
-	}
-	// 关闭抽屉
-	const onClose = () => {
-		formRef.value.resetFields()
-		visible.value = false
+import { required } from '@/utils/formRules'
+import SnowflakeId from 'snowflake-id'
+import tool from '@/utils/tool'
+import forumApi from '@/api/forum/forumApi'
+import XnEditor from '@/components/Editor/index.vue'
+// 默认是关闭状态
+const visible = ref(false)
+const emit = defineEmits({ successful: null })
+const formRef = ref()
+const treeData = ref([])
+// 表单数据,也就是默认给一些数据
+const formData = ref({})
+// 默认展开的节点(顶级)
+const submitLoading = ref(false)
+// 模块ID
+const moduleId = ref('')
+//回复ID
+const replyid = ref('')
+//类型
+const typeOptions = ref([
+	{
+		label: '垃圾广告',
+		value: 0
+	},
+	{
+		label: '色情内容',
+		value: 1
+	},
+	{
+		label: '人身攻击',
+		value: 2
+	},
+	{
+		label: '整治敏感',
+		value: 3
+	},
+	{
+		label: '其他',
+		value: 4
 	}
+])
+const handleChange = (value) => {
+	formData.value.reportReasonType = value
+}
+const filterOption = (input, option) => {
+	return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+}
+const handlerUpImage = (id) => {
+	formData.value.evidenceScreenshot = id
+}
+// 打开抽屉
+const onOpen = (record, module) => {
+	moduleId.value = module
+	visible.value = true
+}
+// 关闭抽屉
+const onClose = () => {
+	formRef.value.resetFields()
+	visible.value = false
+}
 
-	// 默认要校验的
-	const formRules = {
-		reportReasonType: [required('请选择举报类型')],
-		reportDetail: [required('请输入举报原因')],
-		evidenceScreenshot: [required('请上传证据图片')]
-	}
+// 默认要校验的
+const formRules = {
+	reportReasonType: [required('请选择举报类型')],
+	reportDetail: [required('请输入举报原因')],
+	evidenceScreenshot: [required('请上传证据图片')]
+}
 
-	const categoryOptions = tool.dictList('MENU_TYPE')
-	const visibleOptions = tool.dictList('MENU_VISIBLE')
-	// 验证并提交数据
-	const onSubmit = () => {
-		submitLoading.value = true
-		formRef.value.validate().then(() => {
+const categoryOptions = tool.dictList('MENU_TYPE')
+const visibleOptions = tool.dictList('MENU_VISIBLE')
+// 验证并提交数据
+const onSubmit = () => {
+	submitLoading.value = true
+	formRef.value
+		.validate()
+		.then(() => {
 			forumApi
 				.reportinfoAdd({
 					...formData.value,
@@ -135,9 +116,12 @@
 					submitLoading.value = false
 				})
 		})
-	}
-	// 调用这个函数将子组件的一些数据和方法暴露出去
-	defineExpose({
-		onOpen
-	})
+		.finally(() => {
+			submitLoading.value = false
+		})
+}
+// 调用这个函数将子组件的一些数据和方法暴露出去
+defineExpose({
+	onOpen
+})
 </script>

+ 1 - 0
src/views/sys/user/userTab/userMessage/detail.vue

@@ -17,6 +17,7 @@
 					:showPagination="false"
 					bordered
 					:row-key="(record) => record.id"
+					 :scroll="{ x: 'auto' }"
 				>
 					<template #bodyCell="{ column, record }">
 						<template v-if="column.dataIndex === 'read'">