瀏覽代碼

后台管理先关接口对接,页面调整

canghailong 7 月之前
父節點
當前提交
6e755ea290

+ 14 - 2
src/api/forum/forumApi.js

@@ -44,8 +44,20 @@ export default {
 	moreList(data) {
 	moreList(data) {
 		return request('forum/postinfo/moreList', data, 'get')
 		return request('forum/postinfo/moreList', data, 'get')
 	},
 	},
-	// 扩展帖子列表,1.查询我发布的 2.查询我回复的 3.查询关于我的 4.查询我点赞的
+	// 所有用户
 	allUserList(data) {
 	allUserList(data) {
 		return request('sys/user/allList', data, 'get')
 		return request('sys/user/allList', data, 'get')
-	}
+	},
+	// 后台-管理员是否关闭帖子接口
+	postinfoStatus(data) {
+		return request('forum/postinfo/status', data)
+	},
+	// 后台-管理员置顶帖子接口
+	postinfoTop(data) {
+		return request('forum/postinfo/top', data)
+	},
+	// 后台-管理员处理举报接口
+	reportinfoAudit(data) {
+		return request('forum/reportinfo/adminHandle', data)
+	},
 }
 }

+ 2 - 2
src/api/forum/forumPostInfoApi.js

@@ -1,6 +1,6 @@
 import { baseRequest } from '@/utils/request'
 import { baseRequest } from '@/utils/request'
 
 
-const request = (url, ...arg) => baseRequest(`/api/forumapp/forum/postinfo/` + url, ...arg)
+const request = (url, ...arg) => baseRequest(`/api/webapp/forum/postinfo/` + url, ...arg)
 
 
 /**
 /**
  * 帖子信息表Api接口管理器
  * 帖子信息表Api接口管理器
@@ -11,7 +11,7 @@ const request = (url, ...arg) => baseRequest(`/api/forumapp/forum/postinfo/` + u
 export default {
 export default {
 	// 获取帖子信息表分页
 	// 获取帖子信息表分页
 	forumPostInfoPage(data) {
 	forumPostInfoPage(data) {
-		return request('page', data, 'get')
+		return request('adminPage', data, 'get')
 	},
 	},
 	// 提交帖子信息表表单 edit为true时为编辑,默认为新增
 	// 提交帖子信息表表单 edit为true时为编辑,默认为新增
 	forumPostInfoSubmitForm(data, edit = false) {
 	forumPostInfoSubmitForm(data, edit = false) {

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

@@ -1,6 +1,6 @@
 import { baseRequest } from '@/utils/request'
 import { baseRequest } from '@/utils/request'
 
 
-const request = (url, ...arg) => baseRequest(`/api/forumapp/forum/posttype/` + url, ...arg)
+const request = (url, ...arg) => baseRequest(`/api/webapp/forum/posttype/` + url, ...arg)
 
 
 /**
 /**
  * 帖子分类表Api接口管理器
  * 帖子分类表Api接口管理器

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

@@ -1,6 +1,6 @@
 import { baseRequest } from '@/utils/request'
 import { baseRequest } from '@/utils/request'
 
 
-const request = (url, ...arg) => baseRequest(`/api/forumapp/forum/reportinfo/` + url, ...arg)
+const request = (url, ...arg) => baseRequest(`/api/webapp/forum/reportinfo/` + url, ...arg)
 
 
 /**
 /**
  * 论坛-帖子举报信息表Api接口管理器
  * 论坛-帖子举报信息表Api接口管理器

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

@@ -1,6 +1,6 @@
 import { baseRequest } from '@/utils/request'
 import { baseRequest } from '@/utils/request'
 
 
-const request = (url, ...arg) => baseRequest(`/api/forumapp/forum/sensitivity/` + url, ...arg)
+const request = (url, ...arg) => baseRequest(`/api/webapp/forum/sensitivity/` + url, ...arg)
 
 
 /**
 /**
  * 论坛-敏感词Api接口管理器
  * 论坛-敏感词Api接口管理器

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

@@ -1,6 +1,6 @@
 import { baseRequest } from '@/utils/request'
 import { baseRequest } from '@/utils/request'
 
 
-const request = (url, ...arg) => baseRequest(`/api/forumapp/forum/sensitivityrecord/` + url, ...arg)
+const request = (url, ...arg) => baseRequest(`/api/webapp/forum/sensitivityrecord/` + url, ...arg)
 
 
 /**
 /**
  * 敏感词过滤记录Api接口管理器
  * 敏感词过滤记录Api接口管理器

+ 2 - 1
src/components/UpLoadImg/index.vue

@@ -26,7 +26,8 @@ import {message} from 'ant-design-vue'
 import {PictureOutlined, CloudUploadOutlined} from '@ant-design/icons-vue'
 import {PictureOutlined, CloudUploadOutlined} from '@ant-design/icons-vue'
 import tool from "@/utils/tool";
 import tool from "@/utils/tool";
 import sysConfig from '@/config/index'
 import sysConfig from '@/config/index'
-const action = ref(sysConfig.API_URL +'/api/webapp/dev/file/uploadMinioReturnId')
+const action = ref(sysConfig.API_URL +'/api/webapp/dev/file/uploadMinioReturnUrl')
+// const action = ref(sysConfig.API_URL +'/api/webapp/dev/file/uploadMinioReturnId')
 const headers = ref({
 const headers = ref({
 	token: tool.data.get('TOKEN')
 	token: tool.data.get('TOKEN')
 })
 })

+ 3 - 1
src/views/forum/form.vue

@@ -138,7 +138,9 @@
 			.validate()
 			.validate()
 			.then(() => {
 			.then(() => {
 				submitLoading.value = true
 				submitLoading.value = true
-				formData.value.appointUser = formData.value.appointUserArr.join(',')
+				if(formData.value.appointUserArr && formData.value.appointUserArr.length > 1){
+					formData.value.appointUser = formData.value.appointUserArr.join(',')
+				}
 				forumApi.submitForm(formData.value, formData.value.postId).then(() => {
 				forumApi.submitForm(formData.value, formData.value.postId).then(() => {
 					onClose()
 					onClose()
 					emit('successful')
 					emit('successful')

+ 185 - 97
src/views/forum/postinfo/form.vue

@@ -1,103 +1,191 @@
 <template>
 <template>
-    <xn-form-container
-        :title="formData.postId ? '编辑帖子信息表' : '增加帖子信息表'"
-        :width="700"
-        :visible="visible"
-        :destroy-on-close="true"
-        @close="onClose"
-    >
-        <a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
-            <a-form-item label="分类id:" name="typeId">
-                <a-input v-model:value="formData.typeId" placeholder="请输入分类id" allow-clear />
-            </a-form-item>
-            <a-form-item label="用户id:" name="userId">
-                <a-input v-model:value="formData.userId" placeholder="请输入用户id" allow-clear />
-            </a-form-item>
-            <a-form-item label="帖子标题:" name="postTitle">
-                <a-input v-model:value="formData.postTitle" placeholder="请输入帖子标题" allow-clear />
-            </a-form-item>
-            <a-form-item label="帖子内容:" name="postContent">
-                <a-input v-model:value="formData.postContent" placeholder="请输入帖子内容" allow-clear />
-            </a-form-item>
-            <a-form-item label="是否置顶 0普通 1置顶:" name="isTop">
-                <a-input v-model:value="formData.isTop" placeholder="请输入是否置顶 0普通 1置顶" allow-clear />
-            </a-form-item>
-            <a-form-item label="浏览次数:" name="viewCount">
-                <a-input v-model:value="formData.viewCount" placeholder="请输入浏览次数" allow-clear />
-            </a-form-item>
-            <a-form-item label="回复次数:" name="replyCount">
-                <a-input v-model:value="formData.replyCount" placeholder="请输入回复次数" allow-clear />
-            </a-form-item>
-            <a-form-item label="点赞次数:" name="likeCount">
-                <a-input v-model:value="formData.likeCount" placeholder="请输入点赞次数" allow-clear />
-            </a-form-item>
-            <a-form-item label="最后回复用户id:" name="lastReplyUserId">
-                <a-input v-model:value="formData.lastReplyUserId" placeholder="请输入最后回复用户id" allow-clear />
-            </a-form-item>
-            <a-form-item label="最后回复时间:" name="lastReplyTime">
-                <a-date-picker v-model:value="formData.lastReplyTime" value-format="YYYY-MM-DD HH:mm:ss" show-time placeholder="请选择最后回复时间" style="width: 100%" />
-            </a-form-item>
-            <a-form-item label="帖子类型 0普通帖子 1技术支持 2内容纠错:" name="postType">
-                <a-input v-model:value="formData.postType" placeholder="请输入帖子类型 0普通帖子 1技术支持 2内容纠错" allow-clear />
-            </a-form-item>
-            <a-form-item label="定向用户:" name="appointUser">
-                <a-input v-model:value="formData.appointUser" placeholder="请输入定向用户" allow-clear />
-            </a-form-item>
-        </a-form>
-        <template #footer>
-            <a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
-            <a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
-        </template>
-    </xn-form-container>
+	<xn-form-container
+		:title="formData.postId ? '编辑帖子信息表' : '增加帖子信息表'"
+		:width="700"
+		:visible="visible"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
+			<a-form-item label="分类:" name="typeId">
+				<a-select
+					v-model:value="formData.typeId"
+					show-search
+					placeholder="请选择分类"
+					style="width: 100%"
+					:options="typeOptions"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="用户" name="userId">
+				<a-select
+					v-model:value="formData.userId"
+					show-search
+					placeholder="请选择用户"
+					style="width: 100%"
+					:options="usertypeOptions"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="帖子标题:" name="postTitle">
+				<a-input v-model:value="formData.postTitle" placeholder="请输入帖子标题" allow-clear />
+			</a-form-item>
+			<a-form-item label="帖子内容:" name="postContent">
+				<xn-editor v-model="formData.postContent" placeholder="请输入内容" :height="400"></xn-editor>
+			</a-form-item>
+			<a-form-item label="是否置顶:" name="isTop">
+				<a-select
+					v-model:value="formData.isTop"
+					placeholder="请选择是否置顶"
+					style="width: 100%"
+					:options="topOptions"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<!-- <a-form-item label="浏览次数:" name="viewCount">
+				<a-input v-model:value="formData.viewCount" placeholder="请输入浏览次数" allow-clear />
+			</a-form-item>
+			<a-form-item label="回复次数:" name="replyCount">
+				<a-input v-model:value="formData.replyCount" placeholder="请输入回复次数" allow-clear />
+			</a-form-item>
+			<a-form-item label="点赞次数:" name="likeCount">
+				<a-input v-model:value="formData.likeCount" placeholder="请输入点赞次数" allow-clear />
+			</a-form-item> -->
+
+			<a-form-item label="帖子类型:" name="postType">
+				<a-select
+					v-model:value="formData.postType"
+					show-search
+					placeholder="请选择类型"
+					style="width: 100%"
+					:options="invitationOptions"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="定向用户:" name="appointUserArr">
+				<a-select
+					v-model:value="formData.appointUserArr"
+					show-search
+					mode="multiple"
+					placeholder="请选择用户"
+					style="width: 100%"
+					:options="usertypeOptions"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
 </template>
 </template>
 
 
 <script setup name="forumPostInfoForm">
 <script setup name="forumPostInfoForm">
-    import { cloneDeep } from 'lodash-es'
-    import { required } from '@/utils/formRules'
-    import forumPostInfoApi from '@/api/forum/forumPostInfoApi'
-    // 抽屉状态
-    const visible = ref(false)
-    const emit = defineEmits({ successful: null })
-    const formRef = ref()
-    // 表单数据
-    const formData = ref({})
-    const submitLoading = ref(false)
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import forumPostInfoApi from '@/api/forum/forumPostInfoApi'
+	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 formData = ref({})
+	const submitLoading = ref(false)
+	//分类
+	const typeOptions = ref([])
+	//用户
+	const usertypeOptions = ref([])
+	//置顶
+	const topOptions = ref([
+		{
+			label: '普通',
+			value: 0
+		},
+		{
+			label: '置顶',
+			value: 1
+		}
+	])
+	//帖子类型
+	const invitationOptions = ref([
+		{
+			label: '普通帖子',
+			value: 0
+		},
+		{
+			label: '技术支持',
+			value: 1
+		},
+		{
+			label: '内容纠错',
+			value: 2
+		}
+	])
+	// 打开抽屉
+	const onOpen = (record) => {
+		visible.value = true
+		forumApi.forumTypeList().then((data) => {
+			typeOptions.value = data.map((r) => {
+				return {
+					label: r.typeName,
+					value: r.typeId,
+					...r
+				}
+			})
+		})
+		forumApi.allUserList().then((data) => {
+			usertypeOptions.value = data.map((r) => {
+				return {
+					label: r.name,
+					value: r.id,
+					...r
+				}
+			})
+		})
 
 
-    // 打开抽屉
-    const onOpen = (record) => {
-        visible.value = true
-        if (record) {
-            let recordData = cloneDeep(record)
-            formData.value = Object.assign({}, recordData)
-        }
-    }
-    // 关闭抽屉
-    const onClose = () => {
-        formRef.value.resetFields()
-        formData.value = {}
-        visible.value = false
-    }
-    // 默认要校验的
-    const formRules = {
-    }
-    // 验证并提交数据
-    const onSubmit = () => {
-        formRef.value.validate().then(() => {
-            submitLoading.value = true
-            const formDataParam = cloneDeep(formData.value)
-            forumPostInfoApi
-                .forumPostInfoSubmitForm(formDataParam, formDataParam.postId)
-                .then(() => {
-                    onClose()
-                    emit('successful')
-                })
-                .finally(() => {
-                    submitLoading.value = false
-                })
-        })
-    }
-    // 抛出函数
-    defineExpose({
-        onOpen
-    })
+		if (record) {
+			if (record.appointUser) {
+				record.appointUserArr = record.appointUser.split(',')
+			}
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		visible.value = false
+	}
+	const filterOption = (input, option) => {
+		return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+	}
+	// 默认要校验的
+	const formRules = {}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value.validate().then(() => {
+			submitLoading.value = true
+			const formDataParam = cloneDeep(formData.value)
+			forumPostInfoApi
+				.forumPostInfoSubmitForm(formDataParam, formDataParam.postId)
+				.then(() => {
+					if (formData.value.appointUserArr && formData.value.appointUserArr.length > 1) {
+						formData.value.appointUser = formData.value.appointUserArr.join(',')
+					}
+					onClose()
+					emit('successful')
+				})
+				.finally(() => {
+					submitLoading.value = false
+				})
+		})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
 </script>
 </script>

+ 221 - 145
src/views/forum/postinfo/index.vue

@@ -1,150 +1,226 @@
 <template>
 <template>
-    <a-card :bordered="false">
-        <s-table
-            ref="table"
-            :columns="columns"
-            :data="loadData"
-            :alert="options.alert.show"
-            bordered
-            :row-key="(record) => record.postId"
-            :tool-config="toolConfig"
-            :row-selection="options.rowSelection"
-        >
-            <template #operator class="table-operator">
-                <a-space>
-                    <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('forumPostInfoAdd')">
-                        <template #icon><plus-outlined /></template>
-                        新增
-                    </a-button>
-                    <xn-batch-delete
-                        v-if="hasPerm('forumPostInfoBatchDelete')"
-                        :selectedRowKeys="selectedRowKeys"
-                        @batchDelete="deleteBatchForumPostInfo"
-                    />
-                </a-space>
-            </template>
-            <template #bodyCell="{ column, record }">
-                <template v-if="column.dataIndex === 'action'">
-                    <a-space>
-                        <a @click="formRef.onOpen(record)" v-if="hasPerm('forumPostInfoEdit')">编辑</a>
-                        <a-divider type="vertical" v-if="hasPerm(['forumPostInfoEdit', 'forumPostInfoDelete'], 'and')" />
-                        <a-popconfirm title="确定要删除吗?" @confirm="deleteForumPostInfo(record)">
-                            <a-button type="link" danger size="small" v-if="hasPerm('forumPostInfoDelete')">删除</a-button>
-                        </a-popconfirm>
-                    </a-space>
-                </template>
-            </template>
-        </s-table>
-    </a-card>
-    <Form ref="formRef" @successful="table.refresh(true)" />
+	<a-card :bordered="false">
+		<s-table
+			ref="table"
+			:columns="columns"
+			:data="loadData"
+			:alert="options.alert.show"
+			bordered
+			:row-key="(record) => record.postId"
+			:tool-config="toolConfig"
+			:row-selection="options.rowSelection"
+		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('forumPostInfoAdd')">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+					<xn-batch-delete
+						v-if="hasPerm('forumPostInfoBatchDelete')"
+						:selectedRowKeys="selectedRowKeys"
+						@batchDelete="deleteBatchForumPostInfo"
+					/>
+				</a-space>
+			</template>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a @click="formRef.onOpen(record)" v-if="hasPerm('forumPostInfoEdit')">编辑</a>
+						<a-divider type="vertical" v-if="hasPerm(['forumPostInfoEdit', 'forumPostInfoDelete'], 'and')" />
+						<a-popconfirm title="确定要删除吗?" @confirm="deleteForumPostInfo(record)">
+							<a-button type="link" danger size="small" v-if="hasPerm('forumPostInfoDelete')">删除</a-button>
+						</a-popconfirm>
+					</a-space>
+				</template>
+				<template v-if="column.dataIndex === 'postContent'">
+					<a-tooltip>
+						<template #title>
+							<div style="max-height: 400px; overflow-x: auto" v-html="record.postContent"></div>
+						</template>
+						<div class="one-line" v-html="record.postContent"></div>
+					</a-tooltip>
+				</template>
+				<template v-if="column.dataIndex === 'lastReplyTime'">
+					<div>{{ formatDateTime(record.lastReplyTime) }}</div>
+				</template>
+				<template v-if="column.dataIndex === 'postType'">
+					<div v-if="record.postType == 0">普通帖子</div>
+					<div v-if="record.postType == 1">技术支持</div>
+					<div v-if="record.postType == 2">内容纠错</div>
+				</template>
+				<template v-if="column.dataIndex === 'postStatus'">
+					<a-switch
+						v-model:checked="record.postStatus"
+						:checkedValue="0"
+						:unCheckedValue="1"
+						checked-children="开"
+						un-checked-children="关"
+						@change="closeItem($event, record)"
+					/>
+				</template>
+				<template v-if="column.dataIndex === 'isTop'">
+					<a-switch
+						v-model:checked="record.isTop"
+						:checkedValue="1"
+						:unCheckedValue="0"
+						checked-children="是"
+						un-checked-children="否"
+						@change="topItem($event, record)"
+					/>
+				</template>
+			</template>
+		</s-table>
+	</a-card>
+	<Form ref="formRef" @successful="table.refresh(true)" />
 </template>
 </template>
 
 
 <script setup name="postinfo">
 <script setup name="postinfo">
-    import Form from './form.vue'
-    import forumPostInfoApi from '@/api/forum/forumPostInfoApi'
-    const table = ref()
-    const formRef = ref()
-    const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
-    const columns = [
-        {
-            title: '分类id',
-            dataIndex: 'typeId'
-        },
-        {
-            title: '用户id',
-            dataIndex: 'userId'
-        },
-        {
-            title: '帖子标题',
-            dataIndex: 'postTitle'
-        },
-        {
-            title: '帖子内容',
-            dataIndex: 'postContent'
-        },
-        {
-            title: '是否置顶 0普通 1置顶',
-            dataIndex: 'isTop'
-        },
-        {
-            title: '浏览次数',
-            dataIndex: 'viewCount'
-        },
-        {
-            title: '回复次数',
-            dataIndex: 'replyCount'
-        },
-        {
-            title: '点赞次数',
-            dataIndex: 'likeCount'
-        },
-        {
-            title: '最后回复用户id',
-            dataIndex: 'lastReplyUserId'
-        },
-        {
-            title: '最后回复时间',
-            dataIndex: 'lastReplyTime'
-        },
-        {
-            title: '帖子类型 0普通帖子 1技术支持 2内容纠错',
-            dataIndex: 'postType'
-        },
-        {
-            title: '定向用户',
-            dataIndex: 'appointUser'
-        },
-    ]
-    // 操作栏通过权限判断是否显示
-    if (hasPerm(['forumPostInfoEdit', 'forumPostInfoDelete'])) {
-        columns.push({
-            title: '操作',
-            dataIndex: 'action',
-            align: 'center',
-            width: '150px'
-        })
-    }
-    const selectedRowKeys = ref([])
-    // 列表选择配置
-    const options = {
-        // columns数字类型字段加入 needTotal: true 可以勾选自动算账
-        alert: {
-            show: true,
-            clear: () => {
-                selectedRowKeys.value = ref([])
-            }
-        },
-        rowSelection: {
-            onChange: (selectedRowKey, selectedRows) => {
-                selectedRowKeys.value = selectedRowKey
-            }
-        }
-    }
-    const loadData = (parameter) => {
-        return forumPostInfoApi.forumPostInfoPage(parameter).then((data) => {
-            return data
-        })
-    }
-    // 重置
-    const reset = () => {
-        searchFormRef.value.resetFields()
-        table.value.refresh(true)
-    }
-    // 删除
-    const deleteForumPostInfo = (record) => {
-        let params = [
-            {
-                postId: record.postId
-            }
-        ]
-        forumPostInfoApi.forumPostInfoDelete(params).then(() => {
-            table.value.refresh(true)
-        })
-    }
-    // 批量删除
-    const deleteBatchForumPostInfo = (params) => {
-        forumPostInfoApi.forumPostInfoDelete(params).then(() => {
-            table.value.clearRefreshSelected()
-        })
-    }
+	import Form from './form.vue'
+	import forumPostInfoApi from '@/api/forum/forumPostInfoApi'
+	import forumApi from '@/api/forum/forumApi'
+	import { parseTime } from '@/utils/exam'
+	const table = ref()
+	const formRef = ref()
+	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
+	const columns = [
+		{
+			title: '用户',
+			dataIndex: 'userNickName'
+		},
+		{
+			title: '帖子标题',
+			dataIndex: 'postTitle',
+            width: 120,
+		},
+		{
+			title: '帖子内容',
+			dataIndex: 'postContent',
+			width: 300,
+			ellipsis: true
+		},
+		{
+			title: '状态',
+			dataIndex: 'postStatus',
+		},
+		{
+			title: '是否置顶',
+			dataIndex: 'isTop'
+		},
+		{
+			title: '浏览次数',
+			dataIndex: 'viewCount'
+		},
+		{
+			title: '回复次数',
+			dataIndex: 'replyCount'
+		},
+		{
+			title: '点赞次数',
+			dataIndex: 'likeCount'
+		},
+		{
+			title: '最后回复用户',
+			dataIndex: 'lastReplyUserNickName',
+            width: 120,
+		},
+		{
+			title: '最后回复时间',
+			dataIndex: 'lastReplyTime',
+            width: 120,
+		},
+		{
+			title: '帖子类型',
+			dataIndex: 'postType'
+		},
+		{
+			title: '定向用户',
+			dataIndex: 'appointUser'
+		}
+	]
+	function formatDateTime(val) {
+		if (!val) return ''
+		return parseTime(val, '{y}-{m}-{d} {h}:{i}:{s}')
+	}
+	// 操作栏通过权限判断是否显示
+	if (hasPerm(['forumPostInfoEdit', 'forumPostInfoDelete'])) {
+		columns.push({
+			title: '操作',
+			dataIndex: 'action',
+			align: 'center',
+			width: '150px'
+		})
+	}
+	const selectedRowKeys = ref([])
+	// 列表选择配置
+	const options = {
+		// columns数字类型字段加入 needTotal: true 可以勾选自动算账
+		alert: {
+			show: true,
+			clear: () => {
+				selectedRowKeys.value = ref([])
+			}
+		},
+		rowSelection: {
+			onChange: (selectedRowKey, selectedRows) => {
+				selectedRowKeys.value = selectedRowKey
+			}
+		}
+	}
+	const loadData = (parameter) => {
+		parameter.sortOrder = 0
+		return forumPostInfoApi.forumPostInfoPage(parameter).then((data) => {
+			return data
+		})
+	}
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
+		table.value.refresh(true)
+	}
+	// 删除
+	const deleteForumPostInfo = (record) => {
+		let params = [
+			{
+				postId: record.postId
+			}
+		]
+		forumPostInfoApi.forumPostInfoDelete(params).then(() => {
+			table.value.refresh(true)
+		})
+	}
+	// 批量删除
+	const deleteBatchForumPostInfo = (params) => {
+		forumPostInfoApi.forumPostInfoDelete(params).then(() => {
+			table.value.clearRefreshSelected()
+		})
+	}
+	const closeItem = (event, params) => {
+		forumApi
+			.postinfoStatus({
+				postId: params.postId,
+				postStatus: event
+			})
+			.then((data) => {
+				table.value.refresh(true)
+			})
+	}
+	const topItem = (event, params) => {
+		forumApi
+			.postinfoTop({
+				postId: params.postId,
+				postStatus: event
+			})
+			.then((data) => {
+				table.value.refresh(true)
+			})
+	}
 </script>
 </script>
+<style scoped>
+	.one-line {
+		display: -webkit-box;
+		-webkit-box-orient: vertical;
+		-webkit-line-clamp: 1;
+		overflow: hidden;
+	}
+</style>

+ 227 - 80
src/views/forum/reportinfo/form.vue

@@ -1,85 +1,232 @@
 <template>
 <template>
-    <xn-form-container
-        :title="formData.reportId ? '编辑论坛-帖子举报信息表' : '增加论坛-帖子举报信息表'"
-        :width="700"
-        :visible="visible"
-        :destroy-on-close="true"
-        @close="onClose"
-    >
-        <a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
-            <a-form-item label="帖子主键id:" name="postId">
-                <a-input v-model:value="formData.postId" placeholder="请输入帖子主键id" allow-clear />
-            </a-form-item>
-            <a-form-item label="举报人用户id:" name="userId">
-                <a-input v-model:value="formData.userId" placeholder="请输入举报人用户id" allow-clear />
-            </a-form-item>
-            <a-form-item label="举报原因类型 0垃圾广告 1色情内容 2人身攻击 3政治敏感 4其他:" name="reportReasonType">
-                <a-input v-model:value="formData.reportReasonType" placeholder="请输入举报原因类型 0垃圾广告 1色情内容 2人身攻击 3政治敏感 4其他" allow-clear />
-            </a-form-item>
-            <a-form-item label="举报信息描述:" name="reportDetail">
-                <a-input v-model:value="formData.reportDetail" placeholder="请输入举报信息描述" allow-clear />
-            </a-form-item>
-            <a-form-item label="证据图片:" name="evidenceScreenshot">
-                <a-input v-model:value="formData.evidenceScreenshot" placeholder="请输入证据图片" allow-clear />
-            </a-form-item>
-            <a-form-item label="举报处理状态 0待处理 1已关闭帖子 2已驳回:" name="reportStatus">
-                <a-input v-model:value="formData.reportStatus" placeholder="请输入举报处理状态 0待处理 1已关闭帖子 2已驳回" allow-clear />
-            </a-form-item>
-        </a-form>
-        <template #footer>
-            <a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
-            <a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
-        </template>
-    </xn-form-container>
+	<xn-form-container
+		:title="formData.reportId ? '编辑论坛-帖子举报信息表' : '增加论坛-帖子举报信息表'"
+		:width="700"
+		:visible="visible"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
+			<a-form-item label="帖子:" name="postId">
+				<a-select
+					v-model:value="formData.postId"
+					show-search
+					placeholder="请选择帖子"
+					style="width: 100%"
+					:options="invitationList"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<!-- <a-form-item label="帖子类型:" name="postType">
+				<a-select
+					v-model:value="formData.postType"
+					show-search
+					placeholder="请选择帖子类型"
+					style="width: 100%"
+					:options="invitationType"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="帖子状态:" name="postStatus">
+				<a-select
+					v-model:value="formData.postStatus"
+					show-search
+					placeholder="请选择帖子状态"
+					style="width: 100%"
+					:options="invitationStatus"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item> -->
+			<a-form-item label="举报人:" name="userId">
+				<a-select
+					v-model:value="formData.userId"
+					show-search
+					placeholder="请选择用户"
+					style="width: 100%"
+					:options="usertypeOptions"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="举报原因类型:" name="reportReasonType">
+				<a-select
+					v-model:value="formData.reportReasonType"
+					show-search
+					placeholder="请选择类型"
+					style="width: 100%"
+					:options="reportType"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="举报信息描述:" name="reportDetail">
+				<a-input v-model:value="formData.reportDetail" placeholder="请输入举报信息描述" allow-clear />
+			</a-form-item>
+			<a-form-item label="证据图片:" name="evidenceScreenshot">
+				<UpLoadImg ref="upLoadImgRef" @handlerUpImage="handlerUpImage"></UpLoadImg>
+			</a-form-item>
+			<a-form-item label="举报处理状态:" name="reportStatus">
+				<a-select
+					v-model:value="formData.reportStatus"
+					show-search
+					placeholder="请选择分类"
+					style="width: 100%"
+					:options="statusType"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
 </template>
 </template>
 
 
 <script setup name="forumReportInfoForm">
 <script setup name="forumReportInfoForm">
-    import { cloneDeep } from 'lodash-es'
-    import { required } from '@/utils/formRules'
-    import forumReportInfoApi from '@/api/forum/forumReportInfoApi'
-    // 抽屉状态
-    const visible = ref(false)
-    const emit = defineEmits({ successful: null })
-    const formRef = ref()
-    // 表单数据
-    const formData = ref({})
-    const submitLoading = ref(false)
-
-    // 打开抽屉
-    const onOpen = (record) => {
-        visible.value = true
-        if (record) {
-            let recordData = cloneDeep(record)
-            formData.value = Object.assign({}, recordData)
-        }
-    }
-    // 关闭抽屉
-    const onClose = () => {
-        formRef.value.resetFields()
-        formData.value = {}
-        visible.value = false
-    }
-    // 默认要校验的
-    const formRules = {
-    }
-    // 验证并提交数据
-    const onSubmit = () => {
-        formRef.value.validate().then(() => {
-            submitLoading.value = true
-            const formDataParam = cloneDeep(formData.value)
-            forumReportInfoApi
-                .forumReportInfoSubmitForm(formDataParam, formDataParam.reportId)
-                .then(() => {
-                    onClose()
-                    emit('successful')
-                })
-                .finally(() => {
-                    submitLoading.value = false
-                })
-        })
-    }
-    // 抛出函数
-    defineExpose({
-        onOpen
-    })
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import forumReportInfoApi from '@/api/forum/forumReportInfoApi'
+	import forumApi from '@/api/forum/forumApi'
+	// 抽屉状态
+	const visible = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+	//用户
+	const usertypeOptions = ref([])
+	//帖子
+	const invitationList = ref([])
+	//举报原因
+	const reportType = ref([
+		{
+			label: '垃圾广告',
+			value: 0
+		},
+		{
+			label: '色情内容',
+			value: 1
+		},
+		{
+			label: '人身攻击',
+			value: 2
+		},
+		{
+			label: '政治敏感',
+			value: 3
+		},
+		{
+			label: '其他',
+			value: 4
+		}
+	])
+	//状态
+	const statusType = ref([
+		{
+			label: '待处理',
+			value: 0
+		},
+		{
+			label: '已关闭帖子',
+			value: 1
+		},
+		{
+			label: '已驳回',
+			value: 2
+		}
+	])
+	//帖子类型
+	const invitationType = ref([
+		{
+			label:'普通帖子',
+			value:0
+		},
+		{
+			label:'技术支持',
+			value:1
+		},
+		{
+			label:'内容纠错',
+			value:2
+		},
+	])
+	//帖子状态
+	const invitationStatus = ref([
+		{
+			label:'正常',
+			value:0
+		},
+		{
+			label:'关闭',
+			value:1
+		}
+	])
+	//筛选
+	const filterOption = (input, option) => {
+		return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+	}
+	// 打开抽屉
+	const onOpen = (record) => {
+		visible.value = true
+		forumApi.allUserList().then((data) => {
+			usertypeOptions.value = data.map((r) => {
+				return {
+					label: r.name,
+					value: r.id,
+					...r
+				}
+			})
+		})
+		forumApi
+			.forumList({
+				current: 1,
+				size: 999999999,
+				sortOrder: 0
+			})
+			.then((data) => {
+				invitationList.value = data.records.map((r) => {
+					return {
+						label: r.postTitle,
+						value: r.postId,
+						...r
+					}
+				})
+			})
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		visible.value = false
+	}
+	// 默认要校验的
+	const formRules = {}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value.validate().then(() => {
+			submitLoading.value = true
+			const formDataParam = cloneDeep(formData.value)
+			forumReportInfoApi
+				.forumReportInfoSubmitForm(formDataParam, formDataParam.reportId)
+				.then(() => {
+					onClose()
+					emit('successful')
+				})
+				.finally(() => {
+					submitLoading.value = false
+				})
+		})
+	}
+	//选择图片
+	const handlerUpImage = (id) => {
+		formData.value.evidenceScreenshot = id
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
 </script>
 </script>

+ 190 - 120
src/views/forum/reportinfo/index.vue

@@ -1,126 +1,196 @@
 <template>
 <template>
-    <a-card :bordered="false">
-        <s-table
-            ref="table"
-            :columns="columns"
-            :data="loadData"
-            :alert="options.alert.show"
-            bordered
-            :row-key="(record) => record.reportId"
-            :tool-config="toolConfig"
-            :row-selection="options.rowSelection"
-        >
-            <template #operator class="table-operator">
-                <a-space>
-                    <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('forumReportInfoAdd')">
-                        <template #icon><plus-outlined /></template>
-                        新增
-                    </a-button>
-                    <xn-batch-delete
-                        v-if="hasPerm('forumReportInfoBatchDelete')"
-                        :selectedRowKeys="selectedRowKeys"
-                        @batchDelete="deleteBatchForumReportInfo"
-                    />
-                </a-space>
-            </template>
-            <template #bodyCell="{ column, record }">
-                <template v-if="column.dataIndex === 'action'">
-                    <a-space>
-                        <a @click="formRef.onOpen(record)" v-if="hasPerm('forumReportInfoEdit')">编辑</a>
-                        <a-divider type="vertical" v-if="hasPerm(['forumReportInfoEdit', 'forumReportInfoDelete'], 'and')" />
-                        <a-popconfirm title="确定要删除吗?" @confirm="deleteForumReportInfo(record)">
-                            <a-button type="link" danger size="small" v-if="hasPerm('forumReportInfoDelete')">删除</a-button>
-                        </a-popconfirm>
-                    </a-space>
-                </template>
-            </template>
-        </s-table>
-    </a-card>
-    <Form ref="formRef" @successful="table.refresh(true)" />
+	<a-card :bordered="false">
+		<s-table
+			ref="table"
+			:columns="columns"
+			:data="loadData"
+			:alert="options.alert.show"
+			bordered
+			:row-key="(record) => record.reportId"
+			:tool-config="toolConfig"
+			:row-selection="options.rowSelection"
+		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('forumReportInfoAdd')">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+					<xn-batch-delete
+						v-if="hasPerm('forumReportInfoBatchDelete')"
+						:selectedRowKeys="selectedRowKeys"
+						@batchDelete="deleteBatchForumReportInfo"
+					/>
+				</a-space>
+			</template>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a @click="formRef.onOpen(record)" v-if="hasPerm('forumReportInfoEdit')">编辑</a>
+						<a-divider type="vertical" v-if="hasPerm(['forumReportInfoEdit', 'forumReportInfoDelete'], 'and')" />
+						<a-popconfirm title="确定要删除吗?" @confirm="deleteForumReportInfo(record)">
+							<a-button type="link" danger size="small" v-if="hasPerm('forumReportInfoDelete')">删除</a-button>
+						</a-popconfirm>
+						<a-divider type="vertical" v-if="hasPerm(['forumReportInfoDelete', 'forumReportInfoAudit'], 'and')" />
+						<a @click="showModal(record)" v-if="hasPerm('forumReportInfoAudit')">审核</a>
+					</a-space>
+				</template>
+				<template v-if="column.dataIndex === 'reportReasonType'">
+					<div v-if="record.reportReasonType == 0">垃圾广告</div>
+					<div v-if="record.reportReasonType == 1">色情内容</div>
+					<div v-if="record.reportReasonType == 2">人身攻击</div>
+					<div v-if="record.reportReasonType == 3">政治敏感</div>
+					<div v-if="record.reportReasonType == 4">其他</div>
+				</template>
+				<template v-if="column.dataIndex === 'reportStatus'">
+					<div v-if="record.reportStatus == 0">待处理</div>
+					<div v-if="record.reportStatus == 1">已关闭帖子</div>
+					<div v-if="record.reportStatus == 2">已驳回</div>
+				</template>
+				<template v-if="column.dataIndex === 'postType'">
+					<div v-if="record.postType == 0">普通帖子</div>
+					<div v-if="record.postType == 1">技术支持</div>
+					<div v-if="record.postType == 2">内容纠错</div>
+				</template>
+			</template>
+		</s-table>
+	</a-card>
+	<Form ref="formRef" @successful="table.refresh(true)" />
+	<a-modal v-model:visible="openAudit" title="审核" @ok="auditFun">
+		<a-select
+			v-model:value="reportStatus"
+			placeholder="请选择"
+			style="width: 100%"
+			:options="statusType"
+		></a-select>
+	</a-modal>
 </template>
 </template>
 
 
 <script setup name="reportinfo">
 <script setup name="reportinfo">
-    import Form from './form.vue'
-    import forumReportInfoApi from '@/api/forum/forumReportInfoApi'
-    const table = ref()
-    const formRef = ref()
-    const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
-    const columns = [
-        {
-            title: '帖子主键id',
-            dataIndex: 'postId'
-        },
-        {
-            title: '举报人用户id',
-            dataIndex: 'userId'
-        },
-        {
-            title: '举报原因类型 0垃圾广告 1色情内容 2人身攻击 3政治敏感 4其他',
-            dataIndex: 'reportReasonType'
-        },
-        {
-            title: '举报信息描述',
-            dataIndex: 'reportDetail'
-        },
-        {
-            title: '证据图片',
-            dataIndex: 'evidenceScreenshot'
-        },
-        {
-            title: '举报处理状态 0待处理 1已关闭帖子 2已驳回',
-            dataIndex: 'reportStatus'
-        },
-    ]
-    // 操作栏通过权限判断是否显示
-    if (hasPerm(['forumReportInfoEdit', 'forumReportInfoDelete'])) {
-        columns.push({
-            title: '操作',
-            dataIndex: 'action',
-            align: 'center',
-            width: '150px'
-        })
-    }
-    const selectedRowKeys = ref([])
-    // 列表选择配置
-    const options = {
-        // columns数字类型字段加入 needTotal: true 可以勾选自动算账
-        alert: {
-            show: true,
-            clear: () => {
-                selectedRowKeys.value = ref([])
-            }
-        },
-        rowSelection: {
-            onChange: (selectedRowKey, selectedRows) => {
-                selectedRowKeys.value = selectedRowKey
-            }
+	import Form from './form.vue'
+	import forumReportInfoApi from '@/api/forum/forumReportInfoApi'
+	import forumApi from '@/api/forum/forumApi'
+    import { message } from 'ant-design-vue';
+	const table = ref()
+	const formRef = ref()
+	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
+	const columns = [
+		{
+			title: '帖子',
+			dataIndex: 'postTitle'
+		},
+		{
+			title: '帖子类型',
+			dataIndex: 'postType'
+		},
+		{
+			title: '帖子状态',
+			dataIndex: 'postStatus'
+		},
+		{
+			title: '举报人',
+			dataIndex: 'userNickname'
+		},
+		{
+			title: '举报原因类型',
+			dataIndex: 'reportReasonType'
+		},
+		{
+			title: '举报信息描述',
+			dataIndex: 'reportDetail'
+		},
+		{
+			title: '证据图片',
+			dataIndex: 'evidenceScreenshot'
+		},
+		{
+			title: '举报处理状态',
+			dataIndex: 'reportStatus'
+		}
+	]
+	// 操作栏通过权限判断是否显示
+	if (hasPerm(['forumReportInfoEdit', 'forumReportInfoDelete'])) {
+		columns.push({
+			title: '操作',
+			dataIndex: 'action',
+			align: 'center',
+			width: '200px'
+		})
+	}
+	const selectedRowKeys = ref([])
+	// 列表选择配置
+	const options = {
+		// columns数字类型字段加入 needTotal: true 可以勾选自动算账
+		alert: {
+			show: true,
+			clear: () => {
+				selectedRowKeys.value = ref([])
+			}
+		},
+		rowSelection: {
+			onChange: (selectedRowKey, selectedRows) => {
+				selectedRowKeys.value = selectedRowKey
+			}
+		}
+	}
+	const loadData = (parameter) => {
+		return forumReportInfoApi.forumReportInfoPage(parameter).then((data) => {
+			return data
+		})
+	}
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
+		table.value.refresh(true)
+	}
+	// 删除
+	const deleteForumReportInfo = (record) => {
+		let params = [
+			{
+				reportId: record.reportId
+			}
+		]
+		forumReportInfoApi.forumReportInfoDelete(params).then(() => {
+			table.value.refresh(true)
+		})
+	}
+	// 批量删除
+	const deleteBatchForumReportInfo = (params) => {
+		forumReportInfoApi.forumReportInfoDelete(params).then(() => {
+			table.value.clearRefreshSelected()
+		})
+	}
+    //状态
+	const statusType = ref([
+		{
+			label: '关闭帖子',
+			value: 1
+		},
+		{
+			label: '驳回举报',
+			value: 2
+		}
+	])
+    const reportStatus = ref()
+    const itemData = ref({})
+    const openAudit = ref(false)
+	const showModal = (event) => {
+        itemData.value = event
+		openAudit.value = true
+	}
+	const auditFun = (event) => {
+        if(!reportStatus.value){
+            message.warning('请选择处理方式')
+            return
         }
         }
-    }
-    const loadData = (parameter) => {
-        return forumReportInfoApi.forumReportInfoPage(parameter).then((data) => {
-            return data
-        })
-    }
-    // 重置
-    const reset = () => {
-        searchFormRef.value.resetFields()
-        table.value.refresh(true)
-    }
-    // 删除
-    const deleteForumReportInfo = (record) => {
-        let params = [
-            {
-                reportId: record.reportId
-            }
-        ]
-        forumReportInfoApi.forumReportInfoDelete(params).then(() => {
-            table.value.refresh(true)
-        })
-    }
-    // 批量删除
-    const deleteBatchForumReportInfo = (params) => {
-        forumReportInfoApi.forumReportInfoDelete(params).then(() => {
-            table.value.clearRefreshSelected()
-        })
-    }
+		forumApi
+			.reportinfoAudit({
+				reportId: itemData.value.reportId,
+				reportStatus: reportStatus.value
+			})
+			.then((data) => {
+				openAudit.value = false
+				table.value.refresh(true)
+			})
+	}
 </script>
 </script>

+ 136 - 74
src/views/forum/sensitivityrecord/form.vue

@@ -1,79 +1,141 @@
 <template>
 <template>
-    <xn-form-container
-        :title="formData.recordId ? '编辑敏感词过滤记录' : '增加敏感词过滤记录'"
-        :width="700"
-        :visible="visible"
-        :destroy-on-close="true"
-        @close="onClose"
-    >
-        <a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
-            <a-form-item label="过滤词语:" name="sensitivityWord">
-                <a-input v-model:value="formData.sensitivityWord" placeholder="请输入过滤词语" allow-clear />
-            </a-form-item>
-            <a-form-item label="帖子id:" name="postId">
-                <a-input v-model:value="formData.postId" placeholder="请输入帖子id" allow-clear />
-            </a-form-item>
-            <a-form-item label="过滤类型 0发帖 1回复:" name="recordType">
-                <a-input v-model:value="formData.recordType" placeholder="请输入过滤类型 0发帖 1回复" allow-clear />
-            </a-form-item>
-            <a-form-item label="用户id:" name="userId">
-                <a-input v-model:value="formData.userId" placeholder="请输入用户id" allow-clear />
-            </a-form-item>
-        </a-form>
-        <template #footer>
-            <a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
-            <a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
-        </template>
-    </xn-form-container>
+	<xn-form-container
+		:title="formData.recordId ? '编辑敏感词过滤记录' : '增加敏感词过滤记录'"
+		:width="700"
+		:visible="visible"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
+			<a-form-item label="过滤词语:" name="sensitivityWord">
+				<a-input v-model:value="formData.sensitivityWord" placeholder="请输入过滤词语" allow-clear />
+			</a-form-item>
+			<a-form-item label="帖子:" name="postId">
+				<a-select
+					v-model:value="formData.typeId"
+					show-search
+					placeholder="请选择帖子"
+					style="width: 100%"
+					:options="invitationList"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="过滤类型:" name="recordType">
+				<a-select
+					v-model:value="formData.recordType"
+					show-search
+					placeholder="请选择类型"
+					style="width: 100%"
+					:options="typeList"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+			<a-form-item label="用户:" name="userId">
+				<a-select
+					v-model:value="formData.userId"
+					show-search
+					placeholder="请选择用户"
+					style="width: 100%"
+					:options="usertypeOptions"
+					:filter-option="filterOption"
+				></a-select>
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
 </template>
 </template>
 
 
 <script setup name="forumSensitivityRecordForm">
 <script setup name="forumSensitivityRecordForm">
-    import { cloneDeep } from 'lodash-es'
-    import { required } from '@/utils/formRules'
-    import forumSensitivityRecordApi from '@/api/forum/forumSensitivityRecordApi'
-    // 抽屉状态
-    const visible = ref(false)
-    const emit = defineEmits({ successful: null })
-    const formRef = ref()
-    // 表单数据
-    const formData = ref({})
-    const submitLoading = ref(false)
-
-    // 打开抽屉
-    const onOpen = (record) => {
-        visible.value = true
-        if (record) {
-            let recordData = cloneDeep(record)
-            formData.value = Object.assign({}, recordData)
-        }
-    }
-    // 关闭抽屉
-    const onClose = () => {
-        formRef.value.resetFields()
-        formData.value = {}
-        visible.value = false
-    }
-    // 默认要校验的
-    const formRules = {
-    }
-    // 验证并提交数据
-    const onSubmit = () => {
-        formRef.value.validate().then(() => {
-            submitLoading.value = true
-            const formDataParam = cloneDeep(formData.value)
-            forumSensitivityRecordApi
-                .forumSensitivityRecordSubmitForm(formDataParam, formDataParam.recordId)
-                .then(() => {
-                    onClose()
-                    emit('successful')
-                })
-                .finally(() => {
-                    submitLoading.value = false
-                })
-        })
-    }
-    // 抛出函数
-    defineExpose({
-        onOpen
-    })
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import forumSensitivityRecordApi from '@/api/forum/forumSensitivityRecordApi'
+	import forumApi from '@/api/forum/forumApi'
+	// 抽屉状态
+	const visible = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+	//用户
+	const usertypeOptions = ref([])
+	//帖子
+	const invitationList = ref([])
+	// 打开抽屉
+	const onOpen = (record) => {
+		visible.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+		forumApi.allUserList().then((data) => {
+			usertypeOptions.value = data.map((r) => {
+				return {
+					label: r.name,
+					value: r.id,
+					...r
+				}
+			})
+		})
+		forumApi
+			.forumList({
+				current: 1,
+				size: 999999999,
+				sortOrder: 0
+			})
+			.then((data) => {
+				invitationList.value = data.records.map((r) => {
+					return {
+						label: r.postTitle,
+						value: r.postId,
+						...r
+					}
+				})
+			})
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		visible.value = false
+	}
+	//类型
+	const typeList = ref([
+		{
+			label: '发帖',
+			value: 0
+		},
+		{
+			label: '回复',
+			value: 1
+		}
+	])
+	const filterOption = (input, option) => {
+		return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+	}
+	// 默认要校验的
+	const formRules = {}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value.validate().then(() => {
+			submitLoading.value = true
+			const formDataParam = cloneDeep(formData.value)
+			forumSensitivityRecordApi
+				.forumSensitivityRecordSubmitForm(formDataParam, formDataParam.recordId)
+				.then(() => {
+					onClose()
+					emit('successful')
+				})
+				.finally(() => {
+					submitLoading.value = false
+				})
+		})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
 </script>
 </script>

+ 120 - 113
src/views/forum/sensitivityrecord/index.vue

@@ -1,118 +1,125 @@
 <template>
 <template>
-    <a-card :bordered="false">
-        <s-table
-            ref="table"
-            :columns="columns"
-            :data="loadData"
-            :alert="options.alert.show"
-            bordered
-            :row-key="(record) => record.recordId"
-            :tool-config="toolConfig"
-            :row-selection="options.rowSelection"
-        >
-            <template #operator class="table-operator">
-                <a-space>
-                    <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('forumSensitivityRecordAdd')">
-                        <template #icon><plus-outlined /></template>
-                        新增
-                    </a-button>
-                    <xn-batch-delete
-                        v-if="hasPerm('forumSensitivityRecordBatchDelete')"
-                        :selectedRowKeys="selectedRowKeys"
-                        @batchDelete="deleteBatchForumSensitivityRecord"
-                    />
-                </a-space>
-            </template>
-            <template #bodyCell="{ column, record }">
-                <template v-if="column.dataIndex === 'action'">
-                    <a-space>
-                        <a @click="formRef.onOpen(record)" v-if="hasPerm('forumSensitivityRecordEdit')">编辑</a>
-                        <a-divider type="vertical" v-if="hasPerm(['forumSensitivityRecordEdit', 'forumSensitivityRecordDelete'], 'and')" />
-                        <a-popconfirm title="确定要删除吗?" @confirm="deleteForumSensitivityRecord(record)">
-                            <a-button type="link" danger size="small" v-if="hasPerm('forumSensitivityRecordDelete')">删除</a-button>
-                        </a-popconfirm>
-                    </a-space>
-                </template>
-            </template>
-        </s-table>
-    </a-card>
-    <Form ref="formRef" @successful="table.refresh(true)" />
+	<a-card :bordered="false">
+		<s-table
+			ref="table"
+			:columns="columns"
+			:data="loadData"
+			:alert="options.alert.show"
+			bordered
+			:row-key="(record) => record.recordId"
+			:tool-config="toolConfig"
+			:row-selection="options.rowSelection"
+		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('forumSensitivityRecordAdd')">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+					<xn-batch-delete
+						v-if="hasPerm('forumSensitivityRecordBatchDelete')"
+						:selectedRowKeys="selectedRowKeys"
+						@batchDelete="deleteBatchForumSensitivityRecord"
+					/>
+				</a-space>
+			</template>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a @click="formRef.onOpen(record)" v-if="hasPerm('forumSensitivityRecordEdit')">编辑</a>
+						<a-divider
+							type="vertical"
+							v-if="hasPerm(['forumSensitivityRecordEdit', 'forumSensitivityRecordDelete'], 'and')"
+						/>
+						<a-popconfirm title="确定要删除吗?" @confirm="deleteForumSensitivityRecord(record)">
+							<a-button type="link" danger size="small" v-if="hasPerm('forumSensitivityRecordDelete')">删除</a-button>
+						</a-popconfirm>
+					</a-space>
+				</template>
+				<template v-if="column.dataIndex === 'recordType'">
+					<div v-if="record.recordType == 0">发帖</div>
+					<div v-if="record.recordType == 1">回复</div>
+				</template>
+			</template>
+		</s-table>
+	</a-card>
+	<Form ref="formRef" @successful="table.refresh(true)" />
 </template>
 </template>
 
 
 <script setup name="sensitivityrecord">
 <script setup name="sensitivityrecord">
-    import Form from './form.vue'
-    import forumSensitivityRecordApi from '@/api/forum/forumSensitivityRecordApi'
-    const table = ref()
-    const formRef = ref()
-    const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
-    const columns = [
-        {
-            title: '过滤词语',
-            dataIndex: 'sensitivityWord'
-        },
-        {
-            title: '帖子id',
-            dataIndex: 'postId'
-        },
-        {
-            title: '过滤类型 0发帖 1回复',
-            dataIndex: 'recordType'
-        },
-        {
-            title: '用户id',
-            dataIndex: 'userId'
-        },
-    ]
-    // 操作栏通过权限判断是否显示
-    if (hasPerm(['forumSensitivityRecordEdit', 'forumSensitivityRecordDelete'])) {
-        columns.push({
-            title: '操作',
-            dataIndex: 'action',
-            align: 'center',
-            width: '150px'
-        })
-    }
-    const selectedRowKeys = ref([])
-    // 列表选择配置
-    const options = {
-        // columns数字类型字段加入 needTotal: true 可以勾选自动算账
-        alert: {
-            show: true,
-            clear: () => {
-                selectedRowKeys.value = ref([])
-            }
-        },
-        rowSelection: {
-            onChange: (selectedRowKey, selectedRows) => {
-                selectedRowKeys.value = selectedRowKey
-            }
-        }
-    }
-    const loadData = (parameter) => {
-        return forumSensitivityRecordApi.forumSensitivityRecordPage(parameter).then((data) => {
-            return data
-        })
-    }
-    // 重置
-    const reset = () => {
-        searchFormRef.value.resetFields()
-        table.value.refresh(true)
-    }
-    // 删除
-    const deleteForumSensitivityRecord = (record) => {
-        let params = [
-            {
-                recordId: record.recordId
-            }
-        ]
-        forumSensitivityRecordApi.forumSensitivityRecordDelete(params).then(() => {
-            table.value.refresh(true)
-        })
-    }
-    // 批量删除
-    const deleteBatchForumSensitivityRecord = (params) => {
-        forumSensitivityRecordApi.forumSensitivityRecordDelete(params).then(() => {
-            table.value.clearRefreshSelected()
-        })
-    }
+	import Form from './form.vue'
+	import forumSensitivityRecordApi from '@/api/forum/forumSensitivityRecordApi'
+	const table = ref()
+	const formRef = ref()
+	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
+	const columns = [
+		{
+			title: '过滤词语',
+			dataIndex: 'sensitivityWord'
+		},
+		{
+			title: '帖子',
+			dataIndex: 'postTitle'
+		},
+		{
+			title: '过滤类型',
+			dataIndex: 'recordType'
+		},
+		{
+			title: '用户',
+			dataIndex: 'userNickname'
+		}
+	]
+	// 操作栏通过权限判断是否显示
+	if (hasPerm(['forumSensitivityRecordEdit', 'forumSensitivityRecordDelete'])) {
+		columns.push({
+			title: '操作',
+			dataIndex: 'action',
+			align: 'center',
+			width: '150px'
+		})
+	}
+	const selectedRowKeys = ref([])
+	// 列表选择配置
+	const options = {
+		// columns数字类型字段加入 needTotal: true 可以勾选自动算账
+		alert: {
+			show: true,
+			clear: () => {
+				selectedRowKeys.value = ref([])
+			}
+		},
+		rowSelection: {
+			onChange: (selectedRowKey, selectedRows) => {
+				selectedRowKeys.value = selectedRowKey
+			}
+		}
+	}
+	const loadData = (parameter) => {
+		return forumSensitivityRecordApi.forumSensitivityRecordPage(parameter).then((data) => {
+			return data
+		})
+	}
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
+		table.value.refresh(true)
+	}
+	// 删除
+	const deleteForumSensitivityRecord = (record) => {
+		let params = [
+			{
+				recordId: record.recordId
+			}
+		]
+		forumSensitivityRecordApi.forumSensitivityRecordDelete(params).then(() => {
+			table.value.refresh(true)
+		})
+	}
+	// 批量删除
+	const deleteBatchForumSensitivityRecord = (params) => {
+		forumSensitivityRecordApi.forumSensitivityRecordDelete(params).then(() => {
+			table.value.clearRefreshSelected()
+		})
+	}
 </script>
 </script>