insight path blue radio button
This commit is contained in:
@@ -187,11 +187,35 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel v-for="([field, label], i) in fieldNamesAndLabelNames" :key="i" :header="label" contentClass="text-sm">
|
<TabPanel v-for="([field, label], i) in fieldNamesAndLabelNames" :key="i" :header="label"
|
||||||
<p v-if="insights[field].length === 0">No data</p>
|
contentClass="text-sm">
|
||||||
<ul v-else class="ml-6 space-y-1">
|
<p v-if="insights[field].length === 0" class="bg-neutral-100 p-2 rounded">No data</p>
|
||||||
|
<ul v-else class="ml-1 space-y-1">
|
||||||
<li v-for="(item, key2) in insights[field]" :key="key2"
|
<li v-for="(item, key2) in insights[field]" :key="key2"
|
||||||
class="mb-2">
|
class="mb-2 flex bg-neutral-100 p-2 rounded">
|
||||||
|
<div class="flex left-col mr-1">
|
||||||
|
<input type="radio" name="customRadio" :value="key2" v-model="selectedPath"
|
||||||
|
class="hidden peer" @click="onPathOptionClick(key2)"
|
||||||
|
/>
|
||||||
|
<span @click="onPathOptionClick(key2)"
|
||||||
|
:class="[
|
||||||
|
'w-[18px] h-[18px] rounded-full border-2 inline-flex items-center justify-center cursor-pointer bg-[#FFFFFF]',
|
||||||
|
selectedPath === key2
|
||||||
|
? 'border-[#0099FF]'
|
||||||
|
: 'border-[#CBD5E1]'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
:class="[
|
||||||
|
'w-[9px] h-[9px] rounded-full transition-opacity cursor-pointer',
|
||||||
|
selectedPath === key2
|
||||||
|
? 'bg-[#0099FF]'
|
||||||
|
: 'opacity-0'
|
||||||
|
]"
|
||||||
|
></div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="right-col">
|
||||||
<span v-for="(value, index) in item" :key="index">
|
<span v-for="(value, index) in item" :key="index">
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<span v-if="index !== item.length - 1">
|
<span v-if="index !== item.length - 1">
|
||||||
@@ -200,6 +224,7 @@
|
|||||||
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
@@ -211,18 +236,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { computed, } from 'vue';
|
import { computed, ref, } from 'vue';
|
||||||
import PageAdmin from '@/stores/pageAdmin';
|
import PageAdmin from '@/stores/pageAdmin';
|
||||||
import { getTimeLabel } from '@/module/timeLabel.js';
|
import { getTimeLabel } from '@/module/timeLabel.js';
|
||||||
import getMoment from 'moment';
|
import getMoment from 'moment';
|
||||||
import i18next from '@/i18n/i18n';
|
import i18next from '@/i18n/i18n';
|
||||||
|
|
||||||
const fieldNamesAndLabelNames = [
|
const fieldNamesAndLabelNames = [
|
||||||
['self_loops', 'Self-Loop'],
|
['self_loops', 'Self-Loop'],
|
||||||
['short_loops', 'Short-Loop'],
|
['short_loops', 'Short-Loop'],
|
||||||
['shortest_traces', 'Shortest Trace'],
|
['shortest_traces', 'Shortest Trace'],
|
||||||
['longest_traces', 'Longest Trace'],
|
['longest_traces', 'Longest Trace'],
|
||||||
['most_freq_traces', 'Most Frequent Trace'],
|
['most_freq_traces', 'Most Frequent Trace'],
|
||||||
];
|
];
|
||||||
// 刪除第一個和第二個元素
|
// 刪除第一個和第二個元素
|
||||||
fieldNamesAndLabelNames.splice(0, 2);
|
fieldNamesAndLabelNames.splice(0, 2);
|
||||||
@@ -245,11 +270,18 @@ export default {
|
|||||||
const pageAdmin = PageAdmin();
|
const pageAdmin = PageAdmin();
|
||||||
|
|
||||||
const currentMapFile = computed(() => pageAdmin.currentMapFile);
|
const currentMapFile = computed(() => pageAdmin.currentMapFile);
|
||||||
|
const selectedPath = ref(0);
|
||||||
|
|
||||||
|
const onPathOptionClick = (clickedPath) => {
|
||||||
|
selectedPath.value = clickedPath;
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentMapFile,
|
currentMapFile,
|
||||||
i18next,
|
i18next,
|
||||||
fieldNamesAndLabelNames,
|
fieldNamesAndLabelNames,
|
||||||
|
selectedPath,
|
||||||
|
onPathOptionClick,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -323,7 +355,7 @@ export default {
|
|||||||
@apply hidden
|
@apply hidden
|
||||||
}
|
}
|
||||||
:deep(.p-tabview-panels) {
|
:deep(.p-tabview-panels) {
|
||||||
@apply !bg-neutral-100 p-2 rounded
|
@apply p-2 rounded
|
||||||
}
|
}
|
||||||
:deep(.p-tabview-panel) {
|
:deep(.p-tabview-panel) {
|
||||||
@apply animate-fadein
|
@apply animate-fadein
|
||||||
|
|||||||
Reference in New Issue
Block a user