<template>
  <div class="auto" style="height: 500px">
      <data-grid :model="model" class="list_area table_sy"  partial='list' v-ref:grid >
        <template partial='head'>
          <tr>
            <th><nobr>用户编号</nobr></th>
            <th><nobr>用户名称</nobr></th>
            <th><nobr>改变类型</nobr></th>
            <th><nobr>改变前</nobr></th>
            <th><nobr>改变后</nobr></th>
            <th><nobr>操作人</nobr></th>
            <th><nobr>操作时间</nobr></th>
          </tr>
        </template>
        <template partial='body'>
          <tr>
            <td style="text-align:center">{{row.f_userinfo_code}}</td>
            <td style="text-align:center">{{row.f_user_name}}</td>
            <td style="text-align:center">{{row.f_field_name}}</td>
            <td style="text-align:center">{{row.f_used_content}}</td>
            <td style="text-align:center">{{row.f_new_content}}</td>
            <td style="text-align:center">{{row.f_operator}}</td>
            <td style="text-align:center">{{row.f_operate_date}}</td>
          </tr>
        </template>
        <template partial='foot'></template>
      </data-grid>
  </div>
</template>
<script>
  export default {
    title: '详细信息',
    data () {
      return {
        model: {
          rows: []
        }

      }
    },
    props: ['row', 'show'],
    ready () {
      this.search()
    },
    methods: {
      async search () {
        // 获取这个气价的所有记录
        console.log('气价记录', this.row)
        let data = {
          f_userinfo_id: this.row.f_userinfo_id
        }

        let res = await this.$resetpost('rs/logic/historicalPrice', {data: data}, {rejectMsg: '获取气价记录出错', resolveMsg: null})

        this.model.rows = res.data
      }
    },
    watch: {
      'row' () {
        this.search()
      }

    }

  }
</script>
