|
|
@@ -4,9 +4,19 @@
|
|
|
<span class="label-text">{{ labelText }}</span>
|
|
|
<div class="upload-box">
|
|
|
<!-- style="pointer-events: none;" -->
|
|
|
- <el-upload ref="upload" class="file-uploader" action="no" :accept="acceptFileType"
|
|
|
- :multiple="limit === null || limit > 1" :show-file-list="false" :auto-upload="false" :file-list="fileList"
|
|
|
- :on-change="onFileChange" :on-exceed="handleExceed" :limit="limit">
|
|
|
+ <el-upload
|
|
|
+ ref="upload"
|
|
|
+ class="file-uploader"
|
|
|
+ action="no"
|
|
|
+ :accept="acceptFileType"
|
|
|
+ :multiple="limit === null || limit > 1"
|
|
|
+ :show-file-list="false"
|
|
|
+ :auto-upload="false"
|
|
|
+ :file-list="fileList"
|
|
|
+ :on-change="onFileChange"
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :limit="limit"
|
|
|
+ >
|
|
|
<el-button>{{ type === 'h5_games' ? '选择Zip压缩包或单个html文件' : '选取' + labelText + '文件' }}</el-button>
|
|
|
</el-upload>
|
|
|
<el-button size="small" type="primary" @click="selectAndUpload">本地上传</el-button>
|
|
|
@@ -35,41 +45,75 @@
|
|
|
}}</span>
|
|
|
<!-- <span>({{ file.size }})</span> -->
|
|
|
</span>
|
|
|
- <el-progress v-if="file.progress > 0 && file.progress < 100" type="circle" :percentage="file.progress"
|
|
|
- :width="20" color="#2A5AF6" stroke-linecap="butt" :show-text="false" />
|
|
|
+ <el-progress
|
|
|
+ v-if="file.progress > 0 && file.progress < 100"
|
|
|
+ type="circle"
|
|
|
+ :percentage="file.progress"
|
|
|
+ :width="20"
|
|
|
+ color="#2A5AF6"
|
|
|
+ stroke-linecap="butt"
|
|
|
+ :show-text="false"
|
|
|
+ />
|
|
|
<span v-else-if="file.file_id"> 完成</span>
|
|
|
</div>
|
|
|
<SvgIcon icon-class="delete-black" size="12" @click="removeFile(file, i)" />
|
|
|
- <SvgIcon v-show="type === 'picture' && file.file_id" icon-class="mark" size="12"
|
|
|
- @click="viewDialog(file.file_id)" />
|
|
|
+ <SvgIcon
|
|
|
+ v-show="type === 'picture' && file.file_id"
|
|
|
+ icon-class="mark"
|
|
|
+ size="12"
|
|
|
+ @click="viewDialog(file.file_id)"
|
|
|
+ />
|
|
|
<!-- 编辑名称和序号 -->
|
|
|
<template v-if="canEditName && file.file_id">
|
|
|
- <SvgIcon v-if="content.file_info[file.file_id].isEdit" icon-class="icon-save" size="12"
|
|
|
- @click="changeIsEdit(content.file_info[file.file_id])" />
|
|
|
+ <SvgIcon
|
|
|
+ v-if="content.file_info[file.file_id].isEdit"
|
|
|
+ icon-class="icon-save"
|
|
|
+ size="12"
|
|
|
+ @click="changeIsEdit(content.file_info[file.file_id])"
|
|
|
+ />
|
|
|
<SvgIcon v-else icon-class="icon-edit" size="12" @click="changeIsEdit(content.file_info[file.file_id])" />
|
|
|
</template>
|
|
|
|
|
|
<el-tooltip effect="dark" placement="top" content="提交到资源库">
|
|
|
- <SvgIcon v-if="isEnable(projectResourcePopedom.is_can_upload) && file.file_id" icon-class="upload"
|
|
|
- @click="handleSubmitToResource(file)" />
|
|
|
+ <SvgIcon
|
|
|
+ v-if="isEnable(projectResourcePopedom.is_can_upload) && file.file_id"
|
|
|
+ icon-class="upload"
|
|
|
+ @click="handleSubmitToResource(file)"
|
|
|
+ />
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <SvgIcon v-if="isEnable(projectResourcePopedom.is_can_download) && file.file_id" icon-class="download"
|
|
|
- @click="downLoad(file)" />
|
|
|
+ <SvgIcon
|
|
|
+ v-if="isEnable(projectResourcePopedom.is_can_download) && file.file_id"
|
|
|
+ icon-class="download"
|
|
|
+ @click="downLoad(file)"
|
|
|
+ />
|
|
|
</li>
|
|
|
</ul>
|
|
|
|
|
|
<FillDescribe :file-data="curFile" :visible.sync="visible" @fillDescribeToFile="fillDescribeToFile" />
|
|
|
|
|
|
- <SelectResource :visible.sync="visibleResource" :project-id="project_id" :accept="accept"
|
|
|
- :courseware-id="courseware_id" @selectResource="selectResource" />
|
|
|
-
|
|
|
- <el-dialog :visible.sync="visibleSubmitResource" width="500px" append-to-body :show-close="true" title="提交到资源库"
|
|
|
- :close-on-click-modal="false">
|
|
|
+ <SelectResource
|
|
|
+ :visible.sync="visibleResource"
|
|
|
+ :project-id="project_id"
|
|
|
+ :accept="accept"
|
|
|
+ :courseware-id="courseware_id"
|
|
|
+ @selectResource="selectResource"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="visibleSubmitResource"
|
|
|
+ width="500px"
|
|
|
+ append-to-body
|
|
|
+ :show-close="true"
|
|
|
+ title="提交到资源库"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
<el-form ref="resourceForm" :model="resourceForm" :rules="resourceRules" label-width="60px">
|
|
|
<el-form-item prop="position" label="位置">
|
|
|
<el-radio-group v-model="resourceForm.position" size="medium">
|
|
|
- <el-radio border v-for="node in node_list" :label="node.node_id">{{ node.node_name }}</el-radio>
|
|
|
+ <el-radio v-for="node in node_list" :key="node.node_id" border :label="node.node_id">
|
|
|
+ {{ node.node_name }}
|
|
|
+ </el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="name" label="名称">
|
|
|
@@ -88,7 +132,6 @@
|
|
|
<el-button :loading="loading" type="primary" @click="SubmitToResource">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -191,8 +234,7 @@ export default {
|
|
|
default: true,
|
|
|
},
|
|
|
},
|
|
|
- data()
|
|
|
- {
|
|
|
+ data() {
|
|
|
return {
|
|
|
curFile: null,
|
|
|
conversionSize,
|
|
|
@@ -215,12 +257,8 @@ export default {
|
|
|
intro: '',
|
|
|
},
|
|
|
resourceRules: {
|
|
|
- position: [
|
|
|
- { required: true, message: '请选择位置', trigger: 'blur' },
|
|
|
- ],
|
|
|
- name: [
|
|
|
- { required: true, message: '请输入名称', trigger: 'blur' },
|
|
|
- ],
|
|
|
+ position: [{ required: true, message: '请选择位置', trigger: 'blur' }],
|
|
|
+ name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
@@ -288,7 +326,8 @@ export default {
|
|
|
});
|
|
|
if (this.limit !== null && this.content.file_list.length + files.length > this.limit) {
|
|
|
this.$message.warning(
|
|
|
- `当前限制选择 ${this.limit} 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + this.content.file_list.length
|
|
|
+ `当前限制选择 ${this.limit} 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
+ files.length + this.content.file_list.length
|
|
|
} 个文件`,
|
|
|
);
|
|
|
return;
|
|
|
@@ -300,7 +339,8 @@ export default {
|
|
|
|
|
|
handleExceed(files, fileList) {
|
|
|
this.$message.warning(
|
|
|
- `当前限制选择 ${this.limit} 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
|
|
|
+ `当前限制选择 ${this.limit} 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
+ files.length + fileList.length
|
|
|
} 个文件`,
|
|
|
);
|
|
|
},
|
|
|
@@ -317,7 +357,7 @@ export default {
|
|
|
this.content.file_list.splice(i, 1);
|
|
|
this.content.file_id_list.splice(i, 1);
|
|
|
})
|
|
|
- .catch(() => { });
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
|
|
|
// 文件校验
|
|
|
@@ -494,7 +534,7 @@ export default {
|
|
|
|
|
|
// 提交到资源库
|
|
|
handleSubmitToResource(file) {
|
|
|
- debugger
|
|
|
+ debugger;
|
|
|
this.visibleSubmitResource = true;
|
|
|
this.curFile = file;
|
|
|
this.resourceForm = {
|
|
|
@@ -504,10 +544,9 @@ export default {
|
|
|
intro: file.intro || '',
|
|
|
};
|
|
|
|
|
|
- GetBookCoursewarePath({ id: this.courseware_id }).then(res => {
|
|
|
- this.node_list = res.path_list
|
|
|
+ GetBookCoursewarePath({ id: this.courseware_id }).then((res) => {
|
|
|
+ this.node_list = res.path_list;
|
|
|
});
|
|
|
-
|
|
|
},
|
|
|
SubmitToResource() {
|
|
|
this.$refs.resourceForm.validate((valid) => {
|
|
|
@@ -587,7 +626,7 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
|
|
|
- .el-button+.el-button {
|
|
|
+ .el-button + .el-button {
|
|
|
margin-left: 2px;
|
|
|
}
|
|
|
|