Commit aa39a48c by fanyj

修改打标签bug

parent cad4cb27
...@@ -351,17 +351,18 @@ const AssetAction = React.forwardRef(function (props, ref) { ...@@ -351,17 +351,18 @@ const AssetAction = React.forwardRef(function (props, ref) {
width: 360, width: 360,
className: 'table-tag-cell', className: 'table-tag-cell',
render: (_, record) => { render: (_, record) => {
const id = record?.id?record.id:record._id
return( return(
<div onClick={(e) => e.stopPropagation()}> <div onClick={(e) => e.stopPropagation()}>
<TagCell <TagCell
id={record.id} id={id}
did={record.dirId} did={record.dirId}
type={record?.columnType} type={record?.columnType}
tags={resoureTagMap?.[record.id]} tags={resoureTagMap?.[id]}
onChange={(val) => { onChange={(val) => {
setResourceTagMap((prevResourceTagMap) => { setResourceTagMap((prevResourceTagMap) => {
return produce(prevResourceTagMap||{}, (draft) => { return produce(prevResourceTagMap||{}, (draft) => {
draft[record.id] = val draft[id] = val
}) })
}) })
}} }}
...@@ -372,7 +373,10 @@ const AssetAction = React.forwardRef(function (props, ref) { ...@@ -372,7 +373,10 @@ const AssetAction = React.forwardRef(function (props, ref) {
} }
const getResourceTag = () => { const getResourceTag = () => {
const ids = (tableData??[]).map(item => item.id) console.log(tableData)
const ids = (tableData??[]).map(item =>{
return item.id?item.id:item._id
})
if (ids.length > 0) { if (ids.length > 0) {
dispatch({ dispatch({
type: 'tag.getResourceTagIn', type: 'tag.getResourceTagIn',
......
...@@ -59,8 +59,6 @@ const VersionCompareTable = (props) => { ...@@ -59,8 +59,6 @@ const VersionCompareTable = (props) => {
const tableData = React.useMemo(() => { const tableData = React.useMemo(() => {
const newTableData = []; const newTableData = [];
let columnValue = (direction==='left') ? data?.leftValue?.columnValue : data?.rightValue?.columnValue; let columnValue = (direction==='left') ? data?.leftValue?.columnValue : data?.rightValue?.columnValue;
console.log(columnValue)
for (const item of columnValue??[]) { for (const item of columnValue??[]) {
let newItem = {}; let newItem = {};
......
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