This commit is contained in:
zhutianqi
2021-08-05 11:26:42 +08:00
parent b2498c485d
commit a341b2b20e
2 changed files with 29 additions and 16 deletions
@@ -169,6 +169,7 @@
></Role-tree> ></Role-tree>
<el-dialog width='400px' :visible.sync="fileMadel" title="上传文件"> <el-dialog width='400px' :visible.sync="fileMadel" title="上传文件">
<el-upload <el-upload
class="upload-demo"
multiple multiple
drag drag
:action="fileUrl" :action="fileUrl"
@@ -177,6 +178,7 @@
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx" accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx"
:before-upload="beginImportFile" :before-upload="beginImportFile"
:on-success="importFileSuccess" :on-success="importFileSuccess"
:on-progress="progressFile"
:show-file-list="false" :show-file-list="false"
> >
<div style="padding: 20px 0"> <div style="padding: 20px 0">
@@ -184,6 +186,7 @@
<p>点击或拖拽上传文件</p> <p>点击或拖拽上传文件</p>
</div> </div>
</el-upload> </el-upload>
<el-progress style="width: 380px; margin-top: 5px;" v-show="progressType" :percentage="loadProgress"></el-progress>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@@ -198,6 +201,8 @@ export default {
name: "bzdyStep1", name: "bzdyStep1",
data() { data() {
return { return {
progressType: false,
loadProgress: 0,
commentText: '', commentText: '',
nodeList: [], nodeList: [],
nodeList2: [], nodeList2: [],
@@ -310,6 +315,10 @@ export default {
this.drawerTitle = title this.drawerTitle = title
this.modalshowflag = true this.modalshowflag = true
}, },
progressFile (event, file, fileList) {
let loadProgress = Math.floor(event.percent)
this.loadProgress = loadProgress
},
// 导入按钮 上传之前的钩子 // 导入按钮 上传之前的钩子
beginImportFile (file) { beginImportFile (file) {
var filename = file.name var filename = file.name
@@ -318,11 +327,13 @@ export default {
var fileSuffix = filename.substring(index1, index2) var fileSuffix = filename.substring(index1, index2)
// const fileSuffix = file.name.split('.')[1] // 后缀名 // const fileSuffix = file.name.split('.')[1] // 后缀名
// 判断上传文件格式 // 判断上传文件格式
this.progressType = true
if (fileSuffix === '.ppt' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.PPT' || fileSuffix === '.xls' || fileSuffix === '.xlsx') { if (fileSuffix === '.ppt' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.PPT' || fileSuffix === '.xls' || fileSuffix === '.xlsx') {
return true return true
} else { } else {
this.spinShow = false this.spinShow = false
this.$message.error('文件' + file.name + '格式不正确,请上传PPT,DOCX,XLS文件') this.$message.error('文件' + file.name + '格式不正确,请上传PPT,DOCX,XLS文件')
this.progressType = false
return false return false
} }
// 判断文件上传大小 // 判断文件上传大小
@@ -331,6 +342,7 @@ export default {
return true return true
} else { } else {
this.$message.error('文件' + file.name + '大小不超过200M') this.$message.error('文件' + file.name + '大小不超过200M')
this.progressType = false
return false return false
} }
return true return true
@@ -339,6 +351,8 @@ export default {
importFileSuccess (response, file) { importFileSuccess (response, file) {
if (response.ok) { if (response.ok) {
this.fileMadel = false this.fileMadel = false
this.loadProgress = 0
this.progressType = false
this.form.model = response.data.id this.form.model = response.data.id
this.form.modelName = response.data.name this.form.modelName = response.data.name
this.$message({ this.$message({
@@ -412,7 +426,7 @@ export default {
}) })
} }
}, },
mounted () {} mounted () {},
} }
</script> </script>
@@ -102,12 +102,12 @@
width="100" width="100"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
prop="itemsTitle" <!-- prop="itemsTitle"-->
label="条款内容" <!-- label="条款内容"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="technicalRequir" prop="technicalRequir"
width="150" width="150"
@@ -118,7 +118,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="sarType === 'INLAND'"
prop="changePoint" prop="changePoint"
width="150" width="150"
label="基于上一版本差异" label="基于上一版本差异"
@@ -538,17 +537,17 @@
} }
itemList.forEach(item => { itemList.forEach(item => {
item.unitDeptName = this.$store.getters.userInfo.orgName item.unitDeptName = this.$store.getters.userInfo.orgName
item.onlineData = '' item.onlineData = item.onlineData || ''
item.newData = '' item.newData = item.newData || ''
item.complianceState = '' item.complianceState = item.complianceState || ''
item.oldNumber = '' item.oldNumber = item.oldNumber || ''
item.complianceRequir = '1' item.complianceRequir = item.complianceRequir || '1'
item.changePoint = '' item.changePoint = item.changePoint || ''
item.technicalRequir = '' item.technicalRequir = item.technicalRequir || ''
item.itemsTitle = item.itermsConditions item.itemsTitle = item.itermsConditions
}) })
console.log(2);
this.itemList = itemList this.itemList = itemList
console.log(this.itemList)
this.loading = false this.loading = false
}).catch(e => { }).catch(e => {
}) })