Files
yxe-admin/src/views/tower/machine/detail/components/app-photo.vue
T
2024-02-22 13:48:27 +08:00

53 lines
1.3 KiB
Vue

<template>
<a-descriptions title="应用截图" :bordered="false">
<template #extra>
<a @click="openEdit">编辑</a>
</template>
</a-descriptions>
<div class="content">
<template v-if="data.appType === 'web'">
<a-image-preview-group>
<a-space :size="20" v-for="(item, index) in images" :key="index">
<a-image :width="360" :src="item.url" />
</a-space>
</a-image-preview-group>
</template>
<template v-else>
<a-image-preview-group>
<a-space :size="20" v-for="(item, index) in images" :key="index">
<a-image :width="200" :src="item.url" />
</a-space>
</a-image-preview-group>
</template>
</div>
<!-- 编辑弹窗 -->
<AppPhotoEdit v-model:visible="showEdit" :data="data" @done="reload" />
</template>
<script lang="ts" setup>
import { App } from '@/api/oa/app/model';
import { ref } from 'vue';
import AppPhotoEdit from './app-photo-edit.vue';
defineProps<{
visible: boolean;
data: App;
images: any[];
}>();
const emit = defineEmits<{
(e: 'done'): void;
}>();
// 是否显示编辑弹窗
const showEdit = ref(false);
/* 打开编辑弹窗 */
const openEdit = () => {
showEdit.value = true;
};
const reload = () => {
emit('done');
};
</script>