Commit ad8441ac authored by Damon's avatar Damon

定位到第一项

parent be460f14
...@@ -500,17 +500,6 @@ ...@@ -500,17 +500,6 @@
}) })
} }
}, },
tabsChange(index){
this.tabIndex = index
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.leftMenuStatus(0)
this.$nextTick(function() {
this.itemId = this.oldItemId
this.getMenuItemTop()
})
},
calMaterialCraftListAmount(arr){ calMaterialCraftListAmount(arr){
let amount = 0 let amount = 0
if(arr){ if(arr){
...@@ -567,13 +556,26 @@ ...@@ -567,13 +556,26 @@
this.tabIndex++ this.tabIndex++
this.arr = [] this.arr = []
this.scrollRightTop = 0 this.scrollRightTop = 0
this.leftMenuStatus(0) this.current = 0
this.$nextTick(function() { this.leftMenuStatus(0)
this.getMenuItemTop() const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
if (this.oldItemId) this.itemId = this.oldItemId
}) })
} }
}, },
tabsChange(index){
this.tabIndex = index
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.leftMenuStatus(0)
this.$nextTick(function() {
if (this.oldItemId)this.itemId = this.oldItemId
this.getMenuItemTop()
})
},
// ------------------------- 以下方法为上传组件相关 ------------------------- // ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项 // 弹出上传选项
selectUpload(item, groupIndex, itemIndex){ selectUpload(item, groupIndex, itemIndex){
...@@ -665,6 +667,7 @@ ...@@ -665,6 +667,7 @@
if (this.arr.length == 0) { if (this.arr.length == 0) {
await this.getMenuItemTop(); await this.getMenuItemTop();
} }
console.log("index, this.current", index, this.current)
if (index == this.current) return; if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop; this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() { this.$nextTick(function() {
......
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