🔱: [client] sync upgrade with 3 commits [trident-sync]

chore: 1.13.8
perf(form): 支持conditionalRender
pull/14/head
GitHub Actions Bot 2023-05-22 19:23:55 +00:00
parent 2db9343e0f
commit 59f22ab17e
6 changed files with 44 additions and 10 deletions

View File

@ -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

View File

@ -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",

View File

@ -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"

View File

@ -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<UserPageRes> => {
@ -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 <div style={{ lineHeight: "32px" }}>{form.conditionalRender || "请先输入值"}</div>;
}
}
}
},
conditionalRenderToggle: {
title: "切换条件",
type: "dict-switch",
dict: dict({
data: [
{ value: 1, label: "预览模式" },
{ value: 0, label: "编辑模式" }
]
}),
form: {
helper: "切换条件render 编辑/预览 模式"
}
}
}
}

View File

@ -1,7 +1,7 @@
<template>
<fs-page>
<template #header>
<div class="title">表单字段组件周围的render</div>
<div class="title">表单字段render</div>
<div class="more">
<a target="_blank" href="http://fast-crud.docmirror.cn/api/crud-options/columns.html#key-form-prefixrender">文档</a>
</div>

View File

@ -6,10 +6,12 @@ const options: any = {
};
const list = [
{
name: "王小虎"
name: "王小虎",
conditionalRender: "conditionalRender"
},
{
name: "张三"
name: "张三",
conditionalRender: "conditionalRender"
}
];