<script lang='ts' setup>
    import { reactive } from 'vue';
    const OBUList = reactive({
        cno: '',
        carNo: '',
        carColors: '',
        OBUno: '',
    })
const options = [
  {
    value: 'Option1',
    label: 'Option1',
  },
  {
    value: 'Option2',
    label: 'Option2',
  },
  {
    value: 'Option3',
    label: 'Option3',
  },
  {
    value: 'Option4',
    label: 'Option4',
  },
  {
    value: 'Option5',
    label: 'Option5',
  },
]
const colors = [{
            value: 'Option1',
            label: '蓝色',
        },
        {
            value: 'Option2',
            label: '黄色',
        },
        {
            value: 'Option3',
            label: '黑色',
        },
        {
            value: 'Option4',
            label: '白色',
        },
        {
            value: 'Option5',
            label: '渐变绿色',
        },
        {
            value: 'Option6',
            label: '黄绿双拼色',
        },
        {
            value: 'Option7',
            label: '蓝白渐变色',
        },
        {
            value: 'Option8',
            label: '未确定',
        },
        {
            value: 'Option9',
            label: '绿色',
        },
        {
            value: 'Option10',
            label: '红色',
        },
    ]
const tableData = [
  {
    customerName: '周金波',
    carNo: '贵CEP186',
    carColor: '白色',
    carStyle: '一型客车',
    OBUNo: '5202161708027065',
    channel: '中国邮政储蓄银行股份有限公司贵州省分行',
    OBUStatus: '正常',
  },
  {
    customerName: '周金波',
    carNo: '贵CEP186',
    carColor: '白色',
    carStyle: '一型客车',
    OBUNo: '5202161708027065',
    channel: '中国邮政储蓄银行股份有限公司贵州省分行',
    OBUStatus: '正常',
  },
  {
    customerName: '周金波',
    carNo: '贵CEP186',
    carColor: '白色',
    carStyle: '一型客车',
    OBUNo: '5202161708027065',
    channel: '中国邮政储蓄银行股份有限公司贵州省分行',
    OBUStatus: '正常',
  },
  {
    customerName: '周金波',
    carNo: '贵CEP186',
    carColor: '白色',
    carStyle: '一型客车',
    OBUNo: '5202161708027065',
    channel: '中国邮政储蓄银行股份有限公司贵州省分行',
    OBUStatus: '正常',
  },
  
]
const handleView = (item:any,v:any) => {
  console.log('view',item,v)
}
const handleEdit = (item:any,v:any) => {
  console.log('edit',item,v.OBUNo)
}
</script>
<template>
    <div class="OBU-query content-warpper">
        <el-form :inline="true" :model="OBUList" class="demo-form-inline">
            <el-form-item label="客户编号">
                <el-input v-model="OBUList.cno" placeholder="客户编号" />
            </el-form-item>
            <el-form-item label="车牌号码">
                <el-input v-model="OBUList.carNo" placeholder="车牌号码" />
            </el-form-item>
            <el-form-item label="车牌颜色">
                <el-select v-model="OBUList.carColors" class="m-2" placeholder="Select">
                    <el-option
                    v-for="item in colors"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                    />
                </el-select>
            </el-form-item>
            <el-form-item label="OBU编号">
                <el-input v-model="OBUList.OBUno" placeholder="OBU编号" />
            </el-form-item>
            <el-form-item><el-button type="primary">读OBU</el-button></el-form-item>
            <el-form-item label="状态">
                <el-select v-model="OBUList.carColors" class="m-2" placeholder="Select">
                    <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                    />
                </el-select>
            </el-form-item>
            <el-form-item label="每条页数">
                <el-select v-model="OBUList.carColors" class="m-2" placeholder="Select">
                    <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                    />
                </el-select>
            </el-form-item>
            <el-form-item><el-button type="primary" icon="Search">查询</el-button></el-form-item>
            <el-form-item><el-button type="warning" plain icon="Refresh">重置</el-button></el-form-item>
        </el-form>
        <el-table :data="tableData" style="width: 100%">
            <el-table-column type="index" label="序号" width="64" fixed align="center" />
            <el-table-column fixed prop="customerName" label="客户名称" width="100" align="center" />
            <el-table-column prop="carNo" label="车牌" width="100" align="center" />
            <el-table-column prop="carColor" label="车牌颜色" width="120" align="center" />
            <el-table-column prop="carStyle" label="车型" width="100" align="center" />
            <el-table-column prop="OBUNo" label="OBU编号" width="160" align="center" />
            <el-table-column prop="channel" label="渠道" width="360" align="center" />
            <el-table-column prop="OBUStatus" label="OBU状态" width="100" align="center" />
            <el-table-column fixed="right" label="操作" width="160" align="center" >
            <template #default="scope">
                <el-button type="primary" size="small" @click="handleView(scope.$index, scope.row)">详情</el-button>
                <el-button type="success" size="small" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
            </template>
            </el-table-column>
        </el-table>
    </div>
</template>
<style scoped>
.el-form--inline .el-form-item{
    margin-right: 16px;
}
</style>