<template>
    <headerTop @search="searchFn" @reset="resetFn" @export="exportFn"></headerTop>
    <infoCom ref="infoComRef"></infoCom>
    <el-card shadow="always" class="content_body_row">
        <el-table :data="tableListInfo.list" border style="width: 100%" show-overflow-tooltip
            :max-height="'calc(100vh - 72px - 48px - 65px - 12px - 60px - 88px)'"
            :height="'calc(100vh - 72px - 48px - 65px - 12px - 60px  - 88px)'">
            <el-table-column type="index" width="72" label="序号" />
            <el-table-column prop="v_order_code" label="订单编号" min-width="150" />
            <el-table-column prop="v_q_company" label="求租方企业名称" min-width="160">
            </el-table-column>
            <el-table-column prop="v_c_company" label="出租方企业名称" min-width="160">
            </el-table-column>
            <el-table-column prop="v_equip_code" label="装备编号" min-width="160">
            </el-table-column>
            <el-table-column prop="v_equip_name" label="装备名称" min-width="160">
            </el-table-column>
            <el-table-column prop="v_time" label="工期" min-width="160">
            </el-table-column>
            <el-table-column prop="v_money" label="租金" min-width="160">
            </el-table-column>
            <el-table-column prop="v_create_time" label="订单创建时间" min-width="160">
            </el-table-column>
            <el-table-column label="操作" align="center" width="160">

                <template #default="scope">
                   
                    <el-button type="primary" size="small" @click.prevent="showRowFn(scope.row)">
                        查看
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
        <div class="paination_out">
            <Pagination :currentPage="paginationInfo.currentPage" :pageSize="paginationInfo.pageSize" @sendPage="getPageFn">
            </Pagination>
        </div>
    </el-card>
</template>

<script lang="ts" setup>
import headerTop from "./com/headerTop.vue"
import infoCom from "./com/infoCom.vue"
import { ElConfirmBeforeOpert } from "utils/elementCom"
const infoComRef = ref()
const paginationInfo = reactive({
    currentPage: 1,
    pageSize: 15
})
const tableData = [
    {
        v_id: '1',
        v_order_code: '2016-05-03',
        v_q_company: 'Tom',
        v_c_company: 'California',
        v_equip_code: 'Los Angeles',
        v_equip_name: 'No. 189, Grove St, Los Angeles',
        v_time: 'CA 90036',
        v_money:'3241321321',
        v_create_time:'2015-01 11-22-55',
        v_status: '1',
    },
    {
        v_id: '2',
        v_order_code: '2016-05-03',
        v_q_company: 'Tom',
        v_c_company: 'California',
        v_equip_code: 'Los Angeles',
        v_equip_name: 'No. 189, Grove St, Los Angeles',
        v_time: 'CA 90036',
        v_money:'3241321321',
        v_create_time:'2015-01 11-22-55',
        v_status: '1',
    },
    {
        v_id: '3',
        v_order_code: '2016-05-03',
        v_q_company: 'Tom',
        v_c_company: 'California',
        v_equip_code: 'Los Angeles',
        v_equip_name: 'No. 189, Grove St, Los Angeles',
        v_time: 'CA 90036',
        v_money:'3241321321',
        v_create_time:'2015-01 11-22-55',
        v_status: '1',
    },
    {
        v_id: '4',
        v_order_code: '2016-05-03',
        v_q_company: 'Tom',
        v_c_company: 'California',
        v_equip_code: 'Los Angeles',
        v_equip_name: 'No. 189, Grove St, Los Angeles',
        v_time: 'CA 90036',
        v_money:'3241321321',
        v_create_time:'2015-01 11-22-55',
        v_status: '2',

    },
    {
        v_id: '5',
        v_order_code: '2016-05-03',
        v_q_company: 'Tom',
        v_c_company: 'California',
        v_equip_code: 'Los Angeles',
        v_equip_name: 'No. 189, Grove St, Los Angeles',
        v_time: 'CA 90036',
        v_money:'3241321321',
        v_create_time:'2015-01 11-22-55',
        v_status: '3',
    },

]

let tableListInfo = reactive({
    list: tableData
})


const showRowFn = (row: any) => {
    infoComRef.value.show({
        title: "111"
    })  

}

const deleteItem = (row: any) => {
    const itemID = row.v_id
    console.log("ITEMid", row)
}

const deleteRowFn = (row: any) => {
    ElConfirmBeforeOpert(
        '操作确认',
        '是否确定删除数据？',
        deleteItem,
        '确定',
        '取消',
        row
    )

}

const searchFn = () => {

}

const resetFn = () => {

}

const exportFn = () => {

}
const getPageFn = (val: any) => {
    paginationInfo.currentPage = val.currentPage
    paginationInfo.pageSize = val.pageSize
    initTableList()
}

const initTableList = () => {

}

</script>

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