Commit 913c9977 authored by yyh's avatar yyh

代码调整

parent d97c5ef5
...@@ -18,14 +18,6 @@ ...@@ -18,14 +18,6 @@
v-if="!list.length && !loading" v-if="!list.length && !loading"
description="您还未添加存证" description="您还未添加存证"
image="@/assets/empty.png"> image="@/assets/empty.png">
<!-- <van-button
:to="{name: 'TemplateList'}"
round
type="info"
color="#6C7AFE"
class="bottom-button">
添加存证
</van-button> -->
</van-empty> </van-empty>
<proof-item <proof-item
v-else v-else
...@@ -51,7 +43,7 @@ ...@@ -51,7 +43,7 @@
:text="currentProof.status === ChainStatus.FAILURE && item.text === '上链' ? `重新${item.text}`:`${item.text}`" :text="currentProof.status === ChainStatus.FAILURE && item.text === '上链' ? `重新${item.text}`:`${item.text}`"
@click="select(item.key)"> @click="select(item.key)">
<template #icon> <template #icon>
<common-svg :name="item.icon" :width="'44px'" :height="'44px'"></common-svg> <common-svg :name="item.icon" width="44px" height="44px"></common-svg>
</template> </template>
</van-grid-item> </van-grid-item>
</van-grid> </van-grid>
...@@ -73,26 +65,6 @@ ...@@ -73,26 +65,6 @@
<transition name="van-slide-up"> <transition name="van-slide-up">
<preview-template :data="detail" v-if="showPreview" @cancel="showPreview = false" @employ="employ"></preview-template> <preview-template :data="detail" v-if="showPreview" @cancel="showPreview = false" @employ="employ"></preview-template>
</transition> </transition>
<van-popup
v-model="showIncrementMore"
round
class="more-action"
position="bottom"
>
<van-grid :column-num="3" :gutter="10" :border="false">
<van-grid-item
v-for="(item, index) in actionList"
:key="index"
icon="photo-o"
:text="currentProof.status === ChainStatus.FAILURE && item.text === '上链' ? `重新${item.text}`:`${item.text}`"
@click="select(item.key)">
<template #icon>
<common-svg :name="item.icon" :width="'44px'" :height="'44px'"></common-svg>
</template>
</van-grid-item>
</van-grid>
<van-button block round @click="showIncrementMore = false;">取消</van-button>
</van-popup>
</div> </div>
</template> </template>
...@@ -145,8 +117,6 @@ export default class Index extends Vue { ...@@ -145,8 +117,6 @@ export default class Index extends Vue {
private showAddFolder: boolean = false; private showAddFolder: boolean = false;
private showAddProof: boolean = false; private showAddProof: boolean = false;
private showIncrementMore: boolean = false;
private proofName: string = ''; private proofName: string = '';
private templateInfo: any = { private templateInfo: any = {
id: '', id: '',
...@@ -154,6 +124,10 @@ export default class Index extends Vue { ...@@ -154,6 +124,10 @@ export default class Index extends Vue {
}; };
private isZengliang: boolean = false; private isZengliang: boolean = false;
private async addProofHandler() { private async addProofHandler() {
let query: any = {
templateId: this.templateInfo.id,
proofName: this.proofName,
}
if ( this.isZengliang ) { if ( this.isZengliang ) {
let preProof = null; let preProof = null;
if (this.currentProof.increment_num > 0) { if (this.currentProof.increment_num > 0) {
...@@ -162,40 +136,18 @@ export default class Index extends Vue { ...@@ -162,40 +136,18 @@ export default class Index extends Vue {
} else { } else {
preProof = this.currentProof; preProof = this.currentProof;
} }
this.$router.push({name: 'ProofDetail', query = {...query, baseProof: JSON.stringify(this.currentProof), preProof: JSON.stringify(preProof),}
query: { templateId: this.templateInfo.id,
baseProof: JSON.stringify(this.currentProof),
preProof: JSON.stringify(preProof),
proofName: this.proofName }});
} else {
this.$router.push({name: 'ProofDetail',
query: { templateId: this.templateInfo.id,
proofName: this.proofName,
}});
} }
this.$router.push({ name: 'ProofDetail', query});
} }
private async addFolder(data: any) { private async addFolder( { folderName }: any) {
const { folderName } = data; this.showAddFolder = false ;
this.showAddFolder = false;
await this.$api.template.addFolder(folderName); await this.$api.template.addFolder(folderName);
this.showSelectTemplate = false; this.showSelectTemplate = false;
} }
// private async next(data: any) { private nextSelectedTemplate({ templateId, templateName }: any) {
// let preProof = null; this.templateInfo.id = templateId;
// if (this.currentProof.increment_num > 0) { this.templateInfo.name = templateName;
// const incrementProofListResult = await this.$api.proof.incrementList(this.currentProof.hash);
// preProof = (incrementProofListResult.results || [])[0];
// } else {
// preProof = this.currentProof;
// }
// this.$router.push({name: 'ProofDetail',
// query: { templateId: data.templateId,
// baseProof: JSON.stringify(this.currentProof),
// preProof: JSON.stringify(preProof) }});
// }
private nextSelectedTemplate(data: any) {
this.templateInfo.id = data.templateId;
this.templateInfo.name = data.templateName;
this.showPreview = false; this.showPreview = false;
this.showSelectTemplate = false; this.showSelectTemplate = false;
} }
...@@ -205,8 +157,6 @@ export default class Index extends Vue { ...@@ -205,8 +157,6 @@ export default class Index extends Vue {
this.showPreview = true; this.showPreview = true;
} }
private employ() { private employ() {
// this.nextSelectedTemplate({templateId: this.currentTemplate.id})
// this.next({templateId: this.currentTemplate.id});
this.nextSelectedTemplate({ this.nextSelectedTemplate({
templateId: this.currentTemplate.id, templateId: this.currentTemplate.id,
templateName: this.currentTemplate.name, templateName: this.currentTemplate.name,
...@@ -316,23 +266,6 @@ export default class Index extends Vue { ...@@ -316,23 +266,6 @@ export default class Index extends Vue {
}); });
} }
private abandonProof(proofId: number) { private abandonProof(proofId: number) {
// this.$dialog.confirm({
// title: '是否确定删除该存证?',
// message: '已删除的存证,在回收站里',
// beforeClose: (action, done) => {
// if ( action === 'confirm' ) {
// this.$api.proof.abandon(proofId, '暂无原因').then((res: any) => {
// this.$toast.success('已放入回收站');
// this.resetList();
// done();
// }).catch((err: any) => {
// done();
// });
// } else {
// done();
// }
// },
// });
this.$confirmdel().then((res: any) => { this.$confirmdel().then((res: any) => {
this.$api.proof.abandon(proofId, '暂无原因').then(() => { this.$api.proof.abandon(proofId, '暂无原因').then(() => {
this.$toast.success('已放入回收站'); this.$toast.success('已放入回收站');
...@@ -375,8 +308,7 @@ export default class Index extends Vue { ...@@ -375,8 +308,7 @@ export default class Index extends Vue {
box-sizing: border-box; box-sizing: border-box;
padding: 11px 14px; padding: 11px 14px;
background: #F9FBFF; background: #F9FBFF;
// margin-bottom: calc($tabHeight + 50px); margin-bottom: calc( #{ $tabHeight } + 50px);
margin-bottom: 100px;
} }
.add-proof{ .add-proof{
position: fixed; position: fixed;
......
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