<template>
  <template-page
    ref="pageRef"
    :get-list="getList"
    :table-attributes="tableAttributes"
    :table-events="tableEvents"
    :operationColumnWidth="120"
    :options-evens-group="optionsEvensGroup"
    :moreParameters="moreParameters"
    :column-parsing="columnParsing"
    :operation="operation"
    :exportList="exportList"
  >
  </template-page>
</template>

<script>
import TemplatePage from '@/components/template/template-page-1.vue'
import import_mixin from '@/components/template/import_mixin.js'
import ImageUpload from '@/components/file-upload'
import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
import { noticeListPageV2, noticePageExport } from '@/api/readRecords'
import { getList as getListaa } from '@/api/merchant'
export default {
  components: { TemplatePage, ImageUpload },
  mixins: [import_mixin],
  data() {
    return {
      // 事件组合
      optionsEvensGroup: [],
      // 表格属性
      tableAttributes: {
        // 启用勾选列
        selectColumn: false
      },
      tableEvents: {},
      noticeId: ''
    }
  },
  computed: {
    // 更多参数
    moreParameters() {
      return []
    },
    formItems() {}
  },
  created() {
    if (this.$route.query.id) {
      this.noticeId = this.$route.query.id
    }
  },
  methods: {
    // 切换状态
    changeType(val) {
      this.$refs.pageRef.refreshList()
    },
    // 列表请求函数
    getList(p) {
      try {
        var pam = JSON.parse(JSON.stringify(p))
        if (this.noticeId) {
          pam.params.push({ param: 'nr.notice_id', compare: '=', value: this.noticeId })
        }
        return noticeListPageV2(pam)
      } catch (error) {
        console.log(error)
      }
    },
    // 列表导出函数
    exportList: noticePageExport,
    // 表格列解析渲染数据更改
    columnParsing(item, defaultData) {
      return defaultData
    },
    // 表格操作列
    operation(h, { row, index, column }) {
      return ''
    }
  }
}
</script>

<style lang="scss" scoped></style>
