Browse Source

【pc端 添加网格实体化指标详情】-【页面修改】-(魏凯)-2020/12/09

master
weikai 5 years ago
parent
commit
15c7e8d734
  1. 58
      src/views/modules/kpi/kpisubpositiondetail.vue

58
src/views/modules/kpi/kpisubpositiondetail.vue

@ -29,7 +29,7 @@
:limit=6 :limit=6
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-success="handleAvatarSuccess" :on-success="(res, file,fileList) => handleAvatarSuccess( res, file,fileList, index,index1,2)"
:on-error="handelError" :on-error="handelError"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
style="width:480px"> style="width:480px">
@ -49,7 +49,7 @@
:file-list="item1.files" :file-list="item1.files"
:before-upload="beforeAvatarFileUpload" :before-upload="beforeAvatarFileUpload"
:on-remove="handleFileRemove" :on-remove="handleFileRemove"
:on-success="handleAvatarFileSuccess" :on-success="(res, file,fileList) =>handleAvatarFileSuccess( res, file,fileList, index,index1,2)"
:on-error="handelError" :on-error="handelError"
:on-preview="handleFileCardPreview" :on-preview="handleFileCardPreview"
style="width:480px"> style="width:480px">
@ -79,7 +79,7 @@
:limit=6 :limit=6
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-success="handleAvatarSuccess" :on-success="(res, file,fileList) => handleAvatarSuccess( res, file,fileList, index,0,1)"
:on-error="handelError" :on-error="handelError"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
style="width:480px"> style="width:480px">
@ -99,7 +99,7 @@
:file-list="item.files" :file-list="item.files"
:before-upload="beforeAvatarFileUpload" :before-upload="beforeAvatarFileUpload"
:on-remove="handleFileRemove" :on-remove="handleFileRemove"
:on-success="handleAvatarFileSuccess" :on-success="(res, file,fileList) =>handleAvatarFileSuccess( res, file,fileList, index,0,1)"
:on-error="handelError" :on-error="handelError"
:on-preview="handleFileCardPreview" :on-preview="handleFileCardPreview"
style="width:480px"> style="width:480px">
@ -186,8 +186,6 @@ export default {
fileloading: false, fileloading: false,
checkDiction:[], checkDiction:[],
status:'0', status:'0',
//
trialVisible:false,
} }
}, },
@ -201,8 +199,8 @@ export default {
created: function () { created: function () {
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}` // this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}`
// this.uploadFileUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}` // this.uploadFileUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}`
this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}` this.uploadUrl = `http://localhost:9094/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
this.uploadFileUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}` this.uploadFileUrl = `http://localhost:9094/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}`
this.getOptions(); this.getOptions();
this.init(); this.init();
@ -218,6 +216,8 @@ export default {
methods: { methods: {
init () { init () {
this.dataForm.id = this.$route.query.id this.dataForm.id = this.$route.query.id
// 'e0ae6e8286ad0160b62023e030faa1d5'
// this.$route.query.id
this.status = this.$route.query.status === undefined? '0':this.$route.query.status; this.status = this.$route.query.status === undefined? '0':this.$route.query.status;
if (this.status === '1'){ if (this.status === '1'){
this.isAble = true; this.isAble = true;
@ -277,7 +277,7 @@ export default {
return false return false
} }
}, },
handleAvatarSuccess (res, file) { handleAvatarSuccess (res, file,fileList,index,index1,type) {
this.loading = false this.loading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) { if (res === null || res.data === null || res.data.imgUrl === null) {
@ -285,7 +285,14 @@ export default {
this.handleErrorRemove(file) this.handleErrorRemove(file)
return false return false
} }
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName }) if (type ===2){
this.checkDiction[index].childDiction[index1].images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName })
}else {
this.checkDiction[index].images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName })
}
this.hideUpload = this.dataForm.images.length >= 6 this.hideUpload = this.dataForm.images.length >= 6
}, },
handelError () { handelError () {
@ -328,14 +335,18 @@ export default {
} }
this.isAutoRemoveFile = true this.isAutoRemoveFile = true
}, },
handleAvatarFileSuccess (res, file) { handleAvatarFileSuccess (res, file,fileList,index,index1,type) {
this.fileloading = false this.fileloading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) { if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!') this.$message.error('文件上传失败!')
return false return false
} }
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName, name: res.data.fileName }) if (type ===2){
this.checkDiction[index].childDiction[index1].files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName })
}else {
this.checkDiction[index].files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName })
}
}, },
handleFileRemove (file, fileList) { handleFileRemove (file, fileList) {
for (var i = 0; i < this.dataForm.files.length; i++) { for (var i = 0; i < this.dataForm.files.length; i++) {
@ -413,37 +424,32 @@ export default {
// //
console.log(j) console.log(j)
let childDesribe = j.describe; let childDesribe = j.describe;
//
let childUrl = j.images.url === undefined? [] :j.images.url;
//
let thumbnail = j.images.thumbnail === undefined ? [] :j.images.thumbnail;
// //
let childFile =j.files.name === undefined ? [] : j.files; let childFile =j.files === [] ? [] : j.files;
//
let childFileImage =j.images === [] ? [] : j.images;
let littleId = j.id; let littleId = j.id;
let m = { let m = {
id:j.infoId, id:j.infoId,
pCheckItemName :bigId, pCheckItemName :bigId,
checkItemName: littleId, checkItemName: littleId,
desribe: childDesribe, desribe: childDesribe,
imageUrl: childUrl, files: childFile,
thumbnail:thumbnail, images:childFileImage
files: childFile
} }
subChild.push(m) subChild.push(m)
} }
}else { }else {
let childDesribe = i.describe; let childDesribe = i.describe;
let childUrl = i.images.url === undefined ?[]:i.images.url; let childFile = i.files === [] ?[]:i.files;
let thumbnail = i.images.thumbnail === undefined ? [] :j.images.thumbnail; let childFileImage =i.images === [] ? [] : i.images;
let childFile = i.files === undefined ?[]:i.files;
let ai = { let ai = {
id:i.infoId, id:i.infoId,
desribe:childDesribe, desribe:childDesribe,
pCheckItemName :bigId, pCheckItemName :bigId,
checkItemName: '', checkItemName: '',
imageUrl :childUrl, files:childFile,
thumbnail:thumbnail, images:childFileImage
files:childFile
} }
subChild.push(ai) subChild.push(ai)
} }

Loading…
Cancel
Save