refactor: Discover Router Save done.

This commit is contained in:
chiayin
2024-03-19 16:29:29 +08:00
parent 6663b48159
commit 483f6a026d
8 changed files with 9 additions and 68 deletions

View File

@@ -625,8 +625,6 @@ export default {
const inside = (ctx, value) => ctx.p0DataIndex >= start && ctx.p1DataIndex <= end ? value : undefined;
const outside = (ctx, value) => ctx.p0DataIndex < start || ctx.p1DataIndex > end ? value : undefined;
// console.log(formattedXVal);
this.timeChartData = {
labels: formattedXVal,
datasets: [

View File

@@ -49,7 +49,6 @@
</div>
</nav>
</template>
<script>
import { storeToRefs } from 'pinia';
import filesStore from '@/stores/files.js';
@@ -197,10 +196,6 @@ export default {
}
break;
}
// if(this.navViewName === 'DISCOVER') {
// if(name === 'Map' || name === 'CheckMap') this.isActive = 'MAP';
// else if(name === 'Conformance' || name === 'CheckConformance') this.isActive = 'CONFORMANCE';
// }
},
/**
* Save button' modal
@@ -227,7 +222,7 @@ export default {
await saveFilter(this.allMapDataStore.addFilterId);
// 存檔後為 filterID換網址不跳頁使用 push 記錄歷史路由
await this.$router.push(`/discover/filter/${this.createFilterId}/map`);
console.log('Check Map save filter need to check_id');
break;
case 'Conformance':
case 'CheckConformance':
// 先判斷有沒有 check Id有就儲存 return沒有就往下走
@@ -247,7 +242,6 @@ export default {
},
}
</script>
<style scoped>
#searchFiles::-webkit-search-cancel-button{
appearance: none;

View File

@@ -107,49 +107,6 @@ const routes = [
file: {}, // parent log or parent filter
}
},
// {
// // type: log | filter | log-check | filter-check
// path: "/discover/map/:type/:fileId",
// name: "Map",
// component: Map,
// mate: {
// parent: {}, // parent log or parent filter
// base: {} // { type: 'rule', fileId: rule id }
// }
// },
// {
// // type: log | filter | rule(名稱待討論)
// path: "/discover/conformance/:type/:fileId",
// name: "Conformance",
// component: Conformance,
// mate: {
// parent: {}, // parent log or parent filter
// base: {} // { type: 'rule', fileId: rule id }
// }
// },
// {
// // type: rule(名稱待討論)
// // checkType: log | filter
// path: "/:type/:checkType/:checkId/map/:checkFileId",
// name: "CheckMap",
// component: Map,
// props: true,
// },
// {
// path: "/:type/:checkType/:checkId/conformance/:checkFileId",
// name: "CheckConformance",
// component: Conformance,
// props: true,
// },
// {
// path: "/discover/performance/:type/:fileId",
// name: "Performance",
// component: Performance,
// mate: {
// parent: {}, // parent log or parent filter
// base: {} // { type: 'rule', fileId: rule id }
// }
// }
]
},
{

View File

@@ -128,7 +128,6 @@ export default defineStore('filesStore', {
this.$router.push({name: 'Upload'});
Swal.close(); // 關閉進度條
} catch(error) {
console.log(error);
if(error.response.status === 422) {
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv'
// type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix'

View File

@@ -49,8 +49,6 @@ export default defineStore('loginStore', {
async refreshTokenLogin() {
const api = '/api/oauth/token';
const refreshToken = document.cookie.replace(/(?:(?:^|.*;\s*)luciaRefreshToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
console.log(document.cookie);
this.auth.grant_type = 'refresh_token';
this.auth.refresh_token = refreshToken;

View File

@@ -370,18 +370,18 @@ export default {
switch (routeParams.type) {
case 'log':
if(!isCheckPage) {
this.logId = routeParams.fileId;
this.baseLogId = routeParams.fileId;
this.logId = await routeParams.fileId;
this.baseLogId = await routeParams.fileId;
} else {
this.logId = file.parent.id;
this.baseLogId = file.parent.id;
this.logId = await file.parent.id;
this.baseLogId = await file.parent.id;
}
break;
case 'filter':
if(!isCheckPage) {
this.createFilterId = routeParams.fileId;
this.createFilterId = await routeParams.fileId;
} else {
this.createFilterId = file.parent.id;
this.createFilterId = await file.parent.id;
}
// 取得 logID 和上次儲存的 Funnel
await this.allMapDataStore.fetchFunnel(this.createFilterId);

View File

@@ -613,9 +613,9 @@ export default {
let id;
if(!isCheckPage) {
id = routeParams.fileId;
id = await routeParams.fileId;
} else {
id = file.parent.id;
id = await file.parent.id;
}
// 取得 Performance Data
@@ -648,7 +648,6 @@ export default {
const conformanceStore = ConformanceStore();
// Save token in Headers.
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
let data;
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
switch (to.params.type) {

View File

@@ -210,7 +210,6 @@
</ContextMenu>
</div>
</template>
<script>
import { storeToRefs } from 'pinia';
import LoginStore from '@/stores/login.js';
@@ -226,8 +225,6 @@
import IconGrid from '@/components/icons/IconGrid.vue';
import { renameModal, deleteFileModal } from '@/module/alertModal.js';
export default {
data() {
return {
@@ -564,7 +561,6 @@
},
}
</script>
<style scoped>
:deep(thead) {
@apply sticky top-0 bg-neutral-10 after:border-b after:border-neutral-500 after:w-full after:left-0 after:bottom-0 after:absolute table table-fixed w-full