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