Discover: Fix SidebarFilter Funnel.
This commit is contained in:
@@ -45,24 +45,25 @@
|
||||
import Search from '@/components/Search.vue';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
tableTitle: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
tableData: {
|
||||
type: Array,
|
||||
require: true,
|
||||
},
|
||||
tableSelect: {
|
||||
type: Array,
|
||||
require: true,
|
||||
},
|
||||
progressWidth: {
|
||||
type: Function,
|
||||
require: false,
|
||||
}
|
||||
},
|
||||
props: ['tableTitle', 'tableData', 'tableSelect', 'progressWidth'],
|
||||
// {
|
||||
// tableTitle: {
|
||||
// type: String,
|
||||
// require: true,
|
||||
// },
|
||||
// tableData: {
|
||||
// type: Array,
|
||||
// require: true,
|
||||
// },
|
||||
// tableSelect: {
|
||||
// type: Array,
|
||||
// require: true,
|
||||
// },
|
||||
// progressWidth: {
|
||||
// type: Function,
|
||||
// require: false,
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
select: this.tableSelect,
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<div class=" w-full h-full">
|
||||
<div class="h-[calc(100%_-_58px)] border-b border-neutral-400 mb-2 overflow-y-auto overflow-x-auto scrollbar">
|
||||
temporaryData:{{ temporaryData }}<br/>
|
||||
postRuleData:{{ postRuleData }}<br/>
|
||||
isRuleData:{{ isRuleData }}<br/>
|
||||
ruleData:{{ ruleData }}<br/>
|
||||
<div v-if="this.temporaryData.length === 0" class="h-full flex justify-center items-center">
|
||||
<span class="text-neutral-500">No Filter.</span>
|
||||
</div>
|
||||
@@ -76,6 +80,7 @@ export default {
|
||||
// header:Funnel 發送暫存的選取資料
|
||||
async submitAll() {
|
||||
this.postRuleData = this.temporaryData.filter(item => item !== 0); // 取得 submit 的資料,有 toggle button 的話,找出並刪除陣列中為 0 的項目
|
||||
if(!this.postRuleData?.length) return this.$toast.error('Not selected');
|
||||
await this.allMapDataStore.checkHasResult();
|
||||
|
||||
if(this.hasResultRule === null) return;
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<div class="space-y-2 w-[calc(100%_-_240px)] h-[calc(100%_-_106px)]">
|
||||
<p class="h2 ml-1">Activity Select</p>
|
||||
<!-- Filter task Data-->
|
||||
<ActOccCase v-if="selectValue[0] === 'Sequence' && selectValue[1] === 'Have activity(s)'" :tableTitle="'Activity List'" :tableData="filterTaskData" :tableSelect="selectFilterTask" :progressWidth ="progressWidth" @on-row-select="onRowAct"></ActOccCase>
|
||||
<ActOccCase v-if="selectValue[0] === 'Sequence' && selectValue[1] === 'Have activity(s)'" :tableTitle="'Activity List'" :tableData="filterAllTaskData" :tableSelect="selectFilterTask" :progressWidth ="progressWidth" @on-row-select="onRowAct"></ActOccCase>
|
||||
<!-- Filter Start Data -->
|
||||
<ActOcc v-if="selectValue[0] === 'Sequence' && selectValue[1] === 'Start activity / end activity' && selectValue[2] === 'Start'" :tableTitle="'Start activity'" :tableData="filterStartData" :tableSelect="selectFilterStart" :progressWidth ="progressWidth" @on-row-select="onRowStart"></ActOcc>
|
||||
<!-- Filter End Data -->
|
||||
@@ -151,8 +151,12 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
// All Task
|
||||
filterAllTaskData: function() {
|
||||
return this.setHaveAct([...this.filterTasks]);
|
||||
},
|
||||
// Act And Seq
|
||||
filterTaskData: function() {
|
||||
return this.isActAllTask? this.setHaveAct(this.filterTasks) : this.filterTaskData;
|
||||
return this.isActAllTask? this.setHaveAct([...this.filterTasks]) : this.filterTaskData;
|
||||
},
|
||||
// Start and End Task
|
||||
filterStartData: function() {
|
||||
@@ -433,8 +437,9 @@ export default {
|
||||
this.isRuleData = Array.from(this.temporaryData);
|
||||
this.ruleData = this.isRuleData.map(e => this.setRule(e));
|
||||
}else {
|
||||
this.temporaryData.push(...postData);
|
||||
this.isRuleData.push(...postData);
|
||||
this.ruleData = this.isRuleData.map(e => this.setRule(e));
|
||||
this.ruleData.push(this.setRule(...postData));
|
||||
}
|
||||
this.reset(false);
|
||||
this.isLoading = true;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<!-- Other Page: Save and Download -->
|
||||
<!-- Save 有 data 跳重新命名,沒有 data 跳要不要儲存,沒有跳動都不跳 -->
|
||||
<div v-else class="space-x-4">
|
||||
<button class="btn btn-sm btn-neutral">Save</button>
|
||||
<button class="btn btn-sm btn-neutral">Download</button>
|
||||
|
||||
Reference in New Issue
Block a user