sonar 41 left
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
v-closable="{id: size, handler: onClose}">
|
||||
<div class="duration-box" v-for="(unit, index) in inputTypes" :key="unit">
|
||||
<input
|
||||
id="input_duration_dhms"
|
||||
type="text"
|
||||
class="duration duration-val input-dhms-field"
|
||||
:data-index="index"
|
||||
@@ -32,7 +33,7 @@
|
||||
@keyup="onKeyUp"
|
||||
v-model="inputTimeFields[index]"
|
||||
/>
|
||||
<label class="duration">{{ tUnits[unit].dsp }}</label>
|
||||
<label class="duration" for="input_duration_dhms">{{ tUnits[unit].dsp }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -266,7 +266,7 @@ export async function uploadFailedSecond(detail) {
|
||||
|
||||
detail.forEach(i => {
|
||||
let content = '';
|
||||
|
||||
let key = '';
|
||||
switch (i.type) {
|
||||
case 'too_many':
|
||||
manySrt = 'There are more errors.';
|
||||
@@ -278,8 +278,6 @@ export async function uploadFailedSecond(detail) {
|
||||
content = `<li>Data malformed in Timestamp Column: (Row #${i.loc[1]}, "${i.input}")</li>`;
|
||||
break;
|
||||
case 'missing':
|
||||
let key = '';
|
||||
|
||||
switch (i.loc[2]) {
|
||||
case 'case id':
|
||||
key = 'Case ID';
|
||||
|
||||
@@ -113,10 +113,17 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
// 可使用 parseInt(整數) parseFloat(浮點數) 將字串轉為數字
|
||||
// Relative 要轉為百分比 %
|
||||
if(node.data('type') === 'activity') {
|
||||
let textInt;
|
||||
let textFloat;
|
||||
let textDurRel;
|
||||
let timeLabelInt;
|
||||
let timeLabelFloat;
|
||||
let textTimeLabel;
|
||||
|
||||
switch(dataLayerType) {
|
||||
case 'freq': // Frequency
|
||||
let textInt = dataLayerOption === 'rel_freq' ? text + optionValue * 100 + "%" : text + optionValue;
|
||||
let textFloat = dataLayerOption === 'rel_freq'? text + (optionValue * 100).toFixed(2) + "%" : text + optionValue.toFixed(2);
|
||||
textInt = dataLayerOption === 'rel_freq' ? text + optionValue * 100 + "%" : text + optionValue;
|
||||
textFloat = dataLayerOption === 'rel_freq'? text + (optionValue * 100).toFixed(2) + "%" : text + optionValue.toFixed(2);
|
||||
|
||||
// 判斷是否為整數,若非整數要取小數點後面兩個值。
|
||||
text = Math.trunc(optionValue) === optionValue ? textInt : textFloat;
|
||||
@@ -124,13 +131,13 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
|
||||
case 'duration': // Duration 除了 Relative 為百分比 % ,其他要轉變時間單位。
|
||||
// Relative %
|
||||
let textDurRel = text + (optionValue * 100).toFixed(2) + "%";
|
||||
textDurRel = text + (optionValue * 100).toFixed(2) + "%";
|
||||
// Timelabel
|
||||
let timeLabelInt = text + getTimeLabel(optionValue);
|
||||
let timeLabelFloat = text + getTimeLabel(optionValue.toFixed(2));
|
||||
timeLabelInt = text + getTimeLabel(optionValue);
|
||||
timeLabelFloat = text + getTimeLabel(optionValue.toFixed(2));
|
||||
|
||||
// 判斷是否為整數,若非整數要取小數點後面兩個值。
|
||||
let textTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
textTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
|
||||
text = dataLayerOption === 'rel_duration' ? textDurRel : textTimeLabel;
|
||||
break;
|
||||
@@ -169,13 +176,18 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
'content': function(edge) { // 關係線顯示的文字
|
||||
let optionValue = edge.data(`${dataLayerType}.${dataLayerOption}`);
|
||||
let result = '';
|
||||
|
||||
let edgeInt;
|
||||
let edgeFloat;
|
||||
let edgeDurRel;
|
||||
let timeLabelInt;
|
||||
let timeLabelFloat;
|
||||
let edgeTimeLabel;
|
||||
if(optionValue === '') return optionValue;
|
||||
|
||||
switch(dataLayerType) {
|
||||
case 'freq':
|
||||
let edgeInt = dataLayerOption === 'rel_freq' ? optionValue * 100 + "%" : optionValue;
|
||||
let edgeFloat = dataLayerOption === 'rel_freq' ? (optionValue * 100).toFixed(2) + "%" : optionValue.toFixed(2);
|
||||
edgeInt = dataLayerOption === 'rel_freq' ? optionValue * 100 + "%" : optionValue;
|
||||
edgeFloat = dataLayerOption === 'rel_freq' ? (optionValue * 100).toFixed(2) + "%" : optionValue.toFixed(2);
|
||||
|
||||
// 判斷是否為整數,若非整數要取小數點後面兩個值。
|
||||
result = Math.trunc(optionValue) === optionValue ? edgeInt : edgeFloat;
|
||||
@@ -183,11 +195,11 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
|
||||
case 'duration': // Duration 除了 Relative 為百分比 % ,其他要轉變時間單位。
|
||||
// Relative %
|
||||
let edgeDurRel = (optionValue * 100).toFixed(2) + "%";
|
||||
edgeDurRel = (optionValue * 100).toFixed(2) + "%";
|
||||
// Timelabel
|
||||
let timeLabelInt = getTimeLabel(optionValue);
|
||||
let timeLabelFloat = getTimeLabel(optionValue.toFixed(2));
|
||||
let edgeTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
timeLabelInt = getTimeLabel(optionValue);
|
||||
timeLabelFloat = getTimeLabel(optionValue.toFixed(2));
|
||||
edgeTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
|
||||
result = dataLayerOption === 'rel_duration' ? edgeDurRel : edgeTimeLabel;
|
||||
break;
|
||||
|
||||
@@ -99,7 +99,7 @@ export default {
|
||||
// .*$:匹配剩餘的字符,確保完整的提取。
|
||||
// |^.*$:在找不到 "luciaToken" 的情況下,匹配整個字符串。
|
||||
// 實際應用
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
|
||||
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
||||
switch (to.params.type) {
|
||||
|
||||
@@ -468,7 +468,7 @@ export default {
|
||||
if (isCheckPage) {
|
||||
const conformanceStore = ConformanceStore();
|
||||
// Save token in Headers.
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
|
||||
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
||||
switch (to.params.type) {
|
||||
|
||||
@@ -912,7 +912,7 @@ export default {
|
||||
if (isCheckPage) {
|
||||
const conformanceStore = ConformanceStore();
|
||||
// Save token in Headers.
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
|
||||
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
||||
switch (to.params.type) {
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<table class="text-sm border-separate border-spacing-0 h-full overflow-y-auto overflow-x-auto scrollbar">
|
||||
<caption class="hidden">Upload</caption>
|
||||
<thead class="sticky top-0 bg-neutral-10">
|
||||
<tr class="hidden"><th></th></tr>
|
||||
<tr>
|
||||
<td v-for="(item, index) in uploadDetail?.columns" :key="index" class="border border-neutral-500 p-2 truncate max-w-[198px]">{{ item }}</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user