|
@@ -338,7 +338,6 @@ export default {
|
|
|
}
|
|
|
return {
|
|
|
tableButtonType:this.hasPermiDom(['exam:elResources:add','exam:elResources:edit','exam:elResources:del']),
|
|
|
- aa:'1111111',
|
|
|
//页面状态
|
|
|
pageType:1,
|
|
|
pageData:{
|
|
@@ -569,94 +568,6 @@ export default {
|
|
|
this.richTextAddType = false;
|
|
|
this.richTextEditType = false;
|
|
|
},
|
|
|
- //上传
|
|
|
- handleRemove(file, fileList) {
|
|
|
- this.fileList = [];
|
|
|
- },
|
|
|
- fileListAdd(file, fileList){
|
|
|
- this.fileList.push(file);
|
|
|
- this.$forceUpdate()
|
|
|
- },
|
|
|
- //树点击事件
|
|
|
- editCheck(event) {
|
|
|
- this.$refs.ditTree.setCheckedKeys([event.id]);
|
|
|
- this.editForm.cateId = event.id;
|
|
|
- },
|
|
|
- editCheckTwo(event) {
|
|
|
- this.$refs.ditTree.setCheckedKeys([event.id]);
|
|
|
- this.richTextForm.cateId = event.id;
|
|
|
- },
|
|
|
- beforeAvatarUpload(file) {
|
|
|
- console.log('file',file);
|
|
|
- let type = false;
|
|
|
- if (
|
|
|
- //图片
|
|
|
- file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif' ||
|
|
|
- //pdf
|
|
|
- file.type == 'application/pdf' ||
|
|
|
- //视频
|
|
|
- file.type == 'video/mp4' ||
|
|
|
- //word
|
|
|
- file.type == 'application/msword' || file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
|
|
- ) {
|
|
|
- type = true;
|
|
|
- }else{
|
|
|
- this.$message.error('只能上传png/jpeg/gif/mp4/doc/docx/pdf格式文件');
|
|
|
- type = false;
|
|
|
- }
|
|
|
- return type;
|
|
|
- },
|
|
|
- //开始上传
|
|
|
- progressUpEdit(event, file, fileList){
|
|
|
- this.loading = true;
|
|
|
- },
|
|
|
- //上传成功
|
|
|
- handleAvatarSuccessEdit(res, file,index) {
|
|
|
- if(res.code == 200){
|
|
|
- this.msgSuccess("上传成功");
|
|
|
- this.loading = false;
|
|
|
- this.openEdit = false;
|
|
|
- this.getList();
|
|
|
- }else{
|
|
|
- this.loading = false;
|
|
|
- this.msgError(res.message);
|
|
|
- }
|
|
|
- },
|
|
|
- //上传失败
|
|
|
- errorUpEdit(err, file, fileList){
|
|
|
- this.loading = false;
|
|
|
- },
|
|
|
- editUpClick(){
|
|
|
- let self = this;
|
|
|
- this.uploadImgUrl = window.location.href.split('://')[0]+'://' + this.judgmentNetworkReturnAddress() + "/exam/el_resources/update?cateId=" + this.editForm.cateId +'&id=' + this.editForm.id + '&title=' + this.editForm.title
|
|
|
- if(this.fileList[0]){
|
|
|
- setTimeout(function(){
|
|
|
- self.submitUpload();
|
|
|
- },100);
|
|
|
- }else{
|
|
|
- let obj = {
|
|
|
- id:this.editForm.id,
|
|
|
- cateId:this.editForm.cateId,
|
|
|
- title:this.editForm.title,
|
|
|
- };
|
|
|
- examElResourcesUpdate(obj).then( response => {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.loading = false;
|
|
|
- this.openEdit = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- submitUpload() {
|
|
|
- if(this.loading){
|
|
|
- return
|
|
|
- }
|
|
|
- this.$refs["editForm"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.$refs.editFormUp.submit();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
//关闭新增上传页面
|
|
|
offUpPage(done){
|
|
|
if(this.upTextList[0]){
|
|
@@ -736,25 +647,6 @@ export default {
|
|
|
forFn(arr1, id)
|
|
|
return temp
|
|
|
},
|
|
|
-
|
|
|
- //开始上传
|
|
|
- progressUp(event, file, fileList){
|
|
|
- this.loading = true;
|
|
|
- },
|
|
|
- //上传成功
|
|
|
- handleAvatarSuccess(res, file,index) {
|
|
|
- let obj = {
|
|
|
- title:res.data.title,
|
|
|
- postfix:res.data.postfix,
|
|
|
- sizeStr:res.data.sizeStr
|
|
|
- }
|
|
|
- this.upTextList.push(obj);
|
|
|
- this.loading = false;
|
|
|
- },
|
|
|
- //上传失败
|
|
|
- errorUp(err, file, fileList){
|
|
|
- this.loading = false;
|
|
|
- },
|
|
|
/** 查询课件资源列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -946,12 +838,6 @@ export default {
|
|
|
this.msgSuccess("删除成功");
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('exam/el_resources/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `exam_el_resources.xlsx`)
|
|
|
- },
|
|
|
fileSuccess(rootFile, file, response, chunk) {
|
|
|
|
|
|
const result = JSON.parse(response);
|
|
@@ -992,7 +878,6 @@ export default {
|
|
|
// 上传完毕。
|
|
|
},
|
|
|
filesAdded(file, fileList, event) {
|
|
|
- console.log('file',file)
|
|
|
file.forEach((item)=>{
|
|
|
if(["image/png","image/jpeg","image/gif",
|
|
|
"application/pdf",
|
|
@@ -1005,18 +890,6 @@ export default {
|
|
|
this.computeMD5(item);
|
|
|
}
|
|
|
})
|
|
|
- // if (["image/png","image/jpeg","image/gif",
|
|
|
- // "application/pdf",
|
|
|
- // "video/mp4",
|
|
|
- // "application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].indexOf(file[0].fileType) === -1){
|
|
|
- // this.$message.error("请上传正确的格式");
|
|
|
- // file.ignored = true;
|
|
|
- // }else{
|
|
|
- // file.forEach((e) => {
|
|
|
- // this.fileList.push(e);
|
|
|
- // this.computeMD5(e);
|
|
|
- // });
|
|
|
- // }
|
|
|
},
|
|
|
computeMD5(file) {
|
|
|
let fileReader = new FileReader();
|
|
@@ -1054,20 +927,6 @@ export default {
|
|
|
fileReader.readAsArrayBuffer(blobSlice.call(file.file, start, end));
|
|
|
}
|
|
|
},
|
|
|
- allStart() {
|
|
|
- this.fileList.map((e) => {
|
|
|
- if (e.paused) {
|
|
|
- e.resume();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- allStop() {
|
|
|
- this.fileList.map((e) => {
|
|
|
- if (!e.paused) {
|
|
|
- e.pause();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
allRemove() {
|
|
|
this.fileList.map((e) => {
|
|
|
e.cancel();
|