Commit 26bd1ee0 by liuyong

修改bug

1 parent 2630810e
......@@ -57,7 +57,7 @@
item2.shapeWidth ? item2.shapeWidth : 150,
item2.shapeHeight ? item2.shapeHeight : 75,
'',
item2.elementName,
item2.rsName,
null,
'非封闭图形2'
)
......
......@@ -136,7 +136,7 @@
:on-remove="(file, fileList) => handleRemove(file, fileList, scope.row)"
:on-success="(res, file, fileList) => handleFileUploadSuccess(res, file, fileList, scope.row)"
:limit="1"
:file-list="fileList">
:file-list="scope.row.fileList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</template>
......@@ -401,13 +401,13 @@ export default {
},
selectRo3: [],
tableData4: [
{ id: 1, tableLet1: '技术规范书', fileList: [] },
{ id: 2, tableLet1: '可行性研究报告', fileList: [] },
{ id: 3, tableLet1: '需求规格说明书', fileList: [] },
{ id: 4, tableLet1: '概要设计说明书', fileList: [] },
{ id: 5, tableLet1: '安全防护方案', fileList: [] },
{ id: 1, tableLet1: '技术规范书', fileList: [], fileArray: [] },
{ id: 2, tableLet1: '可行性研究报告', fileList: [], fileArray: [] },
{ id: 3, tableLet1: '需求规格说明书', fileList: [], fileArray: [] },
{ id: 4, tableLet1: '概要设计说明书', fileList: [], fileArray: [] },
{ id: 5, tableLet1: '安全防护方案', fileList: [], fileArray: [] },
],
fileList: []
prjId: null,
};
},
mounted(){
......@@ -423,15 +423,14 @@ export default {
methods: {
// 文件上传逻辑
handleRemove(file, fileList, row) {//文件移出
row.fileList = [];
row.fileArray = [];
},
handleFileUploadSuccess(res, file, fileList, row) {//文件上传
row.fileList = [{
row.fileArray = [{
fileName: file.name,
fileId: file.response.data.fileId,
fileUrl: file.response.data.viewUrl
}];
console.log(this.fileList)
},
operation(type, data) {
switch(type){
......@@ -557,7 +556,6 @@ export default {
},
editItem(row) {//编辑
this.add_dialog = true;
console.log(JSON.parse(row.filesValue));
this.is_add_edit = 'edit';
this.ruleForm.let1 = row.appName;
this.selectRow = [{
......@@ -579,7 +577,28 @@ export default {
}]
this.ruleForm.let4 = row.prjName;
}
let filesValue = JSON.parse(row.filesValue);
this.tableData4.forEach((item, index) => {
item.fileList = filesValue[index].fileUrl ? [
{
name: filesValue[index].name,
url: filesValue[index].fileUrl,
fileId: filesValue[index].fileId,
fileName: filesValue[index].fileName,
fileUrl: filesValue[index].fileUrl,
}
] : [];
item.fileArray = filesValue[index].fileUrl ? [
{
name: filesValue[index].name,
url: filesValue[index].fileUrl,
fileId: filesValue[index].fileId,
fileName: filesValue[index].fileName,
fileUrl: filesValue[index].fileUrl,
}
] : [];
});
this.prjId = row.prjId;
},
open_add_dialog2() {//打开选择系统窗口
this.add_dialog2 = true;
......@@ -663,9 +682,9 @@ export default {
this.tableData4.forEach(item => {
filesValue.push({
name: item.tableLet1,
fileId: item.fileList.length > 0 ? item.fileList[0].fileId : null,
fileName: item.fileList.length > 0 ? item.fileList[0].fileName : null,
fileUrl: item.fileList.length > 0 ? item.fileList[0].fileUrl : null,
fileId: item.fileArray.length > 0 ? item.fileArray[0].fileId : null,
fileName: item.fileArray.length > 0 ? item.fileArray[0].fileName : null,
fileUrl: item.fileArray.length > 0 ? item.fileArray[0].fileUrl : null,
})
})
const params = {
......@@ -674,25 +693,39 @@ export default {
prjPlanClass: this.ruleForm.let3,
filesValue
}
const requestParams = this.is_add_edit == 'add' ? params : { ...params, elementId: this.elementId };
const requestParams = this.is_add_edit == 'add' ? params : { ...params, prjId: this.prjId };
if(this.is_add_edit == 'add') {
// addProjectManageTable(requestParams).then(res => {
// if(res.code == 200) {
// this.get_table();
// this.add_dialog = false;
// Message({
// type: 'success',
// message: '保存成功!'
// });
// }else {
// Message({
// type: 'error',
// message: res.msg
// });
// }
// });
addProjectManageTable(requestParams).then(res => {
if(res.code == 200) {
this.get_table();
this.add_dialog = false;
Message({
type: 'success',
message: '保存成功!'
});
}else {
Message({
type: 'error',
message: res.msg
});
}
});
}else {
editDeleteProjectInfoManageTable(requestParams).then(res => {
if(res.code == 200) {
this.get_table();
this.add_dialog = false;
Message({
type: 'success',
message: '保存成功!'
});
}else {
Message({
type: 'error',
message: res.msg
});
}
});
}
}else {
return false;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!