Commit 9e541592 by Lyan

数据报表提交

parent 4cff3665
<template>
<el-dialog
title="点击数详情信息"
:close-on-click-modal="false"
:fullscreen="dialogFull"
:visible.sync="visible">
<template slot="title">
<div class="avue-crud__dialog__header">
<span class="el-dialog__title">
<span ></span>
点击数详情信息
</span>
<div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
<i class="el-icon-full-screen"></i>
</div>
</div>
</template>
<div style="width: 100%; ">
<table class="table_cnt" aria-colspan="0">
<tr>
<td>标题</td>
<td>{{ formInfo.title}}</td>
</tr>
<tr>
<td>编辑</td>
<td>{{ formInfo.editor }}</td>
</tr>
<tr>
<td>更新时间</td>
<td>{{ formInfo.updatedate }}</td>
</tr>
<tr>
<td>类别</td>
<td>{{ formInfo.typeValue }}</td>
</tr>
<tr>
<td>点击数</td>
<td>{{ formInfo.countNum }}</td>
</tr>
</table>
</div>
<div v-loading="loading">
<el-table
:data="dataList"
border
style="width: 100%;">
<el-table-column
header-align="center"
prop="clickTime"
align="center"
label="时间">
</el-table-column>
<el-table-column
prop="clientIp"
header-align="center"
align="center"
label="IP地址">
</el-table-column>
<el-table-column
prop="clientOs"
header-align="center"
align="center"
label="操作系统">
</el-table-column>
<el-table-column
prop="clientBrowser"
header-align="center"
align="center"
label="浏览器">
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</el-dialog>
</template>
<script>
import Ueditor from '../temps/ueditor'
export default {
components: {
Ueditor
},
data () {
return {
dialogFull: false,
loading: false,
visible: false,
disabled: false,
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
formInfo:{}
}
},
created () {
},
mounted () {
},
methods: {
init(item) {
this.formInfo=item
this.cId = item.id || 0
this.visible = true
this.typeValue = item.typeValue
console.log(item)
this.getClickDetailList()
},
// 表单提交
getClickDetailList () {
this.loading = true
this.disabled = true
this.$http({
url: this.$http.adornUrl(`/office/clickDetail/getClickDetailList`),
method: 'post',
data: this.$http.adornData({
'cId': this.cId,
'typeValue': this.typeValue,
"page": this.pageIndex,
"limit": this.pageSize
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.$message.error(data.msg)
this.dataList = []
this.totalPage = 0
}
this.loading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getClickDetailList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getClickDetailList()
},
}
}
</script>
<style scoped>
.table_cnt{
width: 100%;
border-collapse: collapse;
margin-bottom: 30px;
}
.table_cnt tr td{
line-height: 36px;
border: 1px solid #ebeef5;
padding-left: 20px;
}
.table_cnt tr td:first-child{
width: 30%;
text-align: right;
font-weight: 800;padding-right:20px;
color: #333;
}
</style>
\ No newline at end of file
<template>
<div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="120px">
<el-form-item label='分类' prop='typeValue'>
<el-select v-model="dataForm.typeValue" placeholder="请选择分类" clearable size="small">
<el-option
v-for="item in stateList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label='关键字' prop='keyWord'>
<el-input v-model='dataForm.keyWord' placeholder='请输入关键字' clearable size="small"></el-input>
</el-form-item>
<el-form-item label='' prop='keyWordType'>
<el-select v-model="dataForm.keyWordType" placeholder="请选择" clearable size="small">
<el-option
v-for="item in keyWordTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-checkbox v-model="dataForm.order" style="line-height: 36px;" size="small">排序</el-checkbox>
</el-form-item>
<el-form-item label='发布日期' prop='releaseDate'>
<el-date-picker
clearable
v-model="releaseDate"
size="small"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss" >
</el-date-picker>
</el-form-item>
<el-button class="seach-btn" @click="getDataList2()" type="primary" size="small">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button v-loading="loadingDownload" type="primary" @click="exportExcel()" size="small">下载所有统计数据</el-button>
</div>
<div class="table-list" v-loading="dataListLoading">
<el-table
:data="dataList"
border
style="width: 100%;">
<el-table-column
header-align="center"
prop="id"
align="center"
width="120px"
label="ID">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
width="300px"
label="标题">
<template slot-scope="scope">
<a :href="urlsJson[scope.row.title]" target="_blank">{{ scope.row.title}}</a>
</template>
</el-table-column>
<el-table-column
prop="typeName"
header-align="center"
align="center"
label="类别">
</el-table-column>
<el-table-column
prop="inputDate"
header-align="center"
align="center"
label="发布时间">
</el-table-column>
<el-table-column
prop="countNum"
header-align="center"
align="center"
label="点击数">
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click='details(scope.row)'>详细报告</el-button><br />
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from './dataInfo'
export default {
components: {
AddOrUpdate
},
data () {
return {
loadingDownload:false,
addOrUpdateVisible: false,
dataForm: {
keyword: '',
keyWordType: '',
typeValue: 1,
sidx: '',
order:false,
},
releaseDate: [],
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
exportName:'统计结果'+new Date().toLocaleString(),
stateList: [ //1 文章统计 2图片统计 3专题统计 4视频统计 5政策法规 6应用领域 7知识统计 9图书文献 12 公告统计
{
id: 1,
name: '文章统计'
},
{
id: 2,
name: '图片统计'
},
{
id: 3,
name: '专题统计'
},
{
id: 4,
name: '视频统计'
},
{
id: 5,
name: '政策法规'
},
{
id: 6,
name: '应用领域'
},
{
id: 7,
name: '知识统计'
},{
id: 9,
name: '图书文献'
},
{
id: 12,
name: '公告统计'
},
],
keyWordTypeList: [//1内容 2标题 3 id
{
id: 1,
name: '内容'
},
{
id: 2,
name: '标题'
},
{
id: 3,
name: 'id'
},
],
sidx: '',
urlsJson: {}
}
},
activated () {
this.getDataList()
},
methods: {
getDataList2 () {
this.pageIndex = 1
this.getDataList()
},
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/clickDetail/list'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'typeValue': this.dataForm.typeValue,
'keyWord': this.dataForm.keyWord,
'keyWordType': this.dataForm.keyWordType,
'order': this.dataForm.order?'desc':'',
'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1],
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
this.dataList.forEach(item => {
this.copyUrls(item)
})
} else {
this.$message.error(data.msg)
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
copyUrls (item) {
let ursStr = ''
// 获取token
this.$http({
url: this.$http.adornUrl('/office/token/getToken'),
method: 'post'
}).then(({data}) => {
if (data && data.code === 0) {
ursStr = `${item.jumpPath}&token=${data.data}`
this.$set(this.urlsJson, item.title, ursStr)
}
})
},
// 导出
exportExcel() {
this.loadingDownload=true
this.$http({
url: this.$http.adornUrl('/office/clickDetail/export'),
method: 'post',
responseType: 'blob',
data: this.$http.adornData({
'typeValue': this.dataForm.typeValue,
'keyWord': this.dataForm.keyWord,
'keyWordType': this.dataForm.keyWordType,
'order': this.dataForm.order?'desc':'',
'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1],
})
}).then(({data}) => {
const blobData = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
this.downFile(blobData, this.exportName)
this.loadingDownload=false
})
},
downFile(blob, fileName) {
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = fileName
link.click()
window.URL.revokeObjectURL(link.href)
},
splitStr(str){
return str.split('/')[str.split('/').length - 1]
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
details (row) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row)
})
},
}
}
</script>
\ No newline at end of file
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="栏目:" prop="classid"> <el-form-item label="栏目:" prop="classid" >
<el-select v-model="dataForm.classid" @change="getCclassList2" style='width:121px!important' clearable> <el-select v-model="dataForm.classid" @change="getCclassList2" style='width:121px!important' clearable size="small">
<el-option value="5" label="综合报道"></el-option> <el-option value="5" label="综合报道"></el-option>
<el-option value="6" label="中心活动"></el-option> <el-option value="6" label="中心活动"></el-option>
<el-option value="7" label="地方动态"></el-option> <el-option value="7" label="地方动态"></el-option>
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<el-button type="primary" @click="dataFormSubmit()" :disabled="disabled">确定</el-button> <el-button type="primary" @click="dataFormSubmit()" :disabled="disabled">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import Ueditor from '../temps/ueditor' import Ueditor from '../temps/ueditor'
export default { export default {
components: { components: {
...@@ -152,4 +152,5 @@ ...@@ -152,4 +152,5 @@
} }
} }
} }
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment