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 inside = (ctx, value) => ctx.p0DataIndex >= start && ctx.p1DataIndex <= end ? value : undefined;
|
||||||
const outside = (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 = {
|
this.timeChartData = {
|
||||||
labels: formattedXVal,
|
labels: formattedXVal,
|
||||||
datasets: [
|
datasets: [
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import filesStore from '@/stores/files.js';
|
import filesStore from '@/stores/files.js';
|
||||||
@@ -197,10 +196,6 @@ export default {
|
|||||||
}
|
}
|
||||||
break;
|
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
|
* Save button' modal
|
||||||
@@ -227,7 +222,7 @@ export default {
|
|||||||
await saveFilter(this.allMapDataStore.addFilterId);
|
await saveFilter(this.allMapDataStore.addFilterId);
|
||||||
// 存檔後為 filterID,換網址不跳頁,使用 push 記錄歷史路由
|
// 存檔後為 filterID,換網址不跳頁,使用 push 記錄歷史路由
|
||||||
await this.$router.push(`/discover/filter/${this.createFilterId}/map`);
|
await this.$router.push(`/discover/filter/${this.createFilterId}/map`);
|
||||||
console.log('Check Map save filter need to check_id');
|
break;
|
||||||
case 'Conformance':
|
case 'Conformance':
|
||||||
case 'CheckConformance':
|
case 'CheckConformance':
|
||||||
// 先判斷有沒有 check Id,有就儲存 return,沒有就往下走
|
// 先判斷有沒有 check Id,有就儲存 return,沒有就往下走
|
||||||
@@ -247,7 +242,6 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
#searchFiles::-webkit-search-cancel-button{
|
#searchFiles::-webkit-search-cancel-button{
|
||||||
appearance: none;
|
appearance: none;
|
||||||
|
|||||||
@@ -107,49 +107,6 @@ const routes = [
|
|||||||
file: {}, // parent log or parent filter
|
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'});
|
this.$router.push({name: 'Upload'});
|
||||||
Swal.close(); // 關閉進度條
|
Swal.close(); // 關閉進度條
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
console.log(error);
|
|
||||||
if(error.response.status === 422) {
|
if(error.response.status === 422) {
|
||||||
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv'
|
// 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'
|
// type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix'
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ export default defineStore('loginStore', {
|
|||||||
async refreshTokenLogin() {
|
async refreshTokenLogin() {
|
||||||
const api = '/api/oauth/token';
|
const api = '/api/oauth/token';
|
||||||
const refreshToken = document.cookie.replace(/(?:(?:^|.*;\s*)luciaRefreshToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
const refreshToken = document.cookie.replace(/(?:(?:^|.*;\s*)luciaRefreshToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||||
console.log(document.cookie);
|
|
||||||
|
|
||||||
|
|
||||||
this.auth.grant_type = 'refresh_token';
|
this.auth.grant_type = 'refresh_token';
|
||||||
this.auth.refresh_token = refreshToken;
|
this.auth.refresh_token = refreshToken;
|
||||||
|
|||||||
@@ -370,18 +370,18 @@ export default {
|
|||||||
switch (routeParams.type) {
|
switch (routeParams.type) {
|
||||||
case 'log':
|
case 'log':
|
||||||
if(!isCheckPage) {
|
if(!isCheckPage) {
|
||||||
this.logId = routeParams.fileId;
|
this.logId = await routeParams.fileId;
|
||||||
this.baseLogId = routeParams.fileId;
|
this.baseLogId = await routeParams.fileId;
|
||||||
} else {
|
} else {
|
||||||
this.logId = file.parent.id;
|
this.logId = await file.parent.id;
|
||||||
this.baseLogId = file.parent.id;
|
this.baseLogId = await file.parent.id;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'filter':
|
case 'filter':
|
||||||
if(!isCheckPage) {
|
if(!isCheckPage) {
|
||||||
this.createFilterId = routeParams.fileId;
|
this.createFilterId = await routeParams.fileId;
|
||||||
} else {
|
} else {
|
||||||
this.createFilterId = file.parent.id;
|
this.createFilterId = await file.parent.id;
|
||||||
}
|
}
|
||||||
// 取得 logID 和上次儲存的 Funnel
|
// 取得 logID 和上次儲存的 Funnel
|
||||||
await this.allMapDataStore.fetchFunnel(this.createFilterId);
|
await this.allMapDataStore.fetchFunnel(this.createFilterId);
|
||||||
|
|||||||
@@ -613,9 +613,9 @@ export default {
|
|||||||
let id;
|
let id;
|
||||||
|
|
||||||
if(!isCheckPage) {
|
if(!isCheckPage) {
|
||||||
id = routeParams.fileId;
|
id = await routeParams.fileId;
|
||||||
} else {
|
} else {
|
||||||
id = file.parent.id;
|
id = await file.parent.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取得 Performance Data
|
// 取得 Performance Data
|
||||||
@@ -648,7 +648,6 @@ export default {
|
|||||||
const conformanceStore = ConformanceStore();
|
const conformanceStore = ConformanceStore();
|
||||||
// Save token in Headers.
|
// Save token in Headers.
|
||||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||||
let data;
|
|
||||||
|
|
||||||
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
||||||
switch (to.params.type) {
|
switch (to.params.type) {
|
||||||
|
|||||||
@@ -210,7 +210,6 @@
|
|||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import LoginStore from '@/stores/login.js';
|
import LoginStore from '@/stores/login.js';
|
||||||
@@ -226,8 +225,6 @@
|
|||||||
import IconGrid from '@/components/icons/IconGrid.vue';
|
import IconGrid from '@/components/icons/IconGrid.vue';
|
||||||
import { renameModal, deleteFileModal } from '@/module/alertModal.js';
|
import { renameModal, deleteFileModal } from '@/module/alertModal.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -564,7 +561,6 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
:deep(thead) {
|
: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
|
@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