This commit is contained in:
张良(004796)
2024-03-19 16:28:01 +08:00
parent e165f78a1c
commit c4e43bd16d
8 changed files with 667 additions and 7 deletions

View File

@@ -0,0 +1,111 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名字" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="areaCodeList" @selection-change="handleSelectionChange">
<el-table-column label="行政区编码" align="center" prop="code"/>
<el-table-column label="名字" align="center" prop="name" />
<el-table-column label="级别" align="center" prop="level" >
<template v-slot="scope">
<cai-dict-tag :options="areaCodeLevelList" :value="scope.row.level"/>
</template>
</el-table-column>
<el-table-column label="上级编码" align="center" prop="pcode" />
<el-table-column label="上级名称" align="center" prop="pname" />
<el-table-column label="完整名字" align="center" prop="fullname" />
<el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listAreaCode } from '@/api/xq/areaCode'
import { areaCodeLevelList } from '@/constant/statusMap'
export default {
name: "AreaCode",
data() {
return {
areaCodeLevelList,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 行政区划表格数据
areaCodeList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
level: undefined,
pcode: undefined,
pname: undefined,
fullname: undefined,
longitude: undefined,
latitude: undefined
},
};
},
created() {
this.getList();
},
methods: {
/** 查询行政区划列表 */
getList() {
this.loading = true;
listAreaCode(this.queryParams).then(response => {
this.areaCodeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.code)
this.single = selection.length!==1
this.multiple = !selection.length
},
}
};
</script>

View File

@@ -0,0 +1,171 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="举报对象昵称" prop="reportNickname">
<el-input
v-model="queryParams.reportNickname"
placeholder="请输入举报对象昵称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="举报对象手机" prop="reportMobile">
<el-input
v-model="queryParams.reportMobile"
placeholder="请输入举报对象手机"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="举报对象编号" prop="reportUsercode">
<el-input
v-model="queryParams.reportUsercode"
placeholder="请输入举报对象编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="reportList" @selection-change="handleSelectionChange">
<el-table-column label="举报人" align="center" prop="user" >
<el-table-column label="用户编号" align="center" prop="usercode"/>
<el-table-column label="昵称" align="center" prop="nickname" show-overflow-tooltip/>
<el-table-column label="手机号" align="center" prop="mobile" width="100"/>
<el-table-column label="头像" align="center" prop="avatar">
<template v-slot="scope">
<image-avatar :src="scope.row.avatar"/>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="举报对象" align="center" prop="reportUser" >
<el-table-column label="用户编号" align="center" prop="reportUsercode"/>
<el-table-column label="昵称" align="center" prop="reportNickname" show-overflow-tooltip/>
<el-table-column label="手机号" align="center" prop="reportMobile" width="100"/>
<el-table-column label="头像" align="center" prop="reportAvatar">
<template v-slot="scope">
<image-avatar :src="scope.row.reportAvatar"/>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="举报分类" align="center" prop="cateName" />
<el-table-column label="举报内容" align="center" prop="content" />
<el-table-column label="举报照片" align="center" prop="contentImage">
<template v-slot="scope">
<span v-for='val in scope.row.contentImageArray'>
<image-preview :src="val" height="40px" width="40px" /> &nbsp;
</span>
</template>
</el-table-column>
<el-table-column label="状态 " align="center" prop="reportStatus" >
<template v-slot="scope">
<cai-dict-tag :options="reportStatusList" :value="scope.row.reportStatus"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button
size="mini"
type="text"
v-if="scope.row.reportStatus === 0"
@click="handleUpdate(scope.row)"
v-hasPermi="['xq:report:edit']"
>已处理</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { closeReport, listReport } from '@/api/xq/report'
import { reportStatusList } from '@/constant/statusMap'
export default {
name: "Report",
data() {
return {
reportStatusList,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 举报表格数据
reportList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
reportNickname: undefined,
reportUsercode: undefined,
reportMobile: undefined,
},
};
},
created() {
this.getList();
},
methods: {
/** 查询举报列表 */
getList() {
this.loading = true;
listReport(this.queryParams).then(response => {
let rows = response.rows
for (let index in rows){
rows[index].contentImageArray = rows[index].contentImage ? rows[index].contentImage.split(",") : [];
}
this.reportList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
handleUpdate(row) {
this.loading = true;
closeReport({ "id":row.id }).then(response => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("处理成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});;
},
}
};
</script>

View File

@@ -0,0 +1,248 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="举报名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['xq:reportCate:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['xq:reportCate:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['xq:reportCate:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="reportCateList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id"/>
<el-table-column label="举报名称" align="center" prop="name" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['xq:reportCate:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['xq:reportCate:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改举报类型管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="举报名称" prop="name">
<el-input v-model="form.name" placeholder="请输入" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listReportCate, getReportCate, delReportCate, addReportCate, updateReportCate } from "@/api/xq/reportCate";
export default {
name: "ReportCate",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 举报类型管理表格数据
reportCateList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
name: [
{ required: true, message: "不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询举报类型管理列表 */
getList() {
this.loading = true;
listReportCate(this.queryParams).then(response => {
this.reportCateList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: undefined,
name: undefined,
createTime: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加举报类型管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getReportCate(id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改举报类型管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateReportCate(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addReportCate(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除举报类型管理编号为"' + ids + '"的数据项?').then(() => {
this.loading = true;
return delReportCate(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
}
};
</script>