Commit 1f7fb67f by zhaochengxiang

资产增加批量打标签

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