王钦
6 months ago
10 changed files with 572 additions and 36 deletions
@ -0,0 +1,74 @@ |
|||
// import * as PresetFormItems from "@screen/pages/control/event/event/FormEvent/PresetFormItems.js";
|
|||
import * as PresetFormItems from "@screen/common/PresetFormItems.js"; |
|||
// import { merge, cloneDeep } from "lodash";
|
|||
|
|||
export const searchFormList = [ |
|||
{ |
|||
label: "发布渠道:", |
|||
key: "publishChannels", |
|||
type: "select", |
|||
options: { |
|||
clearable: true, |
|||
options: [ |
|||
{ |
|||
key: "1", |
|||
label: "手机短信", |
|||
}, |
|||
{ |
|||
key: "2", |
|||
label: "微信公众号", |
|||
}, |
|||
{ |
|||
key: "3", |
|||
label: "微博", |
|||
}, |
|||
{ |
|||
key: "4", |
|||
label: "情报板", |
|||
}, |
|||
{ |
|||
key: "5", |
|||
label: "服务网站", |
|||
}, |
|||
{ |
|||
key: "6", |
|||
label: "微信小程序", |
|||
}, |
|||
{ |
|||
key: "7", |
|||
label: "语音广播", |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
label: "时间范围:", |
|||
key: "daterange", |
|||
required: false, |
|||
type: "datePicker", |
|||
options: { |
|||
type: "daterange", |
|||
format: "yyyy-MM-dd HH:mm:ss", |
|||
valueFormat: "yyyy-MM-dd HH:mm:ss", |
|||
}, |
|||
}, |
|||
// PresetFormItems.directionCreater("RadioGroup"),
|
|||
{ |
|||
label: "发布状态:", |
|||
key: "publishStatus", |
|||
type: "RadioGroup", |
|||
default: null, |
|||
options: { |
|||
options: [ |
|||
{ |
|||
key: '1', |
|||
label: "成功", |
|||
}, |
|||
{ |
|||
key: '2', |
|||
label: "失败", |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
]; |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 3.1 KiB |
@ -0,0 +1,262 @@ |
|||
<template> |
|||
<div class='board_record'> |
|||
<!-- 搜索栏 --> |
|||
<div class="filter"> |
|||
<div> |
|||
<ButtonGradient @click="onExport"> |
|||
<template #prefix> |
|||
<img src="@screen/images/export.svg" /> |
|||
</template> |
|||
导出 |
|||
</ButtonGradient> |
|||
<ButtonGradient @click="onRefreshForm" class="refresh-btn"> |
|||
<template #prefix> |
|||
<img src="./images/refresh.svg" /> |
|||
</template> |
|||
刷新 |
|||
</ButtonGradient> |
|||
</div> |
|||
<InputSearch ref="searchComp" style="width: 480px" :formList="searchFormList" |
|||
:formConfigOptions="{ dFormData: { eventState: '0' } }" @handleSearch="handleSearch" /> |
|||
</div> |
|||
<!-- 内容 --> |
|||
<Table :data="tableData" height="100%" style="width:500"> |
|||
<el-table-column label="序号" type="index" :index="indexMethod" width="100" align="center" |
|||
header-align="center" /> |
|||
|
|||
<ElTableColumn label="发布渠道" prop="publishChannels" width="120" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
{{ enum_channels[scope.row.publishChannels-1] }} |
|||
</template> |
|||
</ElTableColumn> |
|||
<ElTableColumn label="发布时间" prop="publishTime" align="center" width="200" header-align="center" /> |
|||
<ElTableColumn label="位置/设备" prop="position" align="center" width="200" header-align="center" /> |
|||
<ElTableColumn label="发布内容" prop="contentDetails" align="center" header-align="center" /> |
|||
<ElTableColumn label="发布人" prop="publisher" width="120" align="center" header-align="center" /> |
|||
<ElTableColumn label="操作" prop="status" width="100" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<i class="el-icon-delete" style="font-size: 12px; color:#ff0000;" @click="onDelete(scope.row.id)"></i> |
|||
</template> |
|||
</ElTableColumn> |
|||
</Table> |
|||
|
|||
<!-- 分页 --> |
|||
<div class="footer"> |
|||
<Pagination @current-change="initData" @size-change="onSizeChange" width="'100%'" |
|||
:page-sizes="[10, 20, 30, 40, 50]" :page-size="searchData.pageSize" :current-page.sync="searchData.pageNum" |
|||
layout="total, sizes, prev, pager, next" :total="total"> |
|||
</Pagination> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; |
|||
import Pagination from '@screen/components/Pagination.vue'; |
|||
import Table from '@screen/components/Table.vue'; |
|||
import request from "@/utils/request"; |
|||
import BoardRecordPreview from '@screen/components/infoBoard/BoardRecordPreview.vue' |
|||
import {DirectionTypes} from '@screen/utils/enum.js'; |
|||
import InputSearch from "@screen/components/InputSearch/index.vue"; |
|||
import { searchFormList } from "./data"; |
|||
import moment from "moment"; |
|||
import { Loading } from 'element-ui'; |
|||
|
|||
export default { |
|||
name: 'boardRecord', |
|||
components: { |
|||
ButtonGradient, |
|||
Pagination, |
|||
Table, |
|||
BoardRecordPreview, |
|||
InputSearch |
|||
}, |
|||
data() { |
|||
return { |
|||
DirectionTypes, |
|||
moment, |
|||
enum_channels: [ |
|||
'手机短信', |
|||
'微信公众号', |
|||
'微博', |
|||
'情报板', |
|||
'服务网站', |
|||
'微信小程序', |
|||
'语音广播' |
|||
], |
|||
tableData: [], |
|||
searchFormList, |
|||
isShowPhrases: false, |
|||
isShowDisposal: false, |
|||
total: 20, |
|||
eventType: 1, |
|||
searchData: { |
|||
pageSize: 20, |
|||
pageNum: 1 |
|||
}, |
|||
phrasesData: [], |
|||
process: [] |
|||
} |
|||
}, |
|||
created() { |
|||
this.initData(); |
|||
}, |
|||
methods: { |
|||
onRefreshForm(){ |
|||
this.searchData.pageNum = 1; |
|||
this.$refs.searchComp.handleResetForm(); |
|||
}, |
|||
onDelete(id){ |
|||
const self = this; |
|||
this.$confirm("是否删除?"+id, "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(function () { |
|||
request({ |
|||
url: `/business/manage/`+id, |
|||
method: "DELETE", |
|||
data: {}, |
|||
}).then((result) => { |
|||
console.log(result) |
|||
if (result.code != 200) return self.$message.error(result?.msg); |
|||
self.$message.success('删除成功'); |
|||
self.initData(); |
|||
}); |
|||
}) |
|||
}, |
|||
onExport(){ |
|||
const self = this; |
|||
this.$confirm("是否确认导出共计查询内容?", "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(function () { |
|||
let loadingInstance = Loading.service({ |
|||
fullscreen: true, |
|||
background: "#00000052", |
|||
text: "文件正在下载...", |
|||
}); |
|||
request({ |
|||
url: `/business/manage/export`, |
|||
method: "post", |
|||
data: self.searchData, |
|||
responseType: 'blob', |
|||
}).then((res) => { |
|||
console.log(res) |
|||
|
|||
const url = window.URL.createObjectURL(new Blob([res])); |
|||
let link = document.createElement("a"); |
|||
link.style.display = "none"; |
|||
link.href = url; |
|||
link.setAttribute("download", "事件信息列表.xlsx"); |
|||
document.body.appendChild(link); |
|||
link.click(); |
|||
URL.revokeObjectURL(link.href); // 释放URL 对象 |
|||
document.body.removeChild(link); |
|||
link = null; |
|||
loadingInstance.close(); |
|||
}) |
|||
.catch((err) => { |
|||
self.$message.error(err); |
|||
loadingInstance.close(); |
|||
}); |
|||
}) |
|||
}, |
|||
handleSearch(data) { |
|||
let daterange = data.daterange; |
|||
|
|||
let _searchData = { |
|||
pageSize: 20, |
|||
pageNum: 1 |
|||
} |
|||
if(daterange && daterange.length > 0){ |
|||
_searchData.startTime = daterange[0]; |
|||
_searchData.endTime = daterange[1]; |
|||
} |
|||
if(data.publishChannels){ |
|||
_searchData.publishChannels = data.publishChannels |
|||
} |
|||
if(data.publishStatus){ |
|||
_searchData.publishStatus = data.publishStatus |
|||
} |
|||
this.searchData = _searchData; |
|||
this.initData(); |
|||
}, |
|||
indexMethod(index) { |
|||
return this.searchData.pageSize*(this.searchData.pageNum-1) + index + 1; |
|||
}, |
|||
formatterDirection(row, column) { |
|||
return DirectionTypes[row.direction]; |
|||
}, |
|||
initData() { |
|||
request({ |
|||
url: `/business/manage/statisticsList`, |
|||
method: "post", |
|||
data: this.searchData, |
|||
}).then((result) => { |
|||
if (result.code != 200) return Message.error(result?.msg); |
|||
this.tableData = result.rows; |
|||
this.total = result.total; |
|||
}); |
|||
}, |
|||
|
|||
onSizeChange(pageSize) { |
|||
this.tableData = []; |
|||
this.searchData.pageSize = pageSize; |
|||
this.searchData.pageNum = 1; |
|||
this.initData(); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
.board_record { |
|||
padding: 0 14px 14px; |
|||
width:100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.filter { |
|||
height: 60px; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
|
|||
>div { |
|||
display: flex; |
|||
gap: 6px; |
|||
} |
|||
} |
|||
|
|||
.body { |
|||
flex:1; |
|||
height: 0; |
|||
} |
|||
|
|||
.footer { |
|||
margin-top: 15px; |
|||
height: 36px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.board_shower{ |
|||
margin: 4px; |
|||
} |
|||
::v-deep .el-carousel__indicators--horizontal{ |
|||
line-height: 0; height: 16px; |
|||
.el-carousel__indicator--horizontal{ |
|||
padding: 7px 4px; |
|||
} |
|||
} |
|||
::v-deep .el-table__cell div.cell { |
|||
padding: 0 10px !important; |
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue