fix: Issues #240 done.

This commit is contained in:
chiayin
2024-03-05 15:21:24 +08:00
parent 0503da4a3d
commit e622f1b6fe

View File

@@ -24,14 +24,14 @@
<span class="material-symbols-outlined material-fill text-danger">warning</span> <span class="material-symbols-outlined material-fill text-danger">warning</span>
<p class="text-danger text-sm"> <p class="text-danger text-sm">
Need to select Need to select
<span v-for="(item, index) in informData" :key="index">[ {{ item }} ]<span v-if="index !== informData.length - 1">, </span></span>. <span v-for="(item, index) in informData" :key="index">{{ item.label }}<span v-if="index !== informData.length - 1">, </span></span>.
</p> </p>
<div v-if="repeatedData.length !== 0" class="duration-700"> <div v-if="repeatedData.length !== 0" class="duration-700">
<p v-if="repeatedData.length === 1" class="text-danger text-sm"> <p v-if="repeatedData.length === 1" class="text-danger text-sm">
[ {{repeatedData[0]}} ] has been assigned. {{repeatedData[0].label}} has been assigned.
</p> </p>
<p v-else class="text-danger text-sm"> <p v-else class="text-danger text-sm">
<span v-for="(item, index) in repeatedData" :key="index">[ {{ item }} ]<span v-if="index !== repeatedData.length - 1">, </span></span> <span v-for="(item, index) in repeatedData" :key="index">{{ item.label }}<span v-if="index !== repeatedData.length - 1">, </span></span>
have been assigned. have been assigned.
</p> </p>
</div> </div>
@@ -112,20 +112,19 @@ export default {
autoHide: false, autoHide: false,
}, },
columnType: [ columnType: [
{ name: 'Case ID*', code: 'case_id', color: '!text-secondary', value: '' }, { name: 'Case ID*', code: 'case_id', color: '!text-secondary', value: '', label: 'Case ID', required: true },
{ name: 'Timestamp*', code: 'timestamp', color: '!text-secondary', value: '' }, { name: 'Timestamp*', code: 'timestamp', color: '!text-secondary', value: '', label: 'Timestamp', required: true },
{ name: 'Status*', code: 'status', color: '!text-secondary', value: '' }, { name: 'Status*', code: 'status', color: '!text-secondary', value: '', label: 'Status', required: true },
{ name: 'Activity*', code: 'name', color: '!text-secondary', value: '' }, { name: 'Activity*', code: 'name', color: '!text-secondary', value: '', label: 'Activity', required: true },
{ name: 'Activity Instance ID*', code: 'instance', color: '!text-secondary', value: '' }, { name: 'Activity Instance ID*', code: 'instance', color: '!text-secondary', value: '', label: 'Activity Instance ID', required: true },
{ name: 'Case Attribute', code: 'case_attributes', color: '!text-primary', value: '' }, { name: 'Case Attribute', code: 'case_attributes', color: '!text-primary', value: '', label: 'Case Attribute', required: false },
// { name: 'Resource', code: '', color: '', value: '' }, // 現階段沒有,未來可能有 // { name: 'Resource', code: '', color: '', value: '', label: 'Resource', required: false }, // 現階段沒有,未來可能有
{ name: 'Not Assigned', code: '', color: '!text-neutral-700', value: '' }, { name: 'Not Assigned', code: '', color: '!text-neutral-700', value: '', label: 'Not Assigned', required: false },
], ],
selectedColumns: [], selectedColumns: [],
isInform: true, // true: 藍字提示; false: 紅字提示 isInform: true, // true: 藍字提示; false: 紅字提示
informData: [], // 紅字提示,尚未選擇的 type informData: [], // 紅字提示,尚未選擇的 type
repeatedData: [], // 紅字提示,重複選擇的 type repeatedData: [], // 紅字提示,重複選擇的 type
baseTypeData: ['Case ID*', 'Timestamp*', 'Status*', 'Activity*', 'Activity Instance ID*'],
fileName: this.uploadFileName, fileName: this.uploadFileName,
}; };
}, },
@@ -214,11 +213,11 @@ export default {
// 'Not Assigned'、'Case Attribute' 不列入驗證 // 'Not Assigned'、'Case Attribute' 不列入驗證
if(!code || code === 'case_attributes') return; if(!code || code === 'case_attributes') return;
nameOccurrences[name]++; nameOccurrences[name]++;
this.repeatedData.push(name); this.repeatedData.push(item);
}else { }else {
nameOccurrences[name] = 1; nameOccurrences[name] = 1;
selectedData.push(name); selectedData.push(name);
this.informData = this.baseTypeData.filter(item => !selectedData.includes(item)); this.informData = this.columnType.filter(item => item.required ? !selectedData.includes(item.name) : false);
} }
}); });
this.isInform = (this.informData.length === 0 && this.repeatedData.length === 0) ? true : false; this.isInform = (this.informData.length === 0 && this.repeatedData.length === 0) ? true : false;