Commit 26bd1ee0 by liuyong

修改bug

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