<template>
  <div>
    <criteria-paged :model="model" v-ref:paged>
      <data-grid :model="model" v-ref:grid  partial='list'>
        <template partial='head'>
          <tr>
            <!--<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'>
          <!--<td style="text-align: center;">{{$index + 1}}</td>-->
          <td style="text-align: center;">{{row.f_title}}</td>
          <td style="text-align: center;">{{row.f_modify_date}}</td>
          <td style="text-align: center;">{{row.f_operator}}</td>
          <td style="text-align: center;">{{row.f_filepath}}</td>
        </template>
      </data-grid>
    </criteria-paged>
  </div>
</template>

<script>
  import { PagedList } from 'vue-client'
  export default {
    title: '燃气知识操作记录',
    name: 'KnowledgeRecord',
    data () {
      return {
        model: new PagedList('rs/sql/getGasKnowledge', 20, {tablename: '`t_records`', orderitem: '`f_modify_date DESC`'}),
        f_filialeids: this.$login.f.f_orgids
      }
    },
    props: {
      row: Object
    },
    created () {
    },
    ready () {
      this.search()
    },
    methods: {
      search () {
        let condition = `f_filialeids  = '${this.f_filialeids}'`
        condition += `and f_record_type like '%燃气%'`
        this.model.search(condition)
      }
    },
    watch: {
      'row.id' (val) {
        console.log('row变化', val)
        if (val) {
          this.search(val)
        }
      }
    }
  }
</script>

<style lang="less">
</style>
