Commit e1ca62ff95ffaf0e01010fc5774423b344a9031a

Authored by 郭娟
1 parent 5bc7dd19
Exists in dev

fix:新增天地图组件

frontend/manage/src/api/controlsConfig.js
@@ -1198,6 +1198,38 @@ export const advanceComponents = [ @@ -1198,6 +1198,38 @@ export const advanceComponents = [
1198 } 1198 }
1199 }, 1199 },
1200 { 1200 {
  1201 + ctrlType: 'tianditu',
  1202 + name: '',
  1203 + desc: '天地图',
  1204 + icon: 'icon-gaodeditu',
  1205 + options: {
  1206 + width: '100%',
  1207 + defaultValue: '',
  1208 + dataType: 'varchar',
  1209 + noBindModel: false,
  1210 + placeholder: '',
  1211 + heightMap: '350px',
  1212 + widthMap: '100%',
  1213 + showEffect: 'dialog',
  1214 + isAddPosition: true,
  1215 + locationPath: '',
  1216 + locationName: '',
  1217 + labelAlign: '',
  1218 + longitudeName: '',
  1219 + longitudePath: '',
  1220 + latitudeName: '',
  1221 + latitudePath: '',
  1222 + provinceName: '',
  1223 + provincePath: '',
  1224 + cityName: '',
  1225 + cityPath: '',
  1226 + districtName: '',
  1227 + districtPath: '',
  1228 + streetName: '',
  1229 + streetPath: '',
  1230 + }
  1231 + },
  1232 + {
1201 ctrlType: 'customChart', 1233 ctrlType: 'customChart',
1202 tableName: '', 1234 tableName: '',
1203 boDefAlias: '', 1235 boDefAlias: '',
frontend/manage/src/components/form/BasicsProperty.vue
@@ -4475,7 +4475,7 @@ export default { @@ -4475,7 +4475,7 @@ export default {
4475 customQuerys: [], 4475 customQuerys: [],
4476 customQueryUrl: '', 4476 customQueryUrl: '',
4477 fields: [], 4477 fields: [],
4478 - filterListType: ['number', 'currency', 'date', 'amap'], 4478 + filterListType: ['number', 'currency', 'date', 'amap','tianditu'],
4479 dialogLinkageVisible: false, //联动设置对话框 4479 dialogLinkageVisible: false, //联动设置对话框
4480 linkage: [ 4480 linkage: [
4481 { 4481 {
frontend/manage/src/components/form/FormNavigator.vue
@@ -703,6 +703,7 @@ export default { @@ -703,6 +703,7 @@ export default {
703 'image', 703 'image',
704 'iframe', 704 'iframe',
705 'amap', 705 'amap',
  706 + 'tianditu',
706 'dataView', 707 'dataView',
707 'formTable', 708 'formTable',
708 'table', 709 'table',
@@ -818,6 +819,7 @@ export default { @@ -818,6 +819,7 @@ export default {
818 'image', 819 'image',
819 'iframe', 820 'iframe',
820 'amap', 821 'amap',
  822 + 'tianditu',
821 'dataView', 823 'dataView',
822 'formTable', 824 'formTable',
823 'table', 825 'table',
@@ -826,7 +828,7 @@ export default { @@ -826,7 +828,7 @@ export default {
826 ] 828 ]
827 let amap = 0 829 let amap = 0
828 for (let i = 0; i < this.widgetForm.list.length; i++) { 830 for (let i = 0; i < this.widgetForm.list.length; i++) {
829 - if (this.widgetForm.list[i].ctrlType == 'amap') { 831 + if (['amap','tianditu'].includes(this.widgetForm.list[i].ctrlType)) {
830 amap++ 832 amap++
831 if (amap > 1) { 833 if (amap > 1) {
832 this.$message({ 834 this.$message({
@@ -857,14 +859,14 @@ export default { @@ -857,14 +859,14 @@ export default {
857 k++ 859 k++
858 ) { 860 ) {
859 if ( 861 if (
860 - this.widgetForm.list[i].columns[j].list[k].ctrlType == 'amap' 862 + ['amap','tianditu'].includes(this.widgetForm.list[i].columns[j].list[k].ctrlType)
861 ) { 863 ) {
862 amap++ 864 amap++
863 if (amap > 1) { 865 if (amap > 1) {
864 this.widgetForm.list[i].columns[j].list.splice(k, 1) 866 this.widgetForm.list[i].columns[j].list.splice(k, 1)
865 this.$message({ 867 this.$message({
866 type: 'error', 868 type: 'error',
867 - message: '已存在高德地图控件!' 869 + message: '已存在地图控件!'
868 }) 870 })
869 return 871 return
870 } 872 }
frontend/manage/src/components/form/PropertyPanel.vue
@@ -265,7 +265,7 @@ @@ -265,7 +265,7 @@
265 </ht-input> 265 </ht-input>
266 </ht-form-item> 266 </ht-form-item>
267 <!-- 高德地图 --> 267 <!-- 高德地图 -->
268 - <template v-if="field.ctrlType == 'amap'"> 268 + <template v-if="['amap','tianditu'].includes(field.ctrlType)">
269 <ht-form-item label-width="100px"> 269 <ht-form-item label-width="100px">
270 <template slot="label"> 270 <template slot="label">
271 展示效果 271 展示效果
@@ -1030,6 +1030,7 @@ export default { @@ -1030,6 +1030,7 @@ export default {
1030 'currency', 1030 'currency',
1031 'date', 1031 'date',
1032 'amap', 1032 'amap',
  1033 + 'tianditu',
1033 'slider', 1034 'slider',
1034 'rate', 1035 'rate',
1035 'switch' 1036 'switch'
@@ -1772,13 +1773,14 @@ export default { @@ -1772,13 +1773,14 @@ export default {
1772 filterFieldsByCurrentField(obj, value) { 1773 filterFieldsByCurrentField(obj, value) {
1773 //获取table布局中控件的key 1774 //获取table布局中控件的key
1774 const controlKeys = this.getTableLayoutOfControlKeys() 1775 const controlKeys = this.getTableLayoutOfControlKeys()
1775 - if (obj.ctrlType === 'amap' && controlKeys.includes(this.field.key)) { 1776 + if (['amap','tianditu'].includes(obj.ctrlType) && controlKeys.includes(this.field.key)) {
1776 return false 1777 return false
1777 } 1778 }
1778 //子/孙表不能选择的控件类型 返回false 不能选择 1779 //子/孙表不能选择的控件类型 返回false 不能选择
1779 let types = [ 1780 let types = [
1780 'related-process', 1781 'related-process',
1781 'amap', 1782 'amap',
  1783 + 'tianditu',
1782 'signature', 1784 'signature',
1783 'handSignature', 1785 'handSignature',
1784 'milepost', 1786 'milepost',
@@ -1939,7 +1941,7 @@ export default { @@ -1939,7 +1941,7 @@ export default {
1939 me_.field.options.min = selectObj.options.min 1941 me_.field.options.min = selectObj.options.min
1940 } 1942 }
1941 } 1943 }
1942 - if (item.ctrlType == 'amap') { 1944 + if (['amap','tianditu'].includes(item.ctrlType)) {
1943 me_.field.options.dataType = 'varchar' 1945 me_.field.options.dataType = 'varchar'
1944 } 1946 }
1945 if (item.ctrlType == 'switch') { 1947 if (item.ctrlType == 'switch') {
@@ -2016,7 +2018,7 @@ export default { @@ -2016,7 +2018,7 @@ export default {
2016 me_.field.options.numberMin = selectObj.options.numberMin 2018 me_.field.options.numberMin = selectObj.options.numberMin
2017 me_.field.options.min = selectObj.options.min 2019 me_.field.options.min = selectObj.options.min
2018 } 2020 }
2019 - if (item.ctrlType == 'amap') { 2021 + if (['amap','tianditu'].includes(item.ctrlType)) {
2020 me_.field.options.dataType = 'varchar' 2022 me_.field.options.dataType = 'varchar'
2021 } 2023 }
2022 // WidgetFormBus.$emit("changeCtrlType", me_.field); 2024 // WidgetFormBus.$emit("changeCtrlType", me_.field);
frontend/manage/src/components/form/WidgetFormItem.vue
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <i 17 <i
18 class="icon-copy" 18 class="icon-copy"
19 title="复制" 19 title="复制"
20 - v-if="element.ctrlType !== 'amap'" 20 + v-if="!['amap','tianditu'].includes(element.ctrlType)"
21 @click.stop="handleWidgetClone(index)" 21 @click.stop="handleWidgetClone(index)"
22 ></i> 22 ></i>
23 <el-divider direction="vertical"></el-divider> 23 <el-divider direction="vertical"></el-divider>
@@ -570,6 +570,15 @@ @@ -570,6 +570,15 @@
570 ></el-amap> 570 ></el-amap>
571 </div> 571 </div>
572 </template> 572 </template>
  573 + <template v-if="element.ctrlType == 'tianditu'">
  574 + <div style="width: 100%; height: 350px">
  575 + <ht-tianditu
  576 + :center="mapCenter"
  577 + :zoom="zoom"
  578 + :showSearch="false"
  579 + ></ht-tianditu>
  580 + </div>
  581 + </template>
573 <template v-if="element.ctrlType == 'rate'"> 582 <template v-if="element.ctrlType == 'rate'">
574 <div style="padding-top: 5px"> 583 <div style="padding-top: 5px">
575 <el-rate 584 <el-rate
frontend/manage/src/components/form/WidgetGridLayout.vue
@@ -190,8 +190,8 @@ export default { @@ -190,8 +190,8 @@ export default {
190 this.handleAddBack($event, row.columns[colIndex], newIndex) 190 this.handleAddBack($event, row.columns[colIndex], newIndex)
191 return false 191 return false
192 } 192 }
193 - if (item._underlying_vm_.ctrlType == 'amap') {  
194 - this.$message.warning(text + '不允许存在高德地图') 193 + if (['amap','tianditu'].includes(item._underlying_vm_.ctrlType)) {
  194 + this.$message.warning(text + '不允许存在地图')
195 this.handleAddBack($event, row.columns[colIndex], newIndex) 195 this.handleAddBack($event, row.columns[colIndex], newIndex)
196 return false 196 return false
197 } 197 }
@@ -270,7 +270,7 @@ export default { @@ -270,7 +270,7 @@ export default {
270 cloneData.key = 270 cloneData.key =
271 Date.parse(new Date()) + '_' + Math.ceil(Math.random() * 99999) 271 Date.parse(new Date()) + '_' + Math.ceil(Math.random() * 99999)
272 const hasMap = cloneData.columns 272 const hasMap = cloneData.columns
273 - .map(item => item.list.some(it => it.ctrlType === 'amap')) 273 + .map(item => item.list.some(it => ['amap','tianditu'].includes(it.ctrlType)))
274 .filter(result => Boolean(result)) 274 .filter(result => Boolean(result))
275 if (hasMap && hasMap.length > 0) { 275 if (hasMap && hasMap.length > 0) {
276 this.$message.warning( 276 this.$message.warning(
@@ -296,7 +296,7 @@ export default { @@ -296,7 +296,7 @@ export default {
296 const currentColumns = cloneData.columns.map(item => { 296 const currentColumns = cloneData.columns.map(item => {
297 return { 297 return {
298 ...item, 298 ...item,
299 - list: item.list.filter(it => it.ctrlType !== 'amap') 299 + list: item.list.filter(it => !['amap','tianditu'].includes(it.ctrlType))
300 } 300 }
301 }) 301 })
302 this.data.list.splice(index + 1, 0, { 302 this.data.list.splice(index + 1, 0, {
frontend/manage/src/components/form/WidgetPanel.vue
@@ -433,7 +433,7 @@ export default { @@ -433,7 +433,7 @@ export default {
433 } 433 }
434 let amapNum = 0 434 let amapNum = 0
435 for (let i = vueInst.data.list.length - 1; i >= 0; i--) { 435 for (let i = vueInst.data.list.length - 1; i >= 0; i--) {
436 - if (vueInst.data.list[i].ctrlType == 'amap') { 436 + if (['amap','tianditu'].includes(vueInst.data.list[i].ctrlType)) {
437 amapNum = amapNum + 1 437 amapNum = amapNum + 1
438 } 438 }
439 } 439 }
@@ -441,10 +441,10 @@ export default { @@ -441,10 +441,10 @@ export default {
441 if (amapNum > 1) { 441 if (amapNum > 1) {
442 for (let j = vueInst.data.list.length - 1; j >= 0; j--) { 442 for (let j = vueInst.data.list.length - 1; j >= 0; j--) {
443 if ( 443 if (
444 - vueInst.data.list[j].ctrlType == 'amap' && 444 + ['amap','tianditu'].includes(vueInst.data.list[i].ctrlType) &&
445 !vueInst.data.list[j].options.addressName 445 !vueInst.data.list[j].options.addressName
446 ) { 446 ) {
447 - this.$message.error('已存在高德地图控件') 447 + this.$message.error('已存在地图控件')
448 vueInst.data.list.splice(j, 1) 448 vueInst.data.list.splice(j, 1)
449 return 449 return
450 } 450 }
frontend/manage/src/components/form/WidgetSubDivLayout.vue
@@ -230,8 +230,8 @@ export default { @@ -230,8 +230,8 @@ export default {
230 this.handleAddBack($event, element, newIndex) 230 this.handleAddBack($event, element, newIndex)
231 return false 231 return false
232 } 232 }
233 - if (item.ctrlType == 'amap') {  
234 - this.$message.warning('子表不允许存在高德地图') 233 + if (['amap','tianditu'].includes(item.ctrlType)) {
  234 + this.$message.warning('子表不允许存在地图')
235 this.handleAddBack($event, element, newIndex) 235 this.handleAddBack($event, element, newIndex)
236 return false 236 return false
237 } 237 }
frontend/manage/src/components/form/WidgetSubtableLayout.vue
@@ -181,8 +181,8 @@ export default { @@ -181,8 +181,8 @@ export default {
181 return false 181 return false
182 } 182 }
183 183
184 - if (item.ctrlType == 'amap') {  
185 - this.$message.warning('子表不允许存在高德地图') 184 + if (['amap','tianditu'].includes(item.ctrlType)) {
  185 + this.$message.warning('子表不允许存在地图')
186 this.handleAddBack($event, element, newIndex) 186 this.handleAddBack($event, element, newIndex)
187 return false 187 return false
188 } 188 }
frontend/manage/src/components/form/WidgetSunDivLayout.vue
@@ -166,8 +166,8 @@ export default { @@ -166,8 +166,8 @@ export default {
166 this.handleAddBack($event, element, newIndex) 166 this.handleAddBack($event, element, newIndex)
167 return false 167 return false
168 } 168 }
169 - if (item.ctrlType == 'amap') {  
170 - this.$message.warning('孙表不允许存在高德地图') 169 + if (['amap','tianditu'].includes(item.ctrlType)) {
  170 + this.$message.warning('孙表不允许存在地图')
171 this.handleAddBack($event, element, newIndex) 171 this.handleAddBack($event, element, newIndex)
172 return false 172 return false
173 } 173 }
frontend/manage/src/components/form/WidgetSuntableLayout.vue
@@ -134,8 +134,8 @@ export default { @@ -134,8 +134,8 @@ export default {
134 this.handleAddBack($event, element, newIndex) 134 this.handleAddBack($event, element, newIndex)
135 return false 135 return false
136 } 136 }
137 - if (item.ctrlType == 'amap') {  
138 - this.$message.warning('孙表不允许存在高德地图') 137 + if (['amap','tianditu'].includes(item.ctrlType)) {
  138 + this.$message.warning('孙表不允许存在地图')
139 this.handleAddBack($event, element, newIndex) 139 this.handleAddBack($event, element, newIndex)
140 return false 140 return false
141 } 141 }