refactor: Discover Router Save done.
This commit is contained in:
@@ -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: [
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 }
|
||||
// }
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user