Commit b41918cf authored by yyh's avatar yyh

功能

parent eee05ea0
...@@ -81,7 +81,7 @@ export default class ProofItem extends Vue { ...@@ -81,7 +81,7 @@ export default class ProofItem extends Vue {
return this.proof; return this.proof;
} }
private getIncrementList(count: number) { private getIncrementList(count: number) {
const { proof: { hash }} = this.proof; const { hash } = this.proof;
return this.$api.proof.incrementList(hash).then((res: any) => { return this.$api.proof.incrementList(hash).then((res: any) => {
this.incrementList = res.results || []; this.incrementList = res.results || [];
}); });
......
...@@ -20,7 +20,7 @@ export default class TypeOne extends Vue { ...@@ -20,7 +20,7 @@ export default class TypeOne extends Vue {
@Prop() @Prop()
private value!: []; private value!: [];
private fileList: any[] = []; private fileList: any[] = [];
@Watch('value', { immediate: true, deep: true }) @Watch('valHash', { immediate: true, deep: true })
private async onChange(newVal: [], oldVal: []) { private async onChange(newVal: [], oldVal: []) {
if (newVal.length <= 0) { if (newVal.length <= 0) {
this.fileList = []; this.fileList = [];
...@@ -30,10 +30,21 @@ export default class TypeOne extends Vue { ...@@ -30,10 +30,21 @@ export default class TypeOne extends Vue {
this.fileList = res.files; this.fileList = res.files;
}); });
} }
get valHash() {
return this.value.map((val: any) => {
if (!val.value) {
return val.hash;
}
});
}
private afterRead(file: any) { private afterRead(file: any) {
if (!Array.isArray(file)) { if (!Array.isArray(file)) {
this.$api.file.upload(file.file).then((res: any) => { this.$api.file.upload(file.file).then((res: any) => {
this.$emit('update:value', [...(this.value), res.hash]); this.$emit('update:value', [...(this.value), {
type: 'image',
format: 'hash',
hash: res.hash,
}]);
}); });
} }
} }
......
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