''
liukangdong
2024-06-11 f49cf1c04d06333ace67926430c651ca3cc1752f
admin/src/views/business/retention.vue
@@ -42,6 +42,15 @@
        >
        </el-date-picker>
      </el-form-item>
      <el-radio-group
        v-model="searchForm.radio"
        size="small"
        @input="changeRadio"
      >
        <el-radio-button label="0">当天</el-radio-button>
        <el-radio-button label="1">近7天</el-radio-button>
        <el-radio-button label="2">近30天</el-radio-button>
      </el-radio-group>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
@@ -145,6 +154,7 @@
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import { timeForMat } from '@/utils/util'
export default {
  name: 'Retention',
  extends: BaseTable,
@@ -157,7 +167,8 @@
        type: '',
        keyWords: '',
        startTime: '',
        endTime: ''
        endTime: '',
        radio: 0
      },
      time: []
    }
@@ -169,12 +180,29 @@
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
    this.changeRadio('0')
  },
  methods: {
    changeRadio (e) {
      if (e === '0') {
        this.searchForm.startTime = timeForMat(0)[0]
        this.searchForm.endTime = timeForMat(0)[1]
        this.time = timeForMat(0)
      } else if (e === '1') {
        this.searchForm.startTime = timeForMat(6)[0]
        this.searchForm.endTime = timeForMat(6)[1]
        this.time = timeForMat(6)
      } else if (e === '2') {
        this.searchForm.startTime = timeForMat(29)[0]
        this.searchForm.endTime = timeForMat(29)[1]
        this.time = timeForMat(29)
      }
      this.search()
    },
    reset() {
      this.$refs.searchForm.resetFields()
      this.searchForm.startTime = ''
      this.searchForm.radio = '0'
      this.searchForm.endTime = ''
      this.time = []
      this.search()
@@ -182,6 +210,7 @@
    seleTime(e) {
      this.searchForm.startTime = e[0]
      this.searchForm.endTime = e[1]
      this.searchForm.radio = null
    }
  }
}