From ac3756f19986bfd551c5db4ea803766dd60ab963 Mon Sep 17 00:00:00 2001 From: c Date: Fri, 3 Apr 2026 14:46:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=200.1.1=20=E4=BF=AE=E6=AD=A3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A6=82=E4=B8=8B=EF=BC=9A=201.=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BA=86=E9=83=A8=E5=88=86=E5=BC=80=E5=8F=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=BC=80=E6=BA=90=E6=97=B6=E7=9A=84=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=E3=80=82=202.=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BA=86=E6=88=90=E5=93=81=E5=85=A5=E5=BA=93=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=87=BA=E8=B4=A7=E5=8A=9F=E8=83=BD=E8=A1=8C=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=A1=86=E7=BC=93=E5=AD=98=E6=B2=A1=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=203.=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BA=86=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E9=97=AE=E9=A2=98=E3=80=82=204.=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E4=BA=86=E8=A1=A8=E6=A0=BC=E8=A1=8C=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84=E5=AE=BD=E5=BA=A6=E4=B8=8D=E5=A4=9F=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=205.=20?= =?UTF-8?q?=E5=AF=B9=20Excel=20=E8=A7=A3=E6=9E=90=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=BA=86=E5=85=BC=E5=AE=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 21 -------- package.json | 3 +- .../languages/mapping/base-info-mapping.ts | 2 +- .../base-pageable-table/BasePageableTable.vue | 35 +++++++++++++ .../base/base-table-form/BaseTableForm.vue | 11 +++- src/components/base/base-tree/BaseTree.vue | 4 +- .../DefaultOperateButtonColumn.vue | 2 +- src/views/core/login/loginForm.vue | 9 +--- .../FinishedProductReceiptView.vue | 25 ++++++--- .../FinishedProductShipmentView.vue | 4 +- .../purchase-order/PurchaseOrderView.vue | 4 +- .../purchase-plan/PurchasePlanView.vue | 2 +- src/views/sale/sale-order/SaleOrderView.vue | 2 +- src/views/systemset/sysrole/SysRoleView.vue | 2 +- .../inventory-count/InventoryCountView.vue | 4 +- .../StockTransferOrderView.vue | 4 +- src/views/workbenches/index.vue | 52 +------------------ 17 files changed, 81 insertions(+), 105 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 24550b3..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Brian Liu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/package.json b/package.json index 8aa0324..a1a6d81 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,9 @@ { "name": "erp-frontend", - "version": "2.0.0", + "version": "0.1.1", "private": true, "description": "牛安后台管理系统", "author": "Teeker <2456019588@qq.com>", - "license": "MIT", "type": "module", "scripts": { "dev": "vite --mode development", diff --git a/src/common/languages/mapping/base-info-mapping.ts b/src/common/languages/mapping/base-info-mapping.ts index b52cd7f..26540de 100644 --- a/src/common/languages/mapping/base-info-mapping.ts +++ b/src/common/languages/mapping/base-info-mapping.ts @@ -40,7 +40,7 @@ export const useStatus = () => { }; const finishedProductReceiptStatusKeyMap: Record = { - 1: "_base_info.finished_product_receipt_status.pending_outstock", + 0: "_base_info.finished_product_receipt_status.pending_outstock", 3: "_base_info.finished_product_receipt_status.outstocking", 4: "_base_info.finished_product_receipt_status.completed", }; diff --git a/src/components/base/base-pageable-table/BasePageableTable.vue b/src/components/base/base-pageable-table/BasePageableTable.vue index c6ea3b7..7d4b939 100644 --- a/src/components/base/base-pageable-table/BasePageableTable.vue +++ b/src/components/base/base-pageable-table/BasePageableTable.vue @@ -8,6 +8,9 @@ import { get } from "@/common/http/request"; interface Emits { (e: "data-loaded", data: any[]): void; (e: "expand-change", row: any, expandedRows: any[]): void; + (e: "select", selection: any[], row: any): void; + (e: "select-all", selection: any[]): void; + (e: "selection-change", selection: any[]): void; } const props = defineProps({ @@ -18,6 +21,16 @@ const props = defineProps({ parse: Function, expandRowKeys: Array as PropType<(string | number)[]>, rowKey: { type: String, default: "id" }, + // 树形数据配置 + treeProps: { + type: Object as PropType<{ children: string; hasChildren?: string }>, + default: () => ({ children: "children" }), + }, + // 是否显示为树形表格 + isTreeTable: { + type: Boolean, + default: false, + }, }); const emit = defineEmits(); const tableMainRef = ref | null>(null); @@ -67,6 +80,18 @@ const handleExpandChange = (row: any, expandedRows: any[]) => { emit("expand-change", row, expandedRows); }; +const handleSelect = (selection: any[], row: any) => { + emit("select", selection, row); +}; + +const handleSelectAll = (selection: any[]) => { + emit("select-all", selection); +}; + +const handleSelectionChange = (selection: any[]) => { + emit("selection-change", selection); +}; + const recomputeTableHeight = () => { if (!tableMainHostEl.value) return; const top = tableMainHostEl.value.getBoundingClientRect().top; @@ -85,6 +110,11 @@ defineExpose({ sort: (field: string, order: string) => { tableMainRef.value?.tableRef?.sort(field, order); }, + toggleRowSelection: (row: any, selected?: boolean) => { + tableMainRef.value?.toggleRowSelection(row, selected); + }, + getSelectionRows: () => tableMainRef.value?.getSelectionRows() || [], + clearSelection: () => tableMainRef.value?.tableRef?.clearSelection(), }); onMounted(async () => { @@ -135,7 +165,12 @@ onMounted(async () => { v-model:page-size="pageSize" :expand-row-keys="expandRowKeys" :row-key="rowKey" + :tree-props="treeProps" + :is-tree-table="isTreeTable" @expand-change="handleExpandChange" + @select="handleSelect" + @select-all="handleSelectAll" + @selection-change="handleSelectionChange" > diff --git a/src/components/base/base-table-form/BaseTableForm.vue b/src/components/base/base-table-form/BaseTableForm.vue index 5d65198..10bef4b 100644 --- a/src/components/base/base-table-form/BaseTableForm.vue +++ b/src/components/base/base-table-form/BaseTableForm.vue @@ -94,6 +94,8 @@ watch( if (!val) { // 关闭时清空选中 selectedRows.value = []; + // 清空表格内部的选择状态,避免下次打开时残留 + tableRef.value?.clearSelection(); } } ); @@ -129,7 +131,7 @@ defineExpose({