|
@@ -13,13 +13,7 @@
|
|
|
<el-form-item label="作者" prop="authorName">
|
|
|
<el-input v-model="form.authorName" autocomplete="off" placeholder="请输入作者名称"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="附件">
|
|
|
- <template>
|
|
|
- <div v-if="showDialog">
|
|
|
- <myUpload :file-list="form.systemFile?[form.systemFile]:[]" :limit="1" :autoUpload="true" @on-change="onChange" @on-remove="onRemove"></myUpload>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-form-item>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
@@ -29,6 +23,13 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <el-form-item label="文件">
|
|
|
+ <template>
|
|
|
+ <div v-if="showDialog">
|
|
|
+ <myUpload :file-list="form.systemFiles" :autoUpload="true" @on-change="onChange" @on-remove="onRemove"></myUpload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="备注" prop="description">
|
|
|
<el-input type="textarea" v-model="form.description" autocomplete="off" placeholder="请输入备注"></el-input>
|
|
|
</el-form-item>
|
|
@@ -75,43 +76,47 @@ export default {
|
|
|
},
|
|
|
//切换文件
|
|
|
onChange(file, fileList){
|
|
|
- if(this.form.systemFile){
|
|
|
- if(file.guid){
|
|
|
- if(this.form.systemFile.uid == file.uid){
|
|
|
- this.$set(this.form,'systemFile',null)
|
|
|
- this.$set(this.form,'systemFile',file.raw)
|
|
|
- }
|
|
|
- }else{
|
|
|
- this.$set(this.form,'systemFile',null)
|
|
|
- this.$set(this.form,'systemFile',file.raw)
|
|
|
- }
|
|
|
+ if(!this.form.systemFiles){
|
|
|
+ this.form.systemFiles = []
|
|
|
+ }
|
|
|
+ let index = this.form.systemFiles.findIndex(item=>{
|
|
|
+ return item.guid == file.guid || item.uid == file.uid
|
|
|
+ })
|
|
|
+ if(index == -1){
|
|
|
+ this.form.systemFiles.push(file.raw)
|
|
|
}else{
|
|
|
- this.$set(this.form,'systemFile',null)
|
|
|
- this.$set(this.form,'systemFile',file.raw)
|
|
|
+ this.form.systemFiles[index] = file.raw
|
|
|
}
|
|
|
|
|
|
},
|
|
|
//移除文件
|
|
|
onRemove(file, fileList){
|
|
|
- this.$set(this.form,'systemFile',null)
|
|
|
+ // this.$set(this.form,'systemFile',null)
|
|
|
+ let index = this.form.systemFiles.findIndex(item=>{
|
|
|
+ return item.guid == file.guid || item.uid == file.uid
|
|
|
+ })
|
|
|
+ if(index != -1){
|
|
|
+ this.form.systemFiles.splice(index,1)
|
|
|
+ }
|
|
|
},
|
|
|
//提交
|
|
|
submit(){
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if(this.form.type == 1 && this.form.systemFile){
|
|
|
- var guids = this.$commonJS.checkUploadFile([this.form.systemFile])
|
|
|
+ if(this.form.type == 1 && this.form.systemFiles){
|
|
|
+ var guids = this.$commonJS.checkUploadFile(this.form.systemFiles)
|
|
|
if(!guids){
|
|
|
return false
|
|
|
}
|
|
|
- this.form.fileGuid = guids.length>0?guids[0]:''
|
|
|
+ // this.form.fileGuid = guids.length>0?guids[0]:''
|
|
|
+ this.form.fileGuids = guids
|
|
|
}
|
|
|
|
|
|
this.form.projectId = this.projectId
|
|
|
this.btnLoading = true
|
|
|
if(this.form.id){
|
|
|
if(this.form.type == 1){
|
|
|
- this.form.literatureNo = this.form.fileGuid
|
|
|
+ this.form.literatureNo = this.form.fileGuids.length?this.form.fileGuids[0]:''
|
|
|
}
|
|
|
var a = {
|
|
|
updateBatchLiteratureDTOs:[this.form],
|