Skip to content

Commit

Permalink
✨ zoom image
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZhang73 committed Feb 26, 2022
1 parent ad73fef commit a3b7767
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 15 deletions.
24 changes: 23 additions & 1 deletion src/components/ZoomImage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
<template>
ZoomImage
<div v-if="src">
<img
class="cursor-pointer fit"
:src="src"
alt="thumbnail"
/>
<q-popup-proxy v-model="showPopup">
<q-card>
<img
class="cursor-pointer"
style="max-width: 300px"
:src="src"
alt="thumbnail"
@click="showPopup = false"
/>
</q-card>
</q-popup-proxy>
</div>
</template>

<script setup>
import { ref } from 'vue'
defineProps({
src: String | null | undefined
})
const showPopup = ref(false)
</script>
26 changes: 13 additions & 13 deletions src/pages/annotation/components/ActionTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,12 @@
{{ utils.toFixed2(props.row.end - props.row.start) }}
</q-td>
<q-td>
<!-- <ZoomImage-->
<!-- style="height: 100%; vertical-align: middle;"-->
<!-- v-if="actionLabelData[props.row.action].thumbnail"-->
<!-- :src="actionLabelData[props.row.action].thumbnail"-->
<!-- />-->
<ZoomImage
class="vertical-middle float-left q-pr-md"
style="height: 40px;"
:src="configurationStore.actionLabelData[props.row.action].thumbnail"
/>
<q-select
class="inline-block"
v-model="props.row.action"
:options="actionOptionList"
dense
Expand Down Expand Up @@ -191,6 +190,7 @@

<script setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import ZoomImage from '~/components/ZoomImage.vue'
import { ActionAnnotation } from '~/libs/annotationlib.js'
import utils from '~/libs/utils.js'
import { useAnnotationStore } from '~/store/annotation.js'
Expand All @@ -206,38 +206,38 @@ const columnList = [
label: 'start',
field: 'start',
sortable: true,
sort: (a, b, rowA, rowB) => a !== b ? a - b : rowA.end - rowB.end,
sort: (a, b, rowA, rowB) => a !== b ? a - b : rowA.end - rowB.end
},
{
name: 'end',
align: 'center',
label: 'end',
field: 'end',
sortable: true,
sort: (a, b, rowA, rowB) => a !== b ? a - b : rowA.start - rowB.start,
sort: (a, b, rowA, rowB) => a !== b ? a - b : rowA.start - rowB.start
},
{
name: 'duration',
align: 'center',
label: 'duration',
label: 'duration'
},
{
name: 'action',
align: 'center',
label: 'action',
field: 'action',
field: 'action'
},
{
name: 'object',
align: 'center',
label: 'object',
field: 'object',
field: 'object'
},
{
name: 'color',
align: 'center',
label: 'color',
field: 'color',
field: 'color'
},
{
name: 'description',
Expand All @@ -249,7 +249,7 @@ const columnList = [
name: 'operation',
align: 'center',
label: 'operation',
field: 'operation',
field: 'operation'
}
]
Expand Down
11 changes: 10 additions & 1 deletion src/pages/configuration/components/TableBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
:key="props.row.field"
>
<q-td v-if="col.type === 'input'">
<ZoomImage
class="vertical-middle float-left"
style="height: 40px;"
:src="props.row.thumbnail"
/>
<q-input
input-class="text-center"
v-model="props.row[col.field]"
Expand Down Expand Up @@ -113,7 +118,10 @@
</template>
</q-tr>
<q-tr v-if="props.expand">
<slot name="expand" :props="props"></slot>
<slot
name="expand"
:props="props"
></slot>
</q-tr>
</template>
</q-table>
Expand All @@ -122,6 +130,7 @@
<script setup>
import { storeToRefs } from 'pinia'
import { computed, ref } from 'vue'
import ZoomImage from '~/components/ZoomImage.vue'
import TableEditor from '~/pages/configuration/components/TableEditor.vue'
import { useConfigurationStore } from '~/store/configuration.js'
Expand Down

0 comments on commit a3b7767

Please sign in to comment.