Commit 0283d219 by zhaochengxiang

bug fix

parent 6643d4c3
...@@ -660,8 +660,10 @@ export const ElementItem = ({ type = 'detail', element, reference = AssetManageR ...@@ -660,8 +660,10 @@ export const ElementItem = ({ type = 'detail', element, reference = AssetManageR
} }
return ( return (
<React.Fragment> <div onClick={e => {
e.stopPropagation()
}}>
{inputItem()} {inputItem()}
</React.Fragment> </div>
) )
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import LocalStorage from 'local-storage' ...@@ -7,7 +7,7 @@ import LocalStorage from 'local-storage'
import { dispatch } from '../../../model' import { dispatch } from '../../../model'
import { usePage } from '../../../util/hooks/page' import { usePage } from '../../../util/hooks/page'
import Table from '../../../util/Component/Table' import Table from '../../../util/Component/Table'
import { getAssetType, getAssetTypeName, getQueryParam, isSzseEnv } from '../../../util' import { getAssetType, getAssetTypeName, getQueryParam, isSzseEnv, showMessage } from '../../../util'
import '../Model/Component/EditModel.less' import '../Model/Component/EditModel.less'
import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction' import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction'
...@@ -17,6 +17,7 @@ import produce from 'immer' ...@@ -17,6 +17,7 @@ import produce from 'immer'
const pathElement = { const pathElement = {
name: '资产目录', name: '资产目录',
supportBatchEdit: '是', supportBatchEdit: '是',
manualMaintain: '是',
require: true, require: true,
} }
...@@ -71,6 +72,14 @@ const FC = (props) => { ...@@ -71,6 +72,14 @@ const FC = (props) => {
try { try {
await editAssetsRef.current?.save() await editAssetsRef.current?.save()
const modifyData = editAssetsRef.current?.getModifyData() const modifyData = editAssetsRef.current?.getModifyData()
if ((elementIds??[]).length === 0) {
const index = (modifyData.rowDataList??[]).findIndex(item => (item.dirIds??[]).length === 0)
if (index !== -1) {
showMessage('warn', '请选择资产目录')
return
}
}
setWaiting(true) setWaiting(true)
dispatch({ dispatch({
type: (elementIds??[]).length===0?'assetmanage.resourceBatchAddAsAsset':'assetmanage.resourceBatchEdit', type: (elementIds??[]).length===0?'assetmanage.resourceBatchAddAsAsset':'assetmanage.resourceBatchEdit',
...@@ -84,8 +93,12 @@ const FC = (props) => { ...@@ -84,8 +93,12 @@ const FC = (props) => {
setWaiting(false) setWaiting(false)
setAction('detail') setAction('detail')
LocalStorage.set('editAssetsChange', !(LocalStorage.get('editAssetsChange')??false)) LocalStorage.set('editAssetsChange', !(LocalStorage.get('editAssetsChange')??false))
showMessage('success', '保存成功')
if ((elementIds??[]).length === 0) { if ((elementIds??[]).length === 0) {
window.close() setTimeout(() => {
window.close()
}, [300])
} }
}, },
error: () => { error: () => {
...@@ -255,12 +268,13 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -255,12 +268,13 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
const columns = React.useMemo(() => { const columns = React.useMemo(() => {
const newColumns = [] const newColumns = []
let index = 0
let newElements = [...elements??[]] let newElements = [...elements??[]]
if ((elementIds??[]).length === 0) { if ((elementIds??[]).length === 0) {
newElements = [pathElement, ...newElements] newElements = [pathElement, ...newElements]
} }
newElements = newElements.filter(item => item.manualMaintain==='是')
for (const element of newElements??[]) { for (const element of newElements??[]) {
let col = { let col = {
title: element.name, title: element.name,
...@@ -292,7 +306,10 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -292,7 +306,10 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
</Typography.Text> </Typography.Text>
</Tooltip> </Tooltip>
); );
} }
} else if (element.metadataItem === '是') {
col.width = 200
col.render = (text, record) => <ElementItem type='detail' element={element} value={text} />
} }
col.onCell = (record) => ({ col.onCell = (record) => ({
...@@ -311,7 +328,6 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -311,7 +328,6 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
} }
} }
index++
newColumns.push(col) newColumns.push(col)
} }
...@@ -356,7 +372,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -356,7 +372,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
if ((elementIds??[]).length === 0) { if ((elementIds??[]).length === 0) {
url = 'assetmanage.getAddAsAssetBatchEditInfo' url = 'assetmanage.getAddAsAssetBatchEditInfo'
payload = { payload = {
data: ids data: (ids??'').split(',')
} }
} else { } else {
url = 'assetmanage.getResourceBatchEditInfo' url = 'assetmanage.getResourceBatchEditInfo'
......
...@@ -1672,12 +1672,12 @@ export const MetadataColumnTooltipTitle = ({ data }) => { ...@@ -1672,12 +1672,12 @@ export const MetadataColumnTooltipTitle = ({ data }) => {
dataIndex: 'typeName', dataIndex: 'typeName',
ellipsis: true, ellipsis: true,
render: (text, record) => { render: (text, record) => {
let suffix = (record.size!==null&&record.size!==undefined) ? `(${record.size})` : '' let suffix = (record.size) ? `(${record.size})` : ''
if(record.size && record.decimalDigits){ if(record.size && record.decimalDigits){
suffix = `(${record.size},${record.decimalDigits})` suffix = `(${record.size},${record.decimalDigits})`
} }
return `${text}${suffix}` return `${text??''}${suffix}`
} }
}, },
{ {
...@@ -1714,9 +1714,9 @@ export const MetadataColumnTooltipTitle = ({ data }) => { ...@@ -1714,9 +1714,9 @@ export const MetadataColumnTooltipTitle = ({ data }) => {
type: 'assetmanage.getMetadataColumns', type: 'assetmanage.getMetadataColumns',
payload: { payload: {
params: { params: {
parentId: currentMetadataId parentId: currentMetadataId,
}, },
data: ["Catalog,Database,Schema,Table,Column"] data: [],
}, },
callback: (data) => { callback: (data) => {
setLoading(false) setLoading(false)
......
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