| | |
| | | <template> |
| | | <div> <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item label="搜索" v-if="shouldShowSearch"> |
| | | <div> |
| | | <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item v-if="shouldShowSearch" label="搜索"> |
| | | <el-input v-model="queryParams.searchAll" :placeholder="searchPlaceholder" clearable /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | |
| | | <!-- 操作按钮区 --> |
| | | <el-row :gutter="24" class="table-toolbar"> |
| | | <el-button type="primary" :icon="Plus" @click="handleAdd">新建</el-button> |
| | | <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button> |
| | | <el-button type="info" :icon="Download" @click="handleExport" v-show="canExport">导出</el-button> |
| | | <el-button :icon="Plus" type="primary" @click="handleAdd">新建</el-button> |
| | | <el-button :icon="Delete" type="danger" @click="handleDelete">删除</el-button> |
| | | <el-button @click="jump">admins</el-button> |
| | | <el-button v-show="canExport" :icon="Download" type="info" @click="handleExport">导出</el-button> |
| | | </el-row> <!-- 表格组件 --> |
| | | <div> |
| | | <data-table :loading="loading" :table-data="tableData" :columns="columns" |
| | | @selection-change="handleSelectionChange" @edit="handleEdit" :show-selection="true" :border="true"> <!-- 字段名称列的自定义插槽 - 显示为标签 --> |
| | | <data-table :border="true" :columns="columns" :loading="loading" |
| | | :show-selection="true" :table-data="tableData" @edit="handleEdit" @selection-change="handleSelectionChange"> |
| | | <!-- 字段名称列的自定义插槽 - 显示为标签 --> |
| | | <template v-if="tabName === 'coalQualityMaintenance'" #fieldIds="{ row }"> |
| | | <template v-if="typeof row.fieldIds === 'string' && row.fieldIds.includes(',')"> |
| | | <el-tag v-for="(field, index) in row.fieldIds.split(',')" :key="index" type="primary" size="small" |
| | | style="margin-right: 4px; margin-bottom: 2px;"> |
| | | <el-tag v-for="(field, index) in row.fieldIds.split(',')" :key="index" size="small" style="margin-right: 4px; margin-bottom: 2px;" |
| | | type="primary"> |
| | | {{ getFieldDisplayName(field.trim()) }} |
| | | </el-tag> |
| | | </template> |
| | | <template v-else> |
| | | <el-tag type="primary" size="small"> |
| | | <el-tag size="small" type="primary"> |
| | | {{ getFieldDisplayName(row.fieldIds) || '--' }} |
| | | </el-tag> |
| | | </template> |
| | | </template> |
| | | </data-table> |
| | | </div> |
| | | <pagination v-if="total > 0" :page="pageNum" :limit="pageSizes" :total="total" @pagination="handPagination" |
| | | :layout="'total, prev, pager, next, jumper'" /> |
| | | <pagination v-if="total > 0" :layout="'total, prev, pager, next, jumper'" :limit="pageSizes" :page="pageNum" :total="total" |
| | | @pagination="handPagination"/> |
| | | <Supplier v-if="tabName === 'supplier'" v-model:copyForm="copyForm" |
| | | v-model:supplierDialogFormVisible="dialogFormVisible" :form="form" :title="title" @submit="handleSubmit" |
| | | @beforeClose="handleBeforeClose" @update:dialogFormVisible="handleDialogFormVisible" :addOrEdit="addOrEdit" /> |
| | | v-model:supplierDialogFormVisible="dialogFormVisible" :addOrEdit="addOrEdit" :form="form" :title="title" |
| | | @beforeClose="handleBeforeClose" @submit="handleSubmit" |
| | | @update:dialogFormVisible="handleDialogFormVisible"/> |
| | | <Customer v-if="tabName === 'customer'" v-model:copyForm="copyForm" |
| | | v-model:customerDialogFormVisible="dialogFormVisible" :form="form" :title="title" @submit="handleSubmit" |
| | | :addOrEdit="addOrEdit" @beforeClose="handleBeforeClose" /> |
| | | <Coal v-if="tabName === 'coal'" v-model:copyForm="copyForm" v-model:coalDialogFormVisible="dialogFormVisible" |
| | | :form="form" :title="title" :addOrEdit="addOrEdit" @submit="handleSubmit" /> |
| | | <coalQualityMaintenance v-if="tabName === 'coalQualityMaintenance'" v-model:copyForm="copyForm" |
| | | v-model:coalQualityMaintenanceDialogFormVisible="dialogFormVisible" :form="form" :title="title" |
| | | :addOrEdit="addOrEdit" @submit="handleSubmit" /> |
| | | <coalMeiZhiZiDuanWeiHu v-if="tabName === 'coalMeiZhiZiDuanWeiHu'" v-model:copyForm="copyForm" |
| | | v-model:coalMaintenanceFieldDialogVisible="dialogFormVisible" :form="form" :title="title" :addOrEdit="addOrEdit" |
| | | v-model:customerDialogFormVisible="dialogFormVisible" :addOrEdit="addOrEdit" :form="form" :title="title" |
| | | @beforeClose="handleBeforeClose" @submit="handleSubmit"/> |
| | | <Coal v-if="tabName === 'coal'" v-model:coalDialogFormVisible="dialogFormVisible" v-model:copyForm="copyForm" |
| | | :addOrEdit="addOrEdit" :form="form" :title="title" @submit="handleSubmit"/> |
| | | <coalQualityMaintenance v-if="tabName === 'coalQualityMaintenance'" v-model:coalQualityMaintenanceDialogFormVisible="dialogFormVisible" |
| | | v-model:copyForm="copyForm" :addOrEdit="addOrEdit" |
| | | :form="form" |
| | | :title="title" @submit="handleSubmit"/> |
| | | <coalMeiZhiZiDuanWeiHu v-if="tabName === 'coalMeiZhiZiDuanWeiHu'" v-model:coalMaintenanceFieldDialogVisible="dialogFormVisible" |
| | | v-model:copyForm="copyForm" :addOrEdit="addOrEdit" :form="form" |
| | | :title="title" |
| | | @submit="handleSubmit" /> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | // ===== 核心依赖导入 ===== |
| | | import { ref, reactive, onMounted, computed, getCurrentInstance } from "vue"; |
| | | import {computed, getCurrentInstance, onMounted, reactive, ref, nextTick} from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { Plus, Edit, Delete, Download } from "@element-plus/icons-vue"; |
| | | import {Delete, Download, Plus} from "@element-plus/icons-vue"; |
| | | |
| | | // ===== 组件导入 ===== |
| | | import DataTable from "@/components/Table/ETable.vue"; |
| | |
| | | import coalMeiZhiZiDuanWeiHu from "./mould/coalMeiZhiZiDuanWeiHu.vue"; |
| | | |
| | | // ===== API 服务导入 ===== |
| | | import { getSupply, delSupply } from "@/api/basicInformation/supplier.js"; |
| | | import { getCoalInfo, delCoalInfo } from "@/api/basicInformation/coal.js"; |
| | | import {delSupply, getSupply} from "@/api/basicInformation/supplier.js"; |
| | | import {delCoalInfo, getCoalInfo} from "@/api/basicInformation/coal.js"; |
| | | import { testUserList } from "@/api/tool/publicInterface.js"; |
| | | import { getAreaOptions } from "@/api/system/area.js"; |
| | | import { getCustomerList, delCustomer } from "@/api/basicInformation/customer.js"; |
| | | import {delCustomer, getCustomerList} from "@/api/basicInformation/customer.js"; |
| | | import { coalField, deleteCoalField } from "@/api/basicInformation/coalFieldMaintenance.js"; |
| | | import { getCoalFieldList, getCoalPlanList } from "@/api/basicInformation/coalQualityMaintenance"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | import router from "@/router"; |
| | | |
| | | // ===== 响应式状态管理 ===== |
| | | |
| | | const jump = () => { |
| | | }; |
| | | // 弹窗控制状态 |
| | | const dialogFormVisible = ref(false); |
| | | const form = ref({}); |
| | |
| | | const deleteApiMap = { |
| | | supplier: delSupply, |
| | | coal: delCoalInfo, |
| | | coalQualityMaintenance: () => { throw new Error('delCoalQuality API not imported'); }, |
| | | coalQualityMaintenance: () => { |
| | | throw new Error('delCoalQuality API not imported'); |
| | | }, |
| | | customer: delCustomer, |
| | | coalMeiZhiZiDuanWeiHu: deleteCoalField |
| | | }; |