Commit 9e6f9522 by zhaochengxiang

资产草稿

parent 1af4b7b0
...@@ -339,6 +339,10 @@ export function* getDrafts(payload) { ...@@ -339,6 +339,10 @@ export function* getDrafts(payload) {
return yield call(service.getDrafts, payload); return yield call(service.getDrafts, payload);
} }
export function* listDraftFilterElementsGroupByType(payload) {
return yield call(service.listDraftFilterElementsGroupByType, payload);
}
export function* getDraftDetail(payload) { export function* getDraftDetail(payload) {
return yield call(service.getDraftDetail, payload); return yield call(service.getDraftDetail, payload);
} }
......
...@@ -324,6 +324,11 @@ export function getDrafts(payload) { ...@@ -324,6 +324,11 @@ export function getDrafts(payload) {
return GetJSON("/dataassetmanager/draftApi/listDataAssetsByPage", payload) return GetJSON("/dataassetmanager/draftApi/listDataAssetsByPage", payload)
} }
export function listDraftFilterElementsGroupByType(payload) {
return GetJSON("/dataassetmanager/elementApi/listDraftFilterElementsGroupByType", payload);
}
export function getDraftDetail(payload) { export function getDraftDetail(payload) {
return PostJSON("/dataassetmanager/draftApi/getDraftDetail", payload) return PostJSON("/dataassetmanager/draftApi/getDraftDetail", payload)
} }
......
...@@ -57,8 +57,52 @@ const FC = (props) => { ...@@ -57,8 +57,52 @@ const FC = (props) => {
} }
}, [currentTemplateValue, keyword, currentElementValue, pagination, isAdmin], { wait: 300 }) }, [currentTemplateValue, keyword, currentElementValue, pagination, isAdmin], { wait: 300 })
const pathCol = {
title: '路径',
dataIndex: 'dirPath',
ellipsis: true,
width: 120,
render: (text, record) => {
return (
<Tooltip title={text}>
<Typography.Text ellipsis={true}>
{text}
</Typography.Text>
</Tooltip>
);
}
}
const fixedCols = [
{
title: '修改类型',
dataIndex: 'draftOperation',
ellipsis: true,
width: 80,
render: (text, record) => {
if (text === 'release') return '新增'
if (text === 'change') return '修改'
if (text === 'offline') return '删除'
return ''
}
},
{
title: '状态',
dataIndex: 'draftState',
ellipsis: true,
width: 80,
render: (text, record) => {
if (text === 'draft') return '待提交'
if (text === 'auditing') return '审批中'
return ''
}
},
]
const [columns, tableData, total] = React.useMemo(() => { const [columns, tableData, total] = React.useMemo(() => {
const [newColumns, newTableData] = [[], []] let [newColumns, newTableData] = [[], []]
for (const element of filterElements??[]) { for (const element of filterElements??[]) {
for (const name of element.names??[]) { for (const name of element.names??[]) {
...@@ -87,7 +131,6 @@ const FC = (props) => { ...@@ -87,7 +131,6 @@ const FC = (props) => {
} else if (name === '资产项') { } else if (name === '资产项') {
column.width = isSzseEnv ? 250 : 120 column.width = isSzseEnv ? 250 : 120
column.render = (text) => { column.render = (text) => {
console.log('text', text)
let metadata = null let metadata = null
try { try {
metadata = JSON.parse(text) metadata = JSON.parse(text)
...@@ -130,8 +173,9 @@ const FC = (props) => { ...@@ -130,8 +173,9 @@ const FC = (props) => {
} }
} }
return [newColumns, newTableData, data?.total??0] return [[pathCol, ...newColumns, ...fixedCols]
}, [filterElements, data, loadingFilterElements, users]) , newTableData, data?.total??0]
}, [filterElements, data, loadingFilterElements, users, fixedCols])
const getAdmin = () => { const getAdmin = () => {
dispatch({ dispatch({
...@@ -186,10 +230,7 @@ const FC = (props) => { ...@@ -186,10 +230,7 @@ const FC = (props) => {
const getFilterElements = () => { const getFilterElements = () => {
setLoadingFilterElements(true) setLoadingFilterElements(true)
dispatch({ dispatch({
type: 'assetmanage.listFilterElementsGroupByType', type: 'assetmanage.listDraftFilterElementsGroupByType',
payload: {
isAdmin,
},
callback: data => { callback: data => {
setLoadingFilterElements(false) setLoadingFilterElements(false)
setFilterElements(data) setFilterElements(data)
......
...@@ -156,7 +156,7 @@ const ImportAssetDrawer = (props) => { ...@@ -156,7 +156,7 @@ const ImportAssetDrawer = (props) => {
setConfirmLoading(true); setConfirmLoading(true);
dispatch({ dispatch({
type: 'assetmanage.assetImport', type: 'assetmanage.assetImport',
payload: { fileList: fileList, params: { env: `${app?.env?.domainId}` } }, payload: { fileList: fileList, params: { env: `${app?.env?.domainId}`, saveAsDraft: true } },
callback: data => { callback: data => {
setConfirmLoading(false); setConfirmLoading(false);
setFileList([]); setFileList([]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment