|
@@ -1,63 +0,0 @@
|
|
|
-<template>
|
|
|
|
|
- <transition-group class="upload-file-list" name="el-fade-in-linear" tag="div">
|
|
|
|
|
- <el-row :gutter="60">
|
|
|
|
|
- <el-col :span="span" v-for="(file, index) in fileList" :key="index">
|
|
|
|
|
- <div class="upload-list-img d-flex a-c" @click="show2 = true;lookIndex=index">
|
|
|
|
|
- <img src="@/assets/images/icon_pic.png" alt="" />
|
|
|
|
|
- <el-tooltip class="box-item" effect="dark" :content="file.fileName" placement="top">
|
|
|
|
|
- <div class="item-text flex1 sv-1" style="color: #3e7b65;">
|
|
|
|
|
- {{ file.fileName }}
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <div v-if="!fileList.length">-</div>
|
|
|
|
|
- </transition-group>
|
|
|
|
|
- <ImageViewer v-model:show="show2" :imgs="fileList.map((item: any) => item.url)" :index="lookIndex"></ImageViewer>
|
|
|
|
|
-</template>
|
|
|
|
|
-
|
|
|
|
|
-<script setup lang="ts">
|
|
|
|
|
-import { download } from '@/utils/request';
|
|
|
|
|
-import { propTypes } from '@/utils/propTypes';
|
|
|
|
|
-import { changeByte } from '@/utils/ruoyi';
|
|
|
|
|
-import { ImageViewer } from '@/views/components';
|
|
|
|
|
-const props = defineProps({
|
|
|
|
|
- modelValue: [String, Object, Array],
|
|
|
|
|
- span: propTypes.number.def(8),
|
|
|
|
|
- isObject: propTypes.bool.def(true),
|
|
|
|
|
- isFile: propTypes.bool.def(true)
|
|
|
|
|
-});
|
|
|
|
|
-const show2 = ref(false);
|
|
|
|
|
-const lookIndex = ref(0);
|
|
|
|
|
-const fileList = ref<any>([]);
|
|
|
|
|
-watch(
|
|
|
|
|
- () => props.modelValue,
|
|
|
|
|
- async (val) => {
|
|
|
|
|
- if (val) {
|
|
|
|
|
- let list = [];
|
|
|
|
|
- if (Array.isArray(val)) {
|
|
|
|
|
- list = val;
|
|
|
|
|
- } else if (props.isObject) {
|
|
|
|
|
- list = [val];
|
|
|
|
|
- }
|
|
|
|
|
- fileList.value = [...list];
|
|
|
|
|
- } else {
|
|
|
|
|
- fileList.value = [];
|
|
|
|
|
- return [];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- { deep: true, immediate: true }
|
|
|
|
|
-);
|
|
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
|
|
-.upload-list-img {
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
-
|
|
|
|
|
- &:first-child {
|
|
|
|
|
- margin-top: 0;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-</style>
|
|
|