|
@@ -222,6 +222,8 @@
|
|
<el-upload ref="upfile"
|
|
<el-upload ref="upfile"
|
|
style="display: inline"
|
|
style="display: inline"
|
|
:auto-upload="false"
|
|
:auto-upload="false"
|
|
|
|
+
|
|
|
|
+ :limit="1"
|
|
:on-change="handleChange"
|
|
:on-change="handleChange"
|
|
:file-list="fileList"
|
|
:file-list="fileList"
|
|
action="#">
|
|
action="#">
|
|
@@ -284,7 +286,7 @@
|
|
reportFileData1 : [],
|
|
reportFileData1 : [],
|
|
reportFileData2 : [],
|
|
reportFileData2 : [],
|
|
file_model:["解析文件","模型文件"],
|
|
file_model:["解析文件","模型文件"],
|
|
- model_type:"",
|
|
|
|
|
|
+ model_type:"解析文件",
|
|
file_name:"",
|
|
file_name:"",
|
|
fileNameModel:"",
|
|
fileNameModel:"",
|
|
fileNameXml:"",
|
|
fileNameXml:"",
|
|
@@ -343,15 +345,17 @@
|
|
for (let item of this.reportFileData){
|
|
for (let item of this.reportFileData){
|
|
if(item.fileNameXml){
|
|
if(item.fileNameXml){
|
|
this.reportFileData1.push(item)
|
|
this.reportFileData1.push(item)
|
|
- if(item.fileNameTxt) {
|
|
|
|
- let litem = {
|
|
|
|
- id:item.id,
|
|
|
|
- fileNameXml:item.fileNameTxt,
|
|
|
|
- updateTime:item.updateTime
|
|
|
|
- }
|
|
|
|
- this.reportFileData1.push(litem)
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if(item.fileNameTxt) {
|
|
|
|
+ let litem = {
|
|
|
|
+ id:item.id,
|
|
|
|
+ fileNameXml:item.fileNameTxt,
|
|
|
|
+ updateTime:item.updateTime
|
|
}
|
|
}
|
|
- }if(item.fileNameModel){
|
|
|
|
|
|
+ this.reportFileData1.push(litem)
|
|
|
|
+ }
|
|
|
|
+ if(item.fileNameModel){
|
|
let aitem = {
|
|
let aitem = {
|
|
id:item.id,
|
|
id:item.id,
|
|
fileNameXml:item.fileNameModel,
|
|
fileNameXml:item.fileNameModel,
|
|
@@ -558,12 +562,19 @@
|
|
fd.append("files",item.raw);
|
|
fd.append("files",item.raw);
|
|
if(this.model_type == "模型文件"){
|
|
if(this.model_type == "模型文件"){
|
|
this.fileNameModel = "1"
|
|
this.fileNameModel = "1"
|
|
- }else if(item.raw.name.toString().endsWith("txt")){
|
|
|
|
|
|
+ }
|
|
|
|
+ if(item.raw.name.toString().endsWith("txt")){
|
|
this.fileNameTxt = "1"
|
|
this.fileNameTxt = "1"
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else if(item.raw.name.toString().endsWith("xml")){
|
|
this.fileNameXml = "1"
|
|
this.fileNameXml = "1"
|
|
}
|
|
}
|
|
|
|
+ else {
|
|
|
|
+ {
|
|
|
|
+ this.$alert("请上传正确的文件类型");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
request.post('/report/fileReportAdd',{
|
|
request.post('/report/fileReportAdd',{
|
|
file_name : item.raw.name,
|
|
file_name : item.raw.name,
|
|
fileModel:this.fileNameModel,
|
|
fileModel:this.fileNameModel,
|
|
@@ -577,33 +588,34 @@
|
|
console.log("模型类")
|
|
console.log("模型类")
|
|
|
|
|
|
console.log(this.fileNameModel)
|
|
console.log(this.fileNameModel)
|
|
- })
|
|
|
|
- if(this.model_type == "模型文件") {
|
|
|
|
- request.post('/up/uploadMod', fd).then(res => {
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- this.$message.error(err.message)
|
|
|
|
- // console.log(err)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- request.post('/up/uploadUi', fd).then(res => {
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- this.$message.error(err.message)
|
|
|
|
- // console.log(err)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- this.add_file_show=false;
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.$message({
|
|
|
|
- message: '文件上传成功',
|
|
|
|
- type: 'success'
|
|
|
|
- });
|
|
|
|
|
|
+ if(this.model_type == "模型文件") {
|
|
|
|
+ request.post('/up/uploadMod', fd).then(res => {
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ this.$message.error(err.message)
|
|
|
|
+ // console.log(err)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ request.post('/up/uploadUi', fd).then(res => {
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ this.$message.error(err.message)
|
|
|
|
+ // console.log(err)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.add_file_show=false;
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- location.reload();
|
|
|
|
- }, 1000);
|
|
|
|
- }, 100);
|
|
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '文件上传成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ location.reload();
|
|
|
|
+ }, 1000);
|
|
|
|
+ }, 100);
|
|
|
|
+ })
|
|
|
|
+
|
|
},
|
|
},
|
|
fileDelete: function (row,type){
|
|
fileDelete: function (row,type){
|
|
console.log("asssssdfas")
|
|
console.log("asssssdfas")
|