Skip to content

Instantly share code, notes, and snippets.

@oomusou
Created June 24, 2019 07:46
Show Gist options
  • Save oomusou/750823b9d9c497bbe01b213833479219 to your computer and use it in GitHub Desktop.
Save oomusou/750823b9d9c497bbe01b213833479219 to your computer and use it in GitHub Desktop.
let mounted = 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]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment