<template>
  <div class="data-dictionary h100">
    <common-layout  ref="layoutRef" :table-attrs="{
     'has-operation':true
   }" :form-attrs="{
     'span-attrs':{
       span:5
     }
   }" :table-header="clearRuleHomeTableHeader" :get-table-list="getTableTata" :filter-form="clearRuleHomeFilterForm()">

      <template #operation="{data}">
        <el-button type="info" @click="$emit('changeOperation','edit',data)">配置规则</el-button>

      </template>
    </common-layout>
  </div>
</template>

<script>
import CommonLayout from "@/components/CommonLayout.vue";
import {clearRuleHomeFilterForm, dataDictionaryHomeFilterForm} from "@/data/all-forms";
import {
  clearRuleHomeTableHeader,

} from "@/data/all-table-header";
import {ref} from "vue";
import {getClearRuleHomeTableData} from "@/service/zsk/clear-rule";
import {useRootStore} from "@/stores/useStore";
import {useGetUnitSelect} from "@/unit/use-method/use-unit";
import {useActiveGetTableData} from "@/unit/use-method/usePagination";

export default {
  name: "ClearRuleHome",
  components: {CommonLayout},
  setup() {
    useActiveGetTableData(getTableTata)

    const layoutRef = ref(null)
    // const {formConfig} = useGetUnitSelect(clearRuleHomeFilterForm,'unitCode')
    function getTableTata() {
      getClearRuleHomeTableData({
        pageIndex:layoutRef.value.pageIndex,
        pageSize:layoutRef.value.pageSize,
        catalogName:layoutRef.value.form.catalogName,
        unitCode:layoutRef.value.form.unitCode,
        taskStatus:layoutRef.value.form.taskStatus,
      }).then(res => {
        layoutRef.value.getResData(res.msg[0].Rows||[],res.msg[0].TotalRowCount)
      })

    }
    return {
      clearRuleHomeFilterForm,
      clearRuleHomeTableHeader,
      getTableTata,
      layoutRef
    }
  }
}
</script>

<style scoped lang="scss">

</style>
