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
79a8c7f8
Commit
79a8c7f8
authored
Oct 24, 2025
by
放生的三文鱼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增草稿
parent
62da8f61
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
236 additions
and
2 deletions
+236
-2
App.js
src/App.js
+2
-0
assetmanage.js
src/model/assetmanage.js
+17
-0
routes.js
src/routes.js
+4
-0
dataassetmanager.js
src/service/dataassetmanager.js
+24
-0
constant.js
src/util/constant.js
+2
-0
AssetDraft.jsx
src/view/Manage/AssetDraft/component/AssetDraft.jsx
+90
-0
assetData.jsx
src/view/Manage/AssetDraft/hooks/assetData.jsx
+69
-0
index.jsx
src/view/Manage/AssetDraft/index.jsx
+24
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+1
-1
index.jsx
src/view/Manage/index.jsx
+3
-1
No files found.
src/App.js
View file @
79a8c7f8
...
...
@@ -21,6 +21,7 @@ import AssetDetail from './view/Manage/AssetManage/Component/AssetDetail';
import
ImportAction
from
'./view/Manage/Model/Component/ImportAction'
;
import
EditModel
from
'./view/Manage/Model/Component/EditModel'
;
import
EditTemplate
from
'./view/Manage/ModelConfig/Component/EditTemplate'
;
import
AssetDraft
from
'./view/Manage/AssetDraft'
;
import
AssetTree
from
'./view/Manage/AssetManage/Component/AssetManageTree'
;
import
AssetNewDetail
from
"./view/Manage/AssetManage/Component/AssetAction"
...
...
@@ -178,6 +179,7 @@ export class App extends React.Component {
<
Route
path
=
{
'/center-home/menu/asset-browse'
}
component
=
{
AssetBrowse
}
exact
/>
<
Route
path
=
{
'/center-home/menu/asset-recycle'
}
component
=
{
AssetRecycle
}
exact
/>
<
Route
path
=
{
'/center-home/data-model-action'
}
component
=
{
EditModel
}
exact
/>
<
Route
path
=
{
'/center-home/menu/asset-draft'
}
component
=
{
AssetDraft
}
exact
/>
<
Route
path
=
{
'/center-home/asset-detail'
}
component
=
{
AssetDetailPage
}
exact
/>
<
Route
path
=
{
'/center-home/session/asset-detail'
}
component
=
{
AssetDetailPage
}
exact
/>
<
/Switch
>
...
...
src/model/assetmanage.js
View file @
79a8c7f8
...
...
@@ -335,3 +335,19 @@ export function* getTemplates() {
export
function
*
getMetadataTemplates
(
payload
)
{
return
yield
call
(
service
.
getMetadataTemplates
,
payload
)
}
export
function
*
saveAsDraft
(
payload
)
{
return
yield
call
(
service
.
saveAsDraft
,
payload
)
}
export
function
*
createDraftDataAssetByMetadataIds
(
payload
)
{
return
yield
call
(
service
.
createDraftDataAssetByMetadataIds
,
payload
)
}
export
function
*
listDraftDataAssetsByPage
(
payload
)
{
return
yield
call
(
service
.
listDraftDataAssetsByPage
,
payload
)
}
export
function
*
checkIsNeedSaveAsDraft
(
payload
)
{
return
yield
call
(
service
.
checkIsNeedSaveAsDraft
,
payload
)
}
\ No newline at end of file
src/routes.js
View file @
79a8c7f8
...
...
@@ -48,6 +48,10 @@ export const routes = [
text
:
'未挂载资产'
,
},
{
name
:
'asset-draft'
,
text
:
'资产草稿'
},
{
name
:
'asset-task'
,
text
:
'资产盘点任务'
,
}
...
...
src/service/dataassetmanager.js
View file @
79a8c7f8
...
...
@@ -319,3 +319,27 @@ export function getTemplates() {
export
function
getMetadataTemplates
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/elementTemplateApi/listSupportElementTemplatesByMetadataIdPath"
,
payload
)
}
export
function
saveAsDraft
(
payload
)
{
return
PostJSON
(
'/dataassetmanager/draftApi/saveAsDraft'
,
payload
);
}
export
function
createDraftDataAssetByMetadataIds
(
payload
)
{
return
PostJSON
(
'/dataassetmanager/draftApi/createDataAssetByMetadataIds'
,
payload
);
}
export
function
listDraftDataAssetsByPage
(
payload
)
{
return
GetJSON
(
'/dataassetmanager/draftApi/listDataAssetsByPage'
,
payload
);
}
export
function
checkIsNeedSaveAsDraft
(
payload
)
{
return
PostJSON
(
'/dataassetmanager/draftApi/checkIsNeedSaveAsDraft'
,
payload
);
}
// /draftApi/listDataAssetsByPage
export
function
getDraftDataAsset
(
payload
)
{
return
GetJSON
(
'/dataassetmanager/draftApi/listDataAssetsByPage'
,
payload
);
}
src/util/constant.js
View file @
79a8c7f8
...
...
@@ -33,4 +33,5 @@ export const Asset1104ManageReference = 'asset-1104-manage';
export
const
AssetBrowseReference
=
'asset-browse'
;
export
const
ResourceBrowseReference
=
'resource-browse'
;
export
const
AssetRecycleReference
=
'asset-recycle'
;
export
const
AssetDraftReference
=
'asset-draft'
;
export
const
AssetMountReference
=
'asset-mount'
;
\ No newline at end of file
src/view/Manage/AssetDraft/component/AssetDraft.jsx
0 → 100644
View file @
79a8c7f8
import
React
,
{
useState
,
useEffect
,
useMemo
}
from
"react"
;
import
{
Table
,
Button
,
Space
,
Input
,
Select
,
Tag
,
Modal
,
message
}
from
"antd"
;
import
{
useGetAssetDraft
}
from
"../hooks/assetData"
;
const
{
Option
}
=
Select
;
// 主组件
const
AssetManagementTable
=
()
=>
{
const
{
loading
,
templates
,
currentTemplate
,
setCurrentTemplate
,
setParams
,
}
=
useGetAssetDraft
();
const
changeTemplate
=
(
value
)
=>
{
setCurrentTemplate
(
value
);
};
const
changeParams
=
(
key
,
value
)
=>
{
setParams
((
prev
)
=>
({
...
prev
,
[
key
]:
value
,
}));
};
return
(
<
div
style=
{
{
background
:
"#fff"
}
}
>
{
/* 操作按钮区域 */
}
<
div
style=
{
{
marginBottom
:
16
,
display
:
"flex"
,
justifyContent
:
"space-between"
,
flexWrap
:
"wrap"
,
}
}
>
<
Space
>
<
Select
loading=
{
loading
}
style=
{
{
width
:
100
}
}
options=
{
templates
}
fieldNames=
{
{
label
:
"name"
,
value
:
"type"
}
}
value=
{
currentTemplate
}
onChange=
{
changeTemplate
}
/>
<
Button
>
批量修改
</
Button
>
<
Button
>
导出
</
Button
>
<
Button
type=
"primary"
>
送审
</
Button
>
<
Button
danger
>
删除
</
Button
>
</
Space
>
<
Space
>
<
Select
placeholder=
"请选择状态"
style=
{
{
width
:
120
}
}
allowClear
options=
{
[
{
label
:
"草稿"
,
value
:
"draft"
},
{
label
:
"审核中"
,
value
:
"auditing"
},
]
}
onChange=
{
(
value
)
=>
{
changeParams
(
"state"
,
value
);
}
}
/>
<
Select
placeholder=
"请选择搜索属性"
style=
{
{
width
:
140
}
}
>
<
Option
value=
"id"
>
资产编号
</
Option
>
<
Option
value=
"engName"
>
资产英文名
</
Option
>
<
Option
value=
"chnName"
>
资产中文名
</
Option
>
<
Option
value=
"assetItem"
>
资产项
</
Option
>
</
Select
>
<
Input
placeholder=
"请输入关键字"
style=
{
{
width
:
200
}
}
allowClear
/>
</
Space
>
</
div
>
{
/* 表格区域 */
}
<
Table
// rowSelection={rowSelection}
// columns={}
// dataSource={filteredData}
// loading={loading}
pagination=
{
null
}
size=
"middle"
/>
</
div
>
);
};
export
default
AssetManagementTable
;
src/view/Manage/AssetDraft/hooks/assetData.jsx
0 → 100644
View file @
79a8c7f8
import
{
useEffect
,
useState
,
useMemo
}
from
"react"
;
import
{
getTemplates
,
getDraftDataAsset
,
}
from
"../../../../service/dataassetmanager"
;
// ../standardmanage/hooks/sourceMap
export
function
useGetAssetDraft
()
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
templates
,
setTemplates
]
=
useState
();
const
[
currentTemplate
,
setCurrentTemplate
]
=
useState
();
const
[
params
,
setParams
]
=
useState
({
state
:
""
,
});
const
[
pagination
,
setPagination
]
=
useState
({
pageNum
:
1
,
pageSize
:
10
,
total
:
0
,
});
const
[
dataLoading
,
setDataLoading
]
=
useState
(
false
);
const
[
draftData
,
setDraftData
]
=
useState
();
const
getTemplatesList
=
async
()
=>
{
try
{
setLoading
(
true
);
const
res
=
await
getTemplates
();
setTemplates
(
res
);
setCurrentTemplate
(
res
?.[
0
]?.
type
);
setLoading
(
false
);
}
catch
(
error
)
{
setLoading
(
false
);
}
};
// 获取模板
useEffect
(()
=>
{
getTemplatesList
();
},
[]);
const
getDraftData
=
async
()
=>
{
try
{
// 设置数据加载状态为true,表示开始加载
setDataLoading
(
true
);
const
res
=
await
getDraftDataAsset
({
...
pagination
,
...
params
,
templateType
:
currentTemplate
,
total
:
undefined
,
});
console
.
log
(
"data"
,
res
);
setDataLoading
(
false
);
}
catch
(
error
)
{
setDataLoading
(
false
);
}
};
useEffect
(()
=>
{
if
(
currentTemplate
)
{
getDraftData
();
}
},
[
currentTemplate
,
pagination
.
pageNum
,
pagination
.
pageSize
,
params
]);
return
{
loading
,
templates
,
currentTemplate
,
setCurrentTemplate
,
setParams
,
};
}
src/view/Manage/AssetDraft/index.jsx
0 → 100644
View file @
79a8c7f8
import
React
,
{
useState
}
from
"react"
;
import
{
Tabs
}
from
"antd"
;
import
AssetDraft
from
"./component/AssetDraft"
;
const
{
TabPane
}
=
Tabs
;
const
Index
=
()
=>
{
const
[
tabKey
,
setTabKey
]
=
useState
(
"1"
);
const
onTabChange
=
(
key
)
=>
{
setTabKey
(
key
);
};
return
(
<
div
className=
"model-config"
>
<
Tabs
activeKey=
{
tabKey
}
onChange=
{
onTabChange
}
>
<
TabPane
tab=
"草稿"
key=
"1"
>
<
AssetDraft
/>
</
TabPane
>
</
Tabs
>
</
div
>
);
};
export
default
Index
;
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
79a8c7f8
...
...
@@ -236,7 +236,7 @@ const AssetTable = (props) => {
})
},
render
:(
_
,
record
)
=>
{
const
payload
=
{
id
:
record
.
id
,
type
:
'dataAsset'
,
reload
:
tableReload
,
creator
:
app
.
user
.
userName
}
const
payload
=
{
id
:
record
.
id
,
type
:
'dataAsset'
,
reload
:
tableReload
,
creator
:
app
.
user
?
.
userName
}
console
.
log
(
'payload'
,
payload
)
return
(
record
.
_id
===
mouseEnterKey
)?<
TagColumnConnect
{
...
{
...
payload
,
styleType
:'
complex
'}}
/>:<
TagColumnConnect
{
...
payload
}
/>
}
...
...
src/view/Manage/index.jsx
View file @
79a8c7f8
...
...
@@ -15,7 +15,7 @@ import AssetBrowse from './AssetBrowse';
import
AssetRecycle
from
'./AssetRecycle'
;
import
AssetTask
from
'./AssetTask'
;
import
Asset1104Manage
from
"./Asset1104Manage"
;
import
AssetDraft
from
"./AssetDraft"
;
class
Manage
extends
Component
{
render
()
{
...
...
@@ -39,6 +39,8 @@ class Manage extends Component {
<
Route
path=
{
`${match.path}/asset-recycle`
}
component=
{
AssetRecycle
}
/>
<
Route
path=
{
`${match.path}/asset-task`
}
component=
{
AssetTask
}
/>
<
Route
path=
{
`${match.path}/1104-asset`
}
component=
{
Asset1104Manage
}
/>
<
Route
path=
{
`${match.path}/asset-draft`
}
component=
{
AssetDraft
}
/>
</
Switch
>
)
:
(
<
GetSession
{
...
this
.
props
}
/>
...
...
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