|  | 
| 54 | 54 |       </template> | 
| 55 | 55 |       <!-- CUSTOM FIELD TEMPLATES --> | 
| 56 | 56 |       <template v-for="n in customFieldNames" :key="n" #[`cell:${n}`]="{ item, column }"> | 
| 57 |  | -        <div v-if="isAiResponseReceivedAnalize[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])] && !isInColumnImage(n)"> | 
|  | 57 | +        <div v-if="isAiResponseReceivedAnalize[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])] && !isInColumnImage(n)" @mouseenter="(() => { hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] = true})" @mouseleave="(() => { hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] = false})"> | 
| 58 | 58 |           <div v-if="isInColumnEnum(n)" class="flex flex-col items-start justify-end min-h-[90px]"> | 
| 59 | 59 |               <Select | 
| 60 | 60 |                 class="min-w-[150px]" | 
|  | 
| 65 | 65 |               > | 
| 66 | 66 |               </Select> | 
| 67 | 67 |               <Tooltip> | 
| 68 |  | -                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500"> | 
| 69 |  | -                  <p class="text-sm ">original</p> | 
| 70 |  | -                  <IconScaleBalancedOutline /> | 
|  | 68 | +                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500" :class="{ 'opacity-0': !hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }"> | 
|  | 69 | +                  <p class="text-sm ">old value</p> | 
| 71 | 70 |                 </div> | 
| 72 | 71 |                 <template #tooltip> | 
| 73 | 72 |                   {{  oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }} | 
|  | 
| 82 | 81 |             > | 
| 83 | 82 |             </Textarea> | 
| 84 | 83 |             <Tooltip> | 
| 85 |  | -                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500"> | 
| 86 |  | -                  <p class="text-sm ">original</p> | 
| 87 |  | -                  <IconScaleBalancedOutline /> | 
|  | 84 | +                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500" :class="{ 'opacity-0': !hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }"> | 
|  | 85 | +                  <p class="text-sm ">old value</p> | 
| 88 | 86 |                 </div> | 
| 89 | 87 |               <template #tooltip> | 
| 90 | 88 |                 <p class="max-w-[200px]">{{  oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}</p> | 
|  | 
| 98 | 96 |             > | 
| 99 | 97 |             </Toggle> | 
| 100 | 98 |             <Tooltip> | 
| 101 |  | -                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500"> | 
| 102 |  | -                  <p class="text-sm ">original</p> | 
| 103 |  | -                  <IconScaleBalancedOutline /> | 
|  | 99 | +                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500" :class="{ 'opacity-0': !hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }"> | 
|  | 100 | +                  <p class="text-sm ">old value</p> | 
| 104 | 101 |                 </div> | 
| 105 | 102 |               <template #tooltip> | 
| 106 | 103 |                 {{  oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }} | 
|  | 
| 115 | 112 |               :fullWidth="true" | 
| 116 | 113 |             /> | 
| 117 | 114 |             <Tooltip> | 
| 118 |  | -                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500"> | 
| 119 |  | -                  <p class="text-sm ">original</p> | 
| 120 |  | -                  <IconScaleBalancedOutline /> | 
|  | 115 | +                <div class="mt-2 flex items-center justify-start gap-1 hover:text-blue-500" :class="{ 'opacity-0': !hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }"> | 
|  | 116 | +                  <p class="text-sm ">old value</p> | 
| 121 | 117 |                 </div> | 
| 122 | 118 |               <template #tooltip> | 
| 123 | 119 |                 {{  oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }} | 
|  | 
| 126 | 122 |           </div> | 
| 127 | 123 |         </div> | 
| 128 | 124 | 
 | 
| 129 |  | -        <div v-if="isAiResponseReceivedImage[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])]"> | 
|  | 125 | +        <div v-if="isAiResponseReceivedImage[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])]" @mouseenter="(() => { hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] = true})" @mouseleave="(() => { hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] = false})"> | 
| 130 | 126 |           <div v-if="isInColumnImage(n)"> | 
| 131 | 127 |             <div class="mt-2 flex items-center justify-start gap-2"> | 
| 132 | 128 |               <div v-if="isValidUrl(selected[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n])" class="flex flex-col items-center"> | 
|  | 
| 138 | 134 |               <p | 
| 139 | 135 |                 v-if="isImageHasPreviewUrl[n]" | 
| 140 | 136 |                 class="mt-2 text-sm hover:text-blue-500 hover:underline hover:cursor-pointer flex items-center gap-1" | 
|  | 137 | +                :class="{ 'opacity-0': !hovers[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }" | 
| 141 | 138 |                 @click="() => {openImageCompare[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] = true}"   | 
| 142 | 139 |               > | 
| 143 | 140 |                 old image | 
| 144 |  | -                <IconScaleBalancedOutline /> | 
| 145 | 141 |               </p> | 
| 146 | 142 |               </div> | 
| 147 | 143 |               <div v-else class="flex items-center justify-center text-center w-20 h-20"> | 
|  | 
| 206 | 202 | </template> | 
| 207 | 203 | 
 | 
| 208 | 204 | <script lang="ts" setup> | 
| 209 |  | -import { ref } from 'vue' | 
|  | 205 | +import { ref, watch } from 'vue' | 
| 210 | 206 | import { Select, Input, Textarea, Table, Checkbox, Skeleton, Toggle, Tooltip } from '@/afcl' | 
| 211 | 207 | import GenerationCarousel from './ImageGenerationCarousel.vue' | 
| 212 | 208 | import ImageCompare from './ImageCompare.vue'; | 
| 213 |  | -import { IconRefreshOutline, IconScaleBalancedOutline } from '@iconify-prerendered/vue-flowbite'; | 
|  | 209 | +import { IconRefreshOutline } from '@iconify-prerendered/vue-flowbite'; | 
| 214 | 210 | 
 | 
| 215 | 211 | const props = defineProps<{ | 
| 216 | 212 |   meta: any, | 
| @@ -240,7 +236,13 @@ const emit = defineEmits(['error', 'regenerateImages']); | 
| 240 | 236 | 
 | 
| 241 | 237 | 
 | 
| 242 | 238 | const zoomedImage = ref(null); | 
|  | 239 | +const hovers = ref<{ [key: string]: boolean }[]>([]); | 
| 243 | 240 | 
 | 
|  | 241 | +watch(() => props.tableColumnsIndexes, (newVal) => { | 
|  | 242 | +  if (newVal) { | 
|  | 243 | +    hovers.value = newVal.map(() => ({})); | 
|  | 244 | +  } | 
|  | 245 | +}, { immediate: true }); | 
| 244 | 246 | 
 | 
| 245 | 247 | function zoomImage(img) { | 
| 246 | 248 |   zoomedImage.value = img | 
|  | 
0 commit comments