|
@@ -4,10 +4,14 @@ import { Node } from '@antv/x6';
|
|
|
import '@antv/x6-react-shape';
|
|
|
import scriptLogo from '../style/img/script.png';
|
|
|
import datasourceLogo from '../style/img/datasource.png';
|
|
|
+import successNode from '../style/img/success_node.png';
|
|
|
+import warningNode from '../style/img/warning_node.png';
|
|
|
+import undoneNode from '../style/img/default_node.png';
|
|
|
+import runningNode from '../style/img/running.png';
|
|
|
|
|
|
interface NodeStatus {
|
|
|
id: string;
|
|
|
- status: 'default' | 'success' | 'failed' | 'running';
|
|
|
+ status: 'default' | 'success' | 'failed' | 'running' | 'undone';
|
|
|
type: 'script' | 'datasource';
|
|
|
label?: string;
|
|
|
}
|
|
@@ -15,12 +19,10 @@ interface NodeStatus {
|
|
|
const image = {
|
|
|
scriptLogo,
|
|
|
datasourceLogo,
|
|
|
- success:
|
|
|
- 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*6l60T6h8TTQAAAAAAAAAAAAAARQnAQ',
|
|
|
- failed:
|
|
|
- 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*SEISQ6My-HoAAAAAAAAAAAAAARQnAQ',
|
|
|
- running:
|
|
|
- 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*t8fURKfgSOgAAAAAAAAAAAAAARQnAQ'
|
|
|
+ successNode,
|
|
|
+ warningNode,
|
|
|
+ undoneNode,
|
|
|
+ runningNode
|
|
|
};
|
|
|
|
|
|
export default class AlgoNode extends React.Component<{ node?: Node }> {
|
|
@@ -46,11 +48,16 @@ export default class AlgoNode extends React.Component<{ node?: Node }> {
|
|
|
<img src={image.datasourceLogo} alt="datasourceLogo" />
|
|
|
)}
|
|
|
<span className="label">{label}</span>
|
|
|
- <span className="status">
|
|
|
- {status === 'success' && <img src={image.success} alt="success" />}
|
|
|
- {status === 'failed' && <img src={image.failed} alt="failed" />}
|
|
|
- {status === 'running' && <img src={image.running} alt="running" />}
|
|
|
- </span>
|
|
|
+ <div className="status">
|
|
|
+ {status === 'undone' && <img src={image.undoneNode} alt="未执行" />}
|
|
|
+ {status === 'success' && (
|
|
|
+ <img src={image.successNode} alt="执行成功" />
|
|
|
+ )}
|
|
|
+ {status === 'failed' && (
|
|
|
+ <img src={image.warningNode} alt="执行失败" />
|
|
|
+ )}
|
|
|
+ {status === 'running' && <img src={image.runningNode} alt="执行中" />}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
);
|
|
|
}
|