Commit 1f7fb67f by zhaochengxiang

资产增加批量打标签

parent a669fc26
...@@ -19,7 +19,7 @@ const FC = (props) => { ...@@ -19,7 +19,7 @@ const FC = (props) => {
const getElements = () => { const getElements = () => {
setLoading(true) setLoading(true)
dispatch({ dispatch({
type: 'assetmanage.listElements', type: 'assetmanage.listComputableElements',
callback: data => { callback: data => {
setElements(data??[]) setElements(data??[])
setLoading(false) setLoading(false)
......
...@@ -184,6 +184,9 @@ const FC = (props) => { ...@@ -184,6 +184,9 @@ const FC = (props) => {
action: 'add', action: 'add',
}) })
}}>新增</Button> }}>新增</Button>
<Button onClick={() => {
getEvaluations()
}}>刷新</Button>
<Tooltip title={((selectedRows??[]).length===0)?'请先选择评估方案':''}> <Tooltip title={((selectedRows??[]).length===0)?'请先选择评估方案':''}>
<Button <Button
disabled={(selectedRows??[]).length===0} disabled={(selectedRows??[]).length===0}
......
...@@ -19,6 +19,7 @@ import { FullScreenSvg, CancelFullScreenSvg } from './AssetSvg'; ...@@ -19,6 +19,7 @@ import { FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import { AppContext } from "../../../../App"; import { AppContext } from "../../../../App";
import WorksheetModal from "./WorksheetModal"; import WorksheetModal from "./WorksheetModal";
import WorkbookDrawer from "./WorkbookDrawer"; import WorkbookDrawer from "./WorkbookDrawer";
import AddTagModal from '../../Tag/Component/AddTagModal';
import "./AssetTable.less"; import "./AssetTable.less";
import 'react-contexify/dist/ReactContexify.css'; import 'react-contexify/dist/ReactContexify.css';
...@@ -153,6 +154,10 @@ const AssetTable = (props) => { ...@@ -153,6 +154,10 @@ const AssetTable = (props) => {
const [ biType, setBiType ] = useState(''); const [ biType, setBiType ] = useState('');
const [ reportTypes, setReportTypes ] = useState(); const [ reportTypes, setReportTypes ] = useState();
const [ report, setReport ] = useState(); const [ report, setReport ] = useState();
const [addTagParams, setAddTagParams] = React.useState({
visible: false,
ids: undefined,
});
const [ modal, contextHolder ] = Modal.useModal(); const [ modal, contextHolder ] = Modal.useModal();
const anchorId = getQueryParam(AnchorId, props.location.search); const anchorId = getQueryParam(AnchorId, props.location.search);
...@@ -673,6 +678,17 @@ const AssetTable = (props) => { ...@@ -673,6 +678,17 @@ const AssetTable = (props) => {
} }
} }
const tagAssets = () => {
if ((checkedKeys||[]).length > 0) {
setAddTagParams({
visible: true,
ids: checkedKeys
})
}else{
showMessage("warn","请选择资产")
}
}
const onImportAssetCancel = () => { const onImportAssetCancel = () => {
setImportAssetVisible(false); setImportAssetVisible(false);
} }
...@@ -850,6 +866,14 @@ const AssetTable = (props) => { ...@@ -850,6 +866,14 @@ const AssetTable = (props) => {
</React.Fragment> </React.Fragment>
} }
{
(reference===AssetManageReference) && <Menu.Item disabled={(checkedKeys||[]).length===0}>
<div className='text-center' onClick={tagAssets}>
标签设置
</div>
</Menu.Item>
}
<Menu.Item> <Menu.Item>
<div className='text-center' onClick={onFilterElementClick}> <div className='text-center' onClick={onFilterElementClick}>
可见列设置 可见列设置
...@@ -1111,6 +1135,23 @@ const AssetTable = (props) => { ...@@ -1111,6 +1135,23 @@ const AssetTable = (props) => {
visible={workbookDrawerVisible} visible={workbookDrawerVisible}
onCancel={onWorkbookDrawerCancel} onCancel={onWorkbookDrawerCancel}
/> />
<AddTagModal
{...addTagParams}
creator={app?.user?.userName||''}
type='dataAsset'
onCancel={(refresh=false) => {
setAddTagParams({
visible: false,
ids: undefined
})
if (refresh) {
let event = new Event('storage');
event.key = 'tagChange';
window?.dispatchEvent(event);
}
}}
/>
<RcMenu id={MENU_ID}> <RcMenu id={MENU_ID}>
{ {
......
...@@ -34,7 +34,7 @@ const ClassifySelect = ({ value = '', data = [], onChange, ...restProps }) => { ...@@ -34,7 +34,7 @@ const ClassifySelect = ({ value = '', data = [], onChange, ...restProps }) => {
} }
const AddTagModal = (props) => { const AddTagModal = (props) => {
const { visible, onCancel, id, type, creator, onAssetTag } = props; const { visible, onCancel, ids, type, creator, onAssetTag } = props;
const [ step, setStep ] = useState(0); const [ step, setStep ] = useState(0);
const [ keyword, setKeyword ] = useState(''); const [ keyword, setKeyword ] = useState('');
...@@ -152,7 +152,7 @@ const AddTagModal = (props) => { ...@@ -152,7 +152,7 @@ const AddTagModal = (props) => {
payload: { payload: {
params: { params: {
tagId: selectTag.tagId, tagId: selectTag.tagId,
resourceIds: id, resourceIds: (ids??[]).toString(),
type, type,
creator creator
} }
...@@ -212,7 +212,7 @@ const AddTagModal = (props) => { ...@@ -212,7 +212,7 @@ const AddTagModal = (props) => {
payload: { payload: {
params: { params: {
tagId: data.id, tagId: data.id,
resourceIds: id, resourceIds: (ids??[]).toString(),
type, type,
creator creator
} }
......
...@@ -157,7 +157,7 @@ const TagColumn = (props) => { ...@@ -157,7 +157,7 @@ const TagColumn = (props) => {
} }
<AddTagModal <AddTagModal
visible={addTagModalVisible} visible={addTagModalVisible}
id={id} ids={[id]}
type={type} type={type}
creator={creator} creator={creator}
onCancel={onAddTagModalCancel} onCancel={onAddTagModalCancel}
......
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