| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="文件类型"> |
| | | <el-select v-model="searchForm.contentType" clearable @clear="page" @change="page" placeholder="文件类型"> |
| | | <el-option |
| | | v-for="item in contentTypeList" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="page" size="small">查询</el-button> |
| | | </el-form-item> |
| | |
| | | class="showContent"></el-image> |
| | | <!-- <img v-if="scope.row.contentType === 'img'" :src="'/api/files/' + scope.row.contentUrl.url" |
| | | class="showContent" /> --> |
| | | <el-link type="primary" v-if="scope.row.contentType === 'pdf'" class="showContent" |
| | | @click="checkPdf('/api/files/' + scope.row.contentUrl.url)">点击查看 |
| | | <audio controls v-if="scope.row.contentType === 'audio'" |
| | | class="showContent"> |
| | | <source :src="'/api/files/' + scope.row.contentUrl.url"> |
| | | </audio> |
| | | <el-link type="primary" |
| | | v-if="scope.row.contentType !== 'video' && scope.row.contentType !== 'audio' && scope.row.contentType !== 'img'" |
| | | class="showContent" |
| | | @click="check(scope.row)">点击查看 |
| | | </el-link> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-link type="primary" :href="'/api/upload/download?url=' + item.url +'&fileName=' + item.name"> |
| | | {{ item.name }} |
| | | </el-link> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="visitUrl" label="访问链接"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.contentType === 'video'"> |
| | | {{ scope.row.visitUrl }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-form-item label="主题简介" prop="introduction"> |
| | | <el-input v-model="form.introduction" placeholder="主题内容"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="班级" > |
| | | <el-form-item label="班级"> |
| | | <el-select |
| | | v-model="form.classId" |
| | | placeholder="班级" |
| | |
| | | </el-form-item> |
| | | <el-form-item label="文件类型" prop="contentType"> |
| | | <el-select v-model="form.contentType" placeholder="不同类型的文件阅览方式不同,多余文件请以附件形式上传" @change="fileChange"> |
| | | <el-option label="视频" value="video"></el-option> |
| | | <el-option label="PDF" value="pdf"></el-option> |
| | | <el-option label="图片" value="img"></el-option> |
| | | <el-option |
| | | v-for="item in contentTypeList" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="上传文件(一个)" prop="contentUrl"> |
| | |
| | | dialogTitle: '添加学习内容', |
| | | ids: [], |
| | | typeList: [], |
| | | contentTypeList: [ |
| | | { name: '视频', value: 'video' }, |
| | | { name: '图片', value: 'img' }, |
| | | { name: '音频', value: 'audio' }, |
| | | { name: 'PDF', value: 'pdf' }, |
| | | { name: 'EXCEL', value: 'excel' }, |
| | | { name: 'WORD', value: 'word' }, |
| | | { name: 'PPT', value: 'ppt' } |
| | | ], |
| | | classesIds: [], |
| | | searchForm: { |
| | | pageNum: 1, |
| | | pageSize: 5, |
| | | subjectId: null, |
| | | introduction: null |
| | | introduction: null, |
| | | contentType: null |
| | | }, |
| | | total: 0, |
| | | tableData: [], |
| | |
| | | }, |
| | | rules: { |
| | | contentUrl: [ |
| | | { required: true, message: '请上传文件', trigger: 'blur' }, |
| | | { required: true, message: '请上传文件', trigger: 'blur' } |
| | | ], |
| | | introduction: [ |
| | | { required: true, message: '请输入主题内容', trigger: 'blur' }, |
| | | { required: true, message: '请输入主题内容', trigger: 'blur' } |
| | | ], |
| | | belongType: [ |
| | | { required: true, message: '请选择学习分类', trigger: 'change' } |
| | |
| | | this.classesIds = re.data.data |
| | | }) |
| | | }, |
| | | checkPdf (url) { |
| | | this.pdf = url |
| | | this.pdfDialog = true |
| | | check (row) { |
| | | // this.pdf = url |
| | | // this.pdfDialog = true |
| | | window.open(row.visitUrl) |
| | | }, |
| | | closePdfDialog () { |
| | | this.pdfDialog = false |
| | |
| | | if (row.contentType === 'img') { |
| | | return '图片' |
| | | } |
| | | if (row.contentType === 'audio') { |
| | | return '音频' |
| | | } |
| | | if (row.contentType === 'pdf') { |
| | | return 'PDF' |
| | | } |
| | | if (row.contentType === 'excel') { |
| | | return 'EXCEL' |
| | | } |
| | | if (row.contentType === 'word') { |
| | | return 'WORD' |
| | | } |
| | | if (row.contentType === 'ppt') { |
| | | return 'PPT' |
| | | } |
| | | |
| | | }, |
| | | clearFile () { |
| | | this.form.contentUrl = [] |
| | |
| | | batchRemove () { |
| | | if (this.ids.length < 1) { |
| | | this.$message.warning('请选择要删除的数据') |
| | | } else { |
| | | EducationResourceAPI.remove(this.ids).then(res => { |
| | | if (res.code === 1) { |
| | | this.$message.success('删除成功') |
| | | this.ids = [] |
| | | } |
| | | }) |
| | | } |
| | | EducationResourceAPI.remove(this.ids).then(res => { |
| | | if (res.code === 1) { |
| | | this.$message.success('删除成功') |
| | | this.ids = [] |
| | | } |
| | | }) |
| | | }, |
| | | getTitle (typeName) { |
| | | return '确定要删除' + typeName + '这个文件吗?' |
| | |
| | | this.form.belongType = row.belongType |
| | | this.dialogTitle = '修改学习内容' |
| | | this.open = true |
| | | } |
| | | }, |
| | | }, |
| | | mounted () { |
| | | this.page() |