Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Prettier and StandardJS #265

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/pages/chatgpt/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ChatGpt = () => {
if (e.data !== '[DONE]') {
const payload = JSON.parse(e.data)
const {
delta: { content },
delta: { content }
} = payload.choices[0]
if (content) {
apiResultRef.current += content
Expand Down Expand Up @@ -125,7 +125,7 @@ const ChatGpt = () => {
if (e.data !== '[DONE]') {
const payload = JSON.parse(e.data)
const {
delta: { content },
delta: { content }
} = payload.choices[0]
if (content) {
structureResultRef.current += content
Expand All @@ -151,36 +151,36 @@ const ChatGpt = () => {
<section style={{ width: 600 }}>
<Form
form={form}
layout="vertical"
layout='vertical'
initialValues={{
apiKey: '',
text: '作为产品经理,帮我生成一份PRD文档,功能是公园入园人数大屏展示功能,采用 markdown 格式区分标题和正文,标题加上序号',
text: '作为产品经理,帮我生成一份PRD文档,功能是公园入园人数大屏展示功能,采用 markdown 格式区分标题和正文,标题加上序号'
}}
onFinish={onFinish}
requiredMark={false}
autoComplete="off"
autoComplete='off'
>
<Form.Item name="apiKey" label="OPEN AI KEY" rules={[{ required: true, message: '请输入open ai key' }]}>
<Form.Item name='apiKey' label='OPEN AI KEY' rules={[{ required: true, message: '请输入open ai key' }]}>
<Input.TextArea
onChange={onChange}
rows={1}
style={{ resize: 'none', padding: 2 }}
placeholder="open ai key"
placeholder='open ai key'
/>
</Form.Item>
<Form.Item name="text" label="您的输入" rules={[{ required: true, message: '请输您的需求' }]}>
<Form.Item name='text' label='您的输入' rules={[{ required: true, message: '请输您的需求' }]}>
<Input.TextArea
rows={4}
showCount
maxLength={1000}
style={{ resize: 'none', padding: 2 }}
placeholder=""
placeholder=''
onPressEnter={onFinish}
/>
</Form.Item>

<Form.Item wrapperCol={{ offset: 4, span: 16 }}>
<Button block type="primary" htmlType="submit" disabled={[0, 1].includes(readyState)}>
<Button block type='primary' htmlType='submit' disabled={[0, 1].includes(readyState)}>
{apiResult && readyState === 2 ? '再来一次' : 'ChatGPT'}
</Button>
</Form.Item>
Expand All @@ -198,15 +198,15 @@ const ChatGpt = () => {
items: [
{
key: '1',
label: '复制文本',
label: '复制文本'
},
{
key: '2',
label: '复制Markdown',
},
],
label: '复制Markdown'
}
]
}}
placement="bottom"
placement='bottom'
arrow
>
<Button>
Expand All @@ -228,7 +228,7 @@ const ChatGpt = () => {
<section>
{apiResult && readyState === 2 && (
<Space>
<Button type="primary" disabled={[0, 1].includes(structureReadyState)} onClick={buildStructure}>
<Button type='primary' disabled={[0, 1].includes(structureReadyState)} onClick={buildStructure}>
{structureResult && structureReadyState === 2 ? '重新生成' : '生成页面结构'}
</Button>

Expand All @@ -241,18 +241,18 @@ const ChatGpt = () => {
items: [
{
key: '1',
label: '导出png格式',
label: '导出png格式'
},
{
key: '2',
label: '导出svg格式',
},
],
label: '导出svg格式'
}
]
}}
placement="bottom"
placement='bottom'
arrow
>
<Button type="primary">
<Button type='primary'>
<DownloadOutlined />
导出
</Button>
Expand Down