From 59f22ab17e606fd61918ee2c758406865bc548e2 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Mon, 22 May 2023 19:23:55 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=B1:=20[client]=20sync=20upgrade=20wit?= =?UTF-8?q?h=203=20commits=20[trident-sync]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore: 1.13.8 perf(form): 支持conditionalRender --- packages/ui/certd-client/CHANGELOG.md | 4 +++ packages/ui/certd-client/package.json | 10 +++---- .../src/router/source/modules/crud.ts | 2 +- .../src/views/crud/form/render/crud.tsx | 30 ++++++++++++++++++- .../src/views/crud/form/render/index.vue | 2 +- .../src/views/crud/form/render/mock.ts | 6 ++-- 6 files changed, 44 insertions(+), 10 deletions(-) diff --git a/packages/ui/certd-client/CHANGELOG.md b/packages/ui/certd-client/CHANGELOG.md index 8570e361..aedb4d88 100644 --- a/packages/ui/certd-client/CHANGELOG.md +++ b/packages/ui/certd-client/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.13.8](https://github.com/fast-crud/fast-crud/compare/v1.13.7...v1.13.8) (2023-05-22) + +**Note:** Version bump only for package @fast-crud/fs-admin-antdv + ## [1.13.7](https://github.com/fast-crud/fast-crud/compare/v1.13.6...v1.13.7) (2023-05-19) ### Bug Fixes diff --git a/packages/ui/certd-client/package.json b/packages/ui/certd-client/package.json index 7084d7f0..2f873784 100644 --- a/packages/ui/certd-client/package.json +++ b/packages/ui/certd-client/package.json @@ -1,6 +1,6 @@ { "name": "@fast-crud/fs-admin-antdv", - "version": "1.13.7", + "version": "1.13.8", "private": true, "scripts": { "dev": "vite", @@ -26,10 +26,10 @@ "@aws-sdk/client-s3": "^3.292.0", "@aws-sdk/s3-request-presigner": "^3.292.0", "@fast-crud/fast-bpmn": "^1.0.14", - "@fast-crud/fast-crud": "^1.13.7", - "@fast-crud/fast-extends": "^1.13.7", - "@fast-crud/ui-antdv": "^1.13.7", - "@fast-crud/ui-interface": "^1.13.7", + "@fast-crud/fast-crud": "^1.13.8", + "@fast-crud/fast-extends": "^1.13.8", + "@fast-crud/ui-antdv": "^1.13.8", + "@fast-crud/ui-interface": "^1.13.8", "@iconify/iconify": "^3.1.0", "@iconify/json": "^2.2.35", "@purge-icons/generated": "^0.9.0", diff --git a/packages/ui/certd-client/src/router/source/modules/crud.ts b/packages/ui/certd-client/src/router/source/modules/crud.ts index 3451e7aa..b5d407a9 100644 --- a/packages/ui/certd-client/src/router/source/modules/crud.ts +++ b/packages/ui/certd-client/src/router/source/modules/crud.ts @@ -426,7 +426,7 @@ export const crudResources = [ component: "/crud/form/nest/index.vue" }, { - title: "字段组件周围render", + title: "字段组件render", name: "FormRender", path: "/crud/form/render", component: "/crud/form/render/index.vue" diff --git a/packages/ui/certd-client/src/views/crud/form/render/crud.tsx b/packages/ui/certd-client/src/views/crud/form/render/crud.tsx index 35f17181..6e704d54 100644 --- a/packages/ui/certd-client/src/views/crud/form/render/crud.tsx +++ b/packages/ui/certd-client/src/views/crud/form/render/crud.tsx @@ -1,5 +1,5 @@ import * as api from "./api"; -import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes, useUi } from "@fast-crud/fast-crud"; +import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, useUi } from "@fast-crud/fast-crud"; export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet { const pageRequest = async (query: UserPageQuery): Promise => { @@ -61,6 +61,34 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti ); } } + }, + conditionalRender: { + title: "条件渲染", + type: "text", + form: { + helper: "符合条件则render,否则走默认", + conditionalRender: { + match({ form }) { + return form.conditionalRenderToggle; + }, + render({ form }) { + return
{form.conditionalRender || "请先输入值"}
; + } + } + } + }, + conditionalRenderToggle: { + title: "切换条件", + type: "dict-switch", + dict: dict({ + data: [ + { value: 1, label: "预览模式" }, + { value: 0, label: "编辑模式" } + ] + }), + form: { + helper: "切换条件render 编辑/预览 模式" + } } } } diff --git a/packages/ui/certd-client/src/views/crud/form/render/index.vue b/packages/ui/certd-client/src/views/crud/form/render/index.vue index 6a4162d5..04c96794 100644 --- a/packages/ui/certd-client/src/views/crud/form/render/index.vue +++ b/packages/ui/certd-client/src/views/crud/form/render/index.vue @@ -1,7 +1,7 @@