echart 组件

This commit is contained in:
yanran200730
2022-05-11 11:37:37 +08:00
parent 8998e9a664
commit e4d1e85156
5 changed files with 208 additions and 8 deletions

View File

@@ -10,6 +10,7 @@
<AiSwiper v-else-if="data.type === 'swiper'" :heigth="'100%'" :data="data[data.dataType]"/>
<dv-scroll-board
v-if="data.type === 'table'"
:class="'dvScrollBoard' + theme"
:config="formatTable(data[data.dataType], data.isShowIndex, data.rowNum)"
:key="data.height"
:theme="theme"
@@ -126,6 +127,14 @@
:theme="theme"
:data="data[data.dataType]"
:ops="pieChart1"/>
<ai-echart
v-else-if="data.type === 'pieChart3'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="data[data.dataType]"
:ops="pieChart3"/>
<ai-map :markers="data[data.dataType]" v-else-if="data.type=='map'" :mask="data.mask === '1'" :areaId="data.areaId || user.info.areaId" map-style="amap://styles/e51987628aee5206d4c9ca8c6e98b4f7"/>
<ai-monitor :src="data.src" v-else-if="data.type === 'monitor'" :type="data.monitorType"></ai-monitor>
<video style="width: 100%; height: 100%; object-fit: fill;" loop :src="data.src" autoplay v-else-if="data.type === 'video'"></video>
@@ -138,6 +147,7 @@
import AiSwiper from './AiSwiper.vue'
import pieChart from 'dvcp-dv-ui/components/AiEchart/template/pie/pieChart2'
import pieChart1 from 'dvcp-dv-ui/components/AiEchart/template/pie/pieChart1'
import pieChart3 from 'dvcp-dv-ui/components/AiEchart/template/pie/pieChart3'
import lineChart1 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart1'
import lineChart2 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart2'
import lineChart5 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart5'
@@ -157,7 +167,8 @@
lineChart2,
lineChart5,
pieChart,
pieChart1
pieChart1,
pieChart3
}
},
@@ -208,5 +219,42 @@
</script>
<style lang="scss" scoped>
.render-element {
::v-deep .dvScrollBoard1 {
.index {
color: #fff;
text-shadow: none;
background: transparent;
background-color: #BD4921!important;
-webkit-background-clip: inherit;
-webkit-text-fill-color: #fff;
}
.header {
background: rgba(0, 0, 0, 0.1)!important;
.header-item {
color: #FFBB73!important;
font-size: 16px!important;
font-weight: 600;
}
}
.rows {
font-size: 16px;
font-weight: 600;
color: #FFFFFF;
line-height: 21px;
text-shadow: 0px 2px 4px rgba(117, 9, 9, 0.5);
background: linear-gradient(180deg, #FFF6C7 0%, #FF9A02 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
& > div:nth-of-type(2n) {
background: rgba(0, 0, 0, 0.1)!important;
}
}
}
}
</style>

View File

@@ -12,6 +12,7 @@ import barChart7 from 'dvcp-dv-ui/components/AiEchart/template/bar/barChart7'
import barChart9 from 'dvcp-dv-ui/components/AiEchart/template/bar/barChart9'
import pieChart from 'dvcp-dv-ui/components/AiEchart/template/pie/pieChart2'
import pieChart1 from 'dvcp-dv-ui/components/AiEchart/template/pie/pieChart1'
import pieChart3 from 'dvcp-dv-ui/components/AiEchart/template/pie/pieChart3'
const components = [
{
@@ -438,6 +439,35 @@ const components = [
config: pieChart1,
sourceDataId: '',
dynamicData: []
},
{
code: 'widget-linechart',
type: 'pieChart3',
label: '饼图',
title: '饼图',
icon: 'icontext_box',
value: '',
border: 'border1',
width: 500,
height: 300,
zIndex: 1,
top: 0,
left: 0,
thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie.png',
dataX: '',
dataY: [],
api: '',
apiData: [],
dataType: 'staticData',
staticData: [
{ name: '阿斯达', v1: 23, v2: 33 },
{ name: '水电费', v1: 12, v2: 34 },
{ name: '凡哥', v1: 67, v2: 25 },
{ name: '党费', v1: 98, v2: 85 }
],
config: pieChart1,
sourceDataId: '',
dynamicData: []
}
]
}