Skip to content

Commit 36069b4

Browse files
committed
update UI
1 parent 501e68a commit 36069b4

File tree

8 files changed

+51
-60
lines changed

8 files changed

+51
-60
lines changed

media/src/components/APIPage/API.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export const API: React.FC<APIProps> = (props) => {
201201
</Tab.Item>
202202
<Tab.Item key="sdk" title="示例代码">
203203
<div className="content">
204-
<TrySDK></TrySDK>
204+
<TrySDK isExpand={isExpand}></TrySDK>
205205
</div>
206206
</Tab.Item>
207207
<Tab.Item key="debug" title="调试结果">
@@ -247,7 +247,7 @@ export const API: React.FC<APIProps> = (props) => {
247247
<div>
248248
<div className="flex">
249249
{selectedApi.method ? (
250-
<div className="h-6 w-16 rounded-sm border-2 border-solid border-emerald-100 bg-emerald-100 text-center text-base leading-5 text-teal-500">
250+
<div className="h-6 w-16 rounded-sm border-2 border-solid border-emerald-100 bg-emerald-100 text-center text-base font-medium leading-5 text-teal-500 ">
251251
{selectedApi.method?.toUpperCase()}
252252
</div>
253253
) : null}

media/src/components/APIPage/APIDebugger/APIDebugger.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.codicon {
77
vertical-align: middle;
88
position: relative;
9-
bottom: 2px;
9+
bottom: 1px;
1010
}
1111
}
1212
.alicloud-schema-form-object,

media/src/components/APIPage/APIDebugger/APIGuide.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,12 @@
4545
}
4646
}
4747
}
48+
.api-debugger-param-desc {
49+
.semix-markdown {
50+
font-size: 12px;
51+
p,
52+
code {
53+
font-size: 12px;
54+
}
55+
}
56+
}

media/src/components/APIPage/APIDebugger/APIGuide.tsx

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,18 @@ export const APIGuide = React.memo((props: APIGuideProps) => {
104104
closable={false}
105105
trigger={
106106
<span style={{ lineHeight: "24px" }}>
107-
<div className="codicon codicon-question text-gray-500"></div>
107+
<div className="codicon codicon-question !text-sm text-gray-500"></div>
108108
</span>
109109
}
110110
>
111111
<div className="api-debugger-param-desc !text-xs">
112-
<span className="config-title-desc">描述</span>
112+
<span className="config-title-desc text-gray-500">描述</span>
113113
<div className="!text-xs">
114114
<SemixMarkdown source={description}></SemixMarkdown>
115115
</div>
116116
{props.schema?.example ? (
117117
<>
118-
<div className="config-title">
118+
<div className="config-title mt-2 text-gray-500">
119119
<span>示例值</span>
120120
</div>
121121

@@ -124,25 +124,25 @@ export const APIGuide = React.memo((props: APIGuideProps) => {
124124
) : null}
125125
{props.schema?.maximum ? (
126126
<>
127-
<div className="config-title">最大值</div>
127+
<div className="config-title mt-2 text-gray-500">最大值</div>
128128
<div className="config-content">{props.schema?.maximum}</div>
129129
</>
130130
) : null}
131131
{props.schema?.minimum ? (
132132
<>
133-
<div className="config-title">最小值</div>
133+
<div className="config-title mt-2 text-gray-500">最小值</div>
134134
<div className="config-content">{props.schema?.minimum}</div>
135135
</>
136136
) : null}
137137
{props.schema?.format ? (
138138
<>
139-
<div className="config-title">格式</div>
139+
<div className="config-title mt-2 text-gray-500">格式</div>
140140
<div className="config-content">{props.schema?.format}</div>
141141
</>
142142
) : null}
143143
{props.schema?.enum?.length ? (
144144
<>
145-
<div className="config-title">枚举值</div>
145+
<div className="config-title mt-2 text-gray-500">枚举值</div>
146146
{props.schema?.enum?.map((item) => (
147147
<Tag size="small" type="normal" style={{ marginRight: "4px", borderRadius: "2px" }}>
148148
{item.value || item}
@@ -152,7 +152,7 @@ export const APIGuide = React.memo((props: APIGuideProps) => {
152152
) : null}
153153
{props.schema?.pattern ? (
154154
<>
155-
<div className="config-title">正则</div>
155+
<div className="config-title mt-2 text-gray-500">正则</div>
156156
<div className="config-content">{props.schema?.pattern}</div>
157157
</>
158158
) : null}
@@ -163,18 +163,6 @@ export const APIGuide = React.memo((props: APIGuideProps) => {
163163
</span>
164164
</div>
165165
</div>
166-
{/* {isNewHeader && props.deleteHeader ? (
167-
<span className="guide-op">
168-
<AmpIcon
169-
type="delete"
170-
color="#014cd8"
171-
style={{ cursor: 'pointer' }}
172-
onClick={() => {
173-
props.deleteHeader(props.schema);
174-
}}
175-
/>
176-
</span>
177-
) : null} */}
178166
</div>
179167
) : null}
180168
</div>

media/src/components/APIPage/APIDebugger/widgets/xconsole/list.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
*/
55
// import { AmpIcon } from '@ali/amp-base';
66
// import { LinkButton } from '@alicloud/console-components-actions';
7-
import * as React from 'react';
8-
import './list.module.scss';
9-
import { ListProps } from '../types';
10-
import { Field } from '../../../../SemixFormRender/common/Field';
11-
import { Button } from '@alicloud/console-components';
7+
import * as React from "react";
8+
import { Field } from "../../../../SemixFormRender/common/Field";
9+
import { ListProps } from "../types";
10+
import "./list.module.scss";
1211

1312
export class SimpleListProps extends ListProps {}
1413

@@ -17,15 +16,15 @@ export const SimpleList: React.FC<SimpleListProps> = (props) => {
1716
return (
1817
<div className="list-item" key={index}>
1918
<div className="title-operator">
20-
{props.schema?.widget === 'typeSelect' ? null : (
19+
{props.schema?.widget === "typeSelect" ? null : (
2120
<a
2221
href="javascript:;"
2322
className="op"
2423
onClick={() => {
2524
props.copyItem(index);
2625
}}
2726
>
28-
copy
27+
<div className="codicon codicon-copy"></div>
2928
</a>
3029
)}
3130
<a
@@ -35,15 +34,15 @@ export const SimpleList: React.FC<SimpleListProps> = (props) => {
3534
props.deleteItem(index);
3635
}}
3736
>
38-
delete
37+
<div className="codicon codicon-trash"></div>
3938
</a>
4039
</div>
4140
<Field
42-
fieldName={props.fieldName ? props.fieldName + '.' + index : ''}
41+
fieldName={props.fieldName ? props.fieldName + "." + index : ""}
4342
key={index}
4443
isRequired={false}
45-
dataPath={props.dataPath ? props.dataPath + '.' + index : index + ''}
46-
schemaPath={props.schemaPath ? props.schemaPath + '.items' : '.items'}
44+
dataPath={props.dataPath ? props.dataPath + "." + index : index + ""}
45+
schemaPath={props.schemaPath ? props.schemaPath + ".items" : ".items"}
4746
schema={props.schema as any}
4847
/>
4948
</div>
@@ -61,7 +60,8 @@ export const SimpleList: React.FC<SimpleListProps> = (props) => {
6160
props.addItem();
6261
}}
6362
>
64-
add
63+
<div className="codicon codicon-add m-1 !text-xs"></div>
64+
添加
6565
</a>
6666
</div>
6767
</div>

media/src/components/APIPage/APIDebugger/widgets/xconsole/number.tsx

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @author yini-chen
33
* @description 输入数值
44
*/
5-
import { NumberPicker } from '@alicloud/console-components';
6-
import * as React from 'react';
7-
import { CommonWidgetProps } from '../types';
5+
import { NumberPicker } from "@alicloud/console-components";
6+
import * as React from "react";
7+
import { CommonWidgetProps } from "../types";
88
// import APIParamGenerate from "viteSrc/pages/designAwesome/APIDesign/QuickTest/APIParams/APIParamGenerate";
99

1010
export class NumberInputProps extends CommonWidgetProps {}
@@ -14,10 +14,10 @@ export const NumberInput: React.FC<NumberInputProps> = (props) => {
1414
const [curvalue, setCurvalue] = React.useState(undefined);
1515

1616
const textMap = {
17-
double: '浮点数值',
18-
float: '浮点数值',
19-
int32: '整型数字',
20-
int64: '整型数字',
17+
double: "浮点数值",
18+
float: "浮点数值",
19+
int32: "整型数字",
20+
int64: "整型数字",
2121
} as any;
2222

2323
// const numberProps = {} as any;
@@ -50,28 +50,20 @@ export const NumberInput: React.FC<NumberInputProps> = (props) => {
5050

5151
const uischema = {
5252
...props.schema,
53-
type: props.schema?.format?.includes('int') ? 'integer' : props?.schema?.type,
53+
type: props.schema?.format?.includes("int") ? "integer" : props?.schema?.type,
5454
};
5555

5656
return (
57-
// <APIParamGenerate
58-
// onGetRandomValue={async () => {
59-
// onGetRandomValue(props.onChange, uischema);
60-
// }}
61-
// changeValue={props.onChange}
62-
// param={uischema as any}>
6357
<NumberPicker
6458
// {...numberProps}
6559
value={curvalue}
66-
style={{width:"100%"}}
60+
style={{ width: "100%" }}
6761
onBlur={emitvalues}
6862
onChange={changeCurValue}
69-
stringMode={['double', 'int64'].includes(schema.format!)}
70-
precision={['int64', 'int32'].includes(schema.format!) ? undefined : 4}
63+
stringMode={["double", "int64"].includes(schema.format!)}
64+
precision={["int64", "int32"].includes(schema.format!) ? undefined : 4}
7165
className="jsonschema-form-widget"
72-
// placeholder={schema?.placeholder || '请输入数字'}
7366
></NumberPicker>
74-
// </APIParamGenerate>
7567
);
7668
};
7769

media/src/components/APIPage/APIDocument/BaseClass.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* @author jasonHzq
33
* @description BaseClass
44
*/
5-
import * as React from "react";
6-
import * as PontSpec from "pontx-spec";
75
import classNames from "classnames";
8-
import { getRefSchema } from "../../utils";
6+
import * as PontSpec from "pontx-spec";
7+
import * as React from "react";
98
import { SemixSchemaTable } from "semix-schema-table";
9+
import { getRefSchema } from "../../utils";
1010

1111
export class BaseClassProps {
1212
name?: string;
@@ -21,7 +21,7 @@ export const BaseClass: React.FC<BaseClassProps> = (props) => {
2121
return (
2222
<div className={classNames("pontx-ui-baseclass", (schema as any)?.type)}>
2323
<div className="header">
24-
<div className="title">
24+
<div className="title text-base">
2525
数据结构 - {name}
2626
{schema?.templateArgs?.length
2727
? `<${schema?.templateArgs.map((arg, argIndex) => "T" + argIndex).join(", ")}>`

media/src/components/APIPage/TrySDK/TrySDK.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import MonacoEditor from "../../common/MonacoEditor";
1111
import { APIPageContext } from "../context";
1212
import { DARA_SDK_LANGUAGES } from "./LanguageSwitcher";
1313

14-
export class TrySDKProps {}
14+
export class TrySDKProps {
15+
isExpand? = true;
16+
}
1517

1618
export const TrySDK: React.FC<TrySDKProps> = (props) => {
1719
// const daraSdkLannguages = SDKPublishInfo.getDaraLanguages(props.sdkInfos || [], product, version);
@@ -121,7 +123,7 @@ export const TrySDK: React.FC<TrySDKProps> = (props) => {
121123
></MonacoEditor>
122124
</div>
123125
);
124-
}, [languageTab, sdkDemos]);
126+
}, [languageTab, sdkDemos, props.isExpand]);
125127
};
126128
TrySDK.defaultProps = new TrySDKProps();
127129
export default TrySDK;

0 commit comments

Comments
 (0)