feat(情报板发布日志前端页面):

This commit is contained in:
fuhao 2024-09-05 18:24:35 +08:00
parent a9782ded5a
commit a45eb8ad3b
No known key found for this signature in database
2 changed files with 204 additions and 0 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询发布日志记录列表
export function listReleaseLog(query) {
return request({
url: '/board/releaseLog/list',
method: 'get',
params: query
})
}
// 查询发布日志记录详细
export function getReleaseLog(id) {
return request({
url: '/board/releaseLog/' + id,
method: 'get'
})
}
// 新增发布日志记录
export function addReleaseLog(data) {
return request({
url: '/board/releaseLog',
method: 'post',
data: data
})
}
// 修改发布日志记录
export function updateReleaseLog(data) {
return request({
url: '/board/releaseLog',
method: 'put',
data: data
})
}
// 删除发布日志记录
export function delReleaseLog(id) {
return request({
url: '/board/releaseLog/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,160 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
<el-form-item label="操作人" prop="operator">
<el-input
v-model="queryParams.operator"
placeholder="请输入操作人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="情报板名称" prop="boardName">
<el-input
v-model="queryParams.boardName"
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="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['board:releaseLog:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['board:releaseLog:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="releaseLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="唯一编号" align="center" prop="id" />
<el-table-column label="操作人" align="center" prop="operator" />
<el-table-column label="情报板名称" align="center" prop="boardName" />
<el-table-column label="发布内容" align="center" prop="releaseContent" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['board:releaseLog: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"
/>
</div>
</template>
<script>
import {listReleaseLog, delReleaseLog,} from "@/api/board/releaseLog";
export default {
name: "ReleaseLog",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
releaseLogList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
operator: null,
boardId: null,
boardName: null,
releaseContent: null
},
};
},
created() {
this.getList();
},
methods: {
/** 查询发布日志记录列表 */
getList() {
this.loading = true;
listReleaseLog(this.queryParams).then(response => {
this.releaseLogList = 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
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除发布日志记录编号为"' + ids + '"的数据项?').then(function () {
return delReleaseLog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('board/releaseLog/export', {
...this.queryParams
}, `releaseLog_${new Date().getTime()}.xlsx`)
}
}
};
</script>