Created
June 24, 2019 07:50
-
-
Save oomusou/83abe3c84401ec8980e62c3d90bc61cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getData = async function() { | |
let promise0 = await fetchAllMachine({ | |
app_id: process.env.VUE_APP_APP_ID, | |
s_date: getToday(), | |
e_date: getToday() | |
}); | |
let promise1 = await fetchHistoricProcessInstances({ | |
processDefinitionKey: 'material_order_flow', | |
start: '0', | |
size: '200' | |
}); | |
let machines = promise0.data.payload; | |
let histories = promise1.data.data; | |
machines = map(x => ({ | |
id: x.exceptionId, | |
time: x.exceptionTime, | |
color: statusToColor(x.status), | |
name: description(x.status), | |
title: '叫修流程', | |
rawId: x.exceptionId, | |
sortTime: str2Date(x.exceptionTime) | |
}), machines); | |
histories = map(x => ({ | |
id: flowableId(x.id), | |
time: flowableTime(x.startTime), | |
color: entTimeToColor(x.endTime), | |
name: entTimeToName(x.endTime), | |
title: '叫料流程', | |
rawId: x.id, | |
sortTime: str2Date(x.startTime) | |
}), histories); | |
this.items = pipe( | |
concatAll, | |
sortWith([ | |
(x, y) => { | |
let diff = new Date(y.sortTime) - new Date(x.sortTime); | |
if (diff > 0) { | |
return 1; | |
} | |
else if (diff < 0) { | |
return -1; | |
} | |
else { | |
return 0; | |
} | |
} | |
]), | |
addDivider | |
)([machines, histories]); | |
}; | |
let mounted = function() { | |
getData(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment