fix: Issues #240 done.
This commit is contained in:
@@ -24,14 +24,14 @@
|
||||
<span class="material-symbols-outlined material-fill text-danger">warning</span>
|
||||
<p class="text-danger text-sm">
|
||||
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>
|
||||
<div v-if="repeatedData.length !== 0" class="duration-700">
|
||||
<p v-if="repeatedData.length === 1" class="text-danger text-sm">
|
||||
[ {{repeatedData[0]}} ] has been assigned.
|
||||
{{repeatedData[0].label}} has been assigned.
|
||||
</p>
|
||||
<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.
|
||||
</p>
|
||||
</div>
|
||||
@@ -112,20 +112,19 @@ export default {
|
||||
autoHide: false,
|
||||
},
|
||||
columnType: [
|
||||
{ name: 'Case ID*', code: 'case_id', color: '!text-secondary', value: '' },
|
||||
{ name: 'Timestamp*', code: 'timestamp', color: '!text-secondary', value: '' },
|
||||
{ name: 'Status*', code: 'status', color: '!text-secondary', value: '' },
|
||||
{ name: 'Activity*', code: 'name', color: '!text-secondary', value: '' },
|
||||
{ name: 'Activity Instance ID*', code: 'instance', color: '!text-secondary', value: '' },
|
||||
{ name: 'Case Attribute', code: 'case_attributes', color: '!text-primary', value: '' },
|
||||
// { name: 'Resource', code: '', color: '', value: '' }, // 現階段沒有,未來可能有
|
||||
{ name: 'Not Assigned', code: '', color: '!text-neutral-700', value: '' },
|
||||
{ name: 'Case ID*', code: 'case_id', color: '!text-secondary', value: '', label: 'Case ID', required: true },
|
||||
{ name: 'Timestamp*', code: 'timestamp', color: '!text-secondary', value: '', label: 'Timestamp', required: true },
|
||||
{ name: 'Status*', code: 'status', color: '!text-secondary', value: '', label: 'Status', required: true },
|
||||
{ name: 'Activity*', code: 'name', color: '!text-secondary', value: '', label: 'Activity', required: true },
|
||||
{ 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: '', label: 'Case Attribute', required: false },
|
||||
// { name: 'Resource', code: '', color: '', value: '', label: 'Resource', required: false }, // 現階段沒有,未來可能有
|
||||
{ name: 'Not Assigned', code: '', color: '!text-neutral-700', value: '', label: 'Not Assigned', required: false },
|
||||
],
|
||||
selectedColumns: [],
|
||||
isInform: true, // true: 藍字提示; false: 紅字提示
|
||||
informData: [], // 紅字提示,尚未選擇的 type
|
||||
repeatedData: [], // 紅字提示,重複選擇的 type
|
||||
baseTypeData: ['Case ID*', 'Timestamp*', 'Status*', 'Activity*', 'Activity Instance ID*'],
|
||||
fileName: this.uploadFileName,
|
||||
};
|
||||
},
|
||||
@@ -214,11 +213,11 @@ export default {
|
||||
// 'Not Assigned'、'Case Attribute' 不列入驗證
|
||||
if(!code || code === 'case_attributes') return;
|
||||
nameOccurrences[name]++;
|
||||
this.repeatedData.push(name);
|
||||
this.repeatedData.push(item);
|
||||
}else {
|
||||
nameOccurrences[name] = 1;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user