Commit 6043b9e3 by zhaochengxiang

资产打标签

parent e02e68dc
......@@ -365,4 +365,8 @@ svg {
.yy-notification-notice-description {
max-height: 70vh;
overflow: auto;
}
tbody > tr > td.table-tag-cell {
padding: 12px 8px !important;
}
\ No newline at end of file
......@@ -218,10 +218,18 @@ export const callFetchRaw = (method, url, options) => {
const templateType = getTemplateType();
var bodyFormData = new FormData();
Object.keys(params||[]).forEach(key => {
bodyFormData.append(key, params[key]);
});
bodyFormData.append(templateType, templateType);
return axios.request({
method,
url,
params: {templateType, ...params},
data: bodyFormData,
...config,
...reqConfig
})
......
......@@ -182,19 +182,21 @@ const AssetTable = (props) => {
dataIndex: 'tag',
width: 360,
className: 'table-tag-cell',
render: (_, record) => <TagCell
id={record.id}
did={record.dirId}
type='dataAsset'
tags={resoureTagMap?.[record.id]}
onChange={(val) => {
setResourceTagMap((prevResourceTagMap) => {
return produce(prevResourceTagMap||{}, (draft) => {
draft[record.id] = val
render: (_, record) => <div onClick={(e) => e.stopPropagation()}>
<TagCell
id={record.id}
did={record.dirId}
type='dataAsset'
tags={resoureTagMap?.[record.id]}
onChange={(val) => {
setResourceTagMap((prevResourceTagMap) => {
return produce(prevResourceTagMap||{}, (draft) => {
draft[record.id] = val
})
})
})
}}
/>
}}
/>
</div>
}
const actionCol = {
......@@ -296,6 +298,12 @@ const AssetTable = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [ keyword, pagination, elementsChanged ])
React.useEffect(() => {
if (assets) {
getResourceTag()
}
}, [assets])
const realAssets = useMemo(() => {
const newAssets = [...assets];
// if (users?.length > 0 && assets?.length > 0 && columns?.length > 0) {
......
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