Commit 5c6539fd by zhaopanyu

zpy 11.2

parent 7c20e034
...@@ -39,12 +39,14 @@ ...@@ -39,12 +39,14 @@
</el-table-column> </el-table-column>
<el-table-column label="证书照片" align="center"> <el-table-column label="证书照片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <el-carousel :interval="4000" height="100px">
<el-image v-for="(accessory, index) in scope.row.schoolAccessoryList" :key="index" <el-carousel-item v-for="(item, index) in scope.row.schoolAccessoryList" :key="index">
style="width: 100px; height: 100px" :src="accessory.accessoryUrl" <el-image style="width: 100px; height: 100px" :src="item.accessoryUrl"
:preview-src-list="[accessory.accessoryUrl]"></el-image> :preview-src-list="[item.accessoryUrl]"></el-image>
</div> </el-carousel-item>
</el-carousel>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注1" align="center" prop="remark1" /> <el-table-column label="备注1" align="center" prop="remark1" />
...@@ -119,11 +121,18 @@ ...@@ -119,11 +121,18 @@
<el-col :span="10"> <el-col :span="10">
<el-form-item prop="schoolAccessoryList" label="证书照片"> <el-form-item prop="schoolAccessoryList" label="证书照片">
<el-upload v-loading="uploadLoading" class="avatar-uploader" :action="uploadFileUrl" accept="image/*" <el-upload v-loading="uploadLoading" class="avatar-uploader" :action="uploadFileUrl" accept="image/*"
:show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"> :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"
<img v-for="item in form.schoolAccessoryList" :key="item.accessoryUrl" :src="item.accessoryUrl" :on-remove="handleRemove">
class="avatar" />{{ item }} <div v-if="form.schoolAccessoryList.length === 0">
<i v-if="form.schoolAccessoryList.length === 0" class="el-icon-plus avatar-uploader-icon"></i> <i class="el-icon-plus avatar-uploader-icon"></i>
</div>
<div v-else>
<div v-for="(item, index) in form.schoolAccessoryList" :key="index">
<img :src="item.accessoryUrl" class="avatar" />
</div>
</div>
</el-upload> </el-upload>
<i class="el-icon-delete" @click="handleRemove(index)"></i> <!-- 添加删除按钮 -->
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -290,8 +299,8 @@ export default { ...@@ -290,8 +299,8 @@ export default {
this.pic = val this.pic = val
}, },
// 移除图片 // 移除图片
handleRemove() { handleRemove(index) {
this.schoolAccessoryList = undefined this.form.schoolAccessoryList.splice(index, 1);
}, },
// 上传成功回调 // 上传成功回调
handleAvatarSuccess(response, file) { handleAvatarSuccess(response, file) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment