Commit 72cd190f by zhaochengxiang

显示资产中文名

parent 63810722
......@@ -30,6 +30,7 @@ const AssetTable = (props) =>{
const [visible2,setVisible2] = useState({visible:false,box:{}})
const [selectBox,setSelectBox] = useState([])
const [checkValue,setCheckValue] = useState(false)
const [ assetNames, setAssetNames ] = useState([]);
useEffect(()=>{
getListBasicAttrs()
......@@ -80,10 +81,21 @@ const AssetTable = (props) =>{
type: 'assetmanage.listDataAssetsByPage',
payload: {dirId:nodeId,pageNum:page,pageSize:size,keyword:keyMessage!==''?keyMessage:undefined},
callback: dataBox => {
const _assetNames = [];
(dataBox.data||[]).forEach((item) => {
(item.basicAttrs||[]).forEach((attr) => {
if (attr.key === '中文名称') {
_assetNames.push(attr.value||'');
}
})
})
setAssetNames(_assetNames);
setTableBox({dataList:dataBox.data,total:dataBox.total})
setSelectBox([])
setCheckValue(false)
setTableLoad(false)
},
error: () => {
setTableLoad(false)
......@@ -240,7 +252,7 @@ const AssetTable = (props) =>{
itemLayout="vertical"
dataSource={dataList || []}
footer={null}
renderItem={(item) => (
renderItem={(item, index) => (
<List.Item
actions={[
<Button type="link" key="edit" onClick={()=>edit(item)}>修改</Button>,
......@@ -253,7 +265,7 @@ const AssetTable = (props) =>{
title={
<div>
<Checkbox value={item.id}></Checkbox>
<span dangerouslySetInnerHTML={{ __html: item.id || '' }} style={{marginLeft:8}}/>
<span style={{marginLeft:8}}>{assetNames[index]||''}</span>
</div>
}
description={
......
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