|
@@ -0,0 +1,140 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <div class="scoped-top">
|
|
|
+ <div class="t">当前时间:{{curTime}},将在 <div class="b">{{countdown}}</div> 秒后自动刷新页面</div>
|
|
|
+ </div>
|
|
|
+ <table-list
|
|
|
+ :list-loading="listLoading"
|
|
|
+ :data="tableData2"
|
|
|
+ :columns="listConfig"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :total-records="totalRecords"
|
|
|
+ @currentChange="pageHandle"
|
|
|
+ @sizeChange="sizeChange"
|
|
|
+ />
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { arrToObj } from '@/utils'
|
|
|
+import baseTable from '_m/baseTable.js'
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ provide() {
|
|
|
+ return {
|
|
|
+ parentData: this
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mixins: [baseTable],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ curTime: '',
|
|
|
+ pageSize: 20,
|
|
|
+ apiStr: 'house.admestatehousedynamiclist',
|
|
|
+ searchForm: null,
|
|
|
+ isDtlShow: false,
|
|
|
+ curObj: {},
|
|
|
+ isUpdateShow: false,
|
|
|
+ isQShow: false,
|
|
|
+ countdown: 60 * 10, // 5 minutes in seconds
|
|
|
+ intervalId: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ tableData2() {
|
|
|
+ const arr = [...this.tableData,]
|
|
|
+ const atObj = arrToObj(this.$dictData.area_type)
|
|
|
+ const ptObj = arrToObj(this.$dictData.product_type)
|
|
|
+ arr.map(item => {
|
|
|
+ item.estate_nameArea_type = `${atObj[item.area_type]}:${item.estate_name}`
|
|
|
+ item.product_typeHouse_square = `${ptObj[item.product_type]}:${item.house_square}㎡`
|
|
|
+ item.price_minPrice_max = item.price_max && Number(item.price_max) > 0 ? `¥${item.price_min}-${item.price_max}万` : `¥${item.price_min}万-上限未知`
|
|
|
+ })
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.timer = window.setInterval(() => {
|
|
|
+ this.curTime = this.getTime()
|
|
|
+ }, 1000)
|
|
|
+ this.startCountdown()
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearInterval(this.timer)
|
|
|
+ clearInterval(this.intervalId)
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.listConfig = {
|
|
|
+ rows: [
|
|
|
+ // minWidth: 150, align: 'left'
|
|
|
+ { label: '更新时间', prop: 'update_re' },
|
|
|
+ { label: '区域和楼盘', prop: 'estate_nameArea_type', minWidth: 100 },
|
|
|
+ { label: '产品面积', prop: 'product_typeHouse_square' },
|
|
|
+ { label: '起始价', prop: 'price_minPrice_max' },
|
|
|
+
|
|
|
+ // { label: '楼盘名称', prop: 'estate_name' },
|
|
|
+ // { label: '所属区域', prop: 'area_type', type: 'flag', flags: arrToObj(this.$dictData.area_type) },
|
|
|
+ // { label: '产品类型', prop: 'product_type', type: 'flag', flags: arrToObj(this.$dictData.product_type) },
|
|
|
+ // { label: '户型面积', prop: 'house_square' },
|
|
|
+ // { label: '起价', prop: 'price_min' },
|
|
|
+ // { label: '封顶价', prop: 'price_max' },
|
|
|
+ { label: '最新动态', prop: 'dynamic', minWidth: 150, fullShow: true },
|
|
|
+ { label: '现场折扣', prop: 'scene_discount', fullShow: true, },
|
|
|
+ { label: '实际折扣', prop: 'actual_discount', fullShow: true, },
|
|
|
+ { label: '在售楼栋', prop: 'on_sale', fullShow: true, },
|
|
|
+ { label: '待售楼栋', prop: 'for_sale', fullShow: true, },
|
|
|
+ { label: '推荐房源', prop: 'recommend', fullShow: true, },
|
|
|
+ { label: '动态图片', prop: 'dynamic_img', type: 'img' },
|
|
|
+ { label: '更新人', prop: 'update_by' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getTime () {
|
|
|
+ let date = new Date()
|
|
|
+ let year = date.getFullYear()
|
|
|
+ let month = date.getMonth() + 1
|
|
|
+ month = month > 9 ? month : '0' + month
|
|
|
+ let day = date.getDate()
|
|
|
+ day = day > 9 ? day : '0' + day
|
|
|
+ let hour = date.getHours()
|
|
|
+ hour = hour > 9 ? hour : '0' + hour
|
|
|
+ let min = date.getMinutes()
|
|
|
+ min = min > 9 ? min : '0' + min
|
|
|
+ let second = date.getSeconds()
|
|
|
+ second = second > 9 ? second : '0' + second
|
|
|
+ return `${year}-${month}-${day} ${hour}:${min}:${second}`
|
|
|
+ },
|
|
|
+ startCountdown() {
|
|
|
+ this.intervalId = setInterval(() => {
|
|
|
+ if (this.countdown > 0) {
|
|
|
+ this.countdown--
|
|
|
+ } else {
|
|
|
+ this.refreshPage()
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ },
|
|
|
+ refreshPage() {
|
|
|
+ location.reload()
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.scoped-top {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20px;
|
|
|
+ color: #333;
|
|
|
+ margin-top: -10px;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ .b {
|
|
|
+ display: inline-block;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #2d8cf0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|