Commit 27e32c51 authored by wcmoon's avatar wcmoon

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

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