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

fix: _index列 被conditionalRender影响的bug
refactor:
pull/14/head
GitHub Actions Bot 2023-04-19 19:24:05 +00:00
parent 1173fb1e90
commit a62230c195
3 changed files with 10 additions and 5 deletions

View File

@ -40,7 +40,8 @@ function install(app: any, options: any = {}) {
conditionalRender: {
match(scope) {
//不能用 !scope.value 否则switch组件设置为关之后就消失了
return scope.value == null || (scope.value instanceof Array && scope.value.length === 0);
const { value, key } = scope;
return !value && key != "_index" && value != false;
},
render() {
return "-";

View File

@ -1,6 +1,6 @@
import * as api from "./api";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, ValueChangeContext } from "@fast-crud/fast-crud";
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
export default function createCrudOptions({}: CreateCrudOptionsProps): CreateCrudOptionsRet {
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
@ -17,6 +17,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
};
const remoteDict = dict({
cloneable: true,
url: "/mock/dicts/OpenStatusEnum"
});

View File

@ -6,14 +6,17 @@ const options: any = {
const list = [
{
status: "1",
remote: "2"
remote: "2",
modifyDict: true
},
{
status: "2",
remote: "0"
remote: "0",
modifyDict: false
},
{
status: "0"
status: "0",
modifyDict: true
}
];
options.list = list;