Bläddra i källkod

feat: 目标毁伤评估

28968 8 månader sedan
förälder
incheckning
052e7c63a9
1 ändrade filer med 24 tillägg och 3 borttagningar
  1. 24 3
      src/views/demo/dataAugmentation/index.vue

+ 24 - 3
src/views/demo/dataAugmentation/index.vue

@@ -61,7 +61,16 @@
           <el-image v-for="(image, index) in cacheImages[imageIdx].origin" :key="index" :src="'data:image/png;base64,' + image"></el-image>
           <!-- <el-tag>结果:</el-tag> -->
         </div>
-        <div style="width: 50%">
+        <div v-if="task_type_view == '目标毁伤评估'" style="width: 50%">
+          <ul v-infinite-scroll="load" class="list" :infinite-scroll-disabled="disabled">
+            <li v-for="i in count" :key="i" style="list-style-type: none">
+              <el-image :src="'data:image/png;base64,' + cacheImages[imageIdx].stable[i - 1]"></el-image>
+            </li>
+          </ul>
+          <p v-if="loading">Loading...</p>
+          <p v-if="noMore">No more</p>
+        </div>
+        <div v-else style="width: 50%">
           <el-image v-for="(image, index) in cacheImages[imageIdx].stable" :key="index" :src="'data:image/png;base64,' + image"></el-image>
         </div>
       </div>
@@ -77,7 +86,7 @@
 </template>
 
 <script setup lang="tsx" name="DataAugmentation">
-import { ref, reactive, onMounted } from 'vue'
+import { ref, reactive, onMounted, computed } from 'vue'
 import { useHandleData } from '@/hooks/useHandleData'
 import { useDownload } from '@/hooks/useDownload'
 import { ElMessageBox, ElMessage } from 'element-plus'
@@ -125,6 +134,17 @@ const hyperparameterConfiguration = []
 
 const logDialogVisible = ref(false)
 const logDialog = ref('')
+const count = ref(4)
+const loading = ref(false)
+const noMore = computed(() => count.value >= cacheImages.value[imageIdx.value].stable.length)
+const disabled = computed(() => loading.value || noMore.value)
+const load = () => {
+  loading.value = true
+  setTimeout(() => {
+    count.value += 1
+    loading.value = false
+  }, 2000)
+}
 const openLogDialog = async (id: string | number) => {
   const res: any = await getDialogApi(id)
   logDialog.value = res.data
@@ -207,12 +227,13 @@ const loadImageData = async (taskId: string, imageIdx: number) => {
   cacheImages.value[imageIdx].origin = res.origin
   cacheImages.value[imageIdx].stable = res.stable
 }
-
+const task_type_view = ref('')
 const compareDataAugmentation = async (params: any) => {
   if (taskId.value !== '' && taskId.value !== null && taskId.value !== undefined && taskId.value == params.id) {
     dialogVisible.value = true
     return
   }
+  task_type_view.value = params.taskType
   taskId.value = params.id
   imageIdx.value = 0
   cacheImages.value = {}