<template>
  <div @keyup.enter="search" class="span">
    <criteria-paged :model="model" class="list_area table_sy" v-ref:paged>
      <criteria @condition-changed='$parent.search' partial='criteria' v-ref:criteria>
        <div class="form-horizontal select-overspread container-fluid auto" novalidate partial>
        </div>
      </criteria>
      <data-grid :model="model" class="list_area table_sy" partial='list' v-ref:grid>
        <template partial='head'>
          <tr>
            <th style="text-align:center;">
              <nobr>事件</nobr>
            </th>
            <th style="text-align:center;">
              <nobr>发生时间</nobr>
            </th>
          </tr>
        </template>
        <template partial='body'>
          <tr>
            <td style="text-align:center;">
              <nobr>{{row.f_event_content}}</nobr>
            </td>
            <td style="text-align:center;">
              <nobr>{{row.f_operate_date}}</nobr>
            </td>
          </tr>
        </template>
      </data-grid>
    </criteria-paged>
  </div>

</template>
<script>
  import {PagedList} from 'vue-client'

  export default {
    title: '事件日志',
    name: 'QueryInstructResult',
    props: {
      row: {}
    },
    data () {
      return {
        handcental: false,
        cancelreason: '',
        cancelid: '',
        f_userfiles_id: '',
        model: new PagedList('rs/sql/QueryInstructResult', 10),
        row: null,
        searchshow: false,
        show: false
      }
    },

    ready () {
      this.$refs.paged.$refs.criteria.search()
    },
    watch: {
      'row' (val) {
        this.f_userfiles_id = val.f_userfiles_id
        if (this.row != null) {
          this.$refs.paged.$refs.criteria.search()
        }
      }
    },
    methods: {
      search (arg) {
        arg.condition = `f_meternumber='${this.row.f_meternumber}'`
        this.model.search(arg.condition, arg.model)
      }
    }
  }
</script>

