对接问题反馈接口
This commit is contained in:
parent
8047298f59
commit
dc0df3c420
44
src/api/problemFeedback.js
Normal file
44
src/api/problemFeedback.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取问题反馈列表
|
||||
export function busProblemFeedbackPage(query) {
|
||||
return request({
|
||||
url: '/admin/busProblemFeedback/getBusProblemFeedbackPage',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增问题
|
||||
export function addSysReaddBusProblemFeedbackgion(data) {
|
||||
return request({
|
||||
url: '/admin/busProblemFeedback/addBusProblemFeedback',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改问题
|
||||
export function updateBusProblemFeedback(data) {
|
||||
return request({
|
||||
url: '/admin/busProblemFeedback/updateBusProblemFeedback',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取问题详情
|
||||
export function getBusProblemFeedback(feedbackId) {
|
||||
return request({
|
||||
url: '/admin/busProblemFeedback/getBusProblemFeedback/' + feedbackId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除问题
|
||||
export function deleteBusProblemFeedback(feedbackId) {
|
||||
return request({
|
||||
url: '/admin/busProblemFeedback/deleteBusProblemFeedback/' + feedbackId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
|
@ -1161,6 +1161,28 @@ h6 {
|
|||
// min-width: 34px;
|
||||
}
|
||||
|
||||
.myFeedBackForm .el-input__inner {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #525252;
|
||||
}
|
||||
|
||||
.myFeedBackForm .el-input__clear {
|
||||
color: #B8B8B8;
|
||||
}
|
||||
|
||||
.myFeedBackForm .el-input__clear:hover {
|
||||
color: #B8B8B8;
|
||||
}
|
||||
|
||||
.myFeedBackForm .el-input__inner::placeholder {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #B8B8B8;
|
||||
}
|
||||
|
||||
.myFeedBackForm .el-textarea__inner {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
|
|
|
@ -39,8 +39,11 @@
|
|||
:destroy-on-close="true" :close-on-click-modal="false">
|
||||
<el-form ref="feedBackRef" :model="form" :rules="rules" label-width="120px" label-position="top"
|
||||
class="myFeedBackForm">
|
||||
<el-form-item label="输入反馈内容" prop="menuName">
|
||||
<el-input v-model="form.menuName" style="width: 100%" :rows="12" type="textarea"
|
||||
<el-form-item label="反馈人" prop="feedbackUser">
|
||||
<el-input v-model="form.feedbackUser" placeholder="请输入反馈人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="输入反馈内容" prop="content">
|
||||
<el-input v-model="form.content" style="width: 100%" :rows="12" type="textarea"
|
||||
placeholder="欢迎提出您在使用过程中遇到的问题或宝贵建议" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -64,6 +67,7 @@ import TopNav from '@/components/TopNav'
|
|||
import useAppStore from '@/store/modules/app'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useSettingsStore from '@/store/modules/settings'
|
||||
import { addSysReaddBusProblemFeedbackgion } from "@/api/problemFeedback"
|
||||
|
||||
const appStore = useAppStore()
|
||||
const userStore = useUserStore()
|
||||
|
@ -103,11 +107,11 @@ const openFeedBack = ref(false)
|
|||
const data = reactive({
|
||||
form: {},
|
||||
rules: {
|
||||
menuName: [{ required: true, message: "反馈内容不能为空", trigger: "blur" }]
|
||||
content: [{ required: true, message: "反馈内容不能为空", trigger: "blur" }]
|
||||
},
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
const { form, rules } = toRefs(data)
|
||||
const handleFeedBack = () => {
|
||||
openFeedBack.value = true
|
||||
}
|
||||
|
@ -118,12 +122,15 @@ const cancel = () => {
|
|||
const submitForm = () => {
|
||||
proxy.$refs["feedBackRef"].validate(valid => {
|
||||
if (valid) {
|
||||
openFeedBack.value = false
|
||||
// addMenu(form.value).then(response => {
|
||||
// proxy.$modal.msgSuccess("新增成功")
|
||||
// open.value = false
|
||||
// getList()
|
||||
// })
|
||||
addSysReaddBusProblemFeedbackgion(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("反馈成功")
|
||||
openFeedBack.value = false
|
||||
form.value = {
|
||||
feedbackUser: undefined,
|
||||
content: undefined
|
||||
}
|
||||
proxy.resetForm("feedBackRef")
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
<div class="searchPanel">
|
||||
<el-form :inline="true" v-show="showSearch" class="searchPanelForm">
|
||||
<el-form-item label="反馈时间:" prop="postName" style="width: 330px">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
<el-date-picker v-model="dateRange" @change="handleDateChange" value-format="YYYY-MM-DD"
|
||||
type="daterange" range-separator="-" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
@ -13,7 +14,7 @@
|
|||
<el-col :span="12">
|
||||
<el-form :inline="true" class="searchInputForm">
|
||||
<el-form-item label="">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入反馈人" :prefix-icon="Search"
|
||||
<el-input v-model="queryParams.feedbackUser" placeholder="请输入反馈人" :prefix-icon="Search"
|
||||
style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -32,8 +33,8 @@
|
|||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="反馈内容" align="center" prop="postId" />
|
||||
<el-table-column label="反馈人" align="center" prop="postCode" width="150" />
|
||||
<el-table-column label="反馈内容" align="center" prop="content" />
|
||||
<el-table-column label="反馈人" align="center" prop="feedbackUser" width="150" />
|
||||
<el-table-column label="反馈时间" align="center" prop="createTime" width="210">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
|
@ -49,86 +50,133 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<pagination :total="total" v-model:page="queryParams.pageIndex" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getBusProblemFeedbackPage" />
|
||||
</el-card>
|
||||
|
||||
<!-- 添加反馈对话框 -->
|
||||
<el-dialog title="修改问题反馈" v-model="open" width="800px" align-center class="my_dialog" append-to-body
|
||||
:destroy-on-close="true" :close-on-click-modal="false">
|
||||
<el-form ref="feedBackRef" :model="form" :rules="rules" label-width="120px" label-position="top"
|
||||
class="myFeedBackForm">
|
||||
<el-form-item label="反馈人" prop="feedbackUser">
|
||||
<el-input v-model="form.feedbackUser" placeholder="请输入反馈人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="输入反馈内容" prop="content">
|
||||
<el-input v-model="form.content" style="width: 100%" :rows="12" type="textarea"
|
||||
placeholder="欢迎提出您在使用过程中遇到的问题或宝贵建议" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button class="my-cancel-btn" @click="cancel">取 消</el-button>
|
||||
<el-button class="my-confirm-btn" type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Post">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { listPost, addPost, delPost, getPost, updatePost } from "@/api/system/post"
|
||||
import { busProblemFeedbackPage, updateBusProblemFeedback, getBusProblemFeedback, deleteBusProblemFeedback } from "@/api/problemFeedback"
|
||||
import { useBackgroundStore } from '@/store/modules/background'
|
||||
import otherbg from '@/assets/images/otherbg.png'
|
||||
const bgStore = useBackgroundStore()
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable")
|
||||
|
||||
const postList = ref([])
|
||||
const feedbackList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref("")
|
||||
const dateRange = ref([])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
postCode: undefined,
|
||||
postName: undefined,
|
||||
status: undefined
|
||||
feedbackUser: undefined,
|
||||
startDate: undefined,
|
||||
endDate: undefined
|
||||
},
|
||||
rules: {
|
||||
postName: [{ required: true, message: "岗位名称不能为空", trigger: "blur" }],
|
||||
postCode: [{ required: true, message: "岗位编码不能为空", trigger: "blur" }],
|
||||
postSort: [{ required: true, message: "岗位顺序不能为空", trigger: "blur" }],
|
||||
content: [{ required: true, message: "反馈内容不能为空", trigger: "blur" }]
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询岗位列表 */
|
||||
function getList() {
|
||||
// 处理日期变化
|
||||
const handleDateChange = (val) => {
|
||||
dateRange.value = val;
|
||||
queryParams.value.startDate = val[0]
|
||||
queryParams.value.endDate = val[1]
|
||||
};
|
||||
/** 查询反馈问题列表 */
|
||||
const getBusProblemFeedbackPage = () => {
|
||||
loading.value = true
|
||||
listPost(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
||||
postList.value = response.rows
|
||||
busProblemFeedbackPage(queryParams.value).then(response => {
|
||||
feedbackList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageIndex = 1
|
||||
getBusProblemFeedbackPage()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
const resetQuery = () => {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
postCode: undefined,
|
||||
postName: undefined,
|
||||
status: undefined
|
||||
feedbackUser: undefined,
|
||||
startDate: undefined,
|
||||
endDate: undefined
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 修改问题
|
||||
const handleUpdate = (row) => {
|
||||
form.value = {
|
||||
feedbackUser: undefined,
|
||||
content: undefined
|
||||
}
|
||||
getBusProblemFeedback(row.id).then(res => {
|
||||
form.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const cancel = () => {
|
||||
open.value = false
|
||||
form.value = {}
|
||||
}
|
||||
const submitForm = () => {
|
||||
proxy.$refs["feedBackRef"].validate(valid => {
|
||||
if (valid) {
|
||||
updateBusProblemFeedback(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
form.value = {}
|
||||
proxy.resetForm("feedBackRef")
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const postIds = row.postId || ids.value
|
||||
proxy.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function () {
|
||||
return delPost(postIds)
|
||||
const handleDelete = (row) => {
|
||||
proxy.$modal.confirm('是否确认删除该问题吗?').then(function () {
|
||||
return deleteBusProblemFeedback(row.id)
|
||||
}).then(() => {
|
||||
getList()
|
||||
getBusProblemFeedbackPage()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
@ -136,6 +184,6 @@ function handleDelete(row) {
|
|||
// 初始化
|
||||
onMounted(() => {
|
||||
bgStore.setBgImage(otherbg)
|
||||
getList()
|
||||
getBusProblemFeedbackPage()
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user