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
a0a3f671
Commit
a0a3f671
authored
Jul 03, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多个资产生成工作簿
parent
6549fc48
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
35 deletions
+67
-35
assetmanage.js
src/model/assetmanage.js
+4
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+2
-4
WorksheetModal.jsx
src/view/Manage/AssetManage/Component/WorksheetModal.jsx
+57
-31
No files found.
src/model/assetmanage.js
View file @
a0a3f671
...
@@ -79,6 +79,10 @@ export function* getDataAssetDetail(payload) {
...
@@ -79,6 +79,10 @@ export function* getDataAssetDetail(payload) {
return
yield
call
(
service
.
getDataAssetDetail
,
payload
);
return
yield
call
(
service
.
getDataAssetDetail
,
payload
);
}
}
export
function
*
listDataAssetDetails
(
payload
)
{
return
yield
call
(
service
.
listDataAssetDetails
,
payload
);
}
export
function
*
listDataAssetsByPage
(
payload
)
{
export
function
*
listDataAssetsByPage
(
payload
)
{
return
yield
call
(
service
.
listDataAssetsByPage
,
payload
);
return
yield
call
(
service
.
listDataAssetsByPage
,
payload
);
}
}
...
...
src/service/dataassetmanager.js
View file @
a0a3f671
...
@@ -72,6 +72,10 @@ export function getDataAssetDetail(payload) {
...
@@ -72,6 +72,10 @@ export function getDataAssetDetail(payload) {
return
GetJSON
(
"/dataassetmanager/dataAssetApi/getDataAssetDetail"
,
payload
);
return
GetJSON
(
"/dataassetmanager/dataAssetApi/getDataAssetDetail"
,
payload
);
}
}
export
function
listDataAssetDetails
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/listDataAssetDetails"
,
payload
);
}
export
function
listDataAssetsByPage
(
payload
)
{
export
function
listDataAssetsByPage
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/dataAssetApi/listDataAssetsByPage"
,
payload
);
return
GetJSON
(
"/dataassetmanager/dataAssetApi/listDataAssetsByPage"
,
payload
);
}
}
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
a0a3f671
...
@@ -969,9 +969,7 @@ const AssetTable = (props) => {
...
@@ -969,9 +969,7 @@ const AssetTable = (props) => {
const onReportAnalyseClick = (val) => {
const onReportAnalyseClick = (val) => {
if ((checkedKeys||[]).length === 0) {
if ((checkedKeys||[]).length === 0) {
showMessage('warn', '请先选择一个资产');
showMessage('warn', '请先选择资产');
} else if ((checkedKeys||[]).length > 1) {
showMessage('warn', '只能选择一个资产');
} else {
} else {
setReport(val);
setReport(val);
setWorksheetModalVisible(true);
setWorksheetModalVisible(true);
...
@@ -1251,7 +1249,7 @@ const AssetTable = (props) => {
...
@@ -1251,7 +1249,7 @@ const AssetTable = (props) => {
<WorksheetModal
<WorksheetModal
report={currentReport}
report={currentReport}
visible={worksheetModalVisible}
visible={worksheetModalVisible}
id
={(checkedKeys||[]).length>0?checkedKeys[0]:''
}
id
s={checkedKeys
}
onCancel={() => {
onCancel={() => {
setWorksheetModalVisible(false);
setWorksheetModalVisible(false);
}}
}}
...
...
src/view/Manage/AssetManage/Component/WorksheetModal.jsx
View file @
a0a3f671
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Modal
,
Form
,
Button
,
Space
,
Input
,
Checkbox
,
Row
,
Col
,
Typography
,
Spin
,
InputNumber
}
from
'antd'
;
import
{
Modal
,
Form
,
Button
,
Space
,
Input
,
Checkbox
,
Row
,
Col
,
Typography
,
Spin
,
InputNumber
,
Divider
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
showMessage
}
from
'../../../../util'
;
const
WorksheetModal
=
(
props
)
=>
{
const
WorksheetModal
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
id
,
report
}
=
props
;
const
{
onCancel
,
visible
,
id
s
,
report
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
asset
,
setAsset
]
=
useState
();
const
[
asset
s
,
setAssets
]
=
useState
();
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
visible
&&
id
)
{
if
(
visible
&&
(
ids
??[]).
length
>
0
)
{
getAsset
()
getAsset
s
()
}
}
},
[
visible
,
id
])
},
[
visible
,
id
s
])
const
getAsset
=
()
=>
{
const
getAsset
s
=
()
=>
{
setLoading
(
true
)
setLoading
(
true
)
dispatch
({
dispatch
({
type
:
'assetmanage.
getDataAssetDetail
'
,
type
:
'assetmanage.
listDataAssetDetails
'
,
payload
:
{
payload
:
{
data
AssetId
:
id
,
data
:
ids
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setLoading
(
false
)
setLoading
(
false
);
setAsset
(
data
)
setAssets
(
data
);
form
?.
setFieldsValue
(
data
)
const
newFiledsValue
=
{};
(
data
??[]).
forEach
(
item
=>
{
newFiledsValue
[
`limit-
${
item
.
id
}
`
]
=
10000
;
newFiledsValue
[
`columns-
${
item
.
id
}
`
]
=
item
.
columns
;
});
form
?.
setFieldsValue
(
newFiledsValue
);
},
},
error
:
()
=>
{
error
:
()
=>
{
setLoading
(
false
)
setLoading
(
false
)
...
@@ -44,10 +49,14 @@ const WorksheetModal = (props) => {
...
@@ -44,10 +49,14 @@ const WorksheetModal = (props) => {
type
:
'assetmanage.saveWorkbookByType'
,
type
:
'assetmanage.saveWorkbookByType'
,
payload
:
{
payload
:
{
data
:
{
data
:
{
dataAssetId
:
id
,
name
:
row
.
name
,
metadataTableId
:
asset
?.
metadataId
,
type
:
report
?.
code
,
type
:
report
?.
code
,
...
row
,
dataAssetList
:
(
assets
??[]).
map
(
item
=>
({
dataAssetId
:
item
.
id
,
metadataTableId
:
item
.
metadataId
,
limit
:
row
[
`limit-
${
item
.
id
}
`
],
columns
:
row
[
`columns-
${
item
.
id
}
`
],
}))
}
}
},
},
callback
:
data
=>
{
callback
:
data
=>
{
...
@@ -73,7 +82,7 @@ const WorksheetModal = (props) => {
...
@@ -73,7 +82,7 @@ const WorksheetModal = (props) => {
const reset = () => {
const reset = () => {
setLoading(false);
setLoading(false);
setAsset();
setAsset
s
();
form?.resetFields();
form?.resetFields();
}
}
...
@@ -90,10 +99,11 @@ const WorksheetModal = (props) => {
...
@@ -90,10 +99,11 @@ const WorksheetModal = (props) => {
return (
return (
<Modal
<Modal
forceRender
centered destroyOnClose
title={`
$
{
report
?.
name
}
工作簿信息
`}
title={`
$
{
report
?.
name
}
工作簿信息
`}
visible={ visible }
visible={ visible }
width={ 800 }
width={ 800 }
bodyStyle={{ padding: '15px', overflowX: 'auto', maxHeight: '80vh' }}
onCancel={() => {
onCancel={() => {
reset();
reset();
onCancel && onCancel();
onCancel && onCancel();
...
@@ -114,25 +124,41 @@ const WorksheetModal = (props) => {
...
@@ -114,25 +124,41 @@ const WorksheetModal = (props) => {
label="名称"
label="名称"
name="name"
name="name"
rules={[{ required: true, message: '请填写工作簿名称!' }]}
rules={[{ required: true, message: '请填写工作簿名称!' }]}
style={{ marginBottom: 15 }}
>
>
<Input />
<Input />
</Form.Item>
</Form.Item>
{
{
(report?.code === 'SpreadJS') && <Form.Item
(assets??[]).map(item => <>
label="最大加载行数"
<Divider style={{ marginTop: 0, marginBottom: 15 }} />
name="limit"
<Row>
rules={[{ required: true, message: '请选择最大加载行数!' }]}
<Col span={(report?.code==='SpreadJS')?12:24}>
>
<Form.Item label="库表" labelCol={{ span: (report?.code==='SpreadJS')?8:4 }} style={{ marginBottom: 15 }}>{item.dataAssetCnName}</Form.Item>
<InputNumber min={0} />
</Col>
</Form.Item>
<Col span={12}>
{
(report?.code === 'SpreadJS') && <Form.Item
label="最大加载行数"
labelCol={{ span: 8 }}
name={`
limit
-
$
{
item
.
id
}
`}
rules={[{ required: true, message: '请选择最大加载行数!' }]}
style={{ marginBottom: 15 }}
>
<InputNumber min={0} />
</Form.Item>
}
</Col>
</Row>
<Form.Item
label="字段"
name={`
columns
-
$
{
item
.
id
}
`}
rules={[{ required: true, message: '请选择字段!' }]}
style={{ marginBottom: 15 }}
>
<ColumnsItem data={item?.columns} />
</Form.Item>
</>)
}
}
<Form.Item
label="字段"
name="columns"
rules={[{ required: true, message: '请选择字段!' }]}
>
<ColumnsItem data={asset?.columns} />
</Form.Item>
</Form>
</Form>
</Spin>
</Spin>
</Modal>
</Modal>
...
...
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