优化大屏组件

This commit is contained in:
aixianling
2022-06-28 18:18:37 +08:00
parent b117cf9d51
commit cc211cd22b
5 changed files with 87 additions and 171 deletions

View File

@@ -1,19 +1,3 @@
import lineChart1 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart1'
import lineChart2 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart2'
import lineChart3 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart3'
import lineChart4 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart4'
import lineChart5 from 'dvcp-dv-ui/components/AiEchart/template/line/lineChart5'
import barChart1 from 'dvcp-dv-ui/components/AiEchart/template/bar/barChart1'
import barChart2 from 'dvcp-dv-ui/components/AiEchart/template/bar/barChart2'
import barChart3 from 'dvcp-dv-ui/components/AiEchart/template/bar/barChart3'
import barChart8 from 'dvcp-dv-ui/components/AiEchart/template/bar/barChart8'
import barChart5 from 'dvcp-dv-ui/components/AiEchart/template/bar/barChart5'
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 = [ const components = [
{ {
type: 'chart', type: 'chart',
@@ -49,12 +33,12 @@ const components = [
{name: '凡哥', v1: 67}, {name: '凡哥', v1: 67},
{name: '党费', v1: 98} {name: '党费', v1: 98}
], ],
config: barChart1, config: 'barChart1',
dynamicData: [] dynamicData: []
}, },
{ {
code: 'widget-linechart', code: 'widget-linechart',
type: 'barChart1', type: 'barChart2',
label: '柱状图2', label: '柱状图2',
icon: 'icontext_box', icon: 'icontext_box',
value: '', value: '',
@@ -78,7 +62,7 @@ const components = [
{name: '凡哥', v1: 67}, {name: '凡哥', v1: 67},
{name: '党费', v1: 98} {name: '党费', v1: 98}
], ],
config: barChart2, config: 'barChart2',
dynamicData: [] dynamicData: []
}, },
{ {
@@ -107,7 +91,7 @@ const components = [
{name: '凡哥', v1: 67}, {name: '凡哥', v1: 67},
{name: '党费', v1: 98} {name: '党费', v1: 98}
], ],
config: barChart3, config: 'barChart3',
dynamicData: [] dynamicData: []
}, },
{ {
@@ -136,7 +120,7 @@ const components = [
{name: '凡哥', v1: 67}, {name: '凡哥', v1: 67},
{name: '党费', v1: 98} {name: '党费', v1: 98}
], ],
config: barChart5, config: 'barChart5',
dynamicData: [] dynamicData: []
}, },
{ {
@@ -164,7 +148,7 @@ const components = [
{name: '凡哥', v1: 67}, {name: '凡哥', v1: 67},
{name: '党费', v1: 98} {name: '党费', v1: 98}
], ],
config: barChart7, config: 'barChart7',
dynamicData: [] dynamicData: []
}, },
{ {
@@ -193,7 +177,7 @@ const components = [
{name: '凡哥', v1: 67}, {name: '凡哥', v1: 67},
{name: '党费', v1: 98} {name: '党费', v1: 98}
], ],
config: barChart8, config: 'barChart8',
dynamicData: [] dynamicData: []
}, },
{ {
@@ -222,7 +206,7 @@ const components = [
{name: '凡哥', v1: 67}, {name: '凡哥', v1: 67},
{name: '党费', v1: 98} {name: '党费', v1: 98}
], ],
config: barChart9, config: 'barChart9',
dynamicData: [] dynamicData: []
} }
] ]
@@ -256,7 +240,7 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: lineChart1, config: 'lineChart1',
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
}, },
@@ -285,7 +269,7 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: lineChart2, config: 'lineChart2',
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
}, },
@@ -314,7 +298,7 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: lineChart3, config: 'lineChart3',
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
}, },
@@ -343,7 +327,7 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: lineChart4, config: 'lineChart4',
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
}, },
@@ -372,7 +356,7 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: lineChart5, config: 'lineChart5',
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
} }
@@ -384,7 +368,8 @@ const components = [
list: [ list: [
{ {
code: 'widget-linechart', code: 'widget-linechart',
type: 'pieChart', type: 'pieChart2',
config: 'pieChart2',
label: '饼图', label: '饼图',
title: '饼图', title: '饼图',
icon: 'icontext_box', icon: 'icontext_box',
@@ -407,7 +392,6 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: pieChart,
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
}, },
@@ -436,7 +420,7 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: pieChart1, config: 'pieChart1',
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
}, },
@@ -465,7 +449,7 @@ const components = [
{name: '凡哥', v1: 67, v2: 25}, {name: '凡哥', v1: 67, v2: 25},
{name: '党费', v1: 98, v2: 85} {name: '党费', v1: 98, v2: 85}
], ],
config: pieChart1, config: 'pieChart1',
sourceDataId: '', sourceDataId: '',
dynamicData: [] dynamicData: []
} }
@@ -509,6 +493,20 @@ const components = [
} }
] ]
}, },
{
type: 'ai3d', label: "3D", list: [
{
label: "3D楼栋", type: 'building', list: [{
type: 'building1', label: "楼栋模型1",
width: 840,
height: 800,
zIndex: 1,
title: "楼栋模型1",
thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/total.png'
}]
}
]
},
{ {
type: 'other', type: 'other',
label: '其他', label: '其他',
@@ -527,7 +525,7 @@ const components = [
top: 0, top: 0,
mask: '2', mask: '2',
pulseLines: 1, pulseLines: 1,
mapStyle:"e51987628aee5206d4c9ca8c6e98b4f7", mapStyle: "e51987628aee5206d4c9ca8c6e98b4f7",
areaId: '', areaId: '',
zIndex: 1, zIndex: 1,
apiData: [], apiData: [],

View File

@@ -15,131 +15,19 @@
:key="data.height" :key="data.height"
:theme="theme" :theme="theme"
:style="{height: data.height + 'px', width: '100%'}"/> :style="{height: data.height + 'px', width: '100%'}"/>
<ai-echart <ai-echart v-else-if="/Chart/.test(data.type)"
v-else-if="data.type === 'barChart1'"
style="height: 100%; width: 100%;" style="height: 100%; width: 100%;"
:ref="'chart' + index" :ref="'chart' + index"
:key="`chart${index}`" :key="`chart${index}`"
:theme="theme" :theme="theme"
:data="values" :data="values"
:ops="data.config"/> :ops="chartList[data.config]"/>
<ai-echart
v-else-if="data.type === 'barChart2'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:theme="theme"
:key="`chart${index}`"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'barChart3'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'barChart5'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'barChart7'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'barChart8'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'barChart9'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'lineChart1'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="lineChart1"/>
<ai-echart
v-else-if="data.type === 'lineChart2'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="lineChart2"/>
<ai-echart
v-else-if="data.type === 'lineChart3'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'lineChart4'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="data.config"/>
<ai-echart
v-else-if="data.type === 'lineChart5'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="lineChart5"/>
<ai-echart
v-else-if="data.type === 'pieChart'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="pieChart"/>
<ai-echart
v-else-if="data.type === 'pieChart1'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="pieChart1"/>
<ai-echart
v-else-if="data.type === 'pieChart3'"
style="height: 100%; width: 100%;"
:ref="'chart' + index"
:key="`chart${index}`"
:theme="theme"
:data="values"
:ops="pieChart3"/>
<ai-map :markers="values" v-else-if="data.type=='map'" :mask="data.mask === '1'" :areaId="data.areaId || user.info.areaId" <ai-map :markers="values" v-else-if="data.type=='map'" :mask="data.mask === '1'" :areaId="data.areaId || user.info.areaId"
:map-style="`amap://styles/${data.mapStyle}`" :pulseLines="data.pulseLines==1" :map.sync="map" :lib.sync="lib"/> :map-style="`amap://styles/${data.mapStyle}`" :pulseLines="data.pulseLines==1" :map.sync="map" :lib.sync="lib"/>
<ai-monitor :src="data.src" v-else-if="data.type === 'monitor'" :type="data.monitorType"/> <ai-monitor :src="data.src" v-else-if="data.type === 'monitor'" :type="data.monitorType"/>
<video style="width: 100%; height: 100%; object-fit: fill;" loop :src="data.src" autoplay v-else-if="data.type === 'video'"/> <video style="width: 100%; height: 100%; object-fit: fill;" loop :src="data.src" autoplay v-else-if="data.type === 'video'"/>
<AiDvPartyOrg style="width: 100%; height: 100%;" v-else-if="data.type === 'partyOrg'" :instance="instance"/> <AiDvPartyOrg style="width: 100%; height: 100%;" v-else-if="data.type === 'partyOrg'" :instance="instance"/>
<ai-sprite v-else-if="/building/.test(data.type)" v-bind="data" is3D @init="mods[data.type]"/>
</ai-dv-panel> </ai-dv-panel>
</div> </div>
</template> </template>
@@ -147,54 +35,44 @@
<script> <script>
import {mapState} from 'vuex' import {mapState} from 'vuex'
import AiSwiper from './AiSwiper.vue' import AiSwiper from './AiSwiper.vue'
import pieChart from './AiEchart/template/pie/pieChart2' import chartList from './AiEchart/echartTpls'
import pieChart1 from './AiEchart/template/pie/pieChart1'
import pieChart3 from './AiEchart/template/pie/pieChart3'
import lineChart1 from './AiEchart/template/line/lineChart1'
import lineChart2 from './AiEchart/template/line/lineChart2'
import lineChart5 from './AiEchart/template/line/lineChart5'
import AiMonitor from "./AiMonitor/AiMonitor"; import AiMonitor from "./AiMonitor/AiMonitor";
import AiDvPanel from "../layout/AiDvPanel/AiDvPanel"; import AiDvPanel from "../layout/AiDvPanel/AiDvPanel";
import AiDvDisplay from "../layout/AiDvDisplay/AiDvDisplay"; import AiDvDisplay from "../layout/AiDvDisplay/AiDvDisplay";
import AiDvSummary from "../layout/AiDvSummary/AiDvSummary"; import AiDvSummary from "../layout/AiDvSummary/AiDvSummary";
import AiSprite from "./AiSprite";
import * as mods from "./AiSprite/mods";
export default { export default {
name: 'AiDvRender', name: 'AiDvRender',
props: ['data', 'index', 'theme', 'instance'], props: ['data', 'index', 'theme', 'instance'],
components: { components: {
AiSprite,
AiDvSummary, AiDvSummary,
AiDvDisplay, AiDvDisplay,
AiDvPanel, AiDvPanel,
AiMonitor, AiMonitor,
AiSwiper AiSwiper
}, },
data() { data() {
return { return {
lineChart1, mods,
lineChart2, chartList,
lineChart5,
pieChart,
pieChart1,
pieChart3,
map: null, map: null,
lib: null lib: null
} }
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
values() { values() {
if (!this.data) { if (!this.data) {
return [] return []
} }
return this.data.type === 'map' ? this.data[this.data.dataType].map(e => { return this.data.type === 'map' ? this.data[this.data.dataType].map(e => {
return {...e, lng: e['经度'], lat: e['纬度'], label: e['地区名称']} return {...e, lng: e['经度'], lat: e['纬度'], label: e['地区名称']}
}) : this.data[this.data.dataType] }) : this.data[this.data.dataType]
} },
}, },
methods: { methods: {
formatTable(data, isShowIndex, rowNum) { formatTable(data, isShowIndex, rowNum) {

View File

@@ -0,0 +1,35 @@
import barChart1 from "./template/bar/barChart1"
import barChart2 from "./template/bar/barChart2"
import barChart3 from "./template/bar/barChart3"
import barChart5 from "./template/bar/barChart5"
import barChart7 from "./template/bar/barChart7"
import barChart8 from "./template/bar/barChart8"
import barChart9 from "./template/bar/barChart9"
import lineChart1 from "./template/line/lineChart1"
import lineChart2 from "./template/line/lineChart2"
import lineChart3 from "./template/line/lineChart3"
import lineChart4 from "./template/line/lineChart4"
import lineChart5 from "./template/line/lineChart5"
import pieChart1 from "./template/pie/pieChart1"
import pieChart2 from "./template/pie/pieChart2"
import pieChart3 from "./template/pie/pieChart3"
export default {
barChart1,
barChart2,
barChart3,
barChart5,
barChart7,
barChart8,
barChart9,
lineChart1,
lineChart2,
lineChart3,
lineChart4,
lineChart5,
pieChart1,
pieChart2,
pieChart3
}

View File

@@ -0,0 +1,4 @@
const initModel = () => {
}
export default initModel

View File

@@ -0,0 +1 @@
export const building1 = import('./building/building1')