<template>
  <div id="index">
    <list-frame title="科目列表页" @query="search" :filter="filFields">
      <data-table :fields="fields" :data="index" :opera="opera" @edit="toEdit"></data-table>
    </list-frame>
  </div>
</template>

<script>
import listFrame from '@frame/layout/admin/list-frame';
import dataTable from '@frame/layout/admin/data-table';
export default {
  name: 'index',
  props: {},
  components: {
    dataTable,
    listFrame,
  },
  data: () => ({
    opera: [
      {
        label: '编辑',
        icon: 'el-icon-edit',
        method: 'edit',
      },
    ],
    fields: [
      { label: '科目名称', prop: 'name' },
      { label: '科目代码', prop: 'code' },
    ],
    index: [
      { name: '问卷1', code: '12' },
      { name: '问卷2', code: '12' },
      { name: '问卷3', code: '12' },
    ],
    filFields: [
      { label: '科目名称', model: 'name' },
      { label: '科目代码', model: 'code' },
    ],
  }),
  created() {},
  computed: {},
  methods: {
    search({ skip = 0, limit = 15, ...info } = {}) {
      console.log(`in search`);
    },
    toEdit(data) {
      console.log(`in toEdit`);
      console.log(data);
    },
  },
};
</script>

<style lang="scss" scoped></style>
