zhaowei
2025-07-11 3e3252367b6135476eab5d68a4d5af27eb7eae0d
src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue
@@ -1,18 +1,6 @@
<template>
  <a-card :bordered="false">
    <a-table
      ref="detailTable"
      size="middle"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      class="j-table-force-nowrap"
      @change="handleTableChange">
    </a-table>
  </a-card>
  <a-table ref="detailTable" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
           :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange"/>
</template>
<script>
@@ -34,7 +22,8 @@
        }
      },
      filterKey: {
        type: String
        type: String,
        default: ''
      }
    },
    data() {
@@ -125,8 +114,7 @@
        immediate: true,
        handler(val) {
          if (val) {
            console.log('val---------------------', val)
            this.$nextTick(() => this.loadData(1))
            this.loadData(1)
          } else {
            this.clearList()
          }
@@ -151,10 +139,6 @@
    },
    methods: {
      loadData(arg) {
        if (this.standardId && this.standardId === '-1') {
          this.clearList()
          return
        }
        //加载数据 若传入参数1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1
@@ -165,31 +149,32 @@
        }
        this.dataSource = []
        params.standardId = this.standardId
        params.itemCategory = this.filterKey
        this.loading = true
        console.log('----------------------', this.filterKey)
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            // console.log(res)
            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
            if (this.filterKey) this.dataSource = res.result.records.filter(item => item.itemCategory == this.filterKey)
            else this.dataSource = res.result.records
            if (res.result.total) {
              this.ipagination.total = res.result.total
        getAction(this.url.list, params)
          .then((res) => {
            if (res.success) {
              this.dataSource = res.result.records
              if (res.result.total) {
                this.ipagination.total = res.result.total
              } else {
                this.ipagination.total = 0
              }
            } else {
              this.ipagination.total = 0
              this.$notification.warning({
                message: '消息',
                description: res.message
              })
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          } else {
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
          })
          .finally(() => {
            this.loading = false
          })
      },
      clearList() {
        this.dataSource = []
        this.selectedRowKeys = []
        this.ipagination.current = 1
        this.clearSelected()
      }
    }
  }