<template>
    <div>
        <div>
            <TableHeader area datePicker ref="TableHeaderRef">
                <template #select>
                    <el-form-item label="问题来源">
                        <el-select v-model="tableStore.table.params.searchState" placeholder="请选择问题来源">
                            <el-option
                                v-for="item in uploadData"
                                :key="item.id"
                                :label="item.label"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="填报进度">
                        <el-select v-model="tableStore.table.params.searchStat1e" placeholder="请选择填报进度">
                            <el-option
                                v-for="item in uploadData"
                                :key="item.id"
                                :label="item.label"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item label="问题名称">
                        <el-select v-model="tableStore.table.params.searchState3" placeholder="请输入问题名称">
                            <el-option
                                v-for="item in uploadData"
                                :key="item.id"
                                :label="item.label"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                </template>
                <template #operation>
                    <el-button icon="el-icon-Stamp" type="primary">审核</el-button>
                    <el-button icon="el-icon-PieChart" type="primary">历史审核记录</el-button>
                </template>
            </TableHeader>
            <Table ref="tableRef" />
        </div>
    </div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'

const dictData = useDictData()
const uploadData = [
    {
        id: 0,

        label: '未上传'
    },
    {
        id: 1,

        label: '已上传'
    }
]

const dialogVisible = ref(false)
const TableHeaderRef = ref()
const title = ref('')

const ruleFormRef = ref()
const tableStore = new TableStore({
    url: '/system-boot/area/areaSelect',
    publicHeight: 65,
    method: 'POST',
    column: [
        { width: '60', type: 'checkbox' },
        {
            field: 'index',
            title: '序号',
            width: '60',
            formatter: (row: any) => {
                return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
            }
        },
        { field: 'orgName', title: '所属单位' },
        {
            field: 'problemSources',
            title: '问题来源'
        },
        { field: 'powerQualityProblemNo', title: '问题编号' },
        { field: 'problemName', title: '问题名称' },

        { field: 'dataDate', title: '提交时间' },
        { field: 'reportProcess', title: '填报节点' }
    ],

    loadCallback: () => {
        tableStore.table.data = [
            {
                status: 2
            }
        ]
    }
})

tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''

provide('tableStore', tableStore)
onMounted(() => {
    tableStore.index()
})
</script>
