Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Superman_Main
2021-11-27 20:35:25 +08:00
31 changed files with 6314 additions and 5785 deletions
@@ -14,7 +14,7 @@
:value-format="valueFormat"
format="yyyy-MM-dd"
:value="value"
type="date"
type="dates"
:editable="true"
:disabled="disabled"
:placeholder="placeholder"
@@ -74,5 +74,7 @@ export default {
</script>
<style scoped>
/deep/ .el-input__inner {
padding-left: 30px;
}
</style>
+53 -23
View File
@@ -67,7 +67,8 @@
</template>
<script>
import { getConvertFileByAttId } from 'api/process'
import { getConvertFileByAttId,getBusStandFileByAttId } from 'api/process'
let Base64 = require('js-base64').Base64;
export default {
name: 'CustomFile',
data() {
@@ -335,29 +336,43 @@ export default {
handlePreview(file) {
const attId = file.response.data.id
if (this.preview) {
this.getConvertFileByAttId(attId)
.then(res => {
switch (res.convertState) {
case 'ERROR':
this.$message.warning('文档转换失败')
break
case 'LODING':
this.$message.info('文档转换中,请稍后查看')
break
case 'SUCCESS':
const { convertFileInfo } = res
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + convertFileInfo.id))
break
}
}).catch(e => {
this.$message.warning('文档转换失败')
})
if (attId) {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
} else {
this.$message.warning('文件不存在,下载失败')
}
} else {
if (attId) {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
} else {
this.$message.warning('文件不存在,下载失败')
}
this.getBusStandFileByAttId(attId)
.then(res => {
console.log(res)
if(res){
const editFileInfo = res
console.log(editFileInfo)
if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){
window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl)
}else {
const nowTime = new Date().getTime()
// window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
// switch (res.convertState) {
// case 'ERROR':
// this.$message.warning('文档转换失败')
// break
// case 'LODING':
// this.$message.info('文档转换中,请稍后查看')
// break
// case 'SUCCESS':
// const { convertFileInfo } = res
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + convertFileInfo.id))
// break
// }
}).catch(e => {
console.log(e)
this.$message.warning('文件不存在,预览失败')
})
}
},
@@ -377,6 +392,21 @@ export default {
})
})
},
getBusStandFileByAttId(attId) {
return new Promise((resolve, reject) => {
getBusStandFileByAttId({
attId
}).then(res => {
if (res.ok) {
resolve(res.data)
} else {
reject()
}
}).catch(e => {
reject(e)
})
})
},
/**
* @description: 获取展示的文件
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -175,7 +175,7 @@
if (node.level >= 1) {
setTimeout(() => {
this.getChildByList(node.data.level,node.data.vppsCode, resolve);
this.getChildByList(node.data.level,node.data.id, resolve);
}, 500);
return resolve([]); // 加上这个,防止在该节点没有子节点时一直转圈的问题发生。
}
@@ -192,8 +192,8 @@
}
})
},
getChildByList( level,vppsCode,resolve) { // 获取子节点请求
let params = {level : level,vppsCode :vppsCode,type : this.type};
getChildByList( level,id,resolve) { // 获取子节点请求
let params = {level : level,id :id,type : this.type};
this.$http.get(this.urlChild, params, {
_this: this
}, res => {