Commit 72cd190f by zhaochengxiang

显示资产中文名

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