Compare commits
2 Commits
luckyTycoo
...
feedback
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ab3b8c2871 | ||
![]() |
3a39476782 |
21
src/api/feedBack/feedBack.js
Normal file
21
src/api/feedBack/feedBack.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from '@/utils/request';
|
||||
import qs from 'qs';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
|
||||
// ==================================每日数据====================================
|
||||
// 反馈类型
|
||||
export const listType = query => {
|
||||
return request({
|
||||
url: '/admin/feedback/listType',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 反馈列表
|
||||
export const pageRecord = query => {
|
||||
return request({
|
||||
url: '/admin/feedback/pageRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@@ -212,19 +212,12 @@ export default {
|
||||
this.childMenu.parentName = menu.parentstr;
|
||||
this.childMenu.description = menu.description;
|
||||
store.dispatch("getViewComponent", menu.path).then((componentName) => {
|
||||
console.log(componentName);
|
||||
this.componentName = componentName;
|
||||
const files = require.context("@/views", true, /\.vue$/);
|
||||
let components = {};
|
||||
files.keys().forEach((key) => {
|
||||
components[key.replace(/(\.\/|\.vue)/g, "")] = files(key).default;
|
||||
});
|
||||
Object.keys(components).forEach((item) => {
|
||||
if (components[item].name == componentName) {
|
||||
Vue.component(components[item].name, components[item]);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
search() {
|
||||
|
@@ -65,11 +65,11 @@
|
||||
{{ row.rewardGiftPrice || "/" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="该用户是否中奖">
|
||||
<!-- <el-table-column prop="x" align="center" label="该用户是否中奖">
|
||||
<template #default="{ row }">
|
||||
{{ row.x ? "是" : "否" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
|
205
src/views/users/FeedBack.vue
Normal file
205
src/views/users/FeedBack.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<!-- 时间选择器 -->
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<span class="demonstration">日期</span>
|
||||
<el-date-picker
|
||||
v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>反馈类型</span>
|
||||
<el-select filterable v-model="inquire.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.type"
|
||||
:label="JsonFunc(item.desc).zh"
|
||||
:value="item.type"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- 导出按钮 -->
|
||||
<el-button class="primary" type="primary" @click="derive()">导出</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="desc" align="center" label="问题描述" />
|
||||
<el-table-column prop="type" align="center" label="反馈类型">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.type == 1
|
||||
? "应用异常"
|
||||
: row.type == 2
|
||||
? "充值或收入"
|
||||
: row.type == 3
|
||||
? "账号申诉"
|
||||
: row.type == 4
|
||||
? "建议"
|
||||
: ""
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="giftInfo"
|
||||
label="反馈截图"
|
||||
width="120"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
v-if="scope.row.screenUrl"
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.screenUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.screenUrl"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
<div v-else>/</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contact" align="center" label="联系方式" />
|
||||
<el-table-column prop="createTime" align="center" label="生成时间" />
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listType, pageRecord } from "@/api/feedBack/feedBack";
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: "FeedBack",
|
||||
data() {
|
||||
return {
|
||||
inquire: {
|
||||
giftId: "",
|
||||
userId: "",
|
||||
time: "",
|
||||
value: "",
|
||||
options: [],
|
||||
},
|
||||
loading: false,
|
||||
// 表格数据
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listType().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
});
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.loading = true;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if (this.inquire.time && this.inquire.time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
pageRecord({
|
||||
startTime,
|
||||
endTime,
|
||||
type: this.inquire.value,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data.rows;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
JsonFunc(val) {
|
||||
var res = JSON.parse(val);
|
||||
return res;
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.currentPage = page;
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -1,128 +0,0 @@
|
||||
<template>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
用户uid: <input type="text" name="uid" id="uid" class="input-sm">
|
||||
选择时间: <input type="text" name="beginDate" id="beginDate" class="input-sm">
|
||||
至 <input type="endDate" id="endDate" class="input-sm">
|
||||
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "FeedbackAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'uid', title: '用户uid', align: 'center', width: '10%' },
|
||||
{
|
||||
field: 'feedbackDesc', title: '反馈信息', align: 'center', width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
return val ? val.replace('<', '《').replace('>', '》') : '';
|
||||
}
|
||||
},
|
||||
{ field: 'imgUrl', title: '反馈截图', align: 'center', width: '10%' },
|
||||
{ field: 'contact', title: '摘要', align: 'center', width: '10%' },
|
||||
{
|
||||
field: 'createTime', title: '生成时间', align: 'center',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageSize: params.pageSize,
|
||||
pageNum: params.pageNumber,
|
||||
uid: $('#uid').val(),
|
||||
beginDate: $('#beginDate').val(),
|
||||
endDate: $('#endDate').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'code',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/feedback/list',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
|
||||
})
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
})
|
||||
var picker1 = $("#beginDate").datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
startDate: "2016-01-01"
|
||||
});
|
||||
var picker2 = $("#endDate").datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true
|
||||
});
|
||||
picker1.on('changeDate', function () {
|
||||
var date = $('#beginDate').datepicker('getDate');
|
||||
picker2.datepicker('setStartDate', date);
|
||||
});
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#endDate').datepicker('getDate');
|
||||
picker1.datepicker('setEndDate', date);
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#btnSearch {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
#uid {
|
||||
margin-right: 4px;
|
||||
}</style>
|
Reference in New Issue
Block a user