Issue #166: Done.
This commit is contained in:
@@ -58,7 +58,6 @@
|
|||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import ConformanceStore from '@/stores/conformance.js';
|
import ConformanceStore from '@/stores/conformance.js';
|
||||||
import cytoscapeMapTrace from '@/module/cytoscapeMapTrace.js';
|
import cytoscapeMapTrace from '@/module/cytoscapeMapTrace.js';
|
||||||
import getNumberLabel from '@/module/numberLabel.js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['listModal', 'listNo', 'traceId', 'firstCases', 'listTraces', 'taskSeq', 'cases', 'category'],
|
props: ['listModal', 'listNo', 'traceId', 'firstCases', 'listTraces', 'taskSeq', 'cases', 'category'],
|
||||||
@@ -92,7 +91,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
id: trace.id,
|
id: trace.id,
|
||||||
value: Number((this.getPercentLabel(trace.count / sum))),
|
value: Number((this.getPercentLabel(trace.count / sum))),
|
||||||
count: getNumberLabel(trace.count),
|
count: trace.count.toLocaleString('en-US'),
|
||||||
|
count_base: trace.count,
|
||||||
ratio: this.getPercentLabel(trace.count / sum),
|
ratio: this.getPercentLabel(trace.count / sum),
|
||||||
};
|
};
|
||||||
}).sort((x, y) => x.id - y.id);
|
}).sort((x, y) => x.id - y.id);
|
||||||
|
|||||||
@@ -85,7 +85,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import AllMapDataStore from '@/stores/allMapData.js';
|
import AllMapDataStore from '@/stores/allMapData.js';
|
||||||
import getNumberLabel from '@/module/numberLabel.js';
|
|
||||||
import getTimeLabel from '@/module/timeLabel.js';
|
import getTimeLabel from '@/module/timeLabel.js';
|
||||||
import getMoment from 'moment';
|
import getMoment from 'moment';
|
||||||
|
|
||||||
@@ -117,23 +116,23 @@ export default {
|
|||||||
getStatData() {
|
getStatData() {
|
||||||
this.statData = {
|
this.statData = {
|
||||||
cases: {
|
cases: {
|
||||||
count: getNumberLabel(this.stats.cases.count),
|
count: this.stats.cases.count.toLocaleString('en-US'),
|
||||||
total: getNumberLabel(this.stats.cases.total),
|
total: this.stats.cases.total.toLocaleString('en-US'),
|
||||||
ratio: this.getPercentLabel(this.stats.cases.ratio)
|
ratio: this.getPercentLabel(this.stats.cases.ratio)
|
||||||
},
|
},
|
||||||
traces: {
|
traces: {
|
||||||
count: getNumberLabel(this.stats.traces.count),
|
count: this.stats.traces.count.toLocaleString('en-US'),
|
||||||
total: getNumberLabel(this.stats.traces.total),
|
total: this.stats.traces.total.toLocaleString('en-US'),
|
||||||
ratio: this.getPercentLabel(this.stats.traces.ratio)
|
ratio: this.getPercentLabel(this.stats.traces.ratio)
|
||||||
},
|
},
|
||||||
task_instances: {
|
task_instances: {
|
||||||
count: getNumberLabel(this.stats.task_instances.count),
|
count: this.stats.task_instances.count.toLocaleString('en-US'),
|
||||||
total: getNumberLabel(this.stats.task_instances.total),
|
total: this.stats.task_instances.total.toLocaleString('en-US'),
|
||||||
ratio: this.getPercentLabel(this.stats.task_instances.ratio)
|
ratio: this.getPercentLabel(this.stats.task_instances.ratio)
|
||||||
},
|
},
|
||||||
tasks: {
|
tasks: {
|
||||||
count: getNumberLabel(this.stats.tasks.count),
|
count: this.stats.tasks.count.toLocaleString('en-US'),
|
||||||
total: getNumberLabel(this.stats.tasks.total),
|
total: this.stats.tasks.total.toLocaleString('en-US'),
|
||||||
ratio: this.getPercentLabel(this.stats.tasks.ratio)
|
ratio: this.getPercentLabel(this.stats.tasks.ratio)
|
||||||
},
|
},
|
||||||
started_at: getMoment(this.stats.started_at).format('YYYY-MM-DD HH:mm'),
|
started_at: getMoment(this.stats.started_at).format('YYYY-MM-DD HH:mm'),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<Row>
|
<Row>
|
||||||
<Column selectionMode="single" headerClass="w-8 !p-2 !bg-neutral-10 !border-neutral-500 sticky top-0 left-0 z-10 bg-neutral-10"></Column>
|
<Column selectionMode="single" headerClass="w-8 !p-2 !bg-neutral-10 !border-neutral-500 sticky top-0 left-0 z-10 bg-neutral-10"></Column>
|
||||||
<Column field="label" header="Activity" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable />
|
<Column field="label" header="Activity" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable />
|
||||||
<Column field="occ_value" header="Occurrences" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable :colspan="3" />
|
<Column field="occurrences_base" header="Occurrences" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable :colspan="3" />
|
||||||
</Row>
|
</Row>
|
||||||
</ColumnGroup>
|
</ColumnGroup>
|
||||||
<Column selectionMode="single" bodyClass="!p-2 !border-0"></Column>
|
<Column selectionMode="single" bodyClass="!p-2 !border-0"></Column>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
<Row>
|
<Row>
|
||||||
<Column selectionMode="multiple" headerClass="w-8 !p-2 !bg-neutral-10 !border-neutral-500 sticky top-0 left-0 z-10 bg-neutral-10 allCheckboxAct"></Column>
|
<Column selectionMode="multiple" headerClass="w-8 !p-2 !bg-neutral-10 !border-neutral-500 sticky top-0 left-0 z-10 bg-neutral-10 allCheckboxAct"></Column>
|
||||||
<Column field="label" header="Activity" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable />
|
<Column field="label" header="Activity" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable />
|
||||||
<Column field="occ_value" header="Occurrences" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable :colspan="3" />
|
<Column field="occurrences_base" header="Occurrences" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" sortable :colspan="3" />
|
||||||
<Column field="case_value" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" header="Cases with Activity" sortable :colspan="3" />
|
<Column field="cases_base" headerClass="!bg-neutral-10 !border-neutral-500 !py-2 sticky top-0 left-0 z-10 bg-neutral-10" header="Cases with Activity" sortable :colspan="3" />
|
||||||
</Row>
|
</Row>
|
||||||
</ColumnGroup>
|
</ColumnGroup>
|
||||||
<Column selectionMode="multiple" bodyClass="!p-2 !border-0"></Column>
|
<Column selectionMode="multiple" bodyClass="!p-2 !border-0"></Column>
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ import { storeToRefs } from 'pinia';
|
|||||||
import AllMapDataStore from '@/stores/allMapData.js';
|
import AllMapDataStore from '@/stores/allMapData.js';
|
||||||
import LoadingStore from '@/stores/loading.js';
|
import LoadingStore from '@/stores/loading.js';
|
||||||
import cytoscapeMapTrace from '@/module/cytoscapeMapTrace.js';
|
import cytoscapeMapTrace from '@/module/cytoscapeMapTrace.js';
|
||||||
import numberLabel from '@/module/numberLabel.js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
expose: ['selectArea', 'showTraceId', 'traceTotal'],
|
expose: ['selectArea', 'showTraceId', 'traceTotal'],
|
||||||
@@ -101,7 +100,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
id: trace.id,
|
id: trace.id,
|
||||||
value: this.progressWidth(Number(((trace.count / this.traceCountTotal) * 100).toFixed(1))),
|
value: this.progressWidth(Number(((trace.count / this.traceCountTotal) * 100).toFixed(1))),
|
||||||
count: numberLabel(trace.count),
|
count: trace.count.toLocaleString(),
|
||||||
base_count: trace.count,
|
base_count: trace.count,
|
||||||
ratio: this.getPercentLabel(trace.count / this.traceCountTotal),
|
ratio: this.getPercentLabel(trace.count / this.traceCountTotal),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -264,12 +264,14 @@ export default {
|
|||||||
label: task.label,
|
label: task.label,
|
||||||
occ_value: Number(task.occurrence_ratio * 100),
|
occ_value: Number(task.occurrence_ratio * 100),
|
||||||
occurrences: Number(task.occurrences).toLocaleString('en-US'),
|
occurrences: Number(task.occurrences).toLocaleString('en-US'),
|
||||||
|
occurrences_base: task.occurrences,
|
||||||
occurrence_ratio: this.getPercentLabel(task.occurrence_ratio),
|
occurrence_ratio: this.getPercentLabel(task.occurrence_ratio),
|
||||||
case_value: Number(task.case_ratio * 100),
|
case_value: Number(task.case_ratio * 100),
|
||||||
cases: task.cases.toLocaleString('en-US'),
|
cases: task.cases.toLocaleString('en-US'),
|
||||||
|
cases_base: task.cases,
|
||||||
case_ratio: this.getPercentLabel(task.case_ratio),
|
case_ratio: this.getPercentLabel(task.case_ratio),
|
||||||
};
|
};
|
||||||
}).sort((x, y) => y.occurrences - x.occurrences);
|
}).sort((x, y) => y.occurrences_base - x.occurrences_base);
|
||||||
},
|
},
|
||||||
// 調整 filterStartData / filterEndData / filterStartToEndData / filterEndToStartData 的內容
|
// 調整 filterStartData / filterEndData / filterStartToEndData / filterEndToStartData 的內容
|
||||||
/**
|
/**
|
||||||
@@ -281,11 +283,13 @@ export default {
|
|||||||
let data = {
|
let data = {
|
||||||
label: task.label,
|
label: task.label,
|
||||||
occ_value: Number(task.occurrence_ratio * 100),
|
occ_value: Number(task.occurrence_ratio * 100),
|
||||||
occurrences: Number(task.occurrences).toLocaleString('en-US'),
|
occurrences: task.occurrences.toLocaleString('en-US'),
|
||||||
|
occurrences_base: task.occurrences,
|
||||||
occurrence_ratio: this.getPercentLabel(task.occurrence_ratio),
|
occurrence_ratio: this.getPercentLabel(task.occurrence_ratio),
|
||||||
};
|
};
|
||||||
list.push(data);
|
list.push(data);
|
||||||
});
|
});
|
||||||
|
list.sort((x, y) => y.occurrences_base - x.occurrences_base)
|
||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<p class="h2">Cases</p>
|
<p class="h2">Cases</p>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div class="w-full mr-8">
|
<div class="w-full mr-8">
|
||||||
<span class="block text-sm">{{ numberLabel(stats.cases.count) }} / {{ numberLabel(stats.cases.total) }}</span>
|
<span class="block text-sm">{{ stats.cases.count.toLocaleString() }} / {{ stats.cases.total.toLocaleString() }}</span>
|
||||||
<ProgressBar :value="valueCases" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
<ProgressBar :value="valueCases" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
||||||
</div>
|
</div>
|
||||||
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.cases.ratio) }}</span>
|
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.cases.ratio) }}</span>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<p class="h2">Traces</p>
|
<p class="h2">Traces</p>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div class="w-full mr-8">
|
<div class="w-full mr-8">
|
||||||
<span class="block text-sm">{{ numberLabel(stats.traces.count) }} / {{ numberLabel(stats.traces.total) }}</span>
|
<span class="block text-sm">{{ stats.traces.count.toLocaleString() }} / {{ stats.traces.total.toLocaleString() }}</span>
|
||||||
<ProgressBar :value="valueTraces" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
<ProgressBar :value="valueTraces" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
||||||
</div>
|
</div>
|
||||||
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.traces.ratio) }}</span>
|
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.traces.ratio) }}</span>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<p class="h2">Activity Instances</p>
|
<p class="h2">Activity Instances</p>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div class="w-full mr-8">
|
<div class="w-full mr-8">
|
||||||
<span class="block text-sm">{{ numberLabel(stats.task_instances.count) }} / {{ numberLabel(stats.task_instances.total) }}</span>
|
<span class="block text-sm">{{ stats.task_instances.count.toLocaleString() }} / {{ stats.task_instances.total.toLocaleString() }}</span>
|
||||||
<ProgressBar :value="valueTaskInstances" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
<ProgressBar :value="valueTaskInstances" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
||||||
</div>
|
</div>
|
||||||
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.task_instances.ratio) }}</span>
|
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.task_instances.ratio) }}</span>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<p class="h2">Activities</p>
|
<p class="h2">Activities</p>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div class="w-full mr-8">
|
<div class="w-full mr-8">
|
||||||
<span class="block text-sm">{{ numberLabel(stats.tasks.count) }} / {{ numberLabel(stats.tasks.total) }}</span>
|
<span class="block text-sm">{{ stats.tasks.count.toLocaleString() }} / {{ stats.tasks.total.toLocaleString() }}</span>
|
||||||
<ProgressBar :value="valueTasks" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
<ProgressBar :value="valueTasks" :showValue="false" class="!h-2 !rounded-full my-2 !bg-neutral-300"></ProgressBar>
|
||||||
</div>
|
</div>
|
||||||
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.tasks.ratio) }}</span>
|
<span class="block text-primary text-2xl font-medium">{{ getPercentLabel(stats.tasks.ratio) }}</span>
|
||||||
@@ -164,7 +164,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import getNumberLabel from '@/module/numberLabel.js';
|
|
||||||
import getTimeLabel from '@/module/timeLabel.js';
|
import getTimeLabel from '@/module/timeLabel.js';
|
||||||
import getMoment from 'moment';
|
import getMoment from 'moment';
|
||||||
|
|
||||||
@@ -212,12 +211,6 @@ export default {
|
|||||||
moment(time){
|
moment(time){
|
||||||
return getMoment(time).format('YYYY-MM-DD HH:mm');
|
return getMoment(time).format('YYYY-MM-DD HH:mm');
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* @param {number} num use numberLabel.js
|
|
||||||
*/
|
|
||||||
numberLabel(num){
|
|
||||||
return getNumberLabel(num);
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Number to percentage
|
* Number to percentage
|
||||||
* @param {number} val
|
* @param {number} val
|
||||||
|
|||||||
@@ -56,7 +56,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import cytoscapeMapTrace from '@/module/cytoscapeMapTrace.js';
|
import cytoscapeMapTrace from '@/module/cytoscapeMapTrace.js';
|
||||||
import AllMapDataStore from '@/stores/allMapData.js';
|
import AllMapDataStore from '@/stores/allMapData.js';
|
||||||
import numberLabel from '@/module/numberLabel.js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -89,7 +88,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
id: trace.id,
|
id: trace.id,
|
||||||
value: this.progressWidth(Number(((trace.count / sum) * 100).toFixed(1))),
|
value: this.progressWidth(Number(((trace.count / sum) * 100).toFixed(1))),
|
||||||
count: numberLabel(trace.count),
|
count: trace.count.toLocaleString(),
|
||||||
base_count: trace.count,
|
base_count: trace.count,
|
||||||
ratio: this.getPercentLabel(trace.count / sum),
|
ratio: this.getPercentLabel(trace.count / sum),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* 將數字轉換成帶有逗號格式(ex: 1000 -> 1,000)
|
* 將數字轉換成帶有逗號格式(ex: 1000 -> 1,000)
|
||||||
|
* 也可以改用原生 JS 方法 `.toLocaleString('en-US')`
|
||||||
* @param {number} num
|
* @param {number} num
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user