<template>
  <div>
    <div>
      <div ref="lxHeader">
        <LxHeader
          style="margin-bottom: 10px; border: 0px; margin-top: 15px"
        >
          <div slot="content"></div>
          <slot>
            <header-content :auths="auths_auth_mixin">
              <template #search>
                <div style="display: flex">
                  <Button
                    type="primary"
                    @click="$refs['xyTable'].getTableData(true)"
                  >查询</Button
                  >
                </div>
              </template>
              <template #create>
                <Button
                  type="primary"
                  @click="$refs['create'].setType('add'),$refs['create'].show()"
                >新增</Button
                >
              </template>
            </header-content>
          </slot>
        </LxHeader>
      </div>
    </div>

    <xy-table ref="xyTable"
              :table-item="table"
              :auths="auths_auth_mixin"
              :action="index"
              :destroy-action="destroy"
              @editor="row => {
                $refs['create'].setId(row.id);
                $refs['create'].setType('editor');
                $refs['create'].show();
              }"></xy-table>

    <create ref="create" @refresh="$refs['xyTable'].getTableData()"></create>
  </div>
</template>

<script>
import { index,destroy } from "@/api/categoryType"
import { authMixin } from "@/mixin/authMixin";
import headerContent from "@/components/LxHeader/XyContent.vue";
import LxHeader from "@/components/LxHeader/index.vue";
import create from "./component/create.vue"
export default {
  mixins: [authMixin],
  components: {
    headerContent,
    LxHeader,
    create
  },
  data() {
    return {
      table: [
        {
          type: "index",
          width: 46,
          label: "序号"
        },
        {
          prop: "title",
          label: "清单类型名称"
        },
        {
          prop: "myindex",
          label: "排序"
        }
      ]
    }
  },
  methods: {
    index,destroy,
  },
  computed: {},
}
</script>

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