Commit cac2edb9 by zhaochengxiang

价值评分

parent f6079fcc
...@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Form, Spin, Input, Descriptions, Space, Button, Tooltip } from 'antd'; import { Form, Spin, Input, Descriptions, Space, Button, Tooltip } from 'antd';
import { DownOutlined, UpOutlined } from '@ant-design/icons'; import { DownOutlined, UpOutlined } from '@ant-design/icons';
import LocalStorage from 'local-storage'; import LocalStorage from 'local-storage';
import { Subject } from 'rxjs';
import MetadataInfo from './MetadataInfo'; import MetadataInfo from './MetadataInfo';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
...@@ -13,6 +14,8 @@ import AssetTagModal from './AssetTagModal'; ...@@ -13,6 +14,8 @@ import AssetTagModal from './AssetTagModal';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg'; import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
export const AssetActionSubject = new Subject()
const AssetAction = (props) => { const AssetAction = (props) => {
const { id, dirId, action, terms, onChange, readOnly = false, form, onMetadataChange, onElementsChange } = props; const { id, dirId, action, terms, onChange, readOnly = false, form, onMetadataChange, onElementsChange } = props;
...@@ -29,6 +32,19 @@ const AssetAction = (props) => { ...@@ -29,6 +32,19 @@ const AssetAction = (props) => {
const [ keyword, setKeyword ] = useState(''); const [ keyword, setKeyword ] = useState('');
useEffect(() => { useEffect(() => {
const $$assetAction = AssetActionSubject.subscribe((act) => {
if (act?.type === 'update') {
if (id) {
getAsset();
}
}
})
return () => {
$$assetAction.unsubscribe()
}
}, [id])
useEffect(() => {
if (action === 'add') { if (action === 'add') {
getElements(); getElements();
} else { } else {
......
...@@ -566,11 +566,8 @@ const AssetTree = (props) => { ...@@ -566,11 +566,8 @@ const AssetTree = (props) => {
} }
} }
const onComputeScoreCancel = (refresh=false) => { const onComputeScoreCancel = () => {
setComputeScoreVisible(false); setComputeScoreVisible(false);
if (refresh) {
}
} }
const displayMenu = (e) => { const displayMenu = (e) => {
......
...@@ -4,6 +4,7 @@ import { Modal, Checkbox, Row, Input, Col, Space, Button } from 'antd'; ...@@ -4,6 +4,7 @@ import { Modal, Checkbox, Row, Input, Col, Space, Button } from 'antd';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import { showMessage } from '../../../../util'; import { showMessage } from '../../../../util';
import { AssetActionSubject } from './AssetAction';
const FC = (props) => { const FC = (props) => {
const { visible, onCancel } = props; const { visible, onCancel } = props;
...@@ -63,7 +64,8 @@ const FC = (props) => { ...@@ -63,7 +64,8 @@ const FC = (props) => {
callback: data => { callback: data => {
setConfirmLoading(false); setConfirmLoading(false);
reset(); reset();
onCancel?.(true); AssetActionSubject.next({type: 'update'})
onCancel?.();
}, },
error: () => { error: () => {
setConfirmLoading(false); setConfirmLoading(false);
......
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