Commit 4e6795cc authored by JYbmarawcp's avatar JYbmarawcp

Merge branch 'development' of https://gitlab.33.cn/yyh/traceSourceMb into development

parents 41a5220d fb11c362
...@@ -59,7 +59,6 @@ import AddBaseinfo from './components/AddBaseinfo.vue'; ...@@ -59,7 +59,6 @@ import AddBaseinfo from './components/AddBaseinfo.vue';
import SelectTemplate from '@/views/template/components/SelectTemplate.vue'; import SelectTemplate from '@/views/template/components/SelectTemplate.vue';
import PreviewTemplate from '@/views/template/components/PreviewTemplate.vue'; import PreviewTemplate from '@/views/template/components/PreviewTemplate.vue';
import AddFolder from '@/views/template/components/AddFolder.vue'; import AddFolder from '@/views/template/components/AddFolder.vue';
import proof from '@/api/modules/proof';
@Component({ @Component({
components: { components: {
ProofItem, ProofItem,
......
<template> <template>
<div class="proof-item"> <div
<div class="header" > class="proof-item">
<span style="font-weight:500;font-size:18px;" class="van-ellipsis">{{proof.name}}</span> <div
class="header">
<span
style="font-weight:500;font-size:18px;"
class="van-ellipsis">{{proof.name}}</span>
<div> <div>
<span class="status" :class="statusStr.class">{{statusStr.text}}</span> <span
<span class="time">{{proof.update_time|timeFormat}}</span> class="status"
:class="currentProofStatusAndClass.class"
>{{currentProofStatusAndClass.text}}</span>
<span
class="time">{{proof.update_time | timeFormat}}</span>
</div> </div>
<common-svg @click.stop.native="showMoreAction" class="more" name="cunzhengliebiao-gengduo"></common-svg> <common-svg
@click.stop.native="showMoreAction"
name="cunzhengliebiao-gengduo"
class="more"
></common-svg>
</div> </div>
<div class="increment" v-if="proof.increment_num > 0" :class="proof.increment_num > 0 ? 'van-hairline--top':''"> <div
<van-steps :active="active" direction="vertical" class="list" active-color="#FF3661" v-show="showIncrementList"> v-if="proof.increment_num > 0"
<van-step v-for="(incrementProof, index) in incrementList" :key="incrementProof.id" > class="increment van-hairline--top">
<van-steps
v-show="showIncrementList"
:active="active"
direction="vertical"
class="list"
active-color="#FF3661" >
<van-step
v-for="({ id, name, status, update_time }, index) in incrementList"
:key="id" >
<template #active-icon> <template #active-icon>
<common-svg name="suyuan-weishanglian"></common-svg> <common-svg name="suyuan-weishanglian"></common-svg>
</template> </template>
...@@ -18,24 +39,33 @@ ...@@ -18,24 +39,33 @@
<common-svg name="suyuan-yishanglian"></common-svg> <common-svg name="suyuan-yishanglian"></common-svg>
</template> </template>
<div class="header"> <div class="header">
<div style="color:#737582;">{{incrementProof.name}}</div> <div
style="color:#737582;"
class="van-ellipsis">{{name}}</div>
<div> <div>
<span>{{getIncrementStatusStr(incrementProof.status).text}}</span> <span>{{getStatusTextAndClass(status).text}}</span>
<span style="margin-left: 10px;color:#B6B5BA;">{{incrementProof.update_time|timeFormat}}</span> <span
style="margin-left: 10px;color:#B6B5BA;">{{update_time | timeFormat}}</span>
</div> </div>
<common-svg name="bianji1" <common-svg
v-if="[ChainStatus.NONE, ChainStatus.FAILURE].includes(status)"
@click.stop="editIncrementProof(index)"
name="bianji1"
width="30px" width="30px"
height="30px" height="30px"
v-if="incrementProof.status !== ChainStatus.SUCCESS"
@click.stop="editIncrementProof(incrementProof,index)"
></common-svg> ></common-svg>
</div> </div>
</van-step> </van-step>
</van-steps> </van-steps>
<div class="desc" @click.stop="showIncrementList = !showIncrementList;getIncrementList(3);"> <div
class="desc"
@click.stop="toggleShowIncrementListHandler">
<common-svg name="suyuan-duoshaotiao1"></common-svg> <common-svg name="suyuan-duoshaotiao1"></common-svg>
<div>{{isSy? '溯源' : '慈善'}}流程{{proof.increment_num}}条</div> <div>{{ isSy ? '溯源' : '慈善' }}流程{{ proof.increment_num }}条</div>
<common-svg name="fanhui" :style="{transform: showIncrementList?'rotate(180deg)':'rotate(0)'}"></common-svg> <common-svg
name="fanhui"
class="arrow"
:class="{ expand: showIncrementList }"></common-svg>
</div> </div>
</div> </div>
</div> </div>
...@@ -65,39 +95,46 @@ export default class ProofItem extends Vue { ...@@ -65,39 +95,46 @@ export default class ProofItem extends Vue {
private activeName: string = '1'; private activeName: string = '1';
private ChainStatus = ChainStatus; private ChainStatus = ChainStatus;
private get currentProofStatusAndClass() {
return this.getStatusTextAndClass(this.proof.status);
}
@Emit('show-more-action') @Emit('show-more-action')
private async showMoreAction() { private async showMoreAction() {
const { proof: { increment_num } } = this; const { proof: { increment_num } } = this;
if (increment_num > 0) { if (increment_num > 0 && this.incrementList.length <= 0) {
await this.getIncrementList(increment_num); await this.getIncrementList(increment_num);
} }
return this.proof; return this.proof;
} }
private getIncrementList(count: number) { private async getIncrementList(count: number) {
const { hash } = this.proof; const { hash } = this.proof;
return this.$api.proof.incrementList(hash).then((res: any) => { const { results } = await this.$api.proof.incrementList(hash);
this.incrementList = res.results || []; this.incrementList = results || [];
});
} }
get statusStr() { private toggleShowIncrementListHandler() {
const { status } = this.proof; const {
return { showIncrementList,
text: ChainStatusStr[status], incrementList: { length },
class: classEnum[status], proof: { increment_num }
}; } = this;
this.showIncrementList = !showIncrementList;
if (this.showIncrementList && length <= 0) {
this.getIncrementList(increment_num);
}
} }
private getIncrementStatusStr(status: number) { private getStatusTextAndClass(status: number) {
return { return {
text: ChainStatusStr[status], text: ChainStatusStr[status],
class: classEnum[status],
}; };
} }
@Emit('edit-increment-proof') @Emit('edit-increment-proof')
private editIncrementProof(incrementProof: any, currentIndex: number) { private editIncrementProof(currentIndex: number) {
const preProof = this.incrementList.length < 2 const preProof = this.incrementList.length < 2
? this.proof ? this.proof
: this.incrementList[currentIndex + 1]; : this.incrementList[currentIndex + 1];
return { return {
incrementProof, incrementProof: this.incrementList[currentIndex],
baseProof: this.proof, baseProof: this.proof,
preProof, preProof,
}; };
...@@ -166,6 +203,12 @@ export default class ProofItem extends Vue { ...@@ -166,6 +203,12 @@ export default class ProofItem extends Vue {
padding-top: 10px; padding-top: 10px;
font-size: 12px; font-size: 12px;
color:#B6B5BA; color:#B6B5BA;
.arrow {
transition: all .3s linear;
&.expand {
transform: rotate(180deg);
}
}
} }
} }
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
v-model="searchValue" v-model="searchValue"
show-action show-action
placeholder="请输入搜索关键词" placeholder="请输入搜索关键词"
:left-icon="require('@/assets/search2.png')" left-icon="@/assets/search2.png"
@search="onSearch" @search="onSearch"
@input="onSearch"></van-search> @input="onSearch"></van-search>
<div v-if="searchValue" class="folder-detail"> <div v-if="searchValue" class="folder-detail">
......
...@@ -57,7 +57,8 @@ module.exports = { ...@@ -57,7 +57,8 @@ module.exports = {
options = merge(options, { options = merge(options, {
transformAssetUrls:{ transformAssetUrls:{
'van-image': ['src'], 'van-image': ['src'],
'van-empty': ['image'] 'van-empty': ['image'],
'van-search': ['left-icon']
} }
}); });
return options; return options;
......
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