|
|
@@ -28,15 +28,15 @@ class FuncItem extends Component {
|
|
|
}
|
|
|
|
|
|
componentDidMount () {
|
|
|
- let { funcObj, sup } = this.props
|
|
|
- if (sup) {
|
|
|
+ let { funcObj, supAble, supValue } = this.props
|
|
|
+ if (supValue) {
|
|
|
this.setState({
|
|
|
- supState: sup,
|
|
|
+ supState: supValue,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- if (!isObjEmpty(funcObj.countUrl)) {
|
|
|
- fetchGet( funcObj.countUrl).then(response => {
|
|
|
+ if (supAble && !isObjEmpty(funcObj.countUrl)) {
|
|
|
+ fetchGet(funcObj.countUrl).then(response => {
|
|
|
funcObj.sup = response.data
|
|
|
this.props.onFuncDataChange && this.props.onFuncDataChange(funcObj)
|
|
|
this.setState({
|
|
|
@@ -69,7 +69,8 @@ class FuncItem extends Component {
|
|
|
let {
|
|
|
funcObj,
|
|
|
operation,//右上角操作图标
|
|
|
- sup,//角标
|
|
|
+ supAble,//是否展示角标
|
|
|
+ supValue,//角标值
|
|
|
lineCount,//标题行数
|
|
|
} = this.props
|
|
|
const { supState } = this.state
|
|
|
@@ -107,7 +108,7 @@ class FuncItem extends Component {
|
|
|
style={funcTextStyle}
|
|
|
>{funcObj.name}</span>
|
|
|
{
|
|
|
- (supState) ?
|
|
|
+ ((supAble || supValue) && supState) ?
|
|
|
<sup
|
|
|
className='func-func-sup'
|
|
|
style={{
|