Browse Source

地图编辑添加下拉选择楼盘,获取更多参数

230320a303 2 years ago
parent
commit
bab26ef6ec

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-1a35ef6e.becdd0c2.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3ce428f6.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-1a35ef6e.e3edd16e.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-1b5575dd.1b8a53db.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-29258185.f44fc023.js


+ 32 - 0
src/views/map/components/popup/MapTextEdit.vue

@@ -64,11 +64,13 @@ export default {
         {color: '#4da4ee', t: '医院'}, 
       ],
       cObj: {},
+      estateObj: {},
     }
   },
   watch: {
     isShow: function(val) {
       if (val) {
+        this.estateObj = {}
         this.cObj = JSON.parse(JSON.stringify(this.curObj))
         this.getDef()
       }
@@ -83,6 +85,13 @@ export default {
         params.fillColor = this.fillColor
         params.strokeColor = this.strokeColor
       }
+      let remoteOptions = []
+      if (str === 'estate') {
+        const oldform = this.$refs.ruleForm.baseForm
+        params = {...oldform}
+        params.text = this.estateObj.estate_name
+        remoteOptions = [{ keyRO: this.estateObj.estate_name, valRO: this.estateObj.id }]
+      }
       if (!params.text) params.text = '标题示例'
       if (!params.strokeStyle) params.strokeStyle = 'solid'
       if (this.mteStr === 'polygonAdd' || this.mteStr === 'polylineAdd') {
@@ -92,6 +101,10 @@ export default {
           params.strokeColor = this.strokeColor
         }
         this.formData = [
+          { label: '关联楼盘', key: 'estate_id', type: 'selectRemote', changeHandle: this.estateChange,
+            remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
+            remoteOptions
+          },
           { label: '标题', key: 'text', rules: 1},
           { label: '填充色', key: 'fillColor', type: 'colorPicker', rules: 1},
           { label: '透明度', key: 'fillOpacity', rules: 1},
@@ -109,6 +122,22 @@ export default {
       }
       this.setDefaultValue(params)
     },
+    estateChange (val, op, valObj) {
+      this.estateObj = {
+          id: valObj.id,
+          estate_name: valObj.estate_name,
+          pri_image: valObj.pri_image,
+          price_range: valObj.price_range,
+          product_type: valObj.product_type,
+          property_type: valObj.property_type,
+          // area_type: valObj.area_type,
+          // metro_type: valObj.metro_type,
+          // metro_line: valObj.metro_line,
+          // vr_image: valObj.vr_image,
+          // vr_key: valObj.vr_key,
+        }
+      this.getDef('estate')
+    },
     colorHandle (item) {
       this.fillColor = item.color
       this.strokeColor = item.color
@@ -120,6 +149,9 @@ export default {
           if (valid) {
             const oldform = this.$refs.ruleForm.baseForm
             const newForm = { ...oldform }
+            if (this.estateObj && this.estateObj.id) {
+              newForm.estateObj = JSON.stringify(this.estateObj)
+            }
             if (this.curObj.obj) {
               this.$emit('close', newForm, 'edit')
             } else {

+ 35 - 11
src/views/map/dtl.vue

@@ -294,6 +294,7 @@ export default {
           that.polygonIndex = eData.index
           const lnglatObj = e.lnglat
           const cObj = that.polygons[that.polygonIndex]
+          const estateObj = cObj.estateObj ? JSON.parse(cObj.estateObj) : {}
           const typeObj = {
             '#ff0': '新房用地',
             '#9f7df4': '二手房',
@@ -304,17 +305,39 @@ export default {
             '#4da4ee': '医院用地',
           }
           that.winObj.position = [lnglatObj.lng, lnglatObj.lat]
-          that.winObj.content = `
-          <div style="border-radius: 6px;overflow:hidden;background:#fff;box-shadow: 0 0 3px #ccc;">
-            <div style="font-weight: bold;color:#fff;padding: 10px 10px;background:#409eff;user-select: none;margin-bottom: 10px;text-align: center;">${cObj.text}</div>
-            <div style="padding: 0 10px 10px;color: #999;">类型:${typeObj[cObj.fillColor] || '其它'}</div>
-            <div style="padding: 0 10px 10px;color: #999;">状态:${cObj.strokeStyle === 'dashed' ? '规划中' : '已规划'}</div>
-          </div>
-          `
-          // <div style="font-weight: bold;color:${that.polygons[that.polygonIndex].fillColor};padding: 10px 10px;background:#fff;border-radius: 6px;user-select: none;">${that.polygons[that.polygonIndex].text}</div>
-          // <div style="font-weight: bold;color:#fff;padding: 10px 10px;background:${that.polygons[that.polygonIndex].fillColor};border-radius: 6px;user-select: none;">${that.polygons[that.polygonIndex].text}</div>
-            // <div style="text-align: center;color:#999;">序号:${that.polygonIndex + 1}</div>
-          // wx.miniProgram.navigateTo({url: '/pagesSchool/indexDtl?id=25'})
+          if (estateObj.id) {
+            const ptObj = arrToObj(that.$dictData.product_type)
+            const ptArr = estateObj.product_type.split(',')
+            let ptStrArr = []
+            ptArr.forEach(n => {
+              ptStrArr.push(ptObj[n])
+            })
+            const productTypeStr = ptStrArr.join(',')
+            that.winObj.content = `
+              <div style="border-radius: 6px;overflow:hidden;background:#fff;box-shadow: 0 0 3px #ccc;">
+                <div style="font-weight: bold;color:#fff;padding: 10px 10px;background:#409eff;user-select: none;margin-bottom: 10px;text-align: left;">${cObj.text}</div>
+                <div style="display: flex;padding-left: 10px;">
+                  <div style="width: 100px;">
+                    <img style="width: 100px;height: auto;" src="${estateObj.pri_image}_plus" />
+                  </div>
+                  <div style="width: 160px;">
+                    <div style="padding: 0 10px 6px;color: #999;font-size: 12px;color: #f00;font-weight: bold;">价格:¥${estateObj.price_range}</div>
+                    <div style="padding: 0 10px 6px;color: #999;font-size: 12px;">类型:${typeObj[cObj.fillColor] || '其它'}</div>
+                    <div style="padding: 0 10px 6px;color: #999;font-size: 12px;">物业:${estateObj.property_type}</div>
+                    <div style="padding: 0 10px 6px;color: #999;font-size: 12px;">产品:${productTypeStr}</div>
+                  </div>
+                </div>
+              </div>
+            `
+          } else {
+            that.winObj.content = `
+              <div style="border-radius: 6px;overflow:hidden;background:#fff;box-shadow: 0 0 3px #ccc;">
+                <div style="font-weight: bold;color:#fff;padding: 10px 10px;background:#409eff;user-select: none;margin-bottom: 10px;text-align: center;">${cObj.text}</div>
+                <div style="padding: 0 10px 10px;color: #999;">类型:${typeObj[cObj.fillColor] || '其它'}</div>
+                <div style="padding: 0 10px 10px;color: #999;">状态:${cObj.strokeStyle === 'dashed' ? '规划中' : '已规划'}</div>
+              </div>
+            `
+          }
         },
       },
       polylineEvents: {
@@ -978,6 +1001,7 @@ export default {
             tempData[index].fillOpacity = obj.fillOpacity
             tempData[index].strokeColor = obj.strokeColor
             tempData[index].strokeStyle = obj.strokeStyle
+            tempData[index].estateObj = obj.estateObj
           }
           this[str] = [...tempData]
           this.$storage(`map_${str}`, JSON.stringify(tempData))

+ 1 - 0
src/views/map/list.vue

@@ -94,6 +94,7 @@ export default {
     },
     linkDtl(row) {
       this.$router.push(`/map/dtl?e=1&id=${row.uuid}`)
+      this.$router.go(0)
     },
     openPopup(row) {
       if (row && row.id) {

Some files were not shown because too many files changed in this diff