Discover: Fix SidebarFilter Funnel.

This commit is contained in:
chiayin
2023-04-25 10:47:59 +08:00
parent 280da0731d
commit cbde7b2d4c
4 changed files with 33 additions and 21 deletions

View File

@@ -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,

View File

@@ -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;

View File

@@ -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;

View File

@@ -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>