Commit ce67dae8 by xinla

--no commit message

1 parent e032644e
......@@ -58,7 +58,7 @@ export default {
<template>
<ul class="card-group-index flex">
<li v-for="(row, index) in data" :key="index" class="card-index-li">
<div class="mb5 label">
<div class="label">
<span>{{ row[defaultProps.title] }}</span>
<div v-if="row[defaultProps.tips] !== undefined" class="fr">
<el-popover trigger="hover" :content="row[defaultProps.tips]" placement="top-start">
......@@ -66,8 +66,8 @@ export default {
</el-popover>
</div>
</div>
<div class="mb15 value">{{ row[defaultProps.value] || 0 }}</div>
<div v-if="row[defaultProps.title1] !== undefined || row[defaultProps.value1] !== undefined">
<div class="mt5 value">{{ row[defaultProps.value] || 0 }}</div>
<div class="mt15" v-if="row[defaultProps.title1] !== undefined || row[defaultProps.value1] !== undefined">
{{ row[defaultProps.title1] }}
<span class="fr" :class="row[defaultProps.noArrow] || getClass(row[defaultProps.value1])">
{{ row[defaultProps.noArrow] ? '' : getArrow(row[defaultProps.value1]) }}
......@@ -83,13 +83,15 @@ export default {
.card-index-li {
position: relative;
width: 200px;
// height: 108px;
// background: linear-gradient(90deg, #f7f8fb 0%, #f1f3f8 100%);
background: #fff;
border-radius: $border-radius;
margin: 0 10px 20px 0;
border-radius: var(--border-radius-big);
border: 1px solid #edf2f9;
margin: 0 10px 0 0;
line-height: 1;
padding: 22px 20px;
&:last-child {
margin-right: 0;
}
.card-icon {
position: absolute;
top: 0;
......
......@@ -10,15 +10,7 @@ export default {
// X轴坐标数据
xData: {
type: Array,
default: () => [
'腾讯广告',
'巨量引擎',
'京东数坊',
'达摩盘',
'数据银行',
'微信广告',
'企业微信',
],
default: () => ['腾讯广告', '巨量引擎', '京东数坊', '达摩盘', '数据银行', '微信广告', '企业微信'],
},
// 图例
legend: {
......@@ -62,7 +54,7 @@ export default {
})
},
},
created() { },
created() {},
mounted() {
this.drawChart()
},
......@@ -100,18 +92,18 @@ export default {
// text: 'Stacked Area Chart'
// },
tooltip: {
backgroundColor: '#505050',
borderWidth: 0,
textStyle: {
color: '#fff',
},
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985',
},
},
// backgroundColor: '#505050',
// borderWidth: 0,
// textStyle: {
// color: '#fff',
// },
// axisPointer: {
// type: 'cross',
// label: {
// backgroundColor: '#6a7985',
// },
// },
},
legend: {
data: this.legend,
......
......@@ -16,15 +16,7 @@ export default {
// X轴坐标数据
xData: {
type: Array,
default: () => [
'2021-12-01',
'2021-12-02',
'2021-12-03',
'2021-12-03',
'2021-12-04',
'2021-12-05',
'2021-12-06',
],
default: () => ['2021-12-01', '2021-12-02', '2021-12-03', '2021-12-03', '2021-12-04', '2021-12-05', '2021-12-06'],
},
// 图例; 单个图例可传字符串,实际转换成单元素数组[string]
legend: {
......@@ -124,19 +116,19 @@ export default {
// text: 'Stacked Area Chart'
// },
tooltip: {
textStyle: {
color: '#FFF', // 设置文字颜色
fontSize: 12,
},
trigger: 'axis',
backgroundColor: '#505050',
borderWidth: 0,
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985',
},
},
// textStyle: {
// color: '#FFF', // 设置文字颜色
// fontSize: 12,
// },
// backgroundColor: '#505050',
// borderWidth: 0,
// axisPointer: {
// type: 'cross',
// label: {
// backgroundColor: '#6a7985',
// },
// },
},
legend: {
data: legend,
......@@ -156,7 +148,7 @@ export default {
icon: 'roundRect',
itemWidth: 24,
itemHeight: 4,
itemGap:14,
itemGap: 14,
tooltip: {
show: true,
},
......
......@@ -4,14 +4,14 @@ import { echartColors } from '@/utils/index'
import merge from 'lodash.merge'
export default {
// 折线图
// 饼图
name: 'ChartPie',
components: {},
props: {
// 图例
legend: {
type: Array,
default: () => ['新增客户']
default: () => ['新增客户'],
},
// 展示数据集
series: {
......@@ -21,15 +21,15 @@ export default {
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
{ value: 300, name: 'Video Ads' },
],
},
// 自定义图表配置项,使用loadsh.merge(origin, option)和原有的配置进行覆盖合并
// loadsh.merge: https://www.html.cn/doc/lodash/#_mergeobject-sources
option: {
type: Object,
default: null
}
default: null,
},
},
data() {
return {}
......@@ -38,7 +38,7 @@ export default {
watch: {
series() {
this.drawChart()
}
},
},
created() {},
mounted() {
......@@ -56,19 +56,19 @@ export default {
// top: 'bottom'
// },
tooltip: {
textStyle: {
color: '#FFF', // 设置文字颜色
fontSize: 12
},
trigger: 'item',
backgroundColor: '#505050',
borderWidth: 0,
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
// textStyle: {
// color: '#FFF', // 设置文字颜色
// fontSize: 12,
// },
// backgroundColor: '#505050',
// borderWidth: 0,
// axisPointer: {
// type: 'cross',
// label: {
// backgroundColor: '#6a7985',
// },
// },
},
legend: {
x: 'center',
......@@ -79,20 +79,20 @@ export default {
itemWidth: 8,
itemHeight: 8,
tooltip: {
show: true
show: true,
},
textStyle: {
color: '#36363A',
fontSize: 12,
lineHeight: 14
}
lineHeight: 14,
},
},
grid: {
left: '3%',
right: '3%',
bottom: '20px',
top: '30px',
containLabel: true
containLabel: true,
},
series: {
type: 'pie',
......@@ -102,10 +102,10 @@ export default {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
},
}
this.option && merge(option, this.option)
option && this.myChart.setOption(option)
......@@ -113,8 +113,8 @@ export default {
new ResizeObserver((entries) => {
this.myChart.resize()
}).observe(this.$refs.chart)
}
}
},
},
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!