|
@@ -4,7 +4,7 @@
|
|
|
<el-col :span="span" v-for="(file, index) in fileList" :key="index">
|
|
<el-col :span="span" v-for="(file, index) in fileList" :key="index">
|
|
|
<div class="upload-list-item">
|
|
<div class="upload-list-item">
|
|
|
<el-link class="flex1 right-item" :href="`${file.url}`" :underline="false" target="_blank">
|
|
<el-link class="flex1 right-item" :href="`${file.url}`" :underline="false" target="_blank">
|
|
|
- <img style="width: 36px; height: 36px;" class="mr5" src="@/assets/images/pdf_icon.png" alt="" />
|
|
|
|
|
|
|
+ <img style="width: 36px; height: 36px;" class="mr5" :src="getFileIconByUrl(file.url)" alt="" />
|
|
|
<div>
|
|
<div>
|
|
|
<div class="item-text">{{ file.fileName }}</div>
|
|
<div class="item-text">{{ file.fileName }}</div>
|
|
|
<div v-if="file.fileSize" class="item-text">{{ changeByte(file.fileSize) }}</div>
|
|
<div v-if="file.fileSize" class="item-text">{{ changeByte(file.fileSize) }}</div>
|
|
@@ -26,7 +26,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { download } from '@/utils/request';
|
|
import { download } from '@/utils/request';
|
|
|
import { propTypes } from '@/utils/propTypes';
|
|
import { propTypes } from '@/utils/propTypes';
|
|
|
-import { changeByte } from '@/utils/ruoyi';
|
|
|
|
|
|
|
+import { changeByte, getFileIconByUrl } from '@/utils/ruoyi';
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
modelValue: [String, Object, Array],
|
|
modelValue: [String, Object, Array],
|
|
@@ -57,8 +57,6 @@ watch(
|
|
|
watch(
|
|
watch(
|
|
|
() => props.value,
|
|
() => props.value,
|
|
|
async (val) => {
|
|
async (val) => {
|
|
|
- console.log(val);
|
|
|
|
|
-
|
|
|
|
|
if (val) {
|
|
if (val) {
|
|
|
let list = [];
|
|
let list = [];
|
|
|
if (Array.isArray(val)) {
|
|
if (Array.isArray(val)) {
|