Browse Source

temp save

liujq 4 years ago
parent
commit
866bea92bc
2 changed files with 49 additions and 17 deletions
  1. 25 14
      src/views/house/index.vue
  2. 24 3
      src/views/news/index.vue

+ 25 - 14
src/views/house/index.vue

@@ -52,15 +52,24 @@ export default {
   },
   computed: {
     tableData2() {
-      const arr = [...this.tableData,
-        // {id: 1, aa: '华润万象城', bb: require('@/assets/ex_test.jpg'), eee: '楼盘的具体地址~',  cc: '师大附中,南师附小', dd: '地铁大厦站', ee: '南昌第一人民医院', ff: '万象城商圈', gg: '红谷滩区', hh: '华润物业', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        // {id: 2, aa: '华润万象城', bb: require('@/assets/ex_test.jpg'), eee: '楼盘的具体地址~',  cc: '师大附中,南师附小', dd: '地铁大厦站', ee: '南昌第一人民医院', ff: '万象城商圈', gg: '红谷滩区', hh: '华润物业', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        // {id: 3, aa: '华润万象城', bb: require('@/assets/ex_test.jpg'), eee: '楼盘的具体地址~',  cc: '师大附中,南师附小', dd: '地铁大厦站', ee: '南昌第一人民医院', ff: '万象城商圈', gg: '红谷滩区', hh: '华润物业', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        // {id: 4, aa: '华润万象城', bb: require('@/assets/ex_test.jpg'), eee: '楼盘的具体地址~',  cc: '师大附中,南师附小', dd: '地铁大厦站', ee: '南昌第一人民医院', ff: '万象城商圈', gg: '红谷滩区', hh: '华润物业', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        // {id: 5, aa: '华润万象城', bb: require('@/assets/ex_test.jpg'), eee: '楼盘的具体地址~',  cc: '师大附中,南师附小', dd: '地铁大厦站', ee: '南昌第一人民医院', ff: '万象城商圈', gg: '红谷滩区', hh: '华润物业', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        // {id: 6, aa: '华润万象城', bb: require('@/assets/ex_test.jpg'), eee: '楼盘的具体地址~',  cc: '师大附中,南师附小', dd: '地铁大厦站', ee: '南昌第一人民医院', ff: '万象城商圈', gg: '红谷滩区', hh: '华润物业', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-      ]
-      arr.map(item => {})
+      const arr = [...this.tableData]
+      arr.map(item => {
+        const metro_type = item.metro_type ? item.metro_type.split(',') : []
+        const metroTypeName = metro_type.map(v => {
+          return arrToObj(this.$dictData.metro_type)[v]
+        })
+        item.metroTypeName = metroTypeName.join(',')
+        const product_type = item.product_type ? item.product_type.split(',') : []
+        const productTypeName = product_type.map(v => {
+          return arrToObj(this.$dictData.product_type)[v]
+        })
+        item.productTypeName = productTypeName.join(',')
+        const metro_line = item.metro_line ? item.metro_line.split(',') : []
+        const metroLineName = metro_line.map(v => {
+          return arrToObj(this.$dictData.metro_line)[v]
+        })
+        item.metroLineName = metroLineName.join(',')
+      })
       return arr
     }
   },
@@ -68,14 +77,16 @@ export default {
   mounted() {
     this.listConfig = {
       rows: [
-        { label: '所属区域', prop: 'area_type', type: 'flag', flags: arrToObj(this.$dictData.area_type) }, 
         { label: '楼盘名称', prop: 'estate_name' },
         { label: '图片', prop: 'pri_image', type: 'img' },
+        { label: '所属区域', prop: 'area_type', type: 'flag', flags: arrToObj(this.$dictData.area_type) }, 
         { label: '楼盘地址', prop: 'address', fullShow: true, minWidth: 200 },
-        { label: '地铁口', prop: 'metro_type', type: 'flag', flags: arrToObj(this.$dictData.metro_type)},
-        { label: '周边医院', prop: 'hospital_type', type: 'flag', flags: arrToObj(this.$dictData.hospital_type)},
-        { label: '周边商圈', prop: 'high_street', type: 'flag', flags: arrToObj(this.$dictData.high_street)},
-        { label: '公园', prop: 'park_type', type: 'flag', flags: arrToObj(this.$dictData.park_type)},
+        { label: '地铁线路', prop: 'metroLineName'},
+        { label: '地铁站名', prop: 'metroTypeName'},
+        { label: '产品类型', prop: 'productTypeName'},
+        // { label: '周边医院', prop: 'hospital_type', type: 'flag', flags: arrToObj(this.$dictData.hospital_type)},
+        // { label: '周边商圈', prop: 'high_street', type: 'flag', flags: arrToObj(this.$dictData.high_street)},
+        // { label: '公园', prop: 'park_type', type: 'flag', flags: arrToObj(this.$dictData.park_type)},
         { label: '更新人', prop: 'update_by' },
         { label: '更新时间', prop: 'update_at' },
         { label: '操作', width: 120, type: 'handle2', operations:

+ 24 - 3
src/views/news/index.vue

@@ -14,7 +14,20 @@
       @currentChange="pageHandle"
       :isAdd="true"
       @add="openPopup"
-    />
+      :insertSlotArr="[4]"
+    >
+      <div slot="OI4">
+        <el-table-column
+          width="50"
+          label="链接"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <a :href="scope.row.link" target="_blank" class="scoped-link">链接</a>
+          </template>
+        </el-table-column>
+      </div>
+    </table-list>
     <popup-edit
       :isShow="isDtlShow"
       :curObj="curObj"
@@ -55,6 +68,7 @@ export default {
       const arr = [...this.tableData]
       arr.map(item => {
         item.pri_image = item.pri_image || defaultImg
+        item.hide_status = Number(item.hide_status)
       })
       return arr
     }
@@ -63,10 +77,10 @@ export default {
   mounted() {
     this.listConfig = {
       rows: [
-        { label: '标题', prop: 'title', fullShow: true, minWidth: 300 }, 
+        { label: '标题', prop: 'title', fullShow: true, minWidth: 200 }, 
         { label: '分类', prop: 'information_category', type: 'flag', flags: arrToObj(this.$dictData.information_category) }, 
         { label: '主图', prop: 'pri_image', type: 'img' },
-        { label: '链接', prop: 'link' },
+        // { label: '链接', prop: 'link' },
         { label: '作者', prop: 'author' },
         { label: '状态', prop: 'hide_status', type: 'tag', tags: arrToObj(this.$dictData.hide_status) }, 
         { label: '更新人', prop: 'update_by' },
@@ -108,3 +122,10 @@ export default {
   }
 }
 </script>
+<style lang="scss" scoped>
+.scoped-link {
+  color: #2d8cf0;
+  text-decoration: underline;
+}
+</style>
+