Skip to content

Commit

Permalink
Merge pull request #64 from hocgin/v4.0.37
Browse files Browse the repository at this point in the history
V4.0.37
  • Loading branch information
hocgin authored Dec 20, 2021
2 parents a2e2491 + 4a32a1b commit 7769466
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hocgin/ui",
"version": "4.0.36",
"version": "4.0.37",
"sideEffects": [
".less",
".css"
Expand Down
10 changes: 7 additions & 3 deletions src/Promise/components/Schema/scheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,16 @@ export const SchemeColumns: Record<string, ProRenderFieldPropsType> = {
let params: any = props?.params || {};
let valueEnum = props?.valueEnum || {};

console.log('text', text);
console.log('text type', typeof text);


let options: any = [];
if (text) {
options = Object.keys(valueEnum).map((key) => ({
value: key,
options = Object.keys(valueEnum).map((value) => ({
value: typeof text === 'number' ? parseInt(value) : value,
// title
key: valueEnum[key]?.text || valueEnum[key],
key: valueEnum[value]?.text ?? valueEnum[value],
}));
}
return (
Expand Down
2 changes: 1 addition & 1 deletion src/Promise/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Index: React.FC<{
{...rest}
>
{data.map(({ key, image, description, value }: SearchOption) => (
<Select.Option key={`${value}`} value={value} label={key}>
<Select.Option value={value} label={key}>
<OptionView title={key} image={image} description={description} />
</Select.Option>
))}
Expand Down
31 changes: 14 additions & 17 deletions src/Promise/demos/scheme-archive-config.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Dom } from '@hocgin/ui';
import { Dom, Utils } from '@hocgin/ui';
import treedata from './data-tree';

export const config: any = {
Expand Down Expand Up @@ -49,12 +49,13 @@ export const config: any = {
},
params: {
useAction: {
initialValues: async (params: Record<string, any>) => [
{
key: 'lab',
value: 'vx',
},
],
initialValues: async (params: Record<string, any>) =>
Utils.Lang.sleep(1000).then(() => [
{
key: '这是key字段',
value: 'vx',
},
]),
},
},
},
Expand All @@ -70,24 +71,20 @@ export const config: any = {
return [
{
key: '22',
title: 'search2',
title: 'search sleep',
dataIndex: 'search2',
valueType: Dom.columnPrefix('search'),
hideInTable: true,
valueEnum: {
[search2]: search2Name,
},
valueEnum: { [search2]: search2Name },
params: {
useAction: {
initialValues: async (params: Record<string, any>) => {
console.log('请求 search2', params);
return [
initialValues: async (params: Record<string, any>) =>
Utils.Lang.sleep(1000).then(() => [
{
key: 'lab',
key: '这是key字段',
value: 'vx',
},
];
},
]),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/types/rt-grass.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// :: 网络数据类型协议

export interface Option {
value: string;
value: any;
key: string;
}

export interface SearchOption {
value: string;
value: any;
key?: string;
image?: string;
description?: string;
Expand Down

1 comment on commit 7769466

@vercel
Copy link

@vercel vercel bot commented on 7769466 Dec 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.