<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline">
        <a-row :gutter="24">

          <a-col :md="6" :sm="8">
            <a-form-item label="子任务ID">
              <a-input placeholder="请输入任务ID" v-model="queryParam.taskId"></a-input>
            </a-form-item>
          </a-col>

        <a-col :md="6" :sm="8">
            <a-form-item label="名称">
              <a-input placeholder="请输入名称" v-model="queryParam.name"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="查找类型">
              <!--<a-input placeholder="请输入查找类型" v-model="queryParam.findType"></a-input>-->
              <a-select v-model="queryParam.findType" allowClear>
                <a-select-option value="id">id</a-select-option>
                <a-select-option value="xpath">xpath</a-select-option>
                <a-select-option value="class">class</a-select-option>
                <a-select-option value="loop">loop</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <appiumTaskItem-modal ref="modalForm" @ok="modalFormOk"></appiumTaskItem-modal>
  </a-card>
</template>

<script>
  import AppiumTaskItemModal from './modules/AppiumTaskItemModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'

  export default {
    name: "AppiumTaskItemList",
    mixins:[JeecgListMixin],
    components: {
      AppiumTaskItemModal
    },
    data () {
      return {
        description: '任务子项信息管理页面',
        // 表头
        columns: [
		   {
            title: '子任务ID',
            align:"center",
            dataIndex: 'taskId'
           },
		   {
            title: '名称',
            align:"center",
            dataIndex: 'name'
           },
		   {
            title: '顺序',
            align:"center",
            dataIndex: 'seq'
           },
		   {
            title: '查找类型',
            align:"center",
            dataIndex: 'findType'
           },
		   {
            title: '查找关键字',
            align:"center",
            dataIndex: 'findKey'
           },
		   {
            title: '应用包名',
            align:"center",
            dataIndex: 'appPackage'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
		url: {
          list: "/appium/appiumTaskItem/list",
          delete: "/appium/appiumTaskItem/delete",
          deleteBatch: "/appium/appiumTaskItem/deleteBatch",
          exportXlsUrl: "appium/appiumTaskItem/exportXls",
          importExcelUrl: "appium/appiumTaskItem/importExcel",
       },
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    methods: {

    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>