Skip to content

Commit

Permalink
feat: v4.0.37
Browse files Browse the repository at this point in the history
  • Loading branch information
hocgin committed Dec 20, 2021
1 parent 4eedb85 commit 4a32a1b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 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
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

0 comments on commit 4a32a1b

Please sign in to comment.