From 957d9d8307f33d75ceed7749f75310849e99cb18 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Mon, 26 May 2025 19:25:13 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=B1:=20[client]=20sync=20upgrade=20wit?= =?UTF-8?q?h=204=20commits=20[trident-sync]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build: publish success fix: 修复cloneable模式下的dict 无法动态修改data的bug chore: --- packages/ui/certd-client/CHANGELOG.md | 6 +++ packages/ui/certd-client/package.json | 10 ++--- .../src/views/crud/dict/cloneable/crud.tsx | 39 +++++++++++++++++-- .../src/views/crud/dict/cloneable/mock.ts | 3 +- .../src/views/crud/dict/prototype/crud.tsx | 4 ++ .../src/views/crud/dict/single/crud.tsx | 4 ++ 6 files changed, 57 insertions(+), 9 deletions(-) diff --git a/packages/ui/certd-client/CHANGELOG.md b/packages/ui/certd-client/CHANGELOG.md index b3b69d61..0cd16538 100644 --- a/packages/ui/certd-client/CHANGELOG.md +++ b/packages/ui/certd-client/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.25.12](https://github.com/fast-crud/fast-crud/compare/v1.25.11...v1.25.12) (2025-05-26) + +### Bug Fixes + +* 修复cloneable模式下的dict 无法动态修改data的bug ([1dd5cd1](https://github.com/fast-crud/fast-crud/commit/1dd5cd1e1445b126451c6e1b68f453a70bf920de)) + ## [1.25.11](https://github.com/fast-crud/fast-crud/compare/v1.25.10...v1.25.11) (2025-05-14) ### Bug Fixes diff --git a/packages/ui/certd-client/package.json b/packages/ui/certd-client/package.json index 0965bf1c..164c4c6a 100644 --- a/packages/ui/certd-client/package.json +++ b/packages/ui/certd-client/package.json @@ -1,6 +1,6 @@ { "name": "@fast-crud/fs-admin-antdv4", - "version": "1.25.11", + "version": "1.25.12", "private": true, "scripts": { "dev": "vite", @@ -27,10 +27,10 @@ "@aws-sdk/client-s3": "^3.535.0", "@aws-sdk/s3-request-presigner": "^3.535.0", "@ctrl/tinycolor": "^4.1.0", - "@fast-crud/fast-crud": "^1.25.10", - "@fast-crud/fast-extends": "^1.25.10", - "@fast-crud/ui-antdv4": "^1.25.10", - "@fast-crud/ui-interface": "^1.25.10", + "@fast-crud/fast-crud": "^1.25.12", + "@fast-crud/fast-extends": "^1.25.12", + "@fast-crud/ui-antdv4": "^1.25.12", + "@fast-crud/ui-interface": "^1.25.12", "@iconify/tailwind": "^1.2.0", "@iconify/vue": "^4.1.1", "@manypkg/get-packages": "^2.2.2", diff --git a/packages/ui/certd-client/src/views/crud/dict/cloneable/crud.tsx b/packages/ui/certd-client/src/views/crud/dict/cloneable/crud.tsx index cf7dfc50..28da20b1 100644 --- a/packages/ui/certd-client/src/views/crud/dict/cloneable/crud.tsx +++ b/packages/ui/certd-client/src/views/crud/dict/cloneable/crud.tsx @@ -1,5 +1,6 @@ import * as api from "./api"; -import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, ValueChangeContext } from "@fast-crud/fast-crud"; +import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, ValueChangeContext } from "@fast-crud/fast-crud"; +import { createUploaderRules } from "@fast-crud/fast-extends"; export default async function createCrudOptions({}: CreateCrudOptionsProps): Promise { const pageRequest = async (query: UserPageQuery): Promise => { return await api.GetList(query); @@ -53,6 +54,20 @@ export default async function createCrudOptions({}: CreateCrudOptionsProps): Pro component: { dict: { cache: false } } } }, + localSet: { + title: "本地修改", + search: { show: true }, + dict: dict({ + cloneable: true, + data: [ + { + value: 1, + label: "本地字典" + } + ] + }), + type: "dict-select" + }, modifyDict: { title: "动态修改字典", search: { show: false }, @@ -65,9 +80,16 @@ export default async function createCrudOptions({}: CreateCrudOptionsProps): Pro valueChange({ row, getComponentRef }: ValueChangeContext) { // 这里不能使用remoteDict,因为在分发时已经clone到form配置中了 // 这里dict修改不会影响列里面的数据 - const targetDict = getComponentRef("remote").dict; + const targetDict = getComponentRef("remote").getDict(); targetDict.url = row.modifyDict ? "/mock/dicts/moreOpenStatusEnum?remote" : "/mock/dicts/OpenStatusEnum?remote"; targetDict.reloadDict(); + + const targetDict2 = getComponentRef("localSet").getDict(); + if (row.modifyDict) { + targetDict2.setData([{ value: 1, label: "修改后的字典" }]); + } else { + targetDict2.setData([{ value: 1, label: "原字典" }]); + } } }, form: { @@ -78,11 +100,22 @@ export default async function createCrudOptions({}: CreateCrudOptionsProps): Pro valueChange({ form, getComponentRef }: ValueChangeContext) { // 这里不能使用remoteDict,因为在分发时已经clone到form配置中了 // 这里dict修改不会影响列里面的数据 - const targetDict = getComponentRef("remote").dict; + const targetDict = getComponentRef("remote").getDict(); targetDict.url = form.modifyDict ? "/mock/dicts/moreOpenStatusEnum?remote" : "/mock/dicts/OpenStatusEnum?remote"; targetDict.reloadDict(); + + const targetDict2 = getComponentRef("localSet").getDict(); + if (form.modifyDict) { + targetDict2.setData([{ value: 1, label: "修改后的字典" }]); + } else { + targetDict2.setData([{ value: 1, label: "原字典" }]); + } } } + }, + pictureCard: { + title: "照片墙", + type: "image-uploader" } } } diff --git a/packages/ui/certd-client/src/views/crud/dict/cloneable/mock.ts b/packages/ui/certd-client/src/views/crud/dict/cloneable/mock.ts index 514fc4ed..683f70c9 100644 --- a/packages/ui/certd-client/src/views/crud/dict/cloneable/mock.ts +++ b/packages/ui/certd-client/src/views/crud/dict/cloneable/mock.ts @@ -7,7 +7,8 @@ const list = [ { status: "1", remote: "2", - modifyDict: true + modifyDict: true, + localSet: 1 }, { status: "2", diff --git a/packages/ui/certd-client/src/views/crud/dict/prototype/crud.tsx b/packages/ui/certd-client/src/views/crud/dict/prototype/crud.tsx index 2c663590..fd8c8d42 100644 --- a/packages/ui/certd-client/src/views/crud/dict/prototype/crud.tsx +++ b/packages/ui/certd-client/src/views/crud/dict/prototype/crud.tsx @@ -121,6 +121,10 @@ export default async function ({ crudExpose }: CreateCrudOptionsProps): Promise< title: "动态Url", dict: dynamicUrlDict, type: "dict-select" + }, + pictureCard: { + title: "照片墙", + type: "image-uploader" } } } diff --git a/packages/ui/certd-client/src/views/crud/dict/single/crud.tsx b/packages/ui/certd-client/src/views/crud/dict/single/crud.tsx index f6a4e0e2..046bd09f 100644 --- a/packages/ui/certd-client/src/views/crud/dict/single/crud.tsx +++ b/packages/ui/certd-client/src/views/crud/dict/single/crud.tsx @@ -131,6 +131,10 @@ export default async function ({ crudExpose }: CreateCrudOptionsProps): Promise< cache: true }), type: "dict-select" + }, + pictureCard: { + title: "test", + type: "image-uploader" } } }