mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 10:56:46 +08:00
图片显示
This commit is contained in:
BIN
src/assets/images/course.png
Normal file
BIN
src/assets/images/course.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
@@ -24,7 +24,8 @@
|
||||
<template #bodyCell="{ column, record }">
|
||||
<div v-if="column.dataIndex === 'title'" style="display:flex;align-items:center;">
|
||||
<div>
|
||||
<a-image :width="150" :height="75" :src="record.coverImg"></a-image>
|
||||
<img v-if="record.coverImg" :width="150" :height="75" :src="useImgUrl(record.coverImg)" />
|
||||
<img v-else :width="150" :height="75" src="../../assets/images/course.png" alt="">
|
||||
</div>
|
||||
<div style="height:75px;margin-left: 10px;">
|
||||
<div style="height:25px">{{ record.name }}</div>
|
||||
@@ -64,6 +65,19 @@
|
||||
import { defineProps, ref, computed, reactive, nextTick, watch } from "vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { addCourselList, courseIds, saveCourseList } from "@/api/grateful";
|
||||
const fileBaseUrl = ref('https:' + process.env.VUE_APP_BOE_API_URL + process.env.VUE_APP_AVATAR_PATH)
|
||||
const useImgUrl = (url) => {
|
||||
let imgUrl = url
|
||||
if (imgUrl && imgUrl && imgUrl.startsWith('http')) {
|
||||
return imgUrl;
|
||||
}
|
||||
if (imgUrl && imgUrl && imgUrl != "") {
|
||||
return fileBaseUrl.value + imgUrl;
|
||||
} else if (imgUrl == "") {
|
||||
return "../../assets/images/course.png";
|
||||
}
|
||||
return ''
|
||||
}
|
||||
const formatNum = (num) => {
|
||||
let rsNum = 0;
|
||||
if (num < 5) { return num; }
|
||||
|
||||
Reference in New Issue
Block a user