Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
7d835c60
Commit
7d835c60
authored
Apr 14, 2025
by
fanyj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tijiao
parent
aabb1c9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
9 deletions
+35
-9
QuestionModalButton.tsx
...view/Manage/AssetManage/Component/QuestionModalButton.tsx
+35
-9
No files found.
src/view/Manage/AssetManage/Component/QuestionModalButton.tsx
View file @
7d835c60
import
{
useSetState
}
from
"ahooks"
import
{
Button
,
Drawer
,
Space
,
Collapse
,
Input
}
from
"antd"
import
React
,
{
useState
}
from
"react"
import
{
Edit
Outlined
}
from
"@ant-design/icons"
import
{
CheckOutlined
,
DeleteOutlined
,
EditOutlined
,
Rollback
Outlined
}
from
"@ant-design/icons"
const
{
Panel
}
=
Collapse
...
...
@@ -77,6 +77,11 @@ const QuestionModalButton:React.FC<any>=(props)=>{
setEditKey
(
item
.
id
)
}
const
deleteItem
=
(
item
)
=>
{
const
templist
=
list
.
filter
((
i
:
any
)
=>
(
item
.
id
!==
i
.
id
))
setList
(
templist
)
}
return
(
<
React
.
Fragment
>
<
Button
onClick=
{
openModal
}
>
资产标注
</
Button
>
...
...
@@ -105,12 +110,25 @@ const QuestionModalButton:React.FC<any>=(props)=>{
if
(
item
.
id
===
eidtKey
){
return
(
<
Collapse
key=
{
key
}
activeKey=
{
'1'
}
>
<
Panel
header=
{
<
Input
style=
{
{
width
:
'80%'
}
}
placeholder=
"请输入提示词"
value=
{
editInfo
.
question
}
onChange=
{
(
e
:
any
)
=>
{
setEditInfo
({
question
:
e
.
target
.
value
})}
}
/>
}
key=
"1"
>
<
Panel
header=
{
<
Input
prefix=
{
<
span
>
问题
{
key
+
1
}
:
</
span
>
}
style=
{
{
width
:
'80%'
}
}
placeholder=
"请输入提示词"
value=
{
editInfo
.
question
}
onChange=
{
(
e
:
any
)
=>
{
setEditInfo
({
question
:
e
.
target
.
value
})}
}
/>
}
key=
"1"
extra=
{
readOnly
?
undefined
:(<
Space
>
<
CheckOutlined
onClick=
{
(
event
)
=>
{
event
.
stopPropagation
();
save
()
}
}
/>
<
RollbackOutlined
onClick=
{
(
event
)
=>
{
event
.
stopPropagation
();
cancel
()
}
}
/>
</
Space
>)
}
>
<
Input
.
TextArea
value=
{
editInfo
.
sql
}
autoSize=
{
{
minRows
:
4
,
maxRows
:
8
}
}
onChange=
{
(
e
:
any
)
=>
{
setEditInfo
({
sql
:
e
.
target
.
value
})}
}
placeholder=
"请输入
问题答案
"
placeholder=
"请输入
答案SQL
"
/>
</
Panel
>
</
Collapse
>
...
...
@@ -118,12 +136,20 @@ const QuestionModalButton:React.FC<any>=(props)=>{
}
else
{
return
(
<
Collapse
key=
{
key
}
collapsible=
"header"
defaultActiveKey=
{
[
'1'
]
}
>
<
Panel
header=
{
item
.
question
}
key=
"1"
extra=
{
readOnly
?
undefined
:(<
EditOutlined
onClick=
{
(
event
)
=>
{
event
.
stopPropagation
();
editItem
(
item
)
}
}
/>)
}
>
<
Panel
header=
{
`问题${key+1}:${item?.question}`
}
key=
"1"
extra=
{
readOnly
?
undefined
:(<
Space
>
<
EditOutlined
onClick=
{
(
event
)
=>
{
event
.
stopPropagation
();
editItem
(
item
)
}
}
/>
<
DeleteOutlined
onClick=
{
(
event
)
=>
{
event
.
stopPropagation
();
deleteItem
(
item
)
}
}
/>
</
Space
>)
}
>
{
item
.
sql
}
</
Panel
>
</
Collapse
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment