fix: Issues #203 done.

This commit is contained in:
chiayin
2023-11-20 15:01:06 +08:00
parent 1aba349a76
commit 3254a24740
2 changed files with 5 additions and 4 deletions

View File

@@ -168,9 +168,10 @@ export default {
}, },
}, },
watch: { watch: {
selectArea: function(newValue) { selectArea: function(newValue, oldValue) {
let roundValue = Math.round(newValue[1].toFixed()); let roundValue = Math.round(newValue[1].toFixed());
if(newValue[1] !== roundValue) this.selectArea[1] = roundValue; if(newValue[1] !== roundValue) this.selectArea[1] = roundValue;
if(newValue != oldValue) this.$emit('filter-trace-selectArea', newValue); // 判斷 Apply 是否 disable
}, },
infinite404: function(newValue) { infinite404: function(newValue) {
if(newValue === 404) this.infinitMaxItems = true; if(newValue === 404) this.infinitMaxItems = true;

View File

@@ -87,7 +87,7 @@
<!-- title: Attributes --> <!-- title: Attributes -->
<Attributes v-if="selectValue[0] === 'Attributes'" @select-attribute="getSelectAttribute"></Attributes> <Attributes v-if="selectValue[0] === 'Attributes'" @select-attribute="getSelectAttribute"></Attributes>
<!-- title: Trace --> <!-- title: Trace -->
<Trace v-if="selectValue[0] === 'Trace'" ref="filterTraceView"></Trace> <Trace v-if="selectValue[0] === 'Trace'" ref="filterTraceView" @filter-trace-selectArea="selectTraceArea = $event"></Trace>
<!-- title: Timeframes --> <!-- title: Timeframes -->
<Timeframes v-if="selectValue[0] === 'Timeframes'" :selectValue="selectValue"></Timeframes> <Timeframes v-if="selectValue[0] === 'Timeframes'" :selectValue="selectValue"></Timeframes>
</div> </div>
@@ -96,7 +96,6 @@
<div class="float-right space-x-4 px-4 py-2"> <div class="float-right space-x-4 px-4 py-2">
<button type="button" class="btn btn-sm btn-neutral" @click="reset">Clear</button> <button type="button" class="btn btn-sm btn-neutral" @click="reset">Clear</button>
<button type="button" class="btn btn-sm" @click="submit" :disabled="isDisabledButton" :class="this.isDisabled ? 'btn-disable' : 'btn-neutral'">Apply</button> <button type="button" class="btn btn-sm" @click="submit" :disabled="isDisabledButton" :class="this.isDisabled ? 'btn-disable' : 'btn-neutral'">Apply</button>
<!-- :disabled="isDisabled" -->
</div> </div>
</div> </div>
</div> </div>
@@ -163,6 +162,7 @@ export default {
isEndSelected: null, isEndSelected: null,
isActAllTask: true, isActAllTask: true,
rowData: [], rowData: [],
selectTraceArea: [], // Trace 滑快
isDisabled: true, // Apply Button disabled setting isDisabled: true, // Apply Button disabled setting
} }
}, },
@@ -245,7 +245,7 @@ export default {
} }
break; break;
case 'Trace': // Filter Type 選 Trace 的行為 case 'Trace': // Filter Type 選 Trace 的行為
disabled = false; if(this.selectTraceArea[0] !== this.selectTraceArea[1]) disabled = false;
break; break;
case 'Timeframes': // Filter Type 選 Timeframes 的行為 case 'Timeframes': // Filter Type 選 Timeframes 的行為
if(this.selectTimeFrame.length > 0) disabled = false; if(this.selectTimeFrame.length > 0) disabled = false;