From 8bc6c3b10fdb8acbd6e29425591a55056a621fe0 Mon Sep 17 00:00:00 2001 From: lixiaolong <702156524@qq.com> Date: Fri, 16 Oct 2026 17:17:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(assistant):=20=E6=94=AF=E6=8C=81=E7=89=A9?= =?UTF-8?q?=E5=93=81=E6=A1=A3=E6=A1=88=E7=B1=BB=E5=88=AB=E7=9A=84=E6=9B=B4?= =?UTF-8?q?=E6=AD=A3=E4=B8=8E=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在业务助手中添加对物品类别更正的支持,允许用户手动纠正类别 - 实现类别更正后的档案同步更新功能,确保数据一致性 - 添加权限控制验证,仅授权用户可执行类别更正操作 - 优化采购单编辑界面,显示类别更正的相关提示信息 - 修复批量项目设置时跳过已执行行的问题 - 增强物品档案匹配逻辑,保留显式类别更正而不被覆盖 - 完善单元测试覆盖类别更正的各种场景 --- .../assistant/AssistantBusinessRules.java | 2 +- .../assistant/BusinessActionRegistry.java | 24 +- .../projectdev/PurchaseSheetDatabaseTest.java | 21 +- .../AssistantPurchaseSheetContractTest.java | 42 +- .../service/impl/PurchaseSheetService.java | 40 +- ruoyi-ui-vue3/package-lock.json | 1436 ++++++++++++++++- .../BusinessAssistant/AssistantDraft.vue | 2 +- .../AssistantPurchaseProject.vue | 14 +- .../src/components/PurchaseSheet/index.vue | 3 +- .../src/utils/assistant-draft-edit.js | 13 +- ruoyi-ui-vue3/src/utils/purchase-sheet.js | 5 +- .../business-assistant-draft-edit.test.mjs | 10 + .../tests/unit/purchase-project.test.mjs | 18 +- .../tests/unit/purchase-sheet-input.test.mjs | 10 + 14 files changed, 1613 insertions(+), 27 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/AssistantBusinessRules.java b/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/AssistantBusinessRules.java index 03dc30e..0cc3bff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/AssistantBusinessRules.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/AssistantBusinessRules.java @@ -36,7 +36,7 @@ public final class AssistantBusinessRules { case "budget.save" -> List.of("预算金额是该项目该经费科目的目标总额,不是本次增减额;若用户只给增减额,应先查询当前预算。", "已有预算未要求修改的预警比例、调整说明应保留;预警比例范围0至100。设置预算不代表确认采购或实际付款。"); case "budget.query" -> List.of("查询所选项目各经费科目预算,区别预算总额、已锁定采购费用和剩余额度。"); case "budget.ledger" -> List.of("查询预算和采购费用变动流水,不把它解释成实际银行收付款流水。"); - case "purchase.create", "purchase.update" -> List.of("采购与实际在线表格相同:按名称、品牌、规格精确匹配物品档案,未匹配时可在人工确认后自动建档;productId可不填,不得要求先手工建档才能采购。模糊同名多规格不能强行选中。", "维护物品名称、品牌、规格、类别、单位;品牌和规格是文本,类别和单位必须选择业务字典已有值,禁止自动新建字典。匹配已有档案时单位固定、已有非空类别沿用。", "采购报价可留空。purchaseBatchId选择已有批次;batchName非空表示新建批次,两者互斥,同名新批次行归入同批。均空表示未组批;更新未要求改批次时保留原批次。", "供应商在创建新批次时可选;采购日期省略时使用预览中固定的当天日期。保存采购清单不锁价、不下单、不登记到货。", "整张采购草稿一次事务提交,确认前可补齐或修改全部行,不能声称已执行或绕过未通过校验的行。"); + case "purchase.create", "purchase.update" -> List.of("采购与实际在线表格相同:按名称、品牌、规格精确匹配物品档案,未匹配时可在人工确认后自动建档;productId可不填,不得要求先手工建档才能采购。模糊同名多规格不能强行选中。", "维护物品名称、品牌、规格、类别、单位;品牌和规格是文本,类别和单位必须选择业务字典已有值,禁止自动新建字典。匹配已有档案时单位固定;未要求修改类别时沿用档案类别。用户明确更正类别时保留指定值,提示确认后同步更正物品档案,服务端校验物品维护权限和有效字典;不能悄悄覆盖用户的更正,也不能直接执行。", "采购报价可留空。purchaseBatchId选择已有批次;batchName非空表示新建批次,两者互斥,同名新批次行归入同批。均空表示未组批;更新未要求改批次时保留原批次。", "供应商在创建新批次时可选;采购日期省略时使用预览中固定的当天日期。保存采购清单不锁价、不下单、不登记到货。", "整张采购草稿一次事务提交,确认前可补齐或修改全部行,不能声称已执行或绕过未通过校验的行。"); case "purchase.delete" -> List.of("按原采购明细删除,已有锁价、到货等业务须遵守业务校验,不自动删除关联记录。"); case "purchase.query", "purchase.history" -> List.of("区分采购需求、采购锁价、到货验收与入库,不把采购数量当作当前库存;同物品不同项目、批次是不同明细。"); case "purchase.totals" -> List.of("按采购筛选条件查询汇总数量和金额,统计以系统汇总结果为准,不将列表当前页相加冒充全部采购总额。"); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/BusinessActionRegistry.java b/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/BusinessActionRegistry.java index 66d9751..05ebe98 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/BusinessActionRegistry.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/service/assistant/BusinessActionRegistry.java @@ -438,7 +438,7 @@ public class BusinessActionRegistry { Map,Map> itemPlans=new HashMap<>(); for(var row:rows) { if(row.get("id")!=null&&!ids.add(row.get("id").toString()))errors.add("同一采购明细不能在本次草稿中重复修改"); - if(row.get("_itemResolution") instanceof Map resolution&&!"EXISTING".equals(resolution.get("kind"))) { + if(row.get("_itemResolution") instanceof Map) { List identity=List.of("materialName","materialBrand","materialParams").stream().map(field->Objects.toString(row.get(field),"").trim().replaceAll("\\s+"," ").toLowerCase(Locale.ROOT)).toList(); Map previous=itemPlans.putIfAbsent(identity,row); if(previous!=null&&(!Objects.equals(previous.get("unit"),row.get("unit"))||!Objects.equals(previous.get("category"),row.get("category"))))errors.add("物品【"+row.get("materialName")+"】名称、品牌、规格相同,单位或类别却不一致,请核对后统一"); @@ -473,7 +473,7 @@ public class BusinessActionRegistry { result.put("productId",match.getId()); snapshots.put("purchaseCatalog",itemSnapshot(match)); if(Objects.toString(result.get("unit"),"").isBlank())result.put("unit",match.getUnit()); - if(!Objects.toString(match.getCategory(),"").isBlank())result.put("category",match.getCategory()); + if(Objects.toString(result.get("category"),"").isBlank())result.put("category",match.getCategory()); } } catch(ServiceException exception) { errors.add(exception.getMessage()); } return result; @@ -492,12 +492,20 @@ public class BusinessActionRegistry { PurchaseSheetService sheets=context.getBean(PurchaseSheetService.class); try { if(!Objects.toString(row.get("materialName"),"").isBlank()&&!Objects.toString(row.get("unit"),"").isBlank()&&!Objects.toString(row.get("category"),"").isBlank()) { - PurchaseRequest request=(PurchaseRequest)buildArguments(action,payload(action,row),false)[0]; - var preview=sheets.previewItem(request); ProductInfo item=preview.item(); - snapshots.put("itemResolution",Map.of("kind",preview.kind(),"item",itemSnapshot(item))); - row.put("productId",item.getId());row.put("materialName",item.getProductName());row.put("materialBrand",item.getBrand());row.put("materialParams",item.getSpec());row.put("unit",item.getUnit());row.put("category",item.getCategory()); - row.put("_itemResolution",Map.of("kind",preview.kind(),"label",switch(preview.kind()){case "CREATE"->"确认后新增物品档案";case "FILL_CATEGORY"->"使用已有档案并补充类别";default->"使用已有物品档案";})); - if(item.getId()!=null)labels.put("productId",label("item",itemSnapshot(item))); + // Item preview must not deserialize unresolved supplier/project/batch + // candidates as numeric IDs and misreport them as an item-format error. + var itemValues=new LinkedHashMap(); + for(String key:List.of("productId","materialName","materialBrand","materialParams","unit","category")) + if(row.containsKey(key))itemValues.put(key,row.get(key)); + if(itemValues.values().stream().noneMatch(value->value instanceof Map||value instanceof Collection)) { + PurchaseRequest request=json.convertValue(itemValues,PurchaseRequest.class); + var preview=sheets.previewItem(request); ProductInfo item=preview.item(); + snapshots.put("itemResolution",Map.of("kind",preview.kind(),"item",itemSnapshot(item))); + row.put("productId",item.getId());row.put("materialName",item.getProductName());row.put("materialBrand",item.getBrand());row.put("materialParams",item.getSpec());row.put("unit",item.getUnit());row.put("category",item.getCategory()); + row.put("_itemResolution",Map.of("kind",preview.kind(),"label",switch(preview.kind()){case "CREATE"->"确认后新增物品档案";case "FILL_CATEGORY"->"使用已有档案并补充类别";case "UPDATE_CATEGORY"->"确认后同步更正物品档案类别";default->"使用已有物品档案";})); + row.put("_assistantCanEditCategory",com.ruoyi.common.utils.SecurityUtils.isAdmin()||com.ruoyi.common.utils.SecurityUtils.hasPermi("warehouse:product:edit")); + if(item.getId()!=null)labels.put("productId",label("item",itemSnapshot(item))); + } } } catch(ServiceException exception) { errors.add(exception.getMessage()); } catch(IllegalArgumentException exception) { errors.add("物品资料格式不正确"); } diff --git a/ruoyi-admin/src/test/java/com/ruoyi/projectdev/PurchaseSheetDatabaseTest.java b/ruoyi-admin/src/test/java/com/ruoyi/projectdev/PurchaseSheetDatabaseTest.java index df9d26c..329e58f 100644 --- a/ruoyi-admin/src/test/java/com/ruoyi/projectdev/PurchaseSheetDatabaseTest.java +++ b/ruoyi-admin/src/test/java/com/ruoyi/projectdev/PurchaseSheetDatabaseTest.java @@ -38,6 +38,24 @@ import static org.mockito.Mockito.*; /** Real MySQL saves/locks run inside a rollback-only transaction, never against another database. */ @EnabledIfSystemProperty(named="projectDbTests", matches="true") class PurchaseSheetDatabaseTest { + @Test void savedPurchaseCategoryCanBeCorrectedWithoutChangingIdentityOrQuotesAndOldRowsDoNotUndoIt() throws Exception { + Fixture f=new Fixture(); + try(var security=mockStatic(SecurityUtils.class)) { + security.when(SecurityUtils::isAdmin).thenReturn(true);security.when(SecurityUtils::getUsername).thenReturn("sheet-rollback-test");security.when(SecurityUtils::getUserId).thenReturn(1L); + new TransactionTemplate(f.manager).executeWithoutResult(status->{ + status.setRollbackOnly();var saved=f.save(f.draft());var before=f.copy(saved);Long productId=saved.getRows().get(0).getProductId(); + saved.getRows().get(0).setCategory("更正类别");var changed=f.save(saved);var reopened=f.service.load(changed.getBatch().getId()); + assertEquals("更正类别",reopened.getRows().get(0).getCategory()); + assertEquals("更正类别",f.jdbc.queryForObject("select category from product_info where id=?",String.class,productId)); + for(int i=0;i<2;i++) {assertEquals(before.getRows().get(i).getProductId(),reopened.getRows().get(i).getProductId());assertEquals(before.getRows().get(i).getQuantity(),reopened.getRows().get(i).getQuantity());assertEquals(before.getRows().get(i).getFinalUnitPrice(),reopened.getRows().get(i).getFinalUnitPrice());} + reopened.getRows().get(1).setRemark("仅修改备注,不撤销档案类别更正");f.save(reopened); + assertEquals("更正类别",f.jdbc.queryForObject("select category from product_info where id=?",String.class,productId)); + var invalid=f.service.load(changed.getBatch().getId());invalid.getRows().get(0).setCategory("不存在的类别");assertThrows(ServiceException.class,()->f.save(invalid)); + assertEquals("更正类别",f.jdbc.queryForObject("select category from product_info where id=?",String.class,productId)); + }); + } + assertEquals(0,f.jdbc.queryForObject("select count(*) from product_info where product_name=?",Integer.class,f.name)); + } @Test void supplierInquiryRoundTripSavesOnlyConfirmedPreviewPricesThroughNativeSheetService() throws Exception { Fixture f=new Fixture(); try(var security=mockStatic(SecurityUtils.class)) { @@ -379,9 +397,10 @@ class PurchaseSheetDatabaseTest { SupplierService supplier=new SupplierService();set(supplier,"db",jdbc); set(purchaseTarget,"businessNumbers",allocator); ISysDictTypeService dict=mock(ISysDictTypeService.class);SysDictData unit=new SysDictData();unit.setDictLabel("件");unit.setStatus("0");when(dict.selectDictDataByType("wms_item_unit")).thenReturn(List.of(unit)); - set(productTarget,"dictTypes",dict);var itemCategories=mock(ItemCategoryService.class);when(itemCategories.labels()).thenReturn(List.of("测试类别"));set(productTarget,"itemCategories",itemCategories); + set(productTarget,"dictTypes",dict);var itemCategories=mock(ItemCategoryService.class);when(itemCategories.labels()).thenReturn(List.of("测试类别","更正类别"));set(productTarget,"itemCategories",itemCategories); PurchaseSheetService target=new PurchaseSheetService();set(target,"batches",session.getMapper(PurchaseBatchMapper.class));set(target,"requests",purchases);set(target,"catalog",catalog);set(target,"products",productService);set(target,"purchases",proxy(purchaseTarget));set(target,"prices",prices);set(target,"suppliers",supplier);set(target,"catalogLock",lock);set(target,"jdbc",jdbc);set(target,"json",new ObjectMapper().findAndRegisterModules());set(target,"dictTypes",dict); set(target,"batchNumbers",numbers);set(target,"operationLogs",logs); service=proxy(target); + set(target,"itemCategories",itemCategories); } PurchaseSheet draft() { jdbc.update("insert into supplier_info(name,active,create_by) values(?,1,'sheet-rollback-test')",name); diff --git a/ruoyi-admin/src/test/java/com/ruoyi/web/service/assistant/AssistantPurchaseSheetContractTest.java b/ruoyi-admin/src/test/java/com/ruoyi/web/service/assistant/AssistantPurchaseSheetContractTest.java index 54edbb0..eaf629e 100644 --- a/ruoyi-admin/src/test/java/com/ruoyi/web/service/assistant/AssistantPurchaseSheetContractTest.java +++ b/ruoyi-admin/src/test/java/com/ruoyi/web/service/assistant/AssistantPurchaseSheetContractTest.java @@ -12,6 +12,7 @@ import com.ruoyi.warehouse.mapper.ProductInfoMapper; import com.ruoyi.warehouse.service.IProductInfoService; import com.ruoyi.warehouse.service.impl.PurchaseSheetService; import com.ruoyi.warehouse.service.impl.CatalogWriteLock; +import com.ruoyi.warehouse.service.impl.ItemCategoryService; import com.ruoyi.web.controller.warehouse.PurchaseRequestController; import jakarta.validation.Validator; import java.math.BigDecimal; @@ -42,6 +43,7 @@ class AssistantPurchaseSheetContractTest { final ISysDictTypeService dictionaries=mock(ISysDictTypeService.class); final PurchaseSheetService sheets=spy(new PurchaseSheetService()); final CatalogWriteLock catalogLock=mock(CatalogWriteLock.class); + final ItemCategoryService itemCategories=mock(ItemCategoryService.class); final List items=new ArrayList<>(); final Map> purchases=new HashMap<>(); BusinessActionRegistry registry; @@ -60,6 +62,7 @@ class AssistantPurchaseSheetContractTest { when(context.getBean(CatalogWriteLock.class)).thenReturn(catalogLock); ReflectionTestUtils.setField(sheets,"catalog",catalog);ReflectionTestUtils.setField(sheets,"products",products); ReflectionTestUtils.setField(sheets,"dictTypes",dictionaries);ReflectionTestUtils.setField(sheets,"json",json); + ReflectionTestUtils.setField(sheets,"itemCategories",itemCategories);when(itemCategories.labels()).thenReturn(List.of("零件","配件")); when(catalog.selectProductInfoAll()).thenAnswer(invocation->new ArrayList<>(items)); when(products.previewImport(anyList())).thenReturn(List.of()); SysDictData unit=new SysDictData();unit.setDictLabel("个");unit.setStatus("0"); @@ -80,7 +83,7 @@ class AssistantPurchaseSheetContractTest { if(sql.contains("from supplier_info"))return List.of(Map.of("id",3L,"name","测试供应商")); if(sql.contains("from product_info"))return items.stream().filter(item->!(referenceId instanceof Number)||Objects.equals(item.getId(),number(referenceId))).map(this::itemMap).toList(); if(sql.contains("wms_item_unit"))return dictionaryEnabled?List.of(Map.of("id","个","name","个","code","UNIT")):List.of(); - if(sql.contains("wms_item_category"))return dictionaryEnabled?List.of(Map.of("id","零件","name","零件","code","PART")):List.of(); + if(sql.contains("wms_item_category"))return dictionaryEnabled?List.of(Map.of("id","零件","name","零件","code","PART"),Map.of("id","配件","name","配件","code","ACCESSORY")):List.of(); return List.of(); }); when(controller.saveSheet(any())).thenAnswer(invocation->{ @@ -106,6 +109,26 @@ class AssistantPurchaseSheetContractTest { assertEquals("CREATE",kind(row));assertNull(row.get("productId"));assertEquals("SELF",row.get("purchasePurpose")); verify(products).previewImport(anyList());verify(products,never()).insertProductInfo(any());verify(products,never()).updateProductInfo(any());verifyNoInteractions(controller); } + @Test void unrelatedUnresolvedReferencesDoNotTurnValidNewItemsIntoFormatErrors() { + for(String field:List.of("projectId","expenseCategoryId","supplierId","purchaseBatchId")) { + var input=raw("r-"+field);input.put(field,Map.of("keyword","待核对的名称")); + if("supplierId".equals(field))input.put("batchName","待核对批次"); + var preview=registry.prepare("purchase.create",List.of(input)); + assertEquals(false,preview.get("ready")); + var row=((List>)preview.get("rows")).get(0); + assertEquals("CREATE",kind(row),field); + assertFalse(preview.get("errors").toString().contains("物品资料格式"),field); + assertEquals(new BigDecimal("2"),row.get("quantity"));assertEquals("M4",row.get("materialParams")); + } + verify(products,never()).insertProductInfo(any());verifyNoInteractions(controller); + } + @Test void unresolvedItemDictionaryDoesNotSkipBatchChecksOrCreateAnItem() { + dictionaryEnabled=false;var input=raw("r1");input.put("supplierId",3L); + var preview=registry.prepare("purchase.create",List.of(input)); + assertEquals(false,preview.get("ready")); + assertTrue(preview.get("errors").toString().contains("新批次名称")); + verify(products,never()).insertProductInfo(any());verifyNoInteractions(controller); + } @Test void exactIdentityAutofillsCatalogFieldsAndAllowsHistoricalDictionaryValues() { var existing=item(4L,"M4");existing.setUnit("旧单位");existing.setCategory("旧类别");items.add(existing);dictionaryEnabled=false; var input=raw("r1");input.remove("unit");input.remove("category"); @@ -113,6 +136,23 @@ class AssistantPurchaseSheetContractTest { assertEquals("EXISTING",kind(row));assertEquals(4L,row.get("productId"));assertEquals("旧单位",row.get("unit"));assertEquals("旧类别",row.get("category")); verify(products,never()).previewImport(anyList());verifyNoInteractions(controller); } + @Test void categoryCorrectionIsPreviewOnlyPreservesIdentityAndRequiresArchiveEditPermission() { + var existing=item(4L,"M4");items.add(existing); + PurchaseRequest request=new PurchaseRequest();request.setProductId(4L);request.setMaterialName("螺丝");request.setMaterialBrand("标准");request.setMaterialParams("M4");request.setUnit("个");request.setCategory("配件"); + var preview=sheets.previewItem(request);assertEquals("UPDATE_CATEGORY",preview.kind());assertEquals("配件",preview.item().getCategory());assertEquals("零件",existing.getCategory()); + verify(products,never()).updateProductInfo(any()); + request.setCategory("未维护类别");assertThrows(ServiceException.class,()->sheets.previewItem(request)); + request.setCategory("配件");SysUser user=new SysUser();user.setUserId(8L);user.setUserName("purchase-only"); + var login=new LoginUser(8L,1L,user,Set.of("warehouse:purchase:edit"));SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken(login,null)); + assertTrue(assertThrows(ServiceException.class,()->sheets.previewItem(request)).getMessage().contains("物品维护权限")); + } + @Test void assistantKeepsExplicitCategoryCorrectionAndShowsArchiveSideEffectBeforeConfirmation() { + items.add(item(4L,"M4"));var input=raw("r1");input.put("category","配件"); + var row=ready("purchase.create",List.of(input)).get(0); + assertEquals("UPDATE_CATEGORY",kind(row));assertEquals("配件",row.get("category"));assertEquals(4L,row.get("productId")); + assertTrue(row.get("_itemResolution").toString().contains("同步更正"));assertEquals(true,row.get("_assistantCanEditCategory")); + assertEquals("零件",items.get(0).getCategory());verify(products,never()).updateProductInfo(any());verifyNoInteractions(controller); + } @Test void newItemCannotInventDictionaryAndDifferentSpecIsNotMerged() { items.add(item(4L,"M5"));var valid=ready("purchase.create",List.of(raw("r1"))).get(0); assertEquals("CREATE",kind(valid));assertNull(valid.get("productId")); diff --git a/ruoyi-system/src/main/java/com/ruoyi/warehouse/service/impl/PurchaseSheetService.java b/ruoyi-system/src/main/java/com/ruoyi/warehouse/service/impl/PurchaseSheetService.java index fceda37..e106374 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/warehouse/service/impl/PurchaseSheetService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/warehouse/service/impl/PurchaseSheetService.java @@ -29,6 +29,7 @@ public class PurchaseSheetService @Autowired private JdbcTemplate jdbc; @Autowired private ObjectMapper json; @Autowired private com.ruoyi.system.service.ISysDictTypeService dictTypes; + @Autowired private ItemCategoryService itemCategories; @Transactional(readOnly = true, isolation = org.springframework.transaction.annotation.Isolation.REPEATABLE_READ) public PurchaseSheet load(Long id) @@ -184,6 +185,7 @@ public class PurchaseSheetService if (row.getId() == null) requirePermission("add"); } List deleted = sheet.getDeletedIds() == null ? List.of() : sheet.getDeletedIds(); + validateCategoryCorrections(sheet.getRows(),old); for (Long id : deleted) { if (!old.containsKey(id) || !submitted.add(id)) throw new ServiceException("删除明细不属于当前批次或重复提交"); requirePermission("remove"); @@ -216,7 +218,7 @@ public class PurchaseSheetService continue; } try { - resolveItem(row, items); + resolveItem(row, items, existing); row.setPurchaseBatchId(batch.getId()); row.setEstimatedUnitPrice(row.getFinalUnitPrice()); if (existing == null) { @@ -298,11 +300,12 @@ public class PurchaseSheetService var old=new HashMap(); for(Long id:ids){var row=requests.selectPurchaseRequestByIdForUpdate(id);if(row==null||row.getPurchaseBatchId()!=null||committed(row)||Integer.valueOf(5).equals(row.getPurchaseStatus()))throw new ServiceException("明细已组批、已确认或已有到货,请刷新后处理");old.put(id,requests.selectPurchaseRequestById(id,null));} if(!ids.isEmpty()&&!Objects.equals(sheet.getVersion(),unbatchedSnapshot(new ArrayList<>(old.values())).getVersion()))throw new ServiceException("明细已被其他操作更新,请重新打开后再保存"); + validateCategoryCorrections(sheet.getRows(),old); var items=new ArrayList<>(catalog.selectProductInfoAll());var saved=new ArrayList();int line=0; for(var row:sheet.getRows()){ line++; try{if(row.getId()==null||!sameEditable(old.get(row.getId()),row)){ - resolveItem(row,items);row.setPurchaseBatchId(null);row.setPurchaseBatchNo(null);row.setEstimatedUnitPrice(row.getFinalUnitPrice()); + resolveItem(row,items,old.get(row.getId()));row.setPurchaseBatchId(null);row.setPurchaseBatchNo(null);row.setEstimatedUnitPrice(row.getFinalUnitPrice()); if(row.getId()==null){row.setRequestNo(null);row.setHistorical(false);purchases.insertPurchaseRequest(row);}else purchases.updatePurchaseRequest(row); }saved.add(requests.selectPurchaseRequestById(row.getId(),null));}catch(Exception e){throw new ServiceException("第"+line+"行:"+e.getMessage());} } @@ -370,7 +373,15 @@ public class PurchaseSheetService } else if (!norm(row.getUnit()).isEmpty() && !norm(row.getUnit()).equals(norm(match.getUnit()))) { throw new ServiceException("单位与物品档案不一致,不能将不同单位混用"); } - if(norm(match.getCategory()).isEmpty()) { + if(!norm(match.getCategory()).isEmpty() && !norm(row.getCategory()).isEmpty() && !norm(match.getCategory()).equals(norm(row.getCategory()))) { + if(!SecurityUtils.isAdmin()&&!SecurityUtils.hasPermi("warehouse:product:edit")) + throw new ServiceException("更正已有物品类别需要物品维护权限,可联系管理员协助处理"); + if(!itemCategories.labels().contains(clean(row.getCategory())))throw new ServiceException("物品类别不存在或已停用,请先在业务字典维护后再选择"); + match=json.convertValue(match,ProductInfo.class);match.setCategory(clean(row.getCategory())); + ProductInfo duplicate=catalog.checkProductInfoUnique(match); + if(duplicate!=null&&!Objects.equals(duplicate.getId(),match.getId()))throw new ServiceException("该类别下已存在相同物品,请选择已有档案"); + kind="UPDATE_CATEGORY"; + } else if(norm(match.getCategory()).isEmpty()) { if(norm(row.getCategory()).isEmpty())throw new ServiceException("请选择物品类别"); // The preview must not mutate a shared mapper/cache result. match = json.convertValue(match, ProductInfo.class); @@ -382,10 +393,19 @@ public class PurchaseSheetService private void resolveItem(PurchaseRequest row, List items) { + resolveItem(row,items,null); + } + private void resolveItem(PurchaseRequest row,List items,PurchaseRequest existing) + { + // An unchanged historical snapshot is not a request to undo a newer archive correction. + if(existing!=null&&norm(existing.getCategory()).equals(norm(row.getCategory()))) { + ProductInfo current=findItem(row,items); + if(current!=null)row.setCategory(current.getCategory()); + } ItemPreview plan = planItem(row, items); ProductInfo match = plan.item(); if ("CREATE".equals(plan.kind())) { products.insertProductInfo(match); items.add(match); } - else if ("FILL_CATEGORY".equals(plan.kind())) { + else if (Set.of("FILL_CATEGORY","UPDATE_CATEGORY").contains(plan.kind())) { products.updateProductInfo(match); items.replaceAll(item -> Objects.equals(item.getId(), match.getId()) ? match : item); } @@ -394,6 +414,18 @@ public class PurchaseSheetService row.setMaterialParams(match.getSpec()); row.setCategory(match.getCategory()); row.setUnit(match.getUnit()); } + private void validateCategoryCorrections(List rows,Map old) { + var corrections=new HashMap,String>(); + for(var row:rows) { + var previous=old.get(row.getId()); + if(previous!=null&&norm(previous.getCategory()).equals(norm(row.getCategory())))continue; + String category=norm(row.getCategory()); + if(category.isEmpty())throw new ServiceException("请选择物品类别"); + String first=corrections.putIfAbsent(identity(row),category); + if(first!=null&&!first.equals(category))throw new ServiceException("同一物品填写了不同类别,请统一后再保存,避免反复覆盖物品档案"); + } + } + static List identity(PurchaseRequest row) { return List.of(norm(row.getMaterialName()), norm(row.getMaterialBrand()), norm(row.getMaterialParams())); } static List identity(ProductInfo row) { return List.of(norm(row.getProductName()), norm(row.getBrand()), norm(row.getSpec())); } private static String text(String value) { return value == null ? "" : value; } diff --git a/ruoyi-ui-vue3/package-lock.json b/ruoyi-ui-vue3/package-lock.json index a23b1fe..ad81b27 100644 --- a/ruoyi-ui-vue3/package-lock.json +++ b/ruoyi-ui-vue3/package-lock.json @@ -10,6 +10,11 @@ "license": "MIT", "dependencies": { "@element-plus/icons-vue": "2.3.2", + "@js-temporal/polyfill": "^0.5.1", + "@vue-flow/background": "^1.3.2", + "@vue-flow/controls": "^1.1.3", + "@vue-flow/core": "^1.48.2", + "@vue-flow/minimap": "^1.5.4", "@vueup/vue-quill": "1.2.0", "@vueuse/core": "14.1.0", "axios": "1.13.2", @@ -24,6 +29,7 @@ "nprogress": "0.2.0", "pdfjs-dist": "6.4.299", "pinia": "3.0.4", + "sortablejs": "1.14.0", "vue": "3.5.26", "vue-cropper": "1.1.1", "vue-router": "4.6.4", @@ -31,13 +37,18 @@ }, "devDependencies": { "@vitejs/plugin-vue": "5.2.4", + "@vue/test-utils": "^2.5.1", + "jsdom": "^30.1.2", "playwright": "1.62.1", "sass-embedded": "1.97.2", + "typescript": "^5.9.3", "unplugin-auto-import": "0.18.6", "unplugin-vue-setup-extend-plus": "1.0.1", "vite": "6.4.1", "vite-plugin-compression": "0.5.1", - "vite-plugin-svg-icons": "2.0.1" + "vite-plugin-svg-icons": "2.0.1", + "vitest": "^5.0.4", + "vue-tsc": "^3.3.13" } }, "node_modules/@antfu/utils": { @@ -50,6 +61,80 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/@asamuzakjp/css-color": { + "version": "7.1.5", + "resolved": "https://registry.npmmirror.com/@asamuzakjp/css-color/-/css-color-7.1.5.tgz", + "integrity": "sha512-jCpAvj8apa7SKHZYogk0rbXB3Kb0hLFrpkWF+Ap+vBA5rirItnpv9NKyAyEuDuFizvl0qwnj6JWR70RGJ0rOlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^3.4.3", + "@csstools/css-color-parser": "^4.2.6", + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2", + "lru-cache": "^11.5.3" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@asamuzakjp/dom-selector": { + "version": "10.0.3", + "resolved": "https://registry.npmmirror.com/@asamuzakjp/dom-selector/-/dom-selector-10.0.3.tgz", + "integrity": "sha512-3+777rEPsOOjoy5/sRmIzHnoRDaLpm3XWY2dmWn/N7f/XwDG0bcpnFaKL3X9FYJUbNwLmpcJC1bUYexJRxsFlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bidi-js": "^1.1.0", + "css-tree": "^3.2.1", + "is-potential-custom-element-name": "^1.0.1", + "lru-cache": "^11.5.3" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@asamuzakjp/dom-selector/node_modules/css-tree": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/css-tree/-/css-tree-3.2.1.tgz", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdn-data": "2.27.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/@asamuzakjp/dom-selector/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@asamuzakjp/dom-selector/node_modules/mdn-data": { + "version": "2.27.1", + "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.27.1.tgz", + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/@babel/helper-string-parser": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", @@ -96,6 +181,40 @@ "node": ">=6.9.0" } }, + "node_modules/@bramus/specificity": { + "version": "2.4.3", + "resolved": "https://registry.npmmirror.com/@bramus/specificity/-/specificity-2.4.3.tgz", + "integrity": "sha512-0GEz8qJWokkUVYQYRukmkSHIFNoBH8QTreeHrAFbvz1XFYc3Y+puhMs8PQ5x8GNugiC2l5jvDBXKLbBIByeSBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "css-tree": "^3.2.1" + }, + "bin": { + "specificity": "bin/cli.js" + } + }, + "node_modules/@bramus/specificity/node_modules/css-tree": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/css-tree/-/css-tree-3.2.1.tgz", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdn-data": "2.27.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/@bramus/specificity/node_modules/mdn-data": { + "version": "2.27.1", + "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.27.1.tgz", + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/@bufbuild/protobuf": { "version": "2.16.0", "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.16.0.tgz", @@ -103,6 +222,121 @@ "dev": true, "license": "(Apache-2.0 AND BSD-3-Clause)" }, + "node_modules/@csstools/color-helpers": { + "version": "6.1.2", + "resolved": "https://registry.npmmirror.com/@csstools/color-helpers/-/color-helpers-6.1.2.tgz", + "integrity": "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/@csstools/css-calc": { + "version": "3.4.3", + "resolved": "https://registry.npmmirror.com/@csstools/css-calc/-/css-calc-3.4.3.tgz", + "integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "4.2.6", + "resolved": "https://registry.npmmirror.com/@csstools/css-color-parser/-/css-color-parser-4.2.6.tgz", + "integrity": "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^6.1.2", + "@csstools/css-calc": "^3.4.3" + }, + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz", + "integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^4.0.2" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz", + "integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, "node_modules/@ctrl/tinycolor": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", @@ -563,6 +797,24 @@ "node": ">=18" } }, + "node_modules/@exodus/bytes": { + "version": "1.16.0", + "resolved": "https://registry.npmmirror.com/@exodus/bytes/-/bytes-1.16.0.tgz", + "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@noble/hashes": "^1.8.0 || ^2.0.0" + }, + "peerDependenciesMeta": { + "@noble/hashes": { + "optional": true + } + } + }, "node_modules/@floating-ui/core": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz", @@ -605,12 +857,45 @@ "node": ">=12" } }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "license": "MIT" }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@js-temporal/polyfill": { + "version": "0.5.1", + "resolved": "https://registry.npmmirror.com/@js-temporal/polyfill/-/polyfill-0.5.1.tgz", + "integrity": "sha512-hloP58zRVCRSpgDxmqCWJNlizAlUgJFqG2ypq79DCvyv9tHjRYMDOcPFjzfl/A1/YxDvRCZz8wvZvmapQnKwFQ==", + "license": "ISC", + "dependencies": { + "jsbi": "^4.3.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@napi-rs/canvas": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-1.0.11.tgz", @@ -1679,6 +1964,24 @@ "win32" ] }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmmirror.com/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", @@ -1741,6 +2044,237 @@ "vue": "^3.2.25" } }, + "node_modules/@vitest/mocker": { + "version": "5.0.5", + "resolved": "https://registry.npmmirror.com/@vitest/mocker/-/mocker-5.0.5.tgz", + "integrity": "sha512-xLL3lkDegJZw+MGoGaCCsFayDZthGgpAtr3Vziyfc4p7xH89K7KRPcRBBh/kEYm0Aqkt5DtTmkYpBtRV/FrHZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.0.5", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/mocker/node_modules/magic-string": { + "version": "1.4.3", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-1.4.3.tgz", + "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/spy": { + "version": "5.0.5", + "resolved": "https://registry.npmmirror.com/@vitest/spy/-/spy-5.0.5.tgz", + "integrity": "sha512-lwJRExuH417257Q5wv9QYugN9IMJkoxcrKrYxGPQkBzl7wlNpTUxD/5yNX4ESKVUIShKPgkGchYPFMWOOk0wzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@volar/language-core": { + "version": "2.4.28", + "resolved": "https://registry.npmmirror.com/@volar/language-core/-/language-core-2.4.28.tgz", + "integrity": "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.28" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.28", + "resolved": "https://registry.npmmirror.com/@volar/source-map/-/source-map-2.4.28.tgz", + "integrity": "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.28", + "resolved": "https://registry.npmmirror.com/@volar/typescript/-/typescript-2.4.28.tgz", + "integrity": "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue-flow/background": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/@vue-flow/background/-/background-1.3.2.tgz", + "integrity": "sha512-eJPhDcLj1wEo45bBoqTXw1uhl0yK2RaQGnEINqvvBsAFKh/camHJd5NPmOdS1w+M9lggc9igUewxaEd3iCQX2w==", + "license": "MIT", + "peerDependencies": { + "@vue-flow/core": "^1.23.0", + "vue": "^3.3.0" + } + }, + "node_modules/@vue-flow/controls": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/@vue-flow/controls/-/controls-1.1.3.tgz", + "integrity": "sha512-XCf+G+jCvaWURdFlZmOjifZGw3XMhN5hHlfMGkWh9xot+9nH9gdTZtn+ldIJKtarg3B21iyHU8JjKDhYcB6JMw==", + "license": "MIT", + "peerDependencies": { + "@vue-flow/core": "^1.23.0", + "vue": "^3.3.0" + } + }, + "node_modules/@vue-flow/core": { + "version": "1.48.2", + "resolved": "https://registry.npmmirror.com/@vue-flow/core/-/core-1.48.2.tgz", + "integrity": "sha512-raxhgKWE+G/mcEvXJjGFUDYW9rAI3GOtiHR3ZkNpwBWuIaCC1EYiBmKGwJOoNzVFgwO7COgErnK7i08i287AFA==", + "license": "MIT", + "dependencies": { + "@vueuse/core": "^10.5.0", + "d3-drag": "^3.0.0", + "d3-interpolate": "^3.0.1", + "d3-selection": "^3.0.0", + "d3-zoom": "^3.0.0" + }, + "peerDependencies": { + "vue": "^3.3.0" + } + }, + "node_modules/@vue-flow/core/node_modules/@types/web-bluetooth": { + "version": "0.0.20", + "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz", + "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==", + "license": "MIT" + }, + "node_modules/@vue-flow/core/node_modules/@vueuse/core": { + "version": "10.11.1", + "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.11.1.tgz", + "integrity": "sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==", + "license": "MIT", + "dependencies": { + "@types/web-bluetooth": "^0.0.20", + "@vueuse/metadata": "10.11.1", + "@vueuse/shared": "10.11.1", + "vue-demi": ">=0.14.8" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vue-flow/core/node_modules/@vueuse/core/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vue-flow/core/node_modules/@vueuse/metadata": { + "version": "10.11.1", + "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.11.1.tgz", + "integrity": "sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vue-flow/core/node_modules/@vueuse/shared": { + "version": "10.11.1", + "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.11.1.tgz", + "integrity": "sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==", + "license": "MIT", + "dependencies": { + "vue-demi": ">=0.14.8" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vue-flow/core/node_modules/@vueuse/shared/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vue-flow/minimap": { + "version": "1.5.4", + "resolved": "https://registry.npmmirror.com/@vue-flow/minimap/-/minimap-1.5.4.tgz", + "integrity": "sha512-l4C+XTAXnRxsRpUdN7cAVFBennC1sVRzq4bDSpVK+ag7tdMczAnhFYGgbLkUw3v3sY6gokyWwMl8CDonp8eB2g==", + "license": "MIT", + "dependencies": { + "d3-selection": "^3.0.0", + "d3-zoom": "^3.0.0" + }, + "peerDependencies": { + "@vue-flow/core": "^1.23.0", + "vue": "^3.3.0" + } + }, "node_modules/@vue/compiler-core": { "version": "3.5.43", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.43.tgz", @@ -1828,6 +2362,22 @@ "rfdc": "^1.4.1" } }, + "node_modules/@vue/language-core": { + "version": "3.3.13", + "resolved": "https://registry.npmmirror.com/@vue/language-core/-/language-core-3.3.13.tgz", + "integrity": "sha512-axA0Xemn5LuUKuKWob0/kVq7xQ2mJJM6VqA9Exvt35nM9yRC31goWVve/G/Zb2ZCLsXC8FHYjjfXlnshknSCew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "@vue/compiler-dom": "^3.5.0", + "@vue/shared": "^3.5.0", + "alien-signals": "^3.2.1", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1", + "picomatch": "^4.0.4" + } + }, "node_modules/@vue/reactivity": { "version": "3.5.26", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.26.tgz", @@ -1936,6 +2486,202 @@ "dev": true, "license": "MIT" }, + "node_modules/@vue/test-utils": { + "version": "2.5.1", + "resolved": "https://registry.npmmirror.com/@vue/test-utils/-/test-utils-2.5.1.tgz", + "integrity": "sha512-V/4a99odJ7hapr0bRt35XxljGk8hefq31gSOnlKTcEq2fUeoj2qb+FcpJYfQu4qfYhW9Ug+O2+CZ3QmZ7gXDzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-beautify": "^2.0.0", + "vue-component-type-helpers": "^3.0.0" + }, + "peerDependencies": { + "@vue/compiler-dom": "3.x", + "@vue/server-renderer": "3.x", + "vue": "3.x" + }, + "peerDependenciesMeta": { + "@vue/server-renderer": { + "optional": true + } + } + }, + "node_modules/@vue/test-utils/node_modules/@one-ini/wasm": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/@one-ini/wasm/-/wasm-0.2.1.tgz", + "integrity": "sha512-TUqERXGNTifZ9y2g3wPxQrw3HpHv/02DsW3D90T9x0hhonrL1ZqpSmNrU2XkoIq0fP1N6gZfVQzy2Fw1ZvGBNg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vue/test-utils/node_modules/abbrev": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-5.0.0.tgz", + "integrity": "sha512-/XrFJgzQQQHpti1raDJC6m4ws6aNktmjBlhk8Fdlk7LwCEuDoieEJJY9OFHjfiFJFFRM2tK+Ky/IsfbbmlMu1w==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@vue/test-utils/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@vue/test-utils/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@vue/test-utils/node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/@vue/test-utils/node_modules/editorconfig": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/editorconfig/-/editorconfig-3.0.2.tgz", + "integrity": "sha512-T0ix8GhtxyKVfUFEcvdNDt3YGqlwkFHbD4/5bgFUDgFmxhI/cSRAeJ87/Sz//Cq8Eam6JX/e23RkoFO71P7aAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@one-ini/wasm": "0.2.1", + "commander": "^14.0.3", + "minimatch": "~10.2.4", + "semver": "^7.7.4" + }, + "bin": { + "editorconfig": "bin/editorconfig" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@vue/test-utils/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmmirror.com/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vue/test-utils/node_modules/js-beautify": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/js-beautify/-/js-beautify-2.0.3.tgz", + "integrity": "sha512-cyFbh3tkPhknnTD/0bLf0T0yy2ZIbqL05mttzbt4y1Zfr7NxqXQZ62dkBLKs3oHH/lpjmDRAnciJiSUyOy8XwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "config-chain": "^1.1.13", + "editorconfig": "^3.0.2", + "glob": "^13.0.6", + "js-cookie": "^3.0.8", + "nopt": "^10.0.1" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@vue/test-utils/node_modules/js-cookie": { + "version": "3.0.8", + "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.8.tgz", + "integrity": "sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vue/test-utils/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@vue/test-utils/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vue/test-utils/node_modules/nopt": { + "version": "10.0.1", + "resolved": "https://registry.npmmirror.com/nopt/-/nopt-10.0.1.tgz", + "integrity": "sha512-df3sBr/6ax9hSGuC3CspvLlbnX8cP5L5nZwXF8cGN8l0zSWR6BvzmQ6jPUKjvo6+/xdpkNvEcucBNUdBeeV13g==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^5.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@vue/test-utils/node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@vueup/vue-quill": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@vueup/vue-quill/-/vue-quill-1.2.0.tgz", @@ -2009,6 +2755,13 @@ "node": ">=0.4.0" } }, + "node_modules/alien-signals": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/alien-signals/-/alien-signals-3.2.1.tgz", + "integrity": "sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==", + "dev": true, + "license": "MIT" + }, "node_modules/ansi-regex": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz", @@ -2115,6 +2868,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -2222,6 +2985,16 @@ "node": ">=0.10.0" } }, + "node_modules/bidi-js": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/bidi-js/-/bidi-js-1.1.0.tgz", + "integrity": "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -2364,6 +3137,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmmirror.com/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2758,6 +3541,125 @@ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", "license": "MIT" }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/data-urls": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/data-urls/-/data-urls-8.0.0.tgz", + "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^17.1.2" + }, + "engines": { + "node": "^22.14.0 || >=24.0.0" + } + }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", @@ -2836,6 +3738,13 @@ } } }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, "node_modules/decode-uri-component": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", @@ -3284,6 +4193,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", @@ -3472,6 +4388,16 @@ "dev": true, "license": "MIT" }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/exsolve": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.1.3.tgz", @@ -4117,6 +5043,19 @@ "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", "license": "MIT" }, + "node_modules/html-encoding-sniffer": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/html-encoding-sniffer/-/html-encoding-sniffer-7.0.0.tgz", + "integrity": "sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@exodus/bytes": "^1.15.1" + }, + "engines": { + "node": "^22.13.0 || >=24.0.0" + } + }, "node_modules/htmlparser2": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", @@ -4533,6 +5472,13 @@ "node": ">=0.10.0" } }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -4773,6 +5719,108 @@ "dev": true, "license": "MIT" }, + "node_modules/jsbi": { + "version": "4.3.2", + "resolved": "https://registry.npmmirror.com/jsbi/-/jsbi-4.3.2.tgz", + "integrity": "sha512-9fqMSQbhJykSeii05nxKl4m6Eqn2P6rOlYiS+C5Dr/HPIU/7yZxu5qzbs40tgaFORiw2Amd0mirjxatXYMkIew==", + "license": "Apache-2.0" + }, + "node_modules/jsdom": { + "version": "30.1.3", + "resolved": "https://registry.npmmirror.com/jsdom/-/jsdom-30.1.3.tgz", + "integrity": "sha512-hQMUPvRgN7KxsfIytDQji7bimuJeRQa6Qo5+iuiZQk5CafeRxLIA10/cG5YCBFNpD9RO3oqIiN4CO1Y44kxqXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^7.1.3", + "@asamuzakjp/dom-selector": "^10.0.3", + "@bramus/specificity": "^2.4.2", + "@csstools/css-syntax-patches-for-csstree": "^1.1.15", + "@exodus/bytes": "^1.16.0", + "css-tree": "^3.2.1", + "data-urls": "^8.0.0", + "decimal.js": "^10.6.0", + "html-encoding-sniffer": "^7.0.0", + "is-potential-custom-element-name": "^1.0.1", + "lru-cache": "^11.5.3", + "parse5": "^8.0.1", + "saxes": "^6.0.0", + "tough-cookie": "^6.0.2", + "undici": "^8.12.1", + "w3c-xmlserializer": "^6.0.0", + "webidl-conversions": "^8.0.1", + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^17.2.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + }, + "peerDependencies": { + "canvas": "^3.2.3" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/@csstools/css-syntax-patches-for-csstree": { + "version": "1.1.15", + "resolved": "https://registry.npmmirror.com/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz", + "integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "peerDependencies": { + "css-tree": "^3.2.1" + }, + "peerDependenciesMeta": { + "css-tree": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/css-tree": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/css-tree/-/css-tree-3.2.1.tgz", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdn-data": "2.27.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/jsdom/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/jsdom/node_modules/mdn-data": { + "version": "2.27.1", + "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.27.1.tgz", + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/jsencrypt": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.3.2.tgz", @@ -5101,6 +6149,13 @@ "dev": true, "license": "MIT" }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "dev": true, + "license": "MIT" + }, "node_modules/nanoid": { "version": "3.3.20", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", @@ -5406,6 +6461,20 @@ "node": ">=0.10.0" } }, + "node_modules/obug": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/own-keys": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.2.tgz", @@ -5437,6 +6506,32 @@ "integrity": "sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==", "license": "BSD-3-Clause" }, + "node_modules/parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/parse5/-/parse5-8.0.1.tgz", + "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^8.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "8.1.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-8.1.0.tgz", + "integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -5447,6 +6542,13 @@ "node": ">=0.10.0" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -5734,6 +6836,16 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "license": "MIT" }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/quansync": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", @@ -5967,6 +7079,16 @@ "node": ">=0.10" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -6571,6 +7693,19 @@ "node": ">=11.0.0" } }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, "node_modules/scule": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz", @@ -7049,6 +8184,13 @@ "node": ">= 0.4" } }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", @@ -7595,6 +8737,26 @@ "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", "license": "MIT" }, + "node_modules/tinybench": { + "version": "6.2.2", + "resolved": "https://registry.npmmirror.com/tinybench/-/tinybench-6.2.2.tgz", + "integrity": "sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -7612,6 +8774,26 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tldts": { + "version": "7.4.18", + "resolved": "https://registry.npmmirror.com/tldts/-/tldts-7.4.18.tgz", + "integrity": "sha512-somxA8xKAUzlAxl0TX/jMSYIbRNFIVGnI96pVGJPeMc5BsHmfVXn6mOJT6U++ELnl04eGfzpfcEuZe8WiASkXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^7.4.18" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "7.4.18", + "resolved": "https://registry.npmmirror.com/tldts-core/-/tldts-core-7.4.18.tgz", + "integrity": "sha512-KI2PKvCmvQI/xD6ypPqkU0i7oxNXR/O58RLRaHR4svsgVUQ2JE/XC8BtMbG6PSehD27I8sZJRcC1ASnCy6lp3g==", + "dev": true, + "license": "MIT" + }, "node_modules/to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -7718,6 +8900,32 @@ "node": ">=0.10.0" } }, + "node_modules/tough-cookie": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-6.0.2.tgz", + "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^7.0.5" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/tr46/-/tr46-7.0.0.tgz", + "integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": "^22.14.0 || >=24.0.0" + } + }, "node_modules/traverse": { "version": "0.6.14", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.14.tgz", @@ -7844,6 +9052,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/ufo": { "version": "1.6.4", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", @@ -7870,6 +9092,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "8.12.2", + "resolved": "https://registry.npmmirror.com/undici/-/undici-8.12.2.tgz", + "integrity": "sha512-XtuDWVdqTLr3NAxm2ly9/hU6kUsJOgGh1RASzMBbsw6aWCOaQzHdW+QQDfdERjfJ2V5vL5pRPa4RetO9UfivDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.19.0" + } + }, "node_modules/undici-types": { "version": "8.9.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", @@ -8268,6 +9500,106 @@ "dev": true, "license": "MIT" }, + "node_modules/vitest": { + "version": "5.0.5", + "resolved": "https://registry.npmmirror.com/vitest/-/vitest-5.0.5.tgz", + "integrity": "sha512-cPODOMF8YnkiiYtDdHo6n4wWmBrOBBbOIYH2d33M4l3CdNn72h+qMmO6uXffUN6A5AZFXNND/d+krS9mgkXRfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.0.5", + "chai": "^6.3.0", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.4.3", + "obug": "^3.0.0", + "picomatch": "^4.0.7", + "std-env": "^4.3.0", + "tinybench": "^6.2.2", + "tinyexec": "^1.3.1", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.0.5", + "@vitest/browser-preview": "5.0.5", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.0.5", + "@vitest/coverage-v8": "5.0.5", + "@vitest/ui": "5.0.5", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/vitest/node_modules/magic-string": { + "version": "1.4.3", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-1.4.3.tgz", + "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/vscode-uri": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.2.0.tgz", + "integrity": "sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==", + "dev": true, + "license": "MIT" + }, "node_modules/vue": { "version": "3.5.26", "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.26.tgz", @@ -8289,6 +9621,13 @@ } } }, + "node_modules/vue-component-type-helpers": { + "version": "3.3.13", + "resolved": "https://registry.npmmirror.com/vue-component-type-helpers/-/vue-component-type-helpers-3.3.13.tgz", + "integrity": "sha512-02KCxSmKDhIITjKyJ4QT5csP6L0WoRborLqY/34a40+S9uvMvdNgMV0yVjO3p2Gkz3ZoPmFz/0JsGHacwJYTxw==", + "dev": true, + "license": "MIT" + }, "node_modules/vue-cropper": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/vue-cropper/-/vue-cropper-1.1.1.tgz", @@ -8316,6 +9655,23 @@ "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", "license": "MIT" }, + "node_modules/vue-tsc": { + "version": "3.3.13", + "resolved": "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-3.3.13.tgz", + "integrity": "sha512-jE4/bXdOMSHVxEGgQCqNllJy+9N3Gx6tfSAsg0yhFK/MAN6eXqISihupnDEKSCt12VVnjN2gI3AqLYcqoh5x/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/typescript": "2.4.28", + "@vue/language-core": "3.3.13" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + } + }, "node_modules/vue/node_modules/@vue/compiler-core": { "version": "3.5.26", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.26.tgz", @@ -8384,6 +9740,29 @@ "vue": "^3.0.1" } }, + "node_modules/w3c-xmlserializer": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz", + "integrity": "sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-8.0.1.tgz", + "integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=20" + } + }, "node_modules/webpack-virtual-modules": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", @@ -8391,6 +9770,31 @@ "dev": true, "license": "MIT" }, + "node_modules/whatwg-mimetype": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz", + "integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/whatwg-url": { + "version": "17.3.0", + "resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-17.3.0.tgz", + "integrity": "sha512-KwOAJrpf+GTgBvcBQJcP38sMF0DsQKdwtG+TxM2pW44P6E5k0hDbWrDmyuJDIF0Uef0aQq0ZoJs+5oI+k8ddhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@exodus/bytes": "^1.16.0", + "tr46": "^7.0.0", + "webidl-conversions": "^8.0.1" + }, + "engines": { + "node": "^22.14.0 || >=24.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -8502,6 +9906,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/why-is-node-running": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", + "dev": true, + "license": "MIT", + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=20.11" + } + }, "node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -8590,6 +10007,23 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, "node_modules/zrender": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.1.tgz", diff --git a/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantDraft.vue b/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantDraft.vue index 5ed7db6..d272d5e 100644 --- a/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantDraft.vue +++ b/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantDraft.vue @@ -10,7 +10,7 @@

本确认单存在多个项目或采购批次,保留逐行项目供核对,不会自动合并归属。

{{ group.label }}全部字段{{ selectedIds.length ? `已选 ${selectedIds.length} 项 · ` : '' }}可横向滚动查看各列
-

选择已有物品可带入档案信息;新物品确认后建档。单位、类别须选用已维护的业务字典。

+

选择已有物品可带入档案信息;新物品确认后建档。单位、类别须选用业务字典。更正已有物品类别会同步修改物品档案,确认后才保存。

{{ draft.action === 'purchase.update' ? '已有采购的所属批次保持不变;调整批次请使用采购界面的转批次功能。' : '选择已有批次,或填写新批次名称;两者均不填则保存为未组批明细。采购日期以校验预览为准,供应商可稍后补充。' }}

diff --git a/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantPurchaseProject.vue b/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantPurchaseProject.vue index 25f371e..110de87 100644 --- a/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantPurchaseProject.vue +++ b/ruoyi-ui-vue3/src/components/BusinessAssistant/AssistantPurchaseProject.vue @@ -4,7 +4,7 @@
{{ valueRow._labels.projectId || valueRow.projectId?.keyword || valueRow.projectId || '待填写' }} - 统一应用到未填项 + 统一应用到未填项

{{ state.missing }} 项待填写项目,可在这里统一补充。

{{ notice }}

@@ -15,16 +15,20 @@ import { computed, ref, watch } from 'vue' import AssistantField from './AssistantField.vue' import { purchaseProjectState } from '@/utils/purchase-project' -import { assistantBulkChanges } from '@/utils/assistant-draft-edit' +import { assistantPurchaseProjectChanges, assistantRecordId } from '@/utils/assistant-draft-edit' const props=defineProps({action:String,field:{type:Object,required:true},rows:{type:Array,default:()=>[]},draft:{type:Object,required:true},editable:Boolean,busy:Boolean}) const emit=defineEmits(['change']),notice=ref('') const state=computed(()=>purchaseProjectState(props.rows)) const valueRow=computed(()=>({projectId:state.value.value,_labels:{projectId:props.rows.find(row=>String(row.projectId)===String(state.value.value))?._labels?.projectId||''},_candidates:{projectId:props.rows.flatMap(row=>row._candidates?.projectId||[]).filter((item,index,items)=>items.findIndex(other=>String(other.value)===String(item.value))===index)}})) function apply(event){ if(props.busy||!props.editable)return - const changes=assistantBulkChanges(props.rows,props.field,event,{action:props.action,draft:props.draft,overwrite:true}) - if(!changes.length)return - emit('change',{changes});notice.value=`已统一设置 ${changes.length} 条可编辑明细;其他物品、数量、报价不变,请重新校验。` + try { + const changes=assistantPurchaseProjectChanges(props.rows,props.field,event,{action:props.action,draft:props.draft}) + if(!changes.length)return + emit('change',{changes});notice.value=`已统一设置 ${changes.length} 条明细;其他物品、数量、报价不变,请重新校验。` + } catch { + notice.value='部分明细已执行或不可编辑,不能统一更换项目;原数据未改动,请按原项目继续处理。' + } } watch(()=>[props.draft.id,props.draft.version],()=>{notice.value=''}) diff --git a/ruoyi-ui-vue3/src/components/PurchaseSheet/index.vue b/ruoyi-ui-vue3/src/components/PurchaseSheet/index.vue index 666789c..9711017 100644 --- a/ruoyi-ui-vue3/src/components/PurchaseSheet/index.vue +++ b/ruoyi-ui-vue3/src/components/PurchaseSheet/index.vue @@ -83,6 +83,7 @@
重置
{{ selected.length?'已选 '+selected.length+' 项':'筛选结果 '+visibleRows.length+' 项' }}选择可到货项清空选择
+

更正已有物品的类别将在保存时同步修改物品档案,其他业务中的档案分类也会更新;已有到货的明细仍需先按流程退回。

@@ -307,7 +308,7 @@ unpriced(){return this.sheet.rows.filter(r=>!r.historical&&!this.hasPrice(r)&&Nu brands(row){return [...new Set(candidates(this.items,row,'brand').map(i=>i.brand).filter(Boolean))]},specs(row){return candidates(this.items,row,'spec')}, async searchPlans(row,keyword){const result=await purchasePlanOptions({projectId:row.projectId,keyword});const map=new Map(this.plans.map(p=>[p.id,p]));(result.data||[]).forEach(p=>map.set(p.id,p));this.plans=[...map.values()]}, rowPlans(row){return this.plans.filter(p=>String(p.projectId)===String(row.projectId))},rowUnits(row){return [...new Set([...this.units,...(row.productId&&row.unit?[row.unit]:[])])]}, - canEditCategory(row){const item=this.itemMap.get(String(row.productId));return !item || !clean(item.category)}, + canEditCategory(row){const item=this.itemMap.get(String(row.productId));return !item || !clean(item.category) || this.$auth.hasPermiOr(['warehouse:product:edit'])}, identityEditor(){return this._identityEditor||(this._identityEditor=createRowIdentityEditor({getItems:()=>this.items,loadName:name=>this.loadName(name),isCurrentRow:row=>this.isEditing&&!!this.sheet?.rows.includes(row),onDetach:row=>this.clearLoan(row)}))}, nameChanged(row,value=row.materialName){return this.identityEditor().nameChanged(row,value)}, brandChanged(row){this.identityEditor().brandChanged(row)}, diff --git a/ruoyi-ui-vue3/src/utils/assistant-draft-edit.js b/ruoyi-ui-vue3/src/utils/assistant-draft-edit.js index a03de36..1e51e29 100644 --- a/ruoyi-ui-vue3/src/utils/assistant-draft-edit.js +++ b/ruoyi-ui-vue3/src/utils/assistant-draft-edit.js @@ -1,4 +1,5 @@ import { isAssistantPending } from './business-assistant.js' +import { purchaseBatchProjectChanges } from './purchase-project.js' export function isAssistantPurchase(action) { return ['purchase.create', 'purchase.update'].includes(action) @@ -45,6 +46,7 @@ export function assistantFieldLocked(action, row, field) { const boundItem = assistantRecordId(row.productId) if (boundItem && field.key === 'unit') return true if (boundItem && field.key === 'category') { + if (row._assistantCanEditCategory === true) return false const category = row._assistantCatalogCategory if (category !== undefined) return !!category return (row._itemResolution?.kind || row._itemResolution) !== 'FILL_CATEGORY' && !!row.category @@ -57,7 +59,8 @@ export function assistantItemResolution(row) { const states = { EXISTING: { label: '使用已有档案', type: 'success' }, CREATE: { label: '确认后新建档案', type: 'warning' }, - FILL_CATEGORY: { label: '确认后补全档案类别', type: 'warning' } + FILL_CATEGORY: { label: '确认后补全档案类别', type: 'warning' }, + UPDATE_CATEGORY: { label: '确认后同步更正物品档案类别', type: 'warning' } } const status = states[row._itemResolution?.kind || row._itemResolution] return status ? { ...status, label: row._itemResolution?.label || status.label } : null @@ -132,6 +135,14 @@ export function assistantApplyDraftChanges(rows, event, { action, fields = [], d }) } +// A common batch project must not silently skip rows already executed or locked. +export function assistantPurchaseProjectChanges(rows, field, input, { action, draft } = {}) { + if (field?.key !== 'projectId' || !isAssistantPurchase(action) || !assistantRecordId(input?.value)) return [] + if (!isAssistantPending(draft) || draft.readOnly || draft.permissionDenied) return [] + purchaseBatchProjectChanges(rows, input.value, row => !assistantRowSucceeded(draft, row) && !assistantFieldLocked(action, row, field)) + return assistantBulkChanges(rows, field, input, { action, draft, overwrite: true }) +} + export function assistantBulkChanges(rows, field, input, { action, draft, overwrite = false, selectedIds = null } = {}) { if (!field?.batch || field.hidden || field.key.startsWith('_') || field.type === 'table' || !scalarValue(input?.value) || input?.value == null || input.value === '') return [] if (field.ref && !['unit', 'category'].includes(field.ref) && !assistantRecordId(input.value)) return [] diff --git a/ruoyi-ui-vue3/src/utils/purchase-sheet.js b/ruoyi-ui-vue3/src/utils/purchase-sheet.js index 4c4ddfc..fba6e9d 100644 --- a/ruoyi-ui-vue3/src/utils/purchase-sheet.js +++ b/ruoyi-ui-vue3/src/utils/purchase-sheet.js @@ -69,7 +69,8 @@ export function resolveRow(row, items) { if(!selected)throw new Error('相同物品存在多份档案,请明确选择规格编码') applyItem(row,selected) } else { row.productId=null;row.productCode=null } - if(row.productId && !clean(row.category) && category)row.category=category + // An explicit classification correction must survive archive matching and save. + if(category)row.category=category return row } export function collectRowErrors(rows, items, lineNumbers = [], allowedUnits, allowedCategories) { @@ -87,7 +88,7 @@ export function collectRowErrors(rows, items, lineNumbers = [], allowedUnits, al try { resolveRow(row,items) } catch(error) { add(error.message.includes('单位')?'unit':'materialParams',error.message) } if(!clean(row.category))add('category','请选择物品类别') const catalogItem=items.find(item=>String(item.id)===String(row.productId)) - if(clean(row.category) && (!catalogItem || !clean(catalogItem.category)) && allowedCategories && !allowedCategories.includes(clean(row.category)))add('category','物品类别不存在或已停用,请先在业务字典维护') + if(clean(row.category) && (!catalogItem || !same(row.category,catalogItem.category)) && allowedCategories && !allowedCategories.includes(clean(row.category)))add('category','物品类别不存在或已停用,请先在业务字典维护') if(!row.productId && clean(row.unit) && allowedUnits && !allowedUnits.some(unit=>same(unit,row.unit)))add('unit','请选择字典中的单位') if(row.purchasePurpose==='REPAY'&&!row.loanId)add('loanId','请选择归还的借用记录') const key=itemKey(row), previous=units.get(key) diff --git a/ruoyi-ui-vue3/tests/unit/business-assistant-draft-edit.test.mjs b/ruoyi-ui-vue3/tests/unit/business-assistant-draft-edit.test.mjs index 25434e5..d8bc790 100644 --- a/ruoyi-ui-vue3/tests/unit/business-assistant-draft-edit.test.mjs +++ b/ruoyi-ui-vue3/tests/unit/business-assistant-draft-edit.test.mjs @@ -84,6 +84,16 @@ test('catalog with no category allows filling it but never changing the catalog assert.equal(assistantItemResolution({ _itemResolution: { kind: 'CREATE' } }).label, '确认后新建档案') }) +test('server-authorized category correction stays editable and does not release item identity or clear quotes', () => { + const row={_rowId:'1',productId:7,category:'设备',unit:'个',quantity:2,finalUnitPrice:12,_assistantCanEditCategory:true,_assistantCatalogCategory:'设备'} + const field=fields.find(field=>field.key==='category') + assert.equal(assistantFieldLocked('purchase.update',row,field),false) + const [changed]=assistantApplyDraftChanges([row],{rowId:'1',key:'category',value:'配件'},context({...readyDraft,action:'purchase.update'})) + assert.equal(changed.category,'配件');assert.equal(changed.productId,7);assert.equal(changed.quantity,2);assert.equal(changed.finalUnitPrice,12) + assert.equal(assistantFieldLocked('purchase.update',{...row,_assistantCanEditCategory:false},field),true) + assert.match(assistantItemResolution({_itemResolution:{kind:'UPDATE_CATEGORY'}}).label,/同步更正/) +}) + test('batch setting defaults to filling missing and unresolved references without changing already selected projects or successful rows', () => { const rows = [{ _rowId: 'a', projectId: null }, { _rowId: 'b', projectId: { keyword: '1025底盘项目' } }, { _rowId: 'c', projectId: 6 }, { _rowId: 'done', projectId: null }] const draft = { ...readyDraft, rows, results: [{ rowId: 'done', status: 'SUCCEEDED' }] } diff --git a/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs b/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs index ba5be7a..1d41fe1 100644 --- a/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs +++ b/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs @@ -2,7 +2,7 @@ import test from 'node:test' import assert from 'node:assert/strict' import fs from 'node:fs' import { purchaseProjectState, purchaseDraftBatchCount, purchaseBatchProjectChanges } from '../../src/utils/purchase-project.js' -import { assistantApplyDraftChanges, assistantBulkChanges } from '../../src/utils/assistant-draft-edit.js' +import { assistantApplyDraftChanges, assistantBulkChanges, assistantPurchaseProjectChanges } from '../../src/utils/assistant-draft-edit.js' test('one batch has one common project and missing information can be distinguished from mixed history', () => { assert.deepEqual(purchaseProjectState([{projectId:1},{projectId:'1'}]), {mixed:false,count:1,missing:0,value:1}) @@ -38,3 +38,19 @@ test('both procurement screens expose a common project while retaining mixed-his const ai=fs.readFileSync(new URL('../../src/components/BusinessAssistant/AssistantDraft.vue',import.meta.url),'utf8') assert.match(ai,/assistant-purchase-project/);assert.match(ai,/purchaseDraftBatchCount\(props\.rows\) <= 1/);assert.match(ai,/!sharedProject\.value \|\| field\.key !== 'projectId'/) }) + +test('AI common project never partially changes a batch containing executed rows', () => { + const rows=[{_rowId:'done',projectId:17},{_rowId:'pending',projectId:17}] + const field={key:'projectId',ref:'project',batch:true},draft={status:'PARTIAL',results:[{rowId:'done',status:'SUCCEEDED'}]} + assert.throws(()=>assistantPurchaseProjectChanges(rows,field,{value:18},{action:'purchase.create',draft}),/不能统一更换项目/) + assert.deepEqual(rows.map(row=>row.projectId),[17,17]) + assert.deepEqual(assistantPurchaseProjectChanges(rows,field,{value:17},{action:'purchase.create',draft}),[]) + rows[1].projectId=null + assert.deepEqual(assistantPurchaseProjectChanges(rows,field,{value:17},{action:'purchase.create',draft}).map(change=>change.rowId),['pending']) +}) + +test('AI common project ignores unresolved selections and terminal or readonly drafts', () => { + const rows=[{_rowId:'1',projectId:null}],field={key:'projectId',ref:'project',batch:true} + for(const value of [null,'',{keyword:'研发项目'},'未匹配项目'])assert.deepEqual(assistantPurchaseProjectChanges(rows,field,{value},{action:'purchase.create',draft:{status:'WAIT_CONFIRM'}}),[]) + for(const draft of [{status:'SUCCEEDED'},{status:'CANCELLED'},{status:'WAIT_CONFIRM',readOnly:true},{status:'WAIT_CONFIRM',permissionDenied:true}])assert.deepEqual(assistantPurchaseProjectChanges(rows,field,{value:17},{action:'purchase.create',draft}),[]) +}) diff --git a/ruoyi-ui-vue3/tests/unit/purchase-sheet-input.test.mjs b/ruoyi-ui-vue3/tests/unit/purchase-sheet-input.test.mjs index a8666a8..757311e 100644 --- a/ruoyi-ui-vue3/tests/unit/purchase-sheet-input.test.mjs +++ b/ruoyi-ui-vue3/tests/unit/purchase-sheet-input.test.mjs @@ -44,3 +44,13 @@ test('resolved item categories and zero price remain valid, conflicting units ma const conflict=collectRowErrors([row,{...row,_key:'b',unit:'件'}],[]) assert.deepEqual(new Set(conflict.filter(e=>e.field==='unit').map(e=>e.rowKey)),new Set(['a','b'])) }) + +test('saved catalog category corrections survive matching and paste while invalid dictionary values are rejected', () => { + const item={id:1,productName:'电机',brand:'A',spec:'10',unit:'个',category:'设备'} + const row={_key:'saved',id:8,productId:1,materialName:'电机',materialBrand:'A',materialParams:'10',unit:'个',category:'配件',projectId:1,expenseCategoryId:1,quantity:2,finalUnitPrice:12} + assert.deepEqual(collectRowErrors([row],[item],[],['个'],['设备','配件']),[]) + validateRows([row],[item]);assert.equal(row.category,'配件');assert.equal(row.productId,1);assert.equal(row.quantity,2);assert.equal(row.finalUnitPrice,12) + const pasted=pasteRectangle([row],'设备',0,0,['category'],{readonly:()=>false,items:[item],units:['个']}) + assert.equal(pasted[0].category,'设备');assert.equal(row.category,'配件') + assert.equal(collectRowErrors([{...row,category:'未维护类别'}],[item],[],['个'],['设备','配件'])[0].field,'category') +})