Commit ce3637e7 authored by zL's avatar zL

提交更改

parent 48bab46c
......@@ -28,7 +28,9 @@
</div>
<span class="content-number">{{ serialNumber(index) }}</span>
</li>
<li class="content-name" @click="showProduct(item)">{{ item.name }}</li>
<li class="content-name" @click="showProduct(item, index)">
{{ item.name }}
</li>
<li class="content-time">{{ item.update_time | formatTime }}</li>
<li class="content-chain">
<div class="content-the-above-link" v-if="item.status === 2">
......@@ -173,7 +175,10 @@
]"
></i>
</li>
<li class="incremental-name" @click="enterDetails(item2, item)">
<li
class="incremental-name"
@click="enterDetails(item2, item, index)"
>
{{ item2.name }}
</li>
<li class="incremental-time">{{ item2.update_time | formatTime }}</li>
......@@ -210,6 +215,7 @@
<script>
import { downloadQrCode, getQR, openChainBrowser } from "@/utils/app/common";
import { GO_URLS } from "@/config/URLS";
export default {
data() {
return {
......@@ -223,6 +229,12 @@ export default {
watch: {
getInfoList: function (newv, oldv) {
this.expandTheListIndex = -1;
if (this.$store.state.theAnchor != -1) {
this.expandTheList(
newv[this.$store.state.theAnchor],
this.$store.state.theAnchor
);
}
},
},
computed: {
......@@ -241,11 +253,11 @@ export default {
};
},
},
created() {},
methods: {
// 进入详情页
enterDetails(item2, item) {
enterDetails(item2, item, index) {
if (item2.status === 1) return false;
this.$store.commit("setTheAnchor", index);
this.$router.push({
path: "/editTemplate",
query: {
......@@ -256,11 +268,26 @@ export default {
});
},
// 展开增量数据列表
expandTheList(item, index) {
this.$emit("expandTheList", item, index);
setTimeout(() => {
async expandTheList(item, index) {
if (this.expandTheListIndex === index) {
console.log("满足判断");
this.expandTheListIndex = -1;
return false;
}
const res = await this.$ajax({
type: "post",
url: GO_URLS.incrementList,
params: {
base_hash: item.hash,
page: 1,
page_size: 10,
},
});
if (res) {
let list = res.data.results;
this.$store.commit("setIncrementList", { list, index });
this.expandTheListIndex = index;
}, 300);
}
},
// 打开区块链浏览器
handleChain(item) {
......@@ -299,8 +326,13 @@ export default {
document.removeEventListener("mousedown", this.onHindMenu);
},
// 进入详情页
showProduct(item) {
showProduct(item, index) {
if (item.status === 1 || item.status === 3) return false;
if (item.increment_num > 0) {
this.$store.commit("setTheAnchor", index);
} else {
this.$store.commit("setTheAnchor", -1);
}
this.$router.push({
path: "/editTemplate",
query: {
......
......@@ -47,7 +47,6 @@
<IncrementalDataList
@increment="incrementOperation"
@delete-goods="deleteGoodsShow"
@expandTheList="expandTheList"
@upload="upload"
@delete-incremental="deleteTheIncremental"
@incremental-chain="incrementalOnChain"
......@@ -238,22 +237,6 @@ export default {
this.Copydetails = item;
this.isShowCopy = true;
},
// 展开增量更新列表
async expandTheList(item, index) {
const res = await this.$ajax({
type: "post",
url: GO_URLS.incrementList,
params: {
base_hash: item.hash,
page: 1,
page_size: 10,
},
});
if (res) {
let list = res.data.results;
this.$store.commit("setIncrementList", { list, index });
}
},
// 增量存证上链
incrementalOnChain(item2, item) {
this.isShowToChainDialog = true;
......
......@@ -45,6 +45,9 @@ const mutations: MutationTree<StateTypes> = {
setTemplateNum(state, num) {
state.templateNum = num;
},
setTheAnchor(state, num) {
state.theAnchor = num
}
};
export default mutations;
......@@ -13,6 +13,7 @@ const state: StateTypes = {
existingEvidenceList: [],
userInfos: {},
templateNum: 0, //模板数量
theAnchor: -1
};
export default state;
......@@ -11,6 +11,7 @@ export interface StateTypes {
page: number // 存证当前页码
existingEvidenceList: any
userInfos: object, // 用户信息
templateNum: number // 模板数量
templateNum: number, // 模板数量
theAnchor: number //用于记录增量列表的展开
}
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