Commit 49d94ec4 49d94ec42209c92ad42012bf8d67583778bc93c4 by 官美宏

调整显示

1 parent e641b803
......@@ -25,8 +25,8 @@ export default {
},
data() {
return {
title: '爱奇艺小卡',
stitle: '爱奇艺小卡',
title: 'iQIYI',
stitle: 'iQIYI',
logo: Logo
}
}
......
......@@ -2,7 +2,7 @@ module.exports = {
/**
* @description 网站标题
*/
title: '爱奇艺小卡',
title: '会员卡查询系统',
/**
* @description 是否显示 tagsView
*/
......
......@@ -28,14 +28,15 @@
:value="item.value"
/>
</el-select> -->
<el-select v-model="searchObj.region" filterable class="filter-item" clearable size="mini" placeholder="请选择地区">
<!-- <el-select v-model="searchObj.region" filterable class="filter-item" clearable size="mini" placeholder="请选择地区">
<el-option
v-for="item in dictMap['region']"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-select> -->
<el-input v-model="searchObj.channel" clearable size="small" placeholder="请输入地区" style="width: 200px;" class="filter-item" />
<el-input v-model="searchObj.channel" clearable size="small" placeholder="请输入渠道" style="width: 200px;" class="filter-item" />
<el-input v-model="searchObj.cardNum" clearable size="small" placeholder="请输入卡号" style="width: 200px;" class="filter-item" />
<el-input v-model="searchObj.batch" clearable size="small" placeholder="请输入批次(数字)" style="width: 200px;" class="filter-item" />
......@@ -58,13 +59,13 @@
</template>
</el-table-column>
<el-table-column label="卡号" width="70px" prop="cardNum" />
<el-table-column label="卡密" width="250px" prop="cardKey" />
<el-table-column label="vip类型" width="80px" prop="status">
<el-table-column label="卡密" width="160px" prop="cardKey" />
<el-table-column label="vip状态" width="80px" prop="status">
<template slot-scope="scope">
<span v-if="Number(scope.row.status) === 0">未兑换</span>
<span v-if="Number(scope.row.status) === 1">已兑换</span>
<span v-if="Number(scope.row.status) === 2">兑换失败</span>
<span v-if="Number(scope.row.status) === 3">已失效</span>
<el-tag v-if="Number(scope.row.status) === 0">未激活</el-tag>
<el-tag v-if="Number(scope.row.status) === 1" type="success">已激活</el-tag>
<el-tag v-if="Number(scope.row.status) === 2" type="warning">激活失败</el-tag>
<el-tag v-if="Number(scope.row.status) === 3" type="info">已失效</el-tag>
</template>
</el-table-column>
<el-table-column label="地区" show-overflow-tooltip prop="region" />
......@@ -72,8 +73,8 @@
<el-table-column label="批次" width="60px" prop="batch" />
<el-table-column label="产品id" width="60px" prop="productId" />
<el-table-column label="产品" width="100px" prop="productName" />
<el-table-column label="大屏账号" width="260px" prop="account" />
<el-table-column label="订单号" width="150px" prop="bossOrderNo" />
<el-table-column label="大屏账号" show-overflow-tooltip width="260px" prop="account" />
<el-table-column label="订单号" show-overflow-tooltip width="160px" prop="bossOrderNo" />
<el-table-column label="备注" show-overflow-tooltip prop="remark" />
<el-table-column label="领取手机号" width="125px" prop="rcvMobile" />
</el-table>
......@@ -107,7 +108,7 @@ export default {
{ key: 'bossOrderNo', display_name: '订单号' }
],
vipTypeList: [{ label: '爱奇艺包月', value: '1' }, { label: '爱奇艺包年', value: '4' }],
statusList: [{ label: '未兑换', value: '0' }, { label: '已兑换', value: '1' }, { label: '兑换失败', value: '2' }, { label: '已失效', value: '3' }],
statusList: [{ label: '未激活', value: '0' }, { label: '已激活', value: '1' }, { label: '激活失败', value: '2' }, { label: '已失效', value: '3' }],
total: 0,
tableHeight: 0,
searchObj: {
......
<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'
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
},
option: {
type: Object,
default: () => {}
},
optionData: {
type: Object,
default: () => {}
}
},
data() {
return {
chart: null,
colorList: [
'#ff7e50', '#97d3f9', '#dd70d9', '#34cf34',
'#6497ef', '#85802b', '#D7504B', '#C6E579',
'#F4E001', '#F0805A', '#26C0C0'
]
}
},
watch: {
option: {
handler(newVal) {
// console.log('获取配置', newVal)
if (this.chart) {
this.setOption()
}
},
immediate: true,
deep: true
},
optionData: {
handler(newVal) {
console.log('获取竖柱状数据', newVal, this.chart)
if (this.chart) {
this.initData()
}
},
immediate: true,
deep: true
}
},
mounted() {
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')
const option = {
title: {
show: false,
right: 'center',
textStyle: {
fontSize: 14
}
},
tooltip: {
trigger: 'axis'
},
grid: {
top: '10%',
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
axisLine: {
show: false
},
axisTick: {
show: false,
alignWithLabel: true
},
splitLine: {
show: false
},
axisPointer: {
type: 'shadow'
}
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01],
splitNumber: 5,
max: 'auto',
data: [],
axisLine: {
show: false
},
axisTick: {
show: false
}
},
series: [
{
name: '标签人数分布',
type: 'bar',
data: [],
barWidth: 60,
label: {
show: true,
position: 'inside'
},
itemStyle: {
color: (params) => {
return this.colorList[params.dataIndex]
}
}
}
]
}
this.chart.setOption(option)
if (Object.keys(this.option).length > 0) {
this.setOption()
}
console.log(this.optionData)
if (Object.keys(this.optionData).length > 0) {
this.initData()
}
},
initData() {
console.log(123)
console.log(this.optionData)
const keyArray = Object.keys(this.optionData)
const yAxis = []
const xAxis = []
if (typeof this.optionData[keyArray[0]] !== 'object') {
keyArray.forEach(item => {
yAxis.push(item)
xAxis.push(this.optionData[item])
})
console.log(yAxis, xAxis)
} else {
keyArray.forEach(item => {
const array = Object.keys(this.optionData[item])
array.forEach(itemArray => {
const arrayList = Object.keys(this.optionData[item][itemArray])
arrayList.forEach(itemArray1 => {
yAxis.push(item + ':' + itemArray + ':' + itemArray1)
xAxis.push(this.optionData[item][itemArray][itemArray1])
})
// yAxis.push(item + ':' + itemArray)
// xAxis.push(this.optionData[item][itemArray])
})
})
}
const option = {
xAxis: {
data: yAxis
},
series: [
{
data: xAxis
}
]
}
console.log(option)
this.chart.setOption(option)
},
setOption() {
this.chart.setOption(this.option)
}
}
}
</script>
<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'
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
},
option: {
type: Object,
default: () => {}
},
optionData: {
type: Object,
default: () => {}
}
},
data() {
return {
chart: null,
colorList: [
'#ff7e50', '#97d3f9', '#dd70d9', '#34cf34',
'#6497ef', '#85802b', '#D7504B', '#C6E579',
'#F4E001', '#F0805A', '#26C0C0'
]
}
},
watch: {
option: {
handler(newVal) {
// console.log('获取配置', newVal)
if (this.chart) {
this.setOption()
}
},
immediate: true,
deep: true
},
optionData: {
handler(newVal) {
console.log('获取饼状数据', newVal, this.chart)
if (this.chart) {
this.initData()
}
},
immediate: true,
deep: true
}
},
mounted() {
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')
const option = {
title: {
show: false,
right: 'center',
textStyle: {
fontSize: 14
}
},
tooltip: {
trigger: 'item'
},
grid: {
top: '10%',
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
series: [
{
name: '标签人数分布',
type: 'pie',
radius: '50%',
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}
this.chart.setOption(option)
if (Object.keys(this.option).length > 0) {
this.setOption()
}
console.log(this.optionData)
if (Object.keys(this.optionData).length > 0) {
this.initData()
}
},
initData() {
console.log(123)
console.log(this.optionData)
const keyArray = Object.keys(this.optionData)
const yAxis = []
const xAxis = []
if (typeof this.optionData[keyArray[0]] !== 'object') {
keyArray.forEach(item => {
// yAxis.push(item)
// xAxis.push(this.optionData[item])
xAxis.push({
value: this.optionData[item],
name: item
})
})
console.log(yAxis, xAxis)
} else {
keyArray.forEach(item => {
const array = Object.keys(this.optionData[item])
array.forEach(itemArray => {
yAxis.push(item + ':' + itemArray)
xAxis.push(this.optionData[item][itemArray])
})
})
}
const option = {
// yAxis: {
// data: yAxis
// },
series: [
{
data: xAxis
}
]
}
console.log(option)
this.chart.setOption(option)
},
setOption() {
this.chart.setOption(this.option)
}
}
}
</script>
<template>
<div class="dashboard-container">
<div class="dashboard-editor-container">
<github-corner class="github-corner" />
<!-- <github-corner class="github-corner" /> -->
<panel-group />
<div class="active-open-card">
<el-card>
......@@ -11,17 +11,17 @@
<el-row>
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<bar-chart :option-data="regionStatistics[0]" :option="{title: { show: true, text: '开卡地区:地区分布' }}" />
<pie-chart :option-data="regionStatistics[0]" :option="{title: { show: true, text: '开卡地区:地区分布' }}" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<bar-chart :option-data="batchStatistics[0]" :option="{title: { show: true, text: '开卡地区:批次分布' }}" />
<bar-chart :option-data="channelStatistics[0]" :option="{title: { show: true, text: '开卡地区:渠道分布' }}" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<bar-chart :option-data="channelStatistics[0]" :option="{title: { show: true, text: '开卡地区:渠道分布' }}" />
<bar-chart-h :option-data="batchStatistics[0]" :option="{title: { show: true, text: '开卡地区:批次分布' }}" />
</div>
</el-col>
</el-row>
......@@ -33,17 +33,17 @@
<el-row>
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<bar-chart :option-data="regionStatistics[1]" :option="{title: { show: true, text: '激活地区:地区分布' }}" />
<pie-chart :option-data="regionStatistics[1]" :option="{title: { show: true, text: '激活地区:地区分布' }}" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<bar-chart :option-data="batchStatistics[1]" :option="{title: { show: true, text: '激活地区:批次分布' }}" />
<bar-chart :option-data="channelStatistics[1]" :option="{title: { show: true, text: '激活地区:渠道分布' }}" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<bar-chart :option-data="channelStatistics[1]" :option="{title: { show: true, text: '激活地区:渠道分布' }}" />
<bar-chart-h :option-data="batchStatistics[1]" :option="{title: { show: true, text: '激活地区:批次分布' }}" />
</div>
</el-col>
</el-row>
......@@ -53,17 +53,21 @@
</div>
</template>
<script>
import GithubCorner from '@/components/GithubCorner'
// import GithubCorner from '@/components/GithubCorner'
import PanelGroup from './dashboard/PanelGroup'
import BarChart from './dashboard/BarChart'
import BarChartH from './dashboard/BarChartH'
import PieChart from './dashboard/PieChart'
import homeData from '@/api/home/homeData'
export default {
name: 'Dashboard',
components: {
GithubCorner,
// GithubCorner,
PanelGroup,
BarChart
BarChart,
BarChartH,
PieChart
},
data() {
return {
......
......@@ -3,7 +3,7 @@
<index-bg />
<div class="loginBox">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
<h3 class="title" style="position: relative">爱奇艺小卡<span style="color: #fff;z-index: 999;font-size: 12px;position: absolute;top: 4px;right: 10px" /></h3>
<h3 class="title" style="position: relative">会员卡查询系统<span style="color: #fff;z-index: 999;font-size: 12px;position: absolute;top: 4px;right: 10px" /></h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" :validate-event="false" class="login-input" type="text" size="mini" placeholder="账号" style="width: 400px;">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
......