|  | @ -5,7 +5,7 @@ import moment from 'moment'; | 
			
		
	
		
		
			
				
					|  |  | import FileSaver from 'file-saver'; |  |  | import FileSaver from 'file-saver'; | 
			
		
	
		
		
			
				
					|  |  | import BusinessDatabaseModal from '../components/businessDatabaseModal'; |  |  | import BusinessDatabaseModal from '../components/businessDatabaseModal'; | 
			
		
	
		
		
			
				
					|  |  | const BusinessDatabaseTable = (props) => { |  |  | const BusinessDatabaseTable = (props) => { | 
			
		
	
		
		
			
				
					
					|  |  |     const { user, dispatch, actions, clientHeight, resourceCatalogId, resourceCatalogKey, |  |  |     const { user, dispatch, actions, clientHeight, resourceCatalogId, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         resourceCatalogPath, isRequesting, metadataModels } = props; |  |  |         resourceCatalogPath, isRequesting, metadataModels } = props; | 
			
		
	
		
		
			
				
					|  |  |     const { metadataManagement } = actions; |  |  |     const { metadataManagement } = actions; | 
			
		
	
		
		
			
				
					|  |  |     const SortValues = { 'ascend': 'asc', 'descend': 'desc' }; |  |  |     const SortValues = { 'ascend': 'asc', 'descend': 'desc' }; | 
			
		
	
	
		
		
			
				
					|  | @ -22,11 +22,11 @@ const BusinessDatabaseTable = (props) => { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     useEffect(() => { |  |  |     useEffect(() => { | 
			
		
	
		
		
			
				
					|  |  |         setUpdateAtSort('descend'); |  |  |         setUpdateAtSort('descend'); | 
			
		
	
		
		
			
				
					
					|  |  |         initData({ limit, offset: currentPage - 1, orderDirection: SortValues[updateAtSort] }); |  |  |         onSearch('descend'); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |     }, [resourceCatalogId]); |  |  |     }, [resourceCatalogId]); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     const initData = (query = {}) => { |  |  |     const initData = (query = {}) => { | 
			
		
	
		
		
			
				
					
					|  |  |         dispatch(metadataManagement.getBusinessMetadata({ catalog: resourceCatalogId, keywords, orderBy: 'updateAt', ...query })).then(res => { |  |  |         dispatch(metadataManagement.getBusinessMetadataDatabases({ catalog: resourceCatalogId, keywords, orderBy: 'updateAt', ...query })).then(res => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             if (res.success) { |  |  |             if (res.success) { | 
			
		
	
		
		
			
				
					|  |  |                 setTableData(res.payload.data.rows); |  |  |                 setTableData(res.payload.data.rows); | 
			
		
	
		
		
			
				
					|  |  |                 setTableDataCount(res.payload.data.count); |  |  |                 setTableDataCount(res.payload.data.count); | 
			
		
	
	
		
		
			
				
					|  | @ -39,13 +39,13 @@ const BusinessDatabaseTable = (props) => { | 
			
		
	
		
		
			
				
					|  |  |                 if (!add) |  |  |                 if (!add) | 
			
		
	
		
		
			
				
					|  |  |                     setEditData({ title: '查看业务元数据', record: { path: '/' + resourceCatalogPath.join('/'), ...record, ...record.attributesParam } }); |  |  |                     setEditData({ title: '查看业务元数据', record: { path: '/' + resourceCatalogPath.join('/'), ...record, ...record.attributesParam } }); | 
			
		
	
		
		
			
				
					|  |  |                 else |  |  |                 else | 
			
		
	
		
		
			
				
					
					|  |  |                     setEditData({ add: true, title: '新建业务元数据', record: { path: '/' + resourceCatalogPath.join('/'), ...record, ...record.attributesParam } }); |  |  |                     setEditData({ add: true, title: '新建业务元数据', record: { ...record } }); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                 setModalVisible(true); |  |  |                 setModalVisible(true); | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |         }) |  |  |         }) | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  |     const confirmDelete = (id) => { |  |  |     const confirmDelete = (id) => { | 
			
		
	
		
		
			
				
					
					|  |  |         dispatch(metadataManagement.delBusinessMetadata(id)).then(res => { |  |  |         dispatch(metadataManagement.delBusinessMetadataDatabases(id)).then(res => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             if (res.success) { |  |  |             if (res.success) { | 
			
		
	
		
		
			
				
					|  |  |                 onSearch(); setModalVisible(false); |  |  |                 onSearch(); setModalVisible(false); | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
	
		
		
			
				
					|  | @ -211,18 +211,18 @@ const BusinessDatabaseTable = (props) => { | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |         }]; |  |  |         }]; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     const onSearch = () => { |  |  |     const onSearch = (sort) => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         setSelectedRowKeys([]); |  |  |         setSelectedRowKeys([]); | 
			
		
	
		
		
			
				
					|  |  |         setSelectedRows([]); |  |  |         setSelectedRows([]); | 
			
		
	
		
		
			
				
					|  |  |         setCurrentPage(1); |  |  |         setCurrentPage(1); | 
			
		
	
		
		
			
				
					
					|  |  |         initData({ limit, offset: 0, orderDirection: SortValues[updateAtSort] }); |  |  |         initData({ limit, offset: 0, orderDirection: SortValues[sort || updateAtSort] }); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  |     const handleExport = (isAll = false) => { |  |  |     const handleExport = (isAll = false) => { | 
			
		
	
		
		
			
				
					|  |  |         let tableHeader = `<tr>`; |  |  |         let tableHeader = `<tr>`; | 
			
		
	
		
		
			
				
					|  |  |         columns.filter(c => c.dataIndex != 'action').map(c => { tableHeader += `<th><div>${c.title}</div></th>`; }); |  |  |         columns.filter(c => c.dataIndex != 'action').map(c => { tableHeader += `<th><div>${c.title}</div></th>`; }); | 
			
		
	
		
		
			
				
					|  |  |         tableHeader += '</tr>'; |  |  |         tableHeader += '</tr>'; | 
			
		
	
		
		
			
				
					|  |  |         if (isAll) { |  |  |         if (isAll) { | 
			
		
	
		
		
			
				
					
					|  |  |             dispatch(metadataManagement.getBusinessMetadata({ catalog: resourceCatalogId })).then(res => { |  |  |             dispatch(metadataManagement.getBusinessMetadataDatabases({ catalog: resourceCatalogId })).then(res => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                 if (res.success) { |  |  |                 if (res.success) { | 
			
		
	
		
		
			
				
					|  |  |                     handleExportTable(tableHeader, res.payload.data.rows); |  |  |                     handleExportTable(tableHeader, res.payload.data.rows); | 
			
		
	
		
		
			
				
					|  |  |                 } |  |  |                 } | 
			
		
	
	
		
		
			
				
					|  | @ -270,12 +270,14 @@ const BusinessDatabaseTable = (props) => { | 
			
		
	
		
		
			
				
					|  |  |         let obj = {} |  |  |         let obj = {} | 
			
		
	
		
		
			
				
					|  |  |         if (editData.add) { |  |  |         if (editData.add) { | 
			
		
	
		
		
			
				
					|  |  |             obj = { createBy: user.id, metadataDatabaseId: editData.record.id, ...values } |  |  |             obj = { createBy: user.id, metadataDatabaseId: editData.record.id, ...values } | 
			
		
	
		
		
			
				
					
					|  |  |             dispatch(metadataManagement.postBusinessMetadata(obj)).then(() => { |  |  |             dispatch(metadataManagement.postBusinessMetadataDatabases(obj)).then(res => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |                 if (res.success) { | 
			
		
	
		
		
			
				
					|  |  |                     onSearch(); setModalVisible(false); |  |  |                     onSearch(); setModalVisible(false); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |             }); |  |  |             }); | 
			
		
	
		
		
			
				
					|  |  |         } else { |  |  |         } else { | 
			
		
	
		
		
			
				
					|  |  |             obj = { ...values } |  |  |             obj = { ...values } | 
			
		
	
		
		
			
				
					
					|  |  |             dispatch(metadataManagement.putBusinessMetadata(editData.record.businessMetadataDatabases[0].id, obj)).then(res => { |  |  |             dispatch(metadataManagement.putBusinessMetadataDatabases(editData.record.businessMetadataDatabases[0].id, obj)).then(res => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                 if (res.success) { |  |  |                 if (res.success) { | 
			
		
	
		
		
			
				
					|  |  |                     onSearch(); setModalVisible(false); |  |  |                     onSearch(); setModalVisible(false); | 
			
		
	
		
		
			
				
					|  |  |                 } |  |  |                 } | 
			
		
	
	
		
		
			
				
					|  | @ -332,12 +334,12 @@ const BusinessDatabaseTable = (props) => { | 
			
		
	
		
		
			
				
					|  |  |     </Spin > |  |  |     </Spin > | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
		
		
			
				
					|  |  | function mapStateToProps(state) { |  |  | function mapStateToProps(state) { | 
			
		
	
		
		
			
				
					
					|  |  |     const { global, auth, metadataDatabases, metadataModels } = state; |  |  |     const { global, auth, businessMetadataDatabases, metadataModels } = state; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |     return { |  |  |     return { | 
			
		
	
		
		
			
				
					|  |  |         user: auth.user, |  |  |         user: auth.user, | 
			
		
	
		
		
			
				
					|  |  |         actions: global.actions, |  |  |         actions: global.actions, | 
			
		
	
		
		
			
				
					|  |  |         clientHeight: global.clientHeight, |  |  |         clientHeight: global.clientHeight, | 
			
		
	
		
		
			
				
					
					|  |  |         isRequesting: metadataDatabases.isRequesting || metadataModels.isRequesting, |  |  |         isRequesting: businessMetadataDatabases.isRequesting || metadataModels.isRequesting, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         metadataModels: metadataModels.data |  |  |         metadataModels: metadataModels.data | 
			
		
	
		
		
			
				
					|  |  |     }; |  |  |     }; | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
	
		
		
			
				
					|  | 
 |