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 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 1233 ctrlType: 'customChart',
1202 1234 tableName: '',
1203 1235 boDefAlias: '',
... ...
frontend/manage/src/components/form/BasicsProperty.vue
... ... @@ -4475,7 +4475,7 @@ export default {
4475 4475 customQuerys: [],
4476 4476 customQueryUrl: '',
4477 4477 fields: [],
4478   - filterListType: ['number', 'currency', 'date', 'amap'],
  4478 + filterListType: ['number', 'currency', 'date', 'amap','tianditu'],
4479 4479 dialogLinkageVisible: false, //联动设置对话框
4480 4480 linkage: [
4481 4481 {
... ...
frontend/manage/src/components/form/FormNavigator.vue
... ... @@ -703,6 +703,7 @@ export default {
703 703 'image',
704 704 'iframe',
705 705 'amap',
  706 + 'tianditu',
706 707 'dataView',
707 708 'formTable',
708 709 'table',
... ... @@ -818,6 +819,7 @@ export default {
818 819 'image',
819 820 'iframe',
820 821 'amap',
  822 + 'tianditu',
821 823 'dataView',
822 824 'formTable',
823 825 'table',
... ... @@ -826,7 +828,7 @@ export default {
826 828 ]
827 829 let amap = 0
828 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 832 amap++
831 833 if (amap > 1) {
832 834 this.$message({
... ... @@ -857,14 +859,14 @@ export default {
857 859 k++
858 860 ) {
859 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 864 amap++
863 865 if (amap > 1) {
864 866 this.widgetForm.list[i].columns[j].list.splice(k, 1)
865 867 this.$message({
866 868 type: 'error',
867   - message: '已存在高德地图控件!'
  869 + message: '已存在地图控件!'
868 870 })
869 871 return
870 872 }
... ...
frontend/manage/src/components/form/PropertyPanel.vue
... ... @@ -265,7 +265,7 @@
265 265 </ht-input>
266 266 </ht-form-item>
267 267 <!-- 高德地图 -->
268   - <template v-if="field.ctrlType == 'amap'">
  268 + <template v-if="['amap','tianditu'].includes(field.ctrlType)">
269 269 <ht-form-item label-width="100px">
270 270 <template slot="label">
271 271 展示效果
... ... @@ -1030,6 +1030,7 @@ export default {
1030 1030 'currency',
1031 1031 'date',
1032 1032 'amap',
  1033 + 'tianditu',
1033 1034 'slider',
1034 1035 'rate',
1035 1036 'switch'
... ... @@ -1772,13 +1773,14 @@ export default {
1772 1773 filterFieldsByCurrentField(obj, value) {
1773 1774 //获取table布局中控件的key
1774 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 1777 return false
1777 1778 }
1778 1779 //子/孙表不能选择的控件类型 返回false 不能选择
1779 1780 let types = [
1780 1781 'related-process',
1781 1782 'amap',
  1783 + 'tianditu',
1782 1784 'signature',
1783 1785 'handSignature',
1784 1786 'milepost',
... ... @@ -1939,7 +1941,7 @@ export default {
1939 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 1945 me_.field.options.dataType = 'varchar'
1944 1946 }
1945 1947 if (item.ctrlType == 'switch') {
... ... @@ -2016,7 +2018,7 @@ export default {
2016 2018 me_.field.options.numberMin = selectObj.options.numberMin
2017 2019 me_.field.options.min = selectObj.options.min
2018 2020 }
2019   - if (item.ctrlType == 'amap') {
  2021 + if (['amap','tianditu'].includes(item.ctrlType)) {
2020 2022 me_.field.options.dataType = 'varchar'
2021 2023 }
2022 2024 // WidgetFormBus.$emit("changeCtrlType", me_.field);
... ...
frontend/manage/src/components/form/WidgetFormItem.vue
... ... @@ -17,7 +17,7 @@
17 17 <i
18 18 class="icon-copy"
19 19 title="复制"
20   - v-if="element.ctrlType !== 'amap'"
  20 + v-if="!['amap','tianditu'].includes(element.ctrlType)"
21 21 @click.stop="handleWidgetClone(index)"
22 22 ></i>
23 23 <el-divider direction="vertical"></el-divider>
... ... @@ -570,6 +570,15 @@
570 570 ></el-amap>
571 571 </div>
572 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 582 <template v-if="element.ctrlType == 'rate'">
574 583 <div style="padding-top: 5px">
575 584 <el-rate
... ...
frontend/manage/src/components/form/WidgetGridLayout.vue
... ... @@ -190,8 +190,8 @@ export default {
190 190 this.handleAddBack($event, row.columns[colIndex], newIndex)
191 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 195 this.handleAddBack($event, row.columns[colIndex], newIndex)
196 196 return false
197 197 }
... ... @@ -270,7 +270,7 @@ export default {
270 270 cloneData.key =
271 271 Date.parse(new Date()) + '_' + Math.ceil(Math.random() * 99999)
272 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 274 .filter(result => Boolean(result))
275 275 if (hasMap && hasMap.length > 0) {
276 276 this.$message.warning(
... ... @@ -296,7 +296,7 @@ export default {
296 296 const currentColumns = cloneData.columns.map(item => {
297 297 return {
298 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 302 this.data.list.splice(index + 1, 0, {
... ...
frontend/manage/src/components/form/WidgetPanel.vue
... ... @@ -433,7 +433,7 @@ export default {
433 433 }
434 434 let amapNum = 0
435 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 437 amapNum = amapNum + 1
438 438 }
439 439 }
... ... @@ -441,10 +441,10 @@ export default {
441 441 if (amapNum > 1) {
442 442 for (let j = vueInst.data.list.length - 1; j >= 0; j--) {
443 443 if (
444   - vueInst.data.list[j].ctrlType == 'amap' &&
  444 + ['amap','tianditu'].includes(vueInst.data.list[i].ctrlType) &&
445 445 !vueInst.data.list[j].options.addressName
446 446 ) {
447   - this.$message.error('已存在高德地图控件')
  447 + this.$message.error('已存在地图控件')
448 448 vueInst.data.list.splice(j, 1)
449 449 return
450 450 }
... ...
frontend/manage/src/components/form/WidgetSubDivLayout.vue
... ... @@ -230,8 +230,8 @@ export default {
230 230 this.handleAddBack($event, element, newIndex)
231 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 235 this.handleAddBack($event, element, newIndex)
236 236 return false
237 237 }
... ...
frontend/manage/src/components/form/WidgetSubtableLayout.vue
... ... @@ -181,8 +181,8 @@ export default {
181 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 186 this.handleAddBack($event, element, newIndex)
187 187 return false
188 188 }
... ...
frontend/manage/src/components/form/WidgetSunDivLayout.vue
... ... @@ -166,8 +166,8 @@ export default {
166 166 this.handleAddBack($event, element, newIndex)
167 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 171 this.handleAddBack($event, element, newIndex)
172 172 return false
173 173 }
... ...
frontend/manage/src/components/form/WidgetSuntableLayout.vue
... ... @@ -134,8 +134,8 @@ export default {
134 134 this.handleAddBack($event, element, newIndex)
135 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 139 this.handleAddBack($event, element, newIndex)
140 140 return false
141 141 }
... ...