| | |
| | | <el-form-item label="标题" prop="title"> |
| | | <el-input v-model="form.title" placeholder="请输入标题" /> |
| | | </el-form-item> |
| | | <el-form-item label="排序" prop="title"> |
| | | <el-form-item label="排序" prop="sequence"> |
| | | <el-input v-model="form.sequence" placeholder="请输入排序" /> |
| | | </el-form-item> |
| | | <el-form-item label="视频" prop=""> |
| | | <el-upload action="#" list-type="picture-card" :auto-upload="false"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #file="{ file }"> |
| | | <div> |
| | | <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" /> |
| | | <span class="el-upload-list__item-actions"> |
| | | <span |
| | | class="el-upload-list__item-preview" |
| | | @click="handlePictureCardPreview(file)" |
| | | > |
| | | <el-icon><zoom-in /></el-icon> |
| | | </span> |
| | | <span |
| | | v-if="!disabled" |
| | | class="el-upload-list__item-delete" |
| | | @click="handleDownload(file)" |
| | | > |
| | | <el-icon><Download /></el-icon> |
| | | </span> |
| | | <span |
| | | v-if="!disabled" |
| | | class="el-upload-list__item-delete" |
| | | @click="handleRemove(file)" |
| | | > |
| | | <el-icon><Delete /></el-icon> |
| | | </span> |
| | | </span> |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | <el-dialog v-model="dialogVisible"> |
| | | <img w-full :src="dialogImageUrl" alt="Preview Image" /> |
| | | </el-dialog> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="form.status" placeholder="请选择"> |
| | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | |
| | | import { Delete, Download, Plus, ZoomIn } from '@element-plus/icons-vue' |
| | | |
| | | import type { UploadFile } from 'element-plus' |
| | | |
| | | const dialogImageUrl = ref('') |
| | | const dialogVisible = ref(false) |
| | | const disabled = ref(false) |
| | | |
| | | const handleRemove = (file: UploadFile) => { |
| | | console.log(file) |
| | | } |
| | | |
| | | const handlePictureCardPreview = (file: UploadFile) => { |
| | | dialogImageUrl.value = file.url! |
| | | dialogVisible.value = true |
| | | } |
| | | |
| | | const handleDownload = (file: UploadFile) => { |
| | | console.log(file) |
| | | } |
| | | </script> |