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>
......
<template> <template>
<el-dialog <el-dialog
title="修改年度培训计划" title="修改年度培训计划"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" > <el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="分支机构名称:" prop="name"> <el-form-item label="分支机构名称:" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入显示标题" disabled></el-input> <el-input v-model="dataForm.name" placeholder="请输入显示标题" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上传附件:" prop="file" class="pic"> <el-form-item label="上传附件:" prop="file" class="pic">
<el-upload <el-upload
class="avatar-uploaderFile" class="avatar-uploaderFile"
action="" action=""
:show-file-list="false" :show-file-list="false"
:http-request="UploadFile" :http-request="UploadFile"
:before-upload="beforeUploadFile"> :before-upload="beforeUploadFile">
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
<span style="float:right;color:red;margin-left:100px;font-size:10px">*注意:上传附件为.xsl或.xlsx</span> <span style="float:right;color:red;margin-left:100px;font-size:10px">*注意:上传附件为.xsl或.xlsx</span>
</el-upload> </el-upload>
<a :href="dataForm.docfile" target="_blank">{{dataForm.docfile}}</a> <a :href="dataForm.docfile" target="_blank">{{dataForm.docfile}}</a>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" > <span slot="footer" class="dialog-footer" >
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
<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: {
Ueditor Ueditor
}, },
data () { data () {
return { return {
loading: false, loading: false,
visible: false, visible: false,
disabled: false, disabled: false,
dataForm: { dataForm: {
id: 0, id: 0,
name: '', name: '',
docfile: '' docfile: ''
}, },
fileUrl: new FormData(), fileUrl: new FormData(),
fileUrlStr: '' fileUrlStr: ''
} }
}, },
created () { created () {
}, },
mounted () { mounted () {
}, },
methods: { methods: {
init (id, name, ppth) { init (id, name, ppth) {
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
this.dataForm.name = name this.dataForm.name = name
this.dataForm.docfile = ppth this.dataForm.docfile = ppth
}, },
// 表单提交 // 表单提交
dataFormSubmit () { dataFormSubmit () {
if (this.dataForm.docfile === '') { if (this.dataForm.docfile === '') {
this.$message.error('请上传附件!') this.$message.error('请上传附件!')
return false return false
} }
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.loading = true this.loading = true
this.disabled = true this.disabled = true
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/planbranch/batchUpdateStatus`), url: this.$http.adornUrl(`/office/planbranch/batchUpdateStatus`),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'ids': [this.dataForm.id], 'ids': [this.dataForm.id],
'ppath': this.dataForm.docfile 'ppath': this.dataForm.docfile
}) })
}).then(({data}) => { }).then(({data}) => {
this.loading = false this.loading = false
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.disabled = false this.disabled = false
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
} }
}) })
}, },
clearInp () { clearInp () {
this.dataForm.docfile = '' this.dataForm.docfile = ''
this.dialogVisible = false this.dialogVisible = false
}, },
beforeUploadFile (file) { beforeUploadFile (file) {
const isLt100M = file.size / 1024 / 1024 < 10 const isLt100M = file.size / 1024 / 1024 < 10
var index = file.name.lastIndexOf('.') var index = file.name.lastIndexOf('.')
// 获取后缀 // 获取后缀
var ext = file.name.substr(index + 1).toLowerCase() var ext = file.name.substr(index + 1).toLowerCase()
// 输出结果 // 输出结果
var extarr = ['xlsx', 'xls'] var extarr = ['xlsx', 'xls']
if (extarr.indexOf(ext) === -1) { if (extarr.indexOf(ext) === -1) {
this.$message.error('上传文件只能是xlsx/xls格式!') this.$message.error('上传文件只能是xlsx/xls格式!')
return false return false
} }
if (!isLt100M) { if (!isLt100M) {
this.$message.error('上传文件大小不能超过100MB哦!') this.$message.error('上传文件大小不能超过100MB哦!')
return false return false
} }
if (file) { if (file) {
var windowURL = window.URL || window.webkitURL var windowURL = window.URL || window.webkitURL
this.fileUrlStr = windowURL.createObjectURL(file) this.fileUrlStr = windowURL.createObjectURL(file)
this.dialogVisible = true this.dialogVisible = true
this.fileUrl.append('file', file) this.fileUrl.append('file', file)
} }
}, },
UploadFile () { UploadFile () {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/file/uploadFile'), url: this.$http.adornUrl('/office/file/uploadFile'),
method: 'post', method: 'post',
data: this.fileUrl, data: this.fileUrl,
headers: { headers: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
} }
}) })
.then(res => { .then(res => {
console.log(res) console.log(res)
if (res.data.code === 500) { if (res.data.code === 500) {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} else { } else {
this.dataForm.docfile = res.data.data this.dataForm.docfile = res.data.data
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
this.$message.error('上传失败') this.$message.error('上传失败')
}) })
} }
} }
} }
</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