<template >
  <div>
    <custom-page :data-list="Data" :page.sync="search.page" :page-size.sync="search.size"
                 :total="total" :columns="columns">
      <template slot-scope="{row}" slot="audit_state_one">
        <div class="space-x-3">
          <Tag color="blue" v-if="row.audit_state_one == 0">待审核</Tag>
          <Tag color="green" v-else-if="row.audit_state_one == 1" >通过</Tag>
          <Tag color="magenta" v-else >未通过</Tag>
        </div>
      </template>
      <template slot-scope="{row}" slot="audit_state_two">
        <div class="space-x-3">
          <Tag color="blue" v-if="row.audit_state_two == 0">待审核</Tag>
          <Tag color="green" v-else-if="row.audit_state_two == 1" >通过</Tag>
          <Tag color="magenta" v-else >未通过</Tag>
        </div>
      </template>
      <template slot-scope="{row}" slot="execute_state">
        <div class="space-x-3">
          <Tag color="cyan" v-if="row.execute_state == -1">被驳回</Tag>
          <Tag color="geekblue" v-else-if="row.execute_state == 1">执行中...</Tag>
          <Tag color="green" v-else-if="row.execute_state == 2" >执行成功</Tag>
          <Tag color="red" v-else-if="row.execute_state == 3" >执行失败</Tag>
          <Tag color="purple" v-else >未执行</Tag>
        </div>
      </template>
      <template slot-scope="{row}" slot="operation">
        <Dropdown transfer trigger="click"  @on-click="onDropdownEvent($event,row)">
          <a href="javascript:void(0)">
            操作
            <Icon type="ios-arrow-down"></Icon>
          </a>
          <template #list>
            <DropdownMenu slot="list">
              <DropdownItem name="show" >查看</DropdownItem>
              <DropdownItem name="execute">执行</DropdownItem>
              <DropdownItem name="reject">驳回</DropdownItem>
            </DropdownMenu>
          </template>
        </Dropdown>
      </template>
    </custom-page>

    <Modal v-model="showApplyDialog" title="详情" width="70%" >
      <div style="max-height:500px;overflow: auto">
        <div v-for="(item,index) in DataDetail">
          <div  style="padding: 10px 0 5px 0;" v-if="index != 'deleted_at'">
            <span style="font-size: 20px;font-weight:bold">{{index}}：</span>
            <span style="font-size: 20px;">{{item}}</span>
            <hr>
          </div>
        </div>
      </div>
      <div slot="footer"></div>
    </Modal>



  </div>
</template>

<script lang="ts" src="./execute.ts"></script>