联动地图完成
This commit is contained in:
		| @@ -39,11 +39,17 @@ | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </config-item> | ||||
|         <template v-if="/AiDvMap/.test(config.type)"> | ||||
|         <template v-if="/(AiDvMap|linkageMap)/.test(config.type)"> | ||||
|           <config-item label="地图数据(geoJSON)"> | ||||
|             <el-input v-model="config.geoJson" size="mini" clearable placeholder="请输入geoJson的URL地址"/> | ||||
|           </config-item> | ||||
|         </template> | ||||
|         <template v-if="/linkageMap/.test(config.type)"> | ||||
|           <config-item v-for="(item,i) in config.summaryConfigs" :key="i" :label="`统计${i+1}`"> | ||||
|             <ai-select placeholder="请选择位置" v-model="item.pos" :select-list="positionList" size="mini"/> | ||||
|             <ai-select placeholder="请选择类型" v-model="item.display" :select-list="summaryOps" size="mini"/> | ||||
|           </config-item> | ||||
|         </template> | ||||
|         <template v-if="/Chart/.test(config.type)"> | ||||
|           <config-item label="图表模板"> | ||||
|             <chart-picker v-model="config.config" @input="v=>config.echartOps=$echartTpls[v]"/> | ||||
| @@ -185,14 +191,7 @@ | ||||
|           </div> | ||||
|         </template> | ||||
|         <config-item label="数据汇总" v-if="config.type === 'summary'"> | ||||
|           <el-select size="mini" v-model="config.display" placeholder="请选择类型" clearable> | ||||
|             <el-option | ||||
|                 v-for="(item, index) in summaryList" | ||||
|                 :key="index" | ||||
|                 :label="item" | ||||
|                 :value="item"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|           <ai-select size="mini" v-model="config.display" placeholder="请选择类型" :select-list="summaryOps"/> | ||||
|         </config-item> | ||||
|       </div> | ||||
|     </div> | ||||
| @@ -202,7 +201,7 @@ | ||||
|         <config-item label="标题"> | ||||
|           <el-input size="mini" clearable placeholder="请输入弹窗标题" v-model="config.dialogTitle"/> | ||||
|         </config-item> | ||||
|         <config-item label="内容" v-if="!['table','AiDvTable','AiDvMap'].includes(config.type)"> | ||||
|         <config-item label="内容" v-if="!['table','AiDvTable','AiDvMap','linkageMap'].includes(config.type)"> | ||||
|           <ai-dialog-btn dialog-title="弹窗内容" text="打开编辑器" :modal="false"> | ||||
|             <ai-editor clearable placeholder="请输入弹窗内容" v-model="config.dialogContent" :instance="instance"/> | ||||
|           </ai-dialog-btn> | ||||
| @@ -219,7 +218,6 @@ import {monitorTypes} from "../config"; | ||||
| import JsonEditor from "./jsonEditor.vue"; | ||||
| import ChartPicker from "./chartPicker.vue"; | ||||
| import AiDvSummary from "@dui/dv/layout/AiDvSummary/AiDvSummary"; | ||||
| import Vue from "vue"; | ||||
|  | ||||
| export default { | ||||
|   name: 'componentConfig', | ||||
| @@ -239,14 +237,17 @@ export default { | ||||
|         {label: '否', value: '0'} | ||||
|       ], | ||||
|       dialog: {}, | ||||
|       monitorTypes | ||||
|       monitorTypes, | ||||
|       positionList: [ | ||||
|         {label: "左上", id: "lt"}, | ||||
|         {label: "右上", id: "rt"}, | ||||
|         {label: "左下", id: "lb"}, | ||||
|         {label: "右下", id: "rb"} | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     summaryList: () => Object.keys(AiDvSummary.components) | ||||
|   }, | ||||
|   created() { | ||||
|     console.log(Vue.component("AiDvSummary")) | ||||
|     summaryOps: () => Object.keys(AiDvSummary.components).map(e => ({label: e, id: e})), | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|   | ||||
| @@ -102,7 +102,7 @@ export default { | ||||
|   methods: { | ||||
|     changeData(sdata) { | ||||
|       this.source.dataType == 'staticData' ? this.source.staticData = sdata : | ||||
|           new DvCompData(this.source.dataType, this.source, this.instance).getData().then(data => { | ||||
|           new DvCompData(this.source, this.instance).getData().then(data => { | ||||
|             this.source[this.source.dataType] = data | ||||
|           }) | ||||
|     } | ||||
|   | ||||
| @@ -437,7 +437,7 @@ const maps = [{ | ||||
|   layers: 'vector' | ||||
| }, { | ||||
|   type: 'AiDvMap', | ||||
|   label: '地图', | ||||
|   label: 'echart地图', | ||||
|   display: 'map', | ||||
|   width: 840, | ||||
|   height: 534, | ||||
| @@ -458,7 +458,7 @@ const maps = [{ | ||||
|   thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/map.png', | ||||
|   is3dAround: '0', | ||||
|   limitArea: '0', | ||||
| }, {type: "linkageMap", label: "联动地图", width: 800, height: 964, top: 0, left: 560, thumb: "https://cdn.cunwuyun.cn/dvcp/dv/tpl/linkageMap.png"}] | ||||
| }, {type: "linkageMap", label: "联动地图", width: 800, height: 964, top: 0, left: 560, thumb: "https://cdn.cunwuyun.cn/dvcp/dv/tpl/linkageMap.png", dataType: 'staticData'}] | ||||
| const customHtml = { | ||||
|   label: "HTML块", type: "html", list: [{ | ||||
|     type: 'html', | ||||
|   | ||||
| @@ -504,7 +504,6 @@ export default { | ||||
|       window.open(origin + pathname + '?id=' + this.$route.query.did + "#preview") | ||||
|     }, | ||||
|     setCurLayer(v) { | ||||
|       console.log(v) | ||||
|       this.componentList.splice(this.activeIndex, 1, v) | ||||
|     } | ||||
|   }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user