sonar low
This commit is contained in:
@@ -122,16 +122,16 @@ export default {
|
||||
case 'Map':
|
||||
case 'CheckMap':
|
||||
// 沒有 filter Id, 沒有暫存 tempFilterId Id 就不能存檔
|
||||
return this.tempFilterId ? false : true;
|
||||
return !this.tempFilterId;
|
||||
case 'Conformance':
|
||||
case 'CheckConformance':
|
||||
return this.conformanceFilterTempCheckId || this.conformanceLogTempCheckId ? false : true;
|
||||
return !(this.conformanceFilterTempCheckId || this.conformanceLogTempCheckId);
|
||||
}
|
||||
},
|
||||
showIcon: function() {
|
||||
let result = true;
|
||||
|
||||
result = ['FILES', 'UPLOAD'].includes(this.navViewName) ? false : true;
|
||||
result = !['FILES', 'UPLOAD'].includes(this.navViewName);
|
||||
return result;
|
||||
},
|
||||
noShowSaveButton: function() {
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
if(this.$route.params.type === 'filter') {
|
||||
this.createFilterId= this.$route.params.fileId;
|
||||
}
|
||||
this.showNavbarBreadcrumb = this.$route.matched[0].name !== ('AuthContainer') ? true : false;
|
||||
this.showNavbarBreadcrumb = this.$route.matched[0].name !== ('AuthContainer');
|
||||
this.getNavViewName();
|
||||
},
|
||||
methods: {
|
||||
@@ -251,9 +251,12 @@ export default {
|
||||
break;
|
||||
case 'COMPARE':
|
||||
switch(name) {
|
||||
case 'dummy':
|
||||
case 'CompareDashboard':
|
||||
valueToSet = 'DASHBOARD';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -274,7 +277,6 @@ export default {
|
||||
*/
|
||||
async saveModal() {
|
||||
// 協助判斷 MAP, CONFORMANCE 儲存有「送出」或「取消」。
|
||||
let isSaved;
|
||||
// 傳給 Map,通知 Sidebar 要關閉。
|
||||
this.$emitter.emit('saveModal', false);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ export async function saveFilter(addFilterId, next = null) {
|
||||
* @param { string } value File's name
|
||||
*/
|
||||
export async function savedSuccessfully(value) {
|
||||
value = value ? value : '';
|
||||
value = value || '';
|
||||
await Swal.fire({
|
||||
title: 'SAVE COMPLETE',
|
||||
html: `<span class="text-primary">${value}</span> has been saved in Lucia.`,
|
||||
|
||||
@@ -214,7 +214,7 @@ export default defineStore('filesStore', {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
const response = await axios.put(api, data);
|
||||
await axios.put(api, data);
|
||||
this.uploadFileName = null;
|
||||
await this.fetchAllFiles();
|
||||
} catch(error) {
|
||||
|
||||
@@ -116,26 +116,30 @@
|
||||
</ul>
|
||||
</div>
|
||||
<!-- All Files type of grid -->
|
||||
<draggable tag="ul" :list="compareData" :group="{ name: 'files' }" itemKey="name" class="flex justify-start items-start gap-4 flex-wrap overflow-y-scroll overflow-x-hidden max-h-[calc(100vh_-_440px)] scrollbar" id="compareGridCards">
|
||||
<template #item="{ element, index }">
|
||||
<li class="w-[216px] h-[168px] p-4 border rounded border-neutral-300 hover:bg-primary/10 hover:border-primary duration-300 flex flex-col justify-between cursor-pointer" :title="element.name" :id="'compareFile' + index">
|
||||
<div>
|
||||
<span class="material-symbols-outlined mb-2 !text-[32px] block">
|
||||
{{ element.icon }}
|
||||
</span>
|
||||
<h3 class="text-sm font-medium mb-2 whitespace-nowrap break-keep overflow-hidden text-ellipsis leading-tight">
|
||||
{{ element.name }}
|
||||
</h3>
|
||||
<p class="text-sm text-neutral-500 whitespace-nowrap break-keep text-ellipsis overflow-hidden leading-tight">
|
||||
{{ element.parentLog }}
|
||||
<ul>
|
||||
<draggable tag="ul" :list="compareData" :group="{ name: 'files' }" itemKey="name" class="flex justify-start items-start gap-4
|
||||
flex-wrap overflow-y-scroll overflow-x-hidden max-h-[calc(100vh_-_440px)] scrollbar" id="compareGridCards">
|
||||
<template #item="{ element, index }">
|
||||
<li class="w-[216px] h-[168px] p-4 border rounded border-neutral-300 hover:bg-primary/10 hover:border-primary duration-300
|
||||
flex flex-col justify-between cursor-pointer" :title="element.name" :id="'compareFile' + index">
|
||||
<div>
|
||||
<span class="material-symbols-outlined mb-2 !text-[32px] block">
|
||||
{{ element.icon }}
|
||||
</span>
|
||||
<h3 class="text-sm font-medium mb-2 whitespace-nowrap break-keep overflow-hidden text-ellipsis leading-tight">
|
||||
{{ element.name }}
|
||||
</h3>
|
||||
<p class="text-sm text-neutral-500 whitespace-nowrap break-keep text-ellipsis overflow-hidden leading-tight">
|
||||
{{ element.parentLog }}
|
||||
</p>
|
||||
</div>
|
||||
<p class="text-sm text-neutral-500">
|
||||
{{ element.updated_at }}
|
||||
</p>
|
||||
</div>
|
||||
<p class="text-sm text-neutral-500">
|
||||
{{ element.updated_at }}
|
||||
</p>
|
||||
</li>
|
||||
</template>
|
||||
</draggable>
|
||||
</li>
|
||||
</template>
|
||||
</draggable>
|
||||
</ul>
|
||||
</section>
|
||||
<!-- All & Discover -->
|
||||
<section v-else>
|
||||
@@ -320,7 +324,7 @@
|
||||
* Compare Submit button disabled
|
||||
*/
|
||||
isCompareDisabledButton: function() {
|
||||
let result = this.primaryDragData.length === 0 || this.secondaryDragData.length === 0 ? true : false;
|
||||
let result = this.primaryDragData.length === 0 || this.secondaryDragData.length === 0;
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user