Commit 27e32c51 authored by wcmoon's avatar wcmoon

fix: 解决增量更新丢失prehash 和basehash 问题

parent 71439ea4
...@@ -203,6 +203,6 @@ export default class Template extends Vue { ...@@ -203,6 +203,6 @@ export default class Template extends Vue {
} }
.col_right--show { .col_right--show {
display: block; display: block;
overflow-y: scroll; overflow-y: auto;
} }
</style> </style>
...@@ -274,6 +274,8 @@ export default class editTemplate extends Vue { ...@@ -274,6 +274,8 @@ export default class editTemplate extends Vue {
]; // 所有文件类型 ]; // 所有文件类型
public inputAccept: string = "application/pdf"; public inputAccept: string = "application/pdf";
public files = []; public files = [];
public prehash = '';
public basehash = '';
// 系统模板>建立个人模板or建立存证 // 系统模板>建立个人模板or建立存证
// 个人模板>建立存证or更新模板 // 个人模板>建立存证or更新模板
// 建立存证>保存存证or保存模板 // 建立存证>保存存证or保存模板
...@@ -445,21 +447,32 @@ export default class editTemplate extends Vue { ...@@ -445,21 +447,32 @@ export default class editTemplate extends Vue {
this.localData = res.data.note; this.localData = res.data.note;
this.files = []; this.files = [];
if (res.data.detail !== "") { if (res.data.detail !== "") {
let data = JSON.parse(res.data.detail)[0]; let data = JSON.parse(res.data.detail);
for (let i = 0; i < this.allTypes.length; i++) { let root:any = [];
if (this.allTypes[i][0] === data.label) { data.forEach((item:any) => {
if (item.label === 'ext') {
root.push(item);
} else {
let i:number;
for (i = 0; i < this.allTypes.length; i++) {
if (this.allTypes[i][0] === item.label) {
this.fileType = this.allTypes[i][1]; this.fileType = this.allTypes[i][1];
break; break;
} }
} }
data.data?.forEach((item: any) => { if (i < 4) {
if (item.label === "上链原因") { item.data?.forEach((subItem: any) => {
this.reason = item.data.value; if (subItem.label === "上链原因") {
this.reason = subItem.data.value;
} else { } else {
const hashes: string[] = item.data?.map((i: any) => i.value); const hashes: string[] = subItem.data?.map((i: any) => i.value);
this.getUploadedFiles(hashes); this.getUploadedFiles(hashes);
} }
}); });
}
}
})
this.rootUnitList = formatTemplateApi2Local(root);
} else { } else {
this.rootUnitList = []; this.rootUnitList = [];
} }
...@@ -552,7 +565,6 @@ export default class editTemplate extends Vue { ...@@ -552,7 +565,6 @@ export default class editTemplate extends Vue {
var newDetail = new Array(); var newDetail = new Array();
newDetail = formatApiJson(this.rootUnitList); newDetail = formatApiJson(this.rootUnitList);
console.log(newDetail);
// return; // return;
// return // return
...@@ -592,7 +604,6 @@ export default class editTemplate extends Vue { ...@@ -592,7 +604,6 @@ export default class editTemplate extends Vue {
note: this.localData, note: this.localData,
}, },
}); });
console.log(JSON.stringify(newDetail));
if (res) { if (res) {
this.$message({ this.$message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment