<template>
  <div class="span" style="width: auto;">
    <p class="bg-info text-center" style="padding: 8px;">{{'人员调配记录'}}</p>
    <partial-view v-ref:pv @condition-changed="search">
      <criteria-paged :model="model" v-ref:paged :pager="false">
        <data-grid :model="model" partial='list' v-ref:grid >
          <template partial='head'>
            <tr>
              <th>操作时间</th>
              <th>操作记录</th>
            </tr>
          </template>
          <template partial='body'>
            <td style="text-align:center">{{row.time}}</td>
            <td style="text-align:center">{{row.type}}</td>
          </template>
        </data-grid>
      </criteria-paged>
    </partial-view>
  </div>
</template>

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

  export default {
    title: '人员调配记录',
    data () {
      return {
        model: new PagedList('rs/sql/ldap_getOperate',20, {
          tablename: `'t_address_change'`,items: `'*'`,
          orderitem: `'f_operate_date desc'`}),
      }
    },
    props: ['res_id'],
    ready () {
      this.search()
    },
    methods: {
      search() {
        this.model.search(`resid = '${this.res_id}' and operate='移动资源'`)
      }
    },
    watch: {
      'res_id' () {
        this.search()
      }
    }
  }
</script>
