From 6f73bb7101787b58b5f0ea72432d5a5c8ad7a3d3 Mon Sep 17 00:00:00 2001 From: dzq Date: Fri, 19 Dec 2025 15:34:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=9F=9C=E6=A0=BC=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E7=BD=AE=E6=9F=9C=E6=A0=BC=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在cabinet-cell.ts中新增resetCellById接口 - 在cell-edit-modal.vue中添加密码重置功能及按钮 - 优化detail.vue中柜格卡片显示样式,区分占用状态 - 调整部分代码格式和缩进 --- src/api/cabinet/cabinet-cell.ts | 5 +++ .../cabinet/cabinet-cell/cell-edit-modal.vue | 21 +++++++++- .../cabinet/smart-cabinet-card/detail.vue | 41 +++++++++++++++---- 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/api/cabinet/cabinet-cell.ts b/src/api/cabinet/cabinet-cell.ts index f855269..6af86cc 100644 --- a/src/api/cabinet/cabinet-cell.ts +++ b/src/api/cabinet/cabinet-cell.ts @@ -118,6 +118,11 @@ export const configureGoodsCellsStock = (cellId: number, goodsId: number, stock: export const changeGoodsCellsStock = (cellId: number, stock: number) => { return http.request>('put', `/cabinet/cell/changeGoodsCellsStock/${cellId}/${stock}`); }; + export const clearGoodsCells = (cellId: number) => { return http.request>('put', `/cabinet/cell/clearGoodsCells/${cellId}`); +}; + +export const resetCellById = (cellId: number) => { + return http.request>('put', `/cabinet/cell/reset/${cellId}`); }; \ No newline at end of file diff --git a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue index 60e77d3..dba3b74 100644 --- a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue +++ b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue @@ -2,7 +2,7 @@ import { ref, reactive, watch } from "vue"; import { ElMessage, ElMessageBox } from "element-plus"; import { useRenderIcon } from "@/components/ReIcon/src/hooks"; -import { updateCabinetCell, clearGoodsCells } from "@/api/cabinet/cabinet-cell"; +import { updateCabinetCell, clearGoodsCells, resetCellById } from "@/api/cabinet/cabinet-cell"; import Confirm from "@iconify-icons/ep/check"; import type { FormRules } from 'element-plus'; @@ -96,6 +96,17 @@ const closeDialog = () => { emit('update:modelValue', false); }; +const handleResetPassword = async () => { + try { + await resetCellById(props.row.cellId); + formData.password = ''; + ElMessage.success('密码已重置'); + emit("refresh"); + } catch (error) { + console.error('重置密码失败', error); + } +}; + async function handleClearGoods() { try { await ElMessageBox.confirm( @@ -143,6 +154,9 @@ watch(() => props.row, (val) => { + + 清空 + @@ -173,15 +187,18 @@ watch(() => props.row, (val) => {