<template>
  <div class="card flex-grow flex flex-col">
    <el-form inline :model="queryFormData">
      {{#each queryFormFields}}
      <el-form-item label="{{label}}">{{> WhichFormItem form="queryFormData"}}</el-form-item>
      {{/each}}
      {{#if (equals $import true)}}
      <el-form-item>
        {{#each queryFormBtnList}}
        <el-button @click="handleQueryFormBtn_{{name}}" type="{{type}}">{{ label }}</el-button>
        {{/each}}
      </el-form-item>
      {{/if}}
    </el-form>
    <div class="divider"></div>
    <div>
      {{#each tableRowBtnList}}
      <el-button @click="handleTableRowBtn_{{name}}" type="{{type}}">{{ label }}</el-button>
      {{/each}}
    </div>

    <div class="divider"></div>
    <div class="flex-auto">
      <el-table :data="tableData" @selection-change="handleSelectionChange" v-loading="loading"
        element-loading-background="#ffffff70">
        <el-table-column type="selection"></el-table-column>
        {{#each tableColFields}}
        <el-table-column prop="{{prop}}" label="{{label}}" width="auto" show-overflow-tooltip></el-table-column>
        {{/each}}
        {{#if tableColBtnList}}
        <el-table-column label="操作" fixed="right">
          <template #default="scope">
            {{#each tableColBtnList}}
            <el-link @click="handleTableColBtn_{{name}}(scope)" type="{{type}}" :underline="false" class="mr-2">{{
              label }}</el-link>
            {{/each}}
          </template>
        </el-table-column>
        {{/if}}
      </el-table>
    </div>

    <div class="flex justify-end">
      <el-pagination :page-size="limit" v-model:current-page="currentPage" @current-change="handleCurrentChange"
        background layout="total, prev, pager, next" :total="total" />
    </div>
  </div>

  <el-dialog v-model="dialogVisible_addOrEdit" append-to-body destroy-on-close>
    <el-form :model="dialogForm_Data" ref="dialogForm_Ref_addOrEdit" :rules="dialogForm_Rules_addOrEdit" label-width="120px">
      {{#each dialogFormFields}}
      <el-form-item label="{{label}}" prop="{{value}}">{{> WhichFormItem form="dialogForm_Data"}}</el-form-item>
      {{/each}}
      {{#if dialogFormBtnList}}
      <div class="flex justify-center">
        {{#each dialogFormBtnList}}
        <el-button @click="handleDialogFormBtn_{{name}}('dialogForm_Ref_addOrEdit')" type="{{type}}">{{ label }}</el-button>
        {{/each}}
      </div>
      {{/if}}
    </el-form>
  </el-dialog>

  <el-dialog v-model="dialogVisible_audit" append-to-body destroy-on-close>
    <el-form :model="dialogForm_Data" ref="dialogForm_Ref_audit" :rules="dialogForm_Rules_audit" label-width="120px">
      <el-form-item label="状态">
        <el-radio-group v-model="dialogForm_Data[dialogForm_Field_audit.FLAG]">
          <el-radio :label="0">通过</el-radio>
          <el-radio :label="1">未通过</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="原因" v-show="dialogForm_Data[dialogForm_Field_audit.FLAG] === 1">
        <el-input type="textarea" v-model="dialogForm_Data[dialogForm_Field_audit.REASON]" :rows="5" />
      </el-form-item>
      <div class="flex justify-center">
        {{#each dialogFormBtnList}}
        <el-button @click="handleDialogFormBtn_{{name}}('dialogForm_Ref_audit')" type="{{type}}">{{ label }}</el-button>
        {{/each}}
      </div>
    </el-form>
  </el-dialog>
</template>


        <!--<el-upload :http-request="handleTableRowBtn_{{name}}" class="inline-block mr-12px">
          <el-button type="{{type}}">{{ label }}</el-button>
          <template #file><span></span></template>
        </el-upload>-->
