| | |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | icon="editPen" |
| | | @click="showImage(row)" |
| | | > |
| | | 附件 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | text |
| | | icon="delete" |
| | |
| | | </div> |
| | | <RepairModal ref="repairModalRef" @ok="getTableData" /> |
| | | <MaintainModal ref="maintainModalRef" @ok="getTableData" /> |
| | | <ImagePreviewDialog v-model:model-value="showImages" :images="imageUrls" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { usePaginationApi } from "@/hooks/usePaginationApi"; |
| | | import { getRepairPage, delRepair } from "@/api/equipmentManagement/repair"; |
| | | import {getRepairPage, delRepair, getRepairById} from "@/api/equipmentManagement/repair"; |
| | | import { onMounted, getCurrentInstance } from "vue"; |
| | | import RepairModal from "./Modal/RepairModal.vue"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import MaintainModal from "./Modal/MaintainModal.vue"; |
| | | import ImagePreviewDialog from "@/components/ImagePreview/ImagePreviewDialog.vue"; |
| | | |
| | | defineOptions({ |
| | | name: "设备报修", |
| | |
| | | // 模态框实例 |
| | | const repairModalRef = ref(); |
| | | const maintainModalRef = ref(); |
| | | |
| | | const showImages = ref(false) |
| | | const imageUrls = ref([]) |
| | | |
| | | // 表格多选框选中项 |
| | | const multipleList = ref([]); |
| | |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | width: "300px", |
| | | }, |
| | | ] |
| | | ); |
| | |
| | | }); |
| | | }; |
| | | |
| | | const showImage = async (row) => { |
| | | const {data} = await getRepairById(row.id) |
| | | imageUrls.value = data?.files.map((item) => item.url) |
| | | showImages.value = true |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |