Skip to content

Commit a70da9a

Browse files
committed
fix code
1 parent 7ac79dd commit a70da9a

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

admin-ui/src/components/Flow/flow/data.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,23 @@ export class FlowData extends FlowWorkData {
175175
getNodeState = (code: string) => {
176176
const historyRecords = this.data.historyRecords || [];
177177

178-
179-
if (this.isFinished()) {
178+
if (code==='over' && this.isFinished()) {
180179
return "done";
181180
}
182181

183182
for (const record of historyRecords) {
184183
if (record.nodeCode === code) {
185184
if (record.flowType === 'TODO') {
186-
return "wait";
185+
return "current";
187186
}
188187
return "done";
189188
}
190189
}
191190

191+
if(this.isFinished()){
192+
return "undone";
193+
}
194+
192195
return "wait";
193196
}
194197

@@ -231,9 +234,14 @@ export class FlowData extends FlowWorkData {
231234
// 获取历史审批意见
232235
getOpinions() {
233236
if(this.data.opinions){
234-
return this.data.opinions.filter((item:any)=>item.opinion.result!==0);
237+
return this.data.opinions.filter((item:any)=>{
238+
if(!item.opinion){
239+
return false;
240+
}
241+
return item.opinion.result!==0;
242+
});
235243
}
236-
return this.data.opinions;
244+
return [];
237245
}
238246

239247
// 获取历史记录

admin-ui/src/components/Flow/nodes/StateLabel.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ const StateLabel:React.FC<StateLabelProps> = (props)=>{
1212
switch (state) {
1313
case "done":
1414
return "success";
15-
case "current":
15+
case "undone":
1616
return "processing";
17+
case "current":
18+
return "warning";
1719
default:
1820
return "default";
1921
}
@@ -23,6 +25,8 @@ const StateLabel:React.FC<StateLabelProps> = (props)=>{
2325
switch (state) {
2426
case "done":
2527
return "已执行";
28+
case "undone":
29+
return "未执行";
2630
case "current":
2731
return "当前节点";
2832
default:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export type NodeState = "done" | "wait" | "current";
1+
export type NodeState = "done" | "wait" | "undone" | "current";
22

0 commit comments

Comments
 (0)