diff --git a/src/views/Upload/index.vue b/src/views/Upload/index.vue index 73ead55..bae177a 100644 --- a/src/views/Upload/index.vue +++ b/src/views/Upload/index.vue @@ -24,14 +24,14 @@ warning

Need to select - [ {{ item }} ], . + {{ item.label }}, .

- [ {{repeatedData[0]}} ] has been assigned. + {{repeatedData[0].label}} has been assigned.

- [ {{ item }} ], + {{ item.label }}, have been assigned.

@@ -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;