Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-bi
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-bi
Commits
191a6af6
提交
191a6af6
authored
4月 15, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
7d895a24
隐藏空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
166 行增加
和
130 行删除
+166
-130
Chart.tsx
src/components/chart/Chart.tsx
+89
-22
ChartButtonModal.tsx
src/components/chart/ChartButtonModal.tsx
+21
-15
useQuery.ts
src/hooks/useQuery.ts
+5
-4
query.ts
src/modules/data/preprocess/error/query.ts
+1
-3
query.ts
src/modules/data/preprocess/max/query.ts
+1
-3
query.ts
src/modules/data/preprocess/min/query.ts
+1
-3
query.ts
src/modules/data/preprocess/null/query.ts
+1
-3
query.ts
src/modules/data/preprocess/repeat/query.ts
+1
-3
query.ts
src/modules/data/preprocess/sort/query.ts
+1
-3
query.ts
src/modules/data/preprocess/space/query.ts
+1
-3
query.ts
src/modules/data/preprocess/splice/query.ts
+1
-3
query.ts
src/modules/data/preprocess/split/query.ts
+1
-3
query.ts
src/modules/data/preprocess/symbol/query.ts
+1
-3
query.ts
src/modules/data/preprocess/type/query.ts
+1
-3
ButtonModal.tsx
src/modules/data/process/binning/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/binning/query.ts
+1
-3
ButtonModal.tsx
src/modules/data/process/date/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/date/query.ts
+1
-3
ButtonModal.tsx
...s/data/process/desensitization/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/desensitization/query.ts
+1
-3
ButtonModal.tsx
src/modules/data/process/group/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/group/query.ts
+1
-3
ButtonModal.tsx
src/modules/data/process/logic/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/logic/query.ts
+1
-3
ButtonModal.tsx
src/modules/data/process/mapping/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/mapping/query.ts
+1
-3
ButtonModal.tsx
src/modules/data/process/number/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/number/query.ts
+1
-3
ButtonModal.tsx
src/modules/data/process/string/components/ButtonModal.tsx
+4
-4
query.ts
src/modules/data/process/string/query.ts
+1
-3
没有找到文件。
src/components/chart/Chart.tsx
浏览文件 @
191a6af6
...
@@ -47,6 +47,69 @@ const usePattern = (type = 'horizontal', color = '#5470C6') => {
...
@@ -47,6 +47,69 @@ const usePattern = (type = 'horizontal', color = '#5470C6') => {
}
}
}
}
const
transformData
=
(
data
:
any
[],
yField
:
string
[],
yRule
:
string
,
ySort
:
string
)
=>
{
let
transformedData
=
[...
data
]
// Apply calculation rule
if
(
yRule
)
{
transformedData
=
transformedData
.
map
((
item
)
=>
{
const
newItem
=
{
...
item
}
yField
.
forEach
((
field
)
=>
{
const
values
=
data
.
map
((
d
)
=>
parseFloat
(
d
[
field
])
||
0
)
let
result
=
0
switch
(
yRule
)
{
case
'sum'
:
result
=
values
.
reduce
((
a
,
b
)
=>
a
+
b
,
0
)
break
case
'avg'
:
result
=
values
.
reduce
((
a
,
b
)
=>
a
+
b
,
0
)
/
values
.
length
break
case
'count'
:
result
=
values
.
length
break
case
'max'
:
result
=
Math
.
max
(...
values
)
break
case
'min'
:
result
=
Math
.
min
(...
values
)
break
case
'median'
:
{
const
sorted
=
[...
values
].
sort
((
a
,
b
)
=>
a
-
b
)
const
mid
=
Math
.
floor
(
sorted
.
length
/
2
)
result
=
sorted
.
length
%
2
===
0
?
(
sorted
[
mid
-
1
]
+
sorted
[
mid
])
/
2
:
sorted
[
mid
]
break
}
case
'variance'
:
{
const
mean
=
values
.
reduce
((
a
,
b
)
=>
a
+
b
,
0
)
/
values
.
length
result
=
values
.
reduce
((
a
,
b
)
=>
a
+
Math
.
pow
(
b
-
mean
,
2
),
0
)
/
values
.
length
break
}
}
newItem
[
field
]
=
result
})
return
newItem
})
}
// Apply sorting rule
if
(
ySort
)
{
const
[
sortType
,
topN
]
=
ySort
.
split
(
'Top'
)
if
(
sortType
)
{
transformedData
.
sort
((
a
,
b
)
=>
{
const
aValue
=
parseFloat
(
a
[
yField
[
0
]])
||
0
const
bValue
=
parseFloat
(
b
[
yField
[
0
]])
||
0
return
sortType
===
'asc'
?
aValue
-
bValue
:
bValue
-
aValue
})
}
if
(
topN
)
{
const
n
=
parseInt
(
topN
)
transformedData
=
transformedData
.
slice
(
0
,
n
)
}
}
return
transformedData
}
export
default
function
Chart
({
export
default
function
Chart
({
type
=
'1'
,
type
=
'1'
,
labelField
=
''
,
labelField
=
''
,
...
@@ -56,6 +119,8 @@ export default function Chart({
...
@@ -56,6 +119,8 @@ export default function Chart({
color
=
'auto'
,
color
=
'auto'
,
fillPattern
=
'solid'
,
fillPattern
=
'solid'
,
style
=
{
height
:
'400px'
,
width
:
'100%'
},
style
=
{
height
:
'400px'
,
width
:
'100%'
},
yRule
=
''
,
ySort
=
''
,
...
props
...
props
})
{
})
{
const
{
data
}
=
useDataQuery
()
const
{
data
}
=
useDataQuery
()
...
@@ -66,7 +131,9 @@ export default function Chart({
...
@@ -66,7 +131,9 @@ export default function Chart({
return
null
return
null
}
}
const
dataset
=
{
dimensions
:
[
xField
,
...
yField
].
filter
(
Boolean
),
source
:
data
.
list
}
const
datalist
=
transformData
(
data
.
list
,
yField
,
yRule
,
ySort
)
const
dataset
=
{
dimensions
:
[
xField
,
...
yField
].
filter
(
Boolean
),
source
:
datalist
}
let
defaultOptions
:
any
=
{
let
defaultOptions
:
any
=
{
legend
:
{},
legend
:
{},
tooltip
:
{},
tooltip
:
{},
...
@@ -89,7 +156,7 @@ export default function Chart({
...
@@ -89,7 +156,7 @@ export default function Chart({
position
:
'top'
,
position
:
'top'
,
formatter
:
(
params
:
any
)
=>
{
formatter
:
(
params
:
any
)
=>
{
console
.
log
(
params
.
dataIndex
)
console
.
log
(
params
.
dataIndex
)
return
data
.
list
[
params
.
dataIndex
][
labelField
]
return
datalist
[
params
.
dataIndex
][
labelField
]
},
},
},
},
itemStyle
:
{
borderRadius
,
color
:
itemStyleColor
},
itemStyle
:
{
borderRadius
,
color
:
itemStyleColor
},
...
@@ -107,7 +174,7 @@ export default function Chart({
...
@@ -107,7 +174,7 @@ export default function Chart({
label
:
{
label
:
{
show
:
!!
labelField
,
show
:
!!
labelField
,
position
:
'top'
,
position
:
'top'
,
formatter
:
(
params
:
any
)
=>
data
.
list
[
params
.
dataIndex
][
labelField
],
formatter
:
(
params
:
any
)
=>
datalist
[
params
.
dataIndex
][
labelField
],
},
},
})),
})),
})
})
...
@@ -123,7 +190,7 @@ export default function Chart({
...
@@ -123,7 +190,7 @@ export default function Chart({
label
:
{
label
:
{
show
:
!!
labelField
,
show
:
!!
labelField
,
position
:
'outside'
,
position
:
'outside'
,
formatter
:
(
params
:
any
)
=>
data
.
list
[
params
.
dataIndex
][
labelField
],
formatter
:
(
params
:
any
)
=>
datalist
[
params
.
dataIndex
][
labelField
],
},
},
})),
})),
})
})
...
@@ -135,7 +202,7 @@ export default function Chart({
...
@@ -135,7 +202,7 @@ export default function Chart({
yAxis
:
{
show
:
false
},
yAxis
:
{
show
:
false
},
radar
:
{
radar
:
{
shape
:
'polygon'
,
shape
:
'polygon'
,
indicator
:
data
.
list
.
map
((
item
:
any
)
=>
({
indicator
:
datalist
.
map
((
item
:
any
)
=>
({
name
:
item
[
xField
],
name
:
item
[
xField
],
max
:
Math
.
max
(...
yField
.
map
((
field
)
=>
item
[
field
]))
+
100
,
max
:
Math
.
max
(...
yField
.
map
((
field
)
=>
item
[
field
]))
+
100
,
})),
})),
...
@@ -146,11 +213,11 @@ export default function Chart({
...
@@ -146,11 +213,11 @@ export default function Chart({
label
:
{
label
:
{
show
:
!!
labelField
,
show
:
!!
labelField
,
formatter
(
params
:
any
)
{
formatter
(
params
:
any
)
{
return
data
.
list
[
params
.
dataIndex
][
labelField
]
return
datalist
[
params
.
dataIndex
][
labelField
]
},
},
},
},
data
:
yField
.
map
((
field
)
=>
({
data
:
yField
.
map
((
field
)
=>
({
value
:
data
.
list
.
map
((
item
:
any
)
=>
item
[
field
]),
value
:
datalist
.
map
((
item
:
any
)
=>
item
[
field
]),
name
:
getFieldName
(
field
),
name
:
getFieldName
(
field
),
})),
})),
},
},
...
@@ -170,7 +237,7 @@ export default function Chart({
...
@@ -170,7 +237,7 @@ export default function Chart({
label
:
{
label
:
{
show
:
!!
labelField
,
show
:
!!
labelField
,
position
:
'top'
,
position
:
'top'
,
formatter
:
(
params
:
any
)
=>
data
.
list
[
params
.
dataIndex
][
labelField
],
formatter
:
(
params
:
any
)
=>
datalist
[
params
.
dataIndex
][
labelField
],
},
},
})),
})),
})
})
...
@@ -189,8 +256,8 @@ export default function Chart({
...
@@ -189,8 +256,8 @@ export default function Chart({
},
},
},
},
series
:
yField
.
map
((
field
)
=>
{
series
:
yField
.
map
((
field
)
=>
{
const
maxVal
=
Math
.
max
(...
data
.
list
.
map
((
item
:
any
)
=>
item
[
field
]))
const
maxVal
=
Math
.
max
(...
datalist
.
map
((
item
:
any
)
=>
item
[
field
]))
const
minVal
=
Math
.
min
(...
data
.
list
.
map
((
item
:
any
)
=>
item
[
field
]))
const
minVal
=
Math
.
min
(...
datalist
.
map
((
item
:
any
)
=>
item
[
field
]))
return
{
return
{
type
:
'graph'
,
type
:
'graph'
,
layout
:
'force'
,
layout
:
'force'
,
...
@@ -200,7 +267,7 @@ export default function Chart({
...
@@ -200,7 +267,7 @@ export default function Chart({
gravity
:
0.05
,
gravity
:
0.05
,
edgeLength
:
20
,
edgeLength
:
20
,
},
},
data
:
data
.
list
.
map
((
item
:
any
)
=>
{
data
:
datalist
.
map
((
item
:
any
)
=>
{
const
size
=
20
+
((
parseFloat
(
item
[
field
])
-
minVal
)
/
(
maxVal
-
minVal
||
1
))
*
60
// 字体大小映射
const
size
=
20
+
((
parseFloat
(
item
[
field
])
-
minVal
)
/
(
maxVal
-
minVal
||
1
))
*
60
// 字体大小映射
const
value
=
item
[
field
]
||
10
const
value
=
item
[
field
]
||
10
const
name
=
item
[
xField
]
const
name
=
item
[
xField
]
...
@@ -212,7 +279,7 @@ export default function Chart({
...
@@ -212,7 +279,7 @@ export default function Chart({
show
:
!!
labelField
,
show
:
!!
labelField
,
position
:
'inside'
,
position
:
'inside'
,
fontSize
:
size
/
4
,
fontSize
:
size
/
4
,
formatter
:
(
params
:
any
)
=>
data
.
list
[
params
.
dataIndex
][
labelField
],
formatter
:
(
params
:
any
)
=>
datalist
[
params
.
dataIndex
][
labelField
],
},
},
}
}
}),
}),
...
@@ -228,7 +295,7 @@ export default function Chart({
...
@@ -228,7 +295,7 @@ export default function Chart({
{
{
type
:
'wordCloud'
,
type
:
'wordCloud'
,
shape
:
'circle'
,
shape
:
'circle'
,
data
:
data
.
list
.
map
((
item
:
any
)
=>
({
data
:
datalist
.
map
((
item
:
any
)
=>
({
name
:
item
[
labelField
],
name
:
item
[
labelField
],
value
:
item
[
yField
[
0
]],
value
:
item
[
yField
[
0
]],
})),
})),
...
@@ -242,7 +309,7 @@ export default function Chart({
...
@@ -242,7 +309,7 @@ export default function Chart({
break
break
// 指标卡
// 指标卡
case
'9'
:
{
case
'9'
:
{
const
count
=
data
.
list
.
reduce
((
acc
:
any
,
item
:
any
)
=>
acc
+
parseFloat
(
item
[
yField
[
0
]]),
0
).
toFixed
(
2
)
const
count
=
datalist
.
reduce
((
acc
:
any
,
item
:
any
)
=>
acc
+
parseFloat
(
item
[
yField
[
0
]]),
0
).
toFixed
(
2
)
defaultOptions
=
merge
(
defaultOptions
,
{
defaultOptions
=
merge
(
defaultOptions
,
{
graphic
:
{
graphic
:
{
elements
:
[
elements
:
[
...
@@ -277,7 +344,7 @@ export default function Chart({
...
@@ -277,7 +344,7 @@ export default function Chart({
bottom
:
60
,
bottom
:
60
,
width
:
'80%'
,
width
:
'80%'
,
min
:
0
,
min
:
0
,
max
:
Math
.
max
(...
data
.
list
.
map
((
item
:
any
)
=>
item
[
yField
[
0
]]
||
0
)),
max
:
Math
.
max
(...
datalist
.
map
((
item
:
any
)
=>
item
[
yField
[
0
]]
||
0
)),
minSize
:
'0%'
,
minSize
:
'0%'
,
maxSize
:
'100%'
,
maxSize
:
'100%'
,
sort
:
'descending'
,
sort
:
'descending'
,
...
@@ -285,7 +352,7 @@ export default function Chart({
...
@@ -285,7 +352,7 @@ export default function Chart({
label
:
{
label
:
{
show
:
!!
labelField
,
show
:
!!
labelField
,
position
:
'inside'
,
position
:
'inside'
,
formatter
:
(
params
:
any
)
=>
data
.
list
[
params
.
dataIndex
][
labelField
],
formatter
:
(
params
:
any
)
=>
datalist
[
params
.
dataIndex
][
labelField
],
},
},
},
},
],
],
...
@@ -305,7 +372,7 @@ export default function Chart({
...
@@ -305,7 +372,7 @@ export default function Chart({
position
:
'top'
,
position
:
'top'
,
formatter
:
(
params
:
any
)
=>
{
formatter
:
(
params
:
any
)
=>
{
console
.
log
(
params
.
dataIndex
)
console
.
log
(
params
.
dataIndex
)
return
data
.
list
[
params
.
dataIndex
][
labelField
]
return
datalist
[
params
.
dataIndex
][
labelField
]
},
},
},
},
itemStyle
:
{
borderRadius
,
color
:
itemStyleColor
},
itemStyle
:
{
borderRadius
,
color
:
itemStyleColor
},
...
@@ -315,11 +382,11 @@ export default function Chart({
...
@@ -315,11 +382,11 @@ export default function Chart({
// 表格
// 表格
case
'12'
:
{
case
'12'
:
{
const
columns
=
yField
.
map
((
field
)
=>
({
title
:
getFieldName
(
field
),
dataIndex
:
field
}))
const
columns
=
yField
.
map
((
field
)
=>
({
title
:
getFieldName
(
field
),
dataIndex
:
field
}))
return
<
Table
rowKey=
"pk_id"
dataSource=
{
data
.
list
}
columns=
{
columns
}
/>
return
<
Table
rowKey=
"pk_id"
dataSource=
{
datalist
}
columns=
{
columns
}
/>
}
}
// 帕累托图
// 帕累托图
case
'13'
:
{
case
'13'
:
{
const
paretoData
=
[...
data
.
list
].
sort
((
a
,
b
)
=>
b
[
yField
[
0
]]
-
a
[
yField
[
0
]])
const
paretoData
=
[...
datalist
].
sort
((
a
,
b
)
=>
b
[
yField
[
0
]]
-
a
[
yField
[
0
]])
const
total
=
paretoData
.
reduce
((
sum
,
item
)
=>
sum
+
parseFloat
(
item
[
yField
[
0
]]),
0
)
const
total
=
paretoData
.
reduce
((
sum
,
item
)
=>
sum
+
parseFloat
(
item
[
yField
[
0
]]),
0
)
let
cumulative
=
0
let
cumulative
=
0
const
cumulativeData
=
paretoData
.
map
((
item
)
=>
{
const
cumulativeData
=
paretoData
.
map
((
item
)
=>
{
...
@@ -391,8 +458,8 @@ export default function Chart({
...
@@ -391,8 +458,8 @@ export default function Chart({
series
:
yField
.
map
((
field
)
=>
({
series
:
yField
.
map
((
field
)
=>
({
name
:
getFieldName
(
field
),
name
:
getFieldName
(
field
),
type
:
'treemap'
,
type
:
'treemap'
,
label
:
{
show
:
!!
labelField
,
formatter
:
(
params
:
any
)
=>
data
.
list
[
params
.
dataIndex
-
1
]?.[
labelField
]
},
label
:
{
show
:
!!
labelField
,
formatter
:
(
params
:
any
)
=>
datalist
[
params
.
dataIndex
-
1
]?.[
labelField
]
},
data
:
data
.
list
.
map
((
item
:
any
)
=>
({
name
:
item
[
xField
],
value
:
item
[
field
]
||
0
})),
data
:
datalist
.
map
((
item
:
any
)
=>
({
name
:
item
[
xField
],
value
:
item
[
field
]
||
0
})),
})),
})),
})
})
break
break
...
@@ -401,6 +468,6 @@ export default function Chart({
...
@@ -401,6 +468,6 @@ export default function Chart({
defaultOptions
.
series
=
[{
type
:
'bar'
}]
defaultOptions
.
series
=
[{
type
:
'bar'
}]
}
}
const
options
=
merge
(
props
,
defaultOptions
)
const
options
=
merge
(
props
,
defaultOptions
)
console
.
log
(
options
)
return
<
ReactECharts
option=
{
options
}
notMerge=
{
true
}
lazyUpdate=
{
true
}
style=
{
style
}
/>
return
<
ReactECharts
option=
{
options
}
notMerge=
{
true
}
lazyUpdate=
{
true
}
style=
{
style
}
/>
}
}
src/components/chart/ChartButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -12,22 +12,22 @@ interface Props {
...
@@ -12,22 +12,22 @@ interface Props {
}
}
const
ruleOptions
=
[
const
ruleOptions
=
[
{
label
:
'无计算'
,
value
:
'
无计算
'
},
{
label
:
'无计算'
,
value
:
''
},
{
label
:
'求和'
,
value
:
'
求和
'
},
{
label
:
'求和'
,
value
:
'
sum
'
},
{
label
:
'求平均值'
,
value
:
'
求平均值
'
},
{
label
:
'求平均值'
,
value
:
'
avg
'
},
{
label
:
'计数'
,
value
:
'
计数
'
},
{
label
:
'计数'
,
value
:
'
count
'
},
{
label
:
'求最大值'
,
value
:
'
求最大值
'
},
{
label
:
'求最大值'
,
value
:
'
max
'
},
{
label
:
'求最小值'
,
value
:
'
求最小值
'
},
{
label
:
'求最小值'
,
value
:
'
min
'
},
{
label
:
'求中位数'
,
value
:
'
求中位数
'
},
{
label
:
'求中位数'
,
value
:
'
median
'
},
{
label
:
'求方差'
,
value
:
'
求方差
'
},
{
label
:
'求方差'
,
value
:
'
variance
'
},
]
]
const
sortOptions
=
[
const
sortOptions
=
[
{
label
:
'无排序'
,
value
:
'
无排序
'
},
{
label
:
'无排序'
,
value
:
''
},
{
label
:
'数值顺序'
,
value
:
'
数值顺序
'
},
{
label
:
'数值顺序'
,
value
:
'
asc
'
},
{
label
:
'数值倒序'
,
value
:
'
数值倒序
'
},
{
label
:
'数值倒序'
,
value
:
'
desc
'
},
{
label
:
'数值顺序Top N'
,
value
:
'
数值顺序Top N
'
},
{
label
:
'数值顺序Top N'
,
value
:
'
ascTop10
'
},
{
label
:
'数值倒序Top N'
,
value
:
'
数值倒序Top N
'
},
{
label
:
'数值倒序Top N'
,
value
:
'
descTop10
'
},
]
]
const
showOptions
=
[
const
showOptions
=
[
...
@@ -50,12 +50,12 @@ const Step1 = ({ fieldOptions, getFieldOptions, type }: any) => {
...
@@ -50,12 +50,12 @@ const Step1 = ({ fieldOptions, getFieldOptions, type }: any) => {
</
Col
>
</
Col
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
<
Form
.
Item
label=
"计算规则"
name=
"yRule"
>
<
Form
.
Item
label=
"计算规则"
name=
"yRule"
>
<
Select
options=
{
ruleOptions
}
placeholder=
"请选择"
></
Select
>
<
Select
options=
{
ruleOptions
}
placeholder=
"请选择"
allowClear
></
Select
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
<
Form
.
Item
label=
"排序规则"
name=
"ySort"
>
<
Form
.
Item
label=
"排序规则"
name=
"ySort"
>
<
Select
options=
{
sortOptions
}
placeholder=
"请选择"
></
Select
>
<
Select
options=
{
sortOptions
}
placeholder=
"请选择"
allowClear
></
Select
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -315,6 +315,8 @@ const ModalContent = ({ setOpen, type, id = '' }: Props) => {
...
@@ -315,6 +315,8 @@ const ModalContent = ({ setOpen, type, id = '' }: Props) => {
const
color
=
Form
.
useWatch
(
'color'
,
form
)
const
color
=
Form
.
useWatch
(
'color'
,
form
)
const
borderRadius
=
Form
.
useWatch
(
'borderRadius'
,
form
)
const
borderRadius
=
Form
.
useWatch
(
'borderRadius'
,
form
)
const
fillPattern
=
Form
.
useWatch
(
'fillPattern'
,
form
)
const
fillPattern
=
Form
.
useWatch
(
'fillPattern'
,
form
)
const
yRule
=
Form
.
useWatch
(
'yRule'
,
form
)
const
ySort
=
Form
.
useWatch
(
'ySort'
,
form
)
const
config
=
{
const
config
=
{
title
:
{
show
:
showTitle
,
text
:
title
},
title
:
{
show
:
showTitle
,
text
:
title
},
legend
:
{
show
:
showLegend
},
legend
:
{
show
:
showLegend
},
...
@@ -326,6 +328,8 @@ const ModalContent = ({ setOpen, type, id = '' }: Props) => {
...
@@ -326,6 +328,8 @@ const ModalContent = ({ setOpen, type, id = '' }: Props) => {
color
,
color
,
borderRadius
,
borderRadius
,
fillPattern
,
fillPattern
,
yRule
,
ySort
,
...
results
,
...
results
,
}
}
...
@@ -423,6 +427,8 @@ const ModalContent = ({ setOpen, type, id = '' }: Props) => {
...
@@ -423,6 +427,8 @@ const ModalContent = ({ setOpen, type, id = '' }: Props) => {
showLegend
:
true
,
showLegend
:
true
,
showTitle
:
false
,
showTitle
:
false
,
fillPattern
:
'solid'
,
fillPattern
:
'solid'
,
yRule
:
''
,
ySort
:
''
,
}
}
>
}
}
>
<
Form
.
Item
label=
"组件名称"
name=
"name"
rules=
{
[{
required
:
true
,
message
:
'请输入组件名称'
}]
}
>
<
Form
.
Item
label=
"组件名称"
name=
"name"
rules=
{
[{
required
:
true
,
message
:
'请输入组件名称'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
...
...
src/hooks/useQuery.ts
浏览文件 @
191a6af6
import
{
useEffect
,
useState
}
from
'react'
import
{
use
Callback
,
use
Effect
,
useState
}
from
'react'
import
{
useQuery
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useQuery
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
getUser
,
getMapList
,
getMyList
,
getMyField
,
getProcessProgress
}
from
'@/api/base'
import
{
getUser
,
getMapList
,
getMyList
,
getMyField
,
getProcessProgress
}
from
'@/api/base'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useUserStore
}
from
'@/stores/user'
...
@@ -147,9 +147,10 @@ export function useProcessProgressQuery(params: { function_name: string }) {
...
@@ -147,9 +147,10 @@ export function useProcessProgressQuery(params: { function_name: string }) {
}
}
// 结束轮询的方法
// 结束轮询的方法
const
stop
=
()
=>
{
const
stop
=
useCallback
(
()
=>
{
setEnabled
(
false
)
setEnabled
(
false
)
}
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
[
queryClient
])
// 组件卸载时清理
// 组件卸载时清理
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
query
.
data
?.
result
===
'SUCCESS'
||
query
.
data
?.
result
===
'FAIL'
)
{
if
(
query
.
data
?.
result
===
'SUCCESS'
||
query
.
data
?.
result
===
'FAIL'
)
{
...
@@ -158,7 +159,7 @@ export function useProcessProgressQuery(params: { function_name: string }) {
...
@@ -158,7 +159,7 @@ export function useProcessProgressQuery(params: { function_name: string }) {
return
()
=>
{
return
()
=>
{
stop
()
stop
()
}
}
},
[
query
.
data
,
enabled
])
},
[
query
.
data
,
enabled
,
stop
])
return
{
...
query
,
start
,
stop
,
remove
}
return
{
...
query
,
start
,
stop
,
remove
}
}
}
src/modules/data/preprocess/error/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/max/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/min/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/null/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/repeat/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/sort/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/space/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/splice/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/split/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/symbol/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/preprocess/type/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/binning/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -285,10 +285,10 @@ ${action === '固定步长分箱' ? `最小值 ${min}、最大值 ${max}、步
...
@@ -285,10 +285,10 @@ ${action === '固定步长分箱' ? `最小值 ${min}、最大值 ${max}、步
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
message
[
1
]
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
message
[
2
]
},
{
title
:
'数据分箱处理'
},
{
title
:
'数据分箱处理'
,
description
:
message
[
3
]
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
message
[
4
]
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/binning/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/date/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -265,10 +265,10 @@ export default function ButtonModal() {
...
@@ -265,10 +265,10 @@ export default function ButtonModal() {
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
message
[
1
]
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
message
[
2
]
},
{
title
:
'日期计算处理'
},
{
title
:
'日期计算处理'
,
description
:
message
[
3
]
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
message
[
4
]
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/date/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/desensitization/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -274,10 +274,10 @@ export default function ButtonModal() {
...
@@ -274,10 +274,10 @@ export default function ButtonModal() {
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
message
[
1
]
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
message
[
2
]
},
{
title
:
'数据脱敏处理'
},
{
title
:
'数据脱敏处理'
,
description
:
message
[
3
]
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
message
[
4
]
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/desensitization/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/group/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -236,10 +236,10 @@ export default function ButtonModal() {
...
@@ -236,10 +236,10 @@ export default function ButtonModal() {
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
<>
{
message
[
1
]
}
</>
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
<>
{
message
[
2
]
}
</>
},
{
title
:
'数据分组处理'
},
{
title
:
'数据分组处理'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
4
]
}
</>
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/group/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/logic/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -154,10 +154,10 @@ export default function ButtonModal() {
...
@@ -154,10 +154,10 @@ export default function ButtonModal() {
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
message
[
1
]
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
message
[
2
]
},
{
title
:
'逻辑计算处理'
},
{
title
:
'逻辑计算处理'
,
description
:
message
[
3
]
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
message
[
4
]
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/logic/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/mapping/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -199,10 +199,10 @@ export default function ButtonModal() {
...
@@ -199,10 +199,10 @@ export default function ButtonModal() {
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
message
[
1
]
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
message
[
2
]
},
{
title
:
'值映射处理'
},
{
title
:
'值映射处理'
,
description
:
message
[
3
]
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
message
[
4
]
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/mapping/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/number/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -162,10 +162,10 @@ export default function ButtonModal() {
...
@@ -162,10 +162,10 @@ export default function ButtonModal() {
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
message
[
1
]
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
message
[
2
]
},
{
title
:
'数值计算处理'
},
{
title
:
'数值计算处理'
,
description
:
message
[
3
]
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
message
[
4
]
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/number/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
src/modules/data/process/string/components/ButtonModal.tsx
浏览文件 @
191a6af6
...
@@ -164,10 +164,10 @@ export default function ButtonModal() {
...
@@ -164,10 +164,10 @@ export default function ButtonModal() {
<
AppProgressSteps
<
AppProgressSteps
current=
{
progress
}
current=
{
progress
}
items=
{
[
items=
{
[
{
title
:
'新建字段'
},
{
title
:
'新建字段'
,
description
:
message
[
1
]
},
{
title
:
'复制数据'
},
{
title
:
'复制数据'
,
description
:
message
[
2
]
},
{
title
:
'文本计算处理'
},
{
title
:
'文本计算处理'
,
description
:
message
[
3
]
},
{
title
:
'处理结果'
,
description
:
<>
{
message
[
3
]
}
</>
},
{
title
:
'处理结果'
,
description
:
message
[
4
]
},
]
}
]
}
/>
/>
</
Flex
>
</
Flex
>
...
...
src/modules/data/process/string/query.ts
浏览文件 @
191a6af6
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
useMutation
,
useQueryClient
}
from
'@tanstack/react-query'
import
{
message
}
from
'antd'
import
{
processData
}
from
'./api'
import
{
processData
}
from
'./api'
import
type
{
ProcessDataParams
}
from
'./types'
import
type
{
ProcessDataParams
}
from
'./types'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
import
{
useProcessProgressQuery
}
from
'@/hooks/useQuery'
...
@@ -11,11 +10,10 @@ export function useProcessData() {
...
@@ -11,11 +10,10 @@ export function useProcessData() {
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
start
()
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
message
.
success
(
'处理完成'
)
start
(
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
})
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论