mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-10 19:36:48 +08:00
feat:增加面授课课程附件格式判断
This commit is contained in:
@@ -96,8 +96,8 @@
|
|||||||
<div v-for="(el, index) in formateArr(data.planDto?.attach)" :key="index" class="enclosure"
|
<div v-for="(el, index) in formateArr(data.planDto?.attach)" :key="index" class="enclosure"
|
||||||
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }">
|
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }">
|
||||||
<div class="enclosureL">
|
<div class="enclosureL">
|
||||||
<FileTypeImg :v-model="el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.'))" :style="{width: '22px',height: '26px',marginLeft: '10px',}"></FileTypeImg>
|
<FileTypeImg :v-model="el.name? el.name : el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.'))" :style="{width: '22px',height: '26px',marginLeft: '10px',}"></FileTypeImg>
|
||||||
<div style="margin-left: 20px">{{ el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.')) }}</div>
|
<div style="margin-left: 20px">{{ el.name? el.name : el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.')) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" >
|
<div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" >
|
||||||
<div v-if="new Date(data.planDto.beginTime).getTime() > new Date().getTime()" class="download">
|
<div v-if="new Date(data.planDto.beginTime).getTime() > new Date().getTime()" class="download">
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else class="download">
|
<div v-else class="download">
|
||||||
<img style="width: 16px; height: 15px" src="../../assets/image/download.png" />
|
<img style="width: 16px; height: 15px" src="../../assets/image/download.png" />
|
||||||
<div style="margin-left: 5px" @click="download(el)">
|
<div style="margin-left: 5px" @click="download(el.name? el.response.data : el)">
|
||||||
下载
|
下载
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -239,9 +239,14 @@ const downloads = (url) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function formateArr(strs) {
|
function formateArr(strs) {
|
||||||
let arrs = strs.split(',')
|
let newArr = [];
|
||||||
console.log('112233', arrs)
|
try{
|
||||||
return arrs
|
newArr = JSON.parse(strs)
|
||||||
|
} catch {
|
||||||
|
newArr = strs.split(',')
|
||||||
|
}
|
||||||
|
console.log('112233', newArr)
|
||||||
|
return newArr
|
||||||
}
|
}
|
||||||
|
|
||||||
let timer = null;
|
let timer = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user