Commit f6079fcc by zhaochengxiang

价值评估

parent 042e2609
......@@ -241,5 +241,5 @@ export function subs(payload) {
}
export function getScore(payload) {
return GetJSON("/dataassetmanager/dataAssetApi/getScoreByDirectoryId", payload);
return Get("/dataassetmanager/dataAssetApi/getScoreByDirectoryId", payload);
}
\ No newline at end of file
import React from 'react';
import * as echarts from 'echarts';
import { dispatch } from '../../../../model'
//https://echarts.apache.org/examples/zh/editor.html?c=treemap-show-parent&lang=js
class Thermodynamic extends React.Component {
......@@ -8,6 +9,7 @@ class Thermodynamic extends React.Component {
const { data, onClick } = this.props;
if (data) {
this.graph = init(this)(this.elem, data, onClick);
this.getScore();
}
}
......@@ -16,11 +18,30 @@ class Thermodynamic extends React.Component {
if (data !== prevProps.data) {
this.graph = init(this)(this.elem, data, onClick);
this.getScore();
} else if (resize !== prevProps.resize) {
this.graph?.resize();
}
}
getScore() {
const { data } = this.props;
dispatch({
type: 'assetmanage.getScore',
payload: {
dirId: (data?.length>0) ? data[0]?.nodeId: ''
},
callback: newScore => {
this.graph?.setOption({
title: {
subtext: `价值评分 ${newScore}`,
itemGap: 2,
}
})
}
})
}
elem = undefined;
graph = undefined;
......@@ -75,9 +96,9 @@ const init = (ctx) => function (container, data, onClick) {
title: {
text: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '',
left: 'center',
bottom: 10,
bottom: 0,
textStyle: {
fontSize: 16
fontSize: 14
}
},
tooltip: {
......
......@@ -333,6 +333,9 @@ const AssetAction = (props) => {
{assets.currentPath||''}
</a>
</Descriptions.Item>
<Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>价值评分</div>} style={{ paddingBottom: 15 }}>
<div>{assets.score}</div>
</Descriptions.Item>
<Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 15 }}>
<AppContext.Consumer>
{
......
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