更新直播监控

master
飘泊客 9 months ago
parent 36ac429e01
commit 2072e6d0d2

@ -2,6 +2,7 @@ ENV = 'production'
# 生产环境
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
# VUE_APP_BASE_API = 'https://xx.tuoz.net'
VUE_APP_BASE_API = 'https://xx.tuoz.net'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://xx.tuoz.net'

@ -1,115 +1,117 @@
{
"name": "eladmin-web",
"version": "2.6.0",
"description": "拓众后台文件管理",
"author": "Zheng Jie",
"license": "Apache-2.0",
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"svgo": "svgo -f src/assets/icons/svg --config=src/assets/icons/svgo.yml",
"new": "plop"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/elunez/eladmin-web.git"
},
"bugs": {
"url": "https://github.com/elunez/eladmin/issues"
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "^5.49.2",
"connect": "3.6.6",
"echarts": "^4.2.1",
"echarts-gl": "^1.1.1",
"echarts-wordcloud": "^1.1.3",
"element-ui": "^2.13.2",
"file-saver": "1.3.8",
"fuse.js": "3.4.4",
"js-beautify": "^1.10.2",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"jszip": "3.1.5",
"mavon-editor": "^2.9.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"qs": "^6.9.1",
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
"vue": "2.6.10",
"vue-clipboard2": "^0.3.3",
"vue-count-to": "1.0.13",
"vue-cropper": "0.4.9",
"vue-echarts": "^5.0.0-beta.0",
"vue-highlightjs": "^1.3.3",
"vue-image-crop-upload": "^2.5.0",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"wangeditor": "^3.1.1",
"xlsx": "^0.14.1"
},
"devDependencies": {
"@babel/core": "7.0.0",
"@babel/parser": "^7.7.4",
"@babel/register": "7.0.0",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "^0.19.1",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"plop": "2.3.0",
"runjs": "^4.3.2",
"sass": "^1.26.10",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
{
"name": "eladmin-web",
"version": "2.6.0",
"description": "拓众后台文件管理",
"author": "Zheng Jie",
"license": "Apache-2.0",
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"svgo": "svgo -f src/assets/icons/svg --config=src/assets/icons/svgo.yml",
"new": "plop"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/elunez/eladmin-web.git"
},
"bugs": {
"url": "https://github.com/elunez/eladmin/issues"
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "^5.49.2",
"connect": "3.6.6",
"dayjs": "^1.11.10",
"echarts": "^4.2.1",
"echarts-gl": "^1.1.1",
"echarts-wordcloud": "^1.1.3",
"element-ui": "^2.13.2",
"file-saver": "1.3.8",
"fuse.js": "3.4.4",
"js-beautify": "^1.10.2",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"jszip": "3.1.5",
"mavon-editor": "^2.9.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"qs": "^6.9.1",
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
"vue": "2.6.10",
"vue-clipboard2": "^0.3.3",
"vue-count-to": "1.0.13",
"vue-cropper": "0.4.9",
"vue-echarts": "^5.0.0-beta.0",
"vue-highlightjs": "^1.3.3",
"vue-image-crop-upload": "^2.5.0",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"wangeditor": "^3.1.1",
"xlsx": "^0.14.1"
},
"devDependencies": {
"@babel/core": "7.0.0",
"@babel/parser": "^7.7.4",
"@babel/register": "7.0.0",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"core-js": "^3.34.0",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "^0.19.1",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"plop": "2.3.0",
"runjs": "^4.3.2",
"sass": "^1.26.10",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

@ -59,4 +59,36 @@ export function delRecord(data) {
data
})
}
export function uploadActivityFiles(data) {
return request({
url: '/api/uploadCallFile/upload/files',
method: 'post',
data
})
}
// 活动任务导出
export function uploadCallFileExport(params) {
return request({
url: '/api/uploadCallFile/export',
method: 'get',
params,
responseType: 'blob'
})
}
// 活动任务-折线图
export function queryActivityLine(data) {
return request({
url: '/api/uploadCallFile/query/number',
method: 'post',
data
})
}
// 活动导出-折现
export function uploadCallFileDownload(data) {
return request({
url: '/api/uploadCallFile/query/download',
method: 'post',
data,
responseType: 'blob'
})
}

@ -194,6 +194,9 @@ aside {
.ml-5 {
margin-left: 5px;
}
.mt-5 {
margin-bottom: 5px;
}
.mt-10 {
margin-bottom: 10px;
}

@ -0,0 +1,104 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
// const animationDuration = 6000
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
immediate: true,
handler(val) {
setTimeout(() => {
this.setOptions(val)
}, 300)
}
}
},
mounted() {
this.$nextTick(async() => {
this.initChart()
})
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
window.addEventListener('resize', this.__resizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
if (this.chartData.length > 0) {
this.setOptions(this.chartData)
}
},
setOptions({ xAxis, seriesArr } = {}) {
this.chart.setOption({
tooltip: {
trigger: 'axis'
},
legend: {
},
grid: {
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: xAxis,
axisTick: {
alignWithLabel: true
}
}],
yAxis: [{
type: 'value',
axisTick: {
show: false
}
}],
series: seriesArr
}, true)
}
}
}
</script>

@ -218,16 +218,15 @@
style="width: 160px"
class="filter-item"
/>
<el-select v-model="chartLeft.version" filterable style="width: 15%;">
<el-select v-model="chartLeft.vPoint" clearable placeholder="vpoint选择" style="width: 15%;">
<el-option
v-for="item in versionArray"
:key="item.version"
:label="item.display_name"
:value="item.version"
v-for="item in vpointArray"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="chartLeft.queryType" filterable style="width: 15%;">
<el-select v-model="chartLeft.queryType" filterable clearable style="width: 15%;">
<el-option
v-for="item in queryDateArray"
:key="item.type"
@ -417,6 +416,7 @@ export default {
queryType: 1,
uploadTime: '', //
tags: '', // tag
vPoint: '',
mail: '15158080631@163.com' //
},
chartsRight: [
@ -452,9 +452,31 @@ export default {
value: 5
}
],
versionArray: [
{ version: 1, display_name: '旧版查询' },
{ version: 2, display_name: '新版查询' }
// versionArray: [
// { version: 1, display_name: '' },
// { version: 2, display_name: '' }
// ],
vpointArray: [
{
label: '方式一',
value: 1
},
{
label: '方式二',
value: 2
},
{
label: '方式三',
value: 3
},
{
label: '方式四',
value: 4
},
{
label: '方式五',
value: 5
}
],
queryDateArray: [
{ type: 1, display_name: '方式一' },
@ -671,6 +693,7 @@ export default {
obj.startTime = this.chartLeft.uploadTime[0]
obj.endTime = this.chartLeft.uploadTime[1]
obj.tags = this.chartLeft.tags.split(',')
obj.version = 2
delete obj.uploadTime
dmpNumber(obj).then(res => {
const seriesArr = []

@ -1,3 +0,0 @@
<template>
<router-view />
</template>

@ -1,5 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="三级菜单1" type="success" />
</div>
</template>

@ -1,5 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="三级菜单2" type="success" />
</div>
</template>

@ -1,5 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="二级菜单" />
</div>
</template>

@ -0,0 +1,282 @@
<!--
* @Description: 检测任务
* @Autor: 飘泊客
* @Date: 2022-01-13 15:43:13
* @LastEditors: 飘泊客
* @LastEditTime: 2023-05-31 14:32:03
-->
<template>
<div class="app-container">
<el-row :gutter="20">
<!--工具栏-->
<div class="head-container">
<div>
<!-- 搜索 -->
<el-input
v-model="query.uploadName"
clearable
size="small"
placeholder="输入活动名称"
style="width: 200px"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
</div>
<div>
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-plus" @click="resourcesDialog = true">
上传文件
</el-button>
</div>
</div>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
:header-cell-style="{'text-align':'left'}"
style="width: 100%;"
>
<el-table-column :show-overflow-tooltip="true" type="index" label="序号" />
<!-- <el-table-column :show-overflow-tooltip="true" prop="activityName" label="文件名称" /> -->
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="上传时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="uploadNum" label="总数" />
<el-table-column :show-overflow-tooltip="true" prop="uploadName" label="活动名" />
<el-table-column :show-overflow-tooltip="true" prop="activityId" label="对应活动ID" />
<el-table-column :show-overflow-tooltip="true" prop="status" label="发送状态">
<template slot-scope="scope">
<span :class="scope.row.status == 0 ? 'info' : 'scuuess'">{{ scope.row.status == 0 ? '发送中' : '发送成功' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="发送日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
>
<template slot-scope="scope">
<el-button type="primary" @click="downloadUrl(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</el-row>
<!--追加资源-->
<el-dialog
append-to-body
:close-on-click-modal="false"
:visible.sync="resourcesDialog"
:before-close="colseFileDialog"
title="上传文件"
width="520px"
class="import-dialog"
>
<div div class="u-flex mt-5">
<div class="label">任务名</div>
<el-input v-model="activityName" placeholder="请设置任务名" style="width: 360px" />
</div>
<div div class="u-flex mt-5">
<div class="label">活动ID</div>
<el-input v-model="actId" placeholder="请输入活动ID" style="width: 360px" />
</div>
<div class="margin-auto">
<el-upload
ref="updaatefiles"
action=""
accept=".xlsx,.xls"
drag
multiple
:limit="5"
class="mt-10 text-center"
:file-list="fileList"
:auto-upload="false"
:on-remove="handleRemove"
:on-exceed="handleExceed"
:http-request="updtaFils"
>
<i class="el-icon-upload" />
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传.xls.xlsx.csv文件且不超过100M</div>
</el-upload>
<div class="line-text margin-auto">
1请导入 xlsxlsx.csv 格式的文件<br>
2必须填写表头方便后续匹配也可点击下载 模板帮助您快速完成导入<br>
3多文件导入请统一提交<br>
4一次最多支持导入 5 份文件<br>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="colseFileDialog"></el-button>
<el-button
:loading="uploading"
type="primary"
@click="submitUpload"
>上传资源
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
// import DateRangePicker from '@/components/DateRangePicker'
import { uploadActivityFiles, uploadCallFileExport } from '@/api/index'
import { downloadFile } from '@/utils/index'
import { mapGetters } from 'vuex'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
const defaultForm = {}
export default {
name: 'DetectionTask',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '检测任务', url: '/api/uploadCallFile' })
},
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
uploading: false,
resourcesDialog: false,
activityName: '', //
actId: '', // id
fileList: [], // files
permission: {
add: ['admin', 'user:add'],
edit: ['admin', 'user:edit'],
del: ['admin', 'user:del'],
download: ['admin', 'user:download']
}
}
},
computed: {
...mapGetters([
'user'
])
},
created() {
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
methods: {
downloadUrl(data) {
uploadCallFileExport({ fileId: data.id }).then(res => {
downloadFile(res, data.uploadName, 'xlsx')
})
// const a = document.createElement('a')
// a.style.display = 'none'
// a.href = data.filePath
// document.body.appendChild(a)
// a.click()
// document.body.removeChild(a)
},
// toDelete(data) {
// this.$confirm(`?`, '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// this.crud.delAllLoading = true
// const arrayIds = Array.of(data.id)
// delRecord(arrayIds).then((res) => {
// this.crud.toQuery()
// })
// }).catch(() => {
// })
// },
colseFileDialog() {
this.fileList = []
this.activityName = ''
this.actId = ''
this.resourcesDialog = false
},
//
updtaFils(file) {
this.fileData.append('file', file.file)
},
//
handleRemove(file, fileList) {
this.fileList = fileList
},
//
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
},
submitUpload() {
//
const isLt100M = this.fileList.every(file => file.size / 1024 / 1024 < 100)
if (!isLt100M) {
this.$message.warning('请检查上传文件大小不能超过100MB!')
} else {
this.fileData = new FormData() // new formData
this.$refs['updaatefiles'].submit()
if (!this.fileData.get('file')) {
this.$message({
message: '请先选择文件',
type: 'warning'
})
return false
}
this.fileData.append('uploadName', this.activityName)
this.fileData.append('actId', this.actId)
this.uploading = true
uploadActivityFiles(this.fileData).then((res) => {
this.$message({
message: '操作成功,文件上传中',
type: 'success'
})
this.fileList = []
setTimeout(() => {
this.colseFileDialog()
this.crud.toQuery()
this.uploading = false
}, 800)
}).catch(() => {
this.uploading = false
})
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .vue-treeselect__control, ::v-deep .vue-treeselect__placeholder, ::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
.label {
min-width: 60px;
line-height: 32px;
float: none;
display: inline-block;
font-size: 14px;
color: #606266;
text-align: left;
vertical-align: middle;
font-weight: 700;
// padding: 0 20px 0 0;
}
.scuuess {
color: #67c23a;
}
.info {
color: #909399;
}
</style>

@ -0,0 +1,215 @@
<!-- 效果统计 -->
<template>
<div class="container">
<el-row>
<el-col :span="24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>效果统计</span>
<el-button style="float: right" type="primary" @click="downloadLine"></el-button>
</div>
<div v-loading="tagLineLoading">
<div class="mt-5">
<el-date-picker
v-model="chartData.selectTime"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
style="width: 230px;"
class="date-item mb-5"
/>
<el-select
v-model="chartData.tags"
multiple
filterable
allow-create
clearable
default-first-option
:multiple-limit="5"
placeholder="请输入tag"
style="min-width: 350px;"
>
<el-option
v-for="item in tagOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-button
type="primary"
@click="searchData"
>搜索
</el-button>
</div>
<div v-if="isLinechart">
<Line-chart :chart-data="lineChartData" />
</div>
<div v-else style="height: 300px;">
<el-empty description="暂无数据" />
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import LineChart from '@/components/Echarts/LineChart'
// import DateRangePicker from '@/components/DateRangePicker'
// import dayjs from 'dayjs'
import { queryActivityLine, uploadCallFileDownload } from '@/api/index'
import { downloadFile } from '@/utils/index'
export default {
name: 'EffectStatistics',
components: {
LineChart
},
data() {
return {
lineChartData: null,
tagLineLoading: false,
pickerMinDate: null,
pickerMaxDate: null,
isLinechart: false,
chartData: {
selectTime: [],
tags: []
},
tagOptions: [],
pickerOptions: {
// onPick: ({ maxDate, minDate }) => {
// this.pickerMinDate = minDate.getTime()
// if (maxDate) {
// this.pickerMaxDate = maxDate.getTime()
// }
// },
// disabledDate(time) {
// // const curDate = new Date().getTime()
// const three = (30 - 1) * 24 * 3600 * 1000
// if (this.pickerMinDate !== '' && this.pickerMaxDate !== '') {
// let maxTime = this.pickerMinDate + three
// if (maxTime > new Date()) {
// maxTime = new Date()
// }
// return time.getTime() > maxTime || time.getTime() > Date.now()
// }
// if (this.pickerMaxDate !== '' && this.pickerMinDate !== '') {
// const minTime = this.pickerMaxDate - three
// let maxTime = this.pickerMinDate + three
// if (maxTime > new Date()) {
// maxTime = new Date()
// }
// return time.getTime() < minTime || time.getTime() > maxTime
// }
// return time.getTime() > Date.now()
// },
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}]
}
}
},
methods: {
searchData() {
if (!this.chartData.selectTime || this.chartData.selectTime.length !== 2) {
this.$message({
message: '请选择筛选日期',
type: 'warning'
})
return false
}
if (this.chartData.tags.length === 0) {
this.$message({
message: '请输入Tag',
type: 'warning'
})
return false
}
const data = Object.assign({}, this.chartData)
if (this.chartData.selectTime && this.chartData.selectTime.length === 2) {
data.startTime = this.chartData.selectTime[0]
data.endTime = this.chartData.selectTime[1]
}
delete data.selectTime
queryActivityLine(data).then(res => {
if (res.data) {
const seriesArr = []
const xData = Object.keys(res.data[Object.keys(res.data)[0]])
this.isLinechart = false
for (const i in res.data) {
const data = Object.values(res.data[i])
if (this.isLinechart === false) {
this.isLinechart = !data.every(item => item === 0)
}
const obj = {}
obj.data = data
obj.type = 'line'
obj.stack = 'Total'
obj.name = i
seriesArr.push(obj)
}
const chartDatas = {
xAxis: xData,
seriesArr
}
this.lineChartData = chartDatas
!this.isLinechart && this.$message('未查询到相关数据')
}
this.tagLineLoading = false
})
},
downloadLine() {
if (!this.chartData.selectTime || this.chartData.selectTime.length !== 2) {
this.$message({
message: '请选择筛选日期',
type: 'warning'
})
return false
}
if (this.chartData.tags.length === 0) {
this.$message({
message: '请输入Tag',
type: 'warning'
})
return false
}
const data = Object.assign({}, this.chartData)
if (this.chartData.selectTime && this.chartData.selectTime.length === 2) {
data.startTime = this.chartData.selectTime[0]
data.endTime = this.chartData.selectTime[1]
}
delete data.selectTime
uploadCallFileDownload(data).then(res => {
downloadFile(res, '活动导出', 'xlsx')
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
background-color: #f0f2f5;
padding: 18px 22px 33px 22px;
min-height: calc(100vh - 84px);
}
</style>
Loading…
Cancel
Save