提交 c3a721d8 编写于 作者: Shine-zwj's avatar Shine-zwj

修复导航视图修改右侧表单数据时,只能跳转第一条数据BUG

上级 7f160620
......@@ -560,7 +560,16 @@ import CodeListService from "@/codelist/codelist-service";
this.isAddBehind = false;
this.$emit('load', this.items);
if(this.isSelectFirstDefault){
this.handleClick(this.items[0]);
if(this.selections && this.selections.length > 0){
this.selections.forEach((select: any)=>{
const index = this.items.findIndex((item:any) => Object.is(item.srfkey,select.srfkey));
if(index != -1){
this.handleClick(this.items[index]);
}
})
}else{
this.handleClick(this.items[0]);
}
}
<#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
this.group();
......
......@@ -639,7 +639,16 @@ import CodeListService from "@/codelist/codelist-service";
this.isAddBehind = false;
this.$emit('load', this.items);
if(this.isSelectFirstDefault){
this.handleClick(this.items[0]);
if(this.selections && this.selections.length > 0){
this.selections.forEach((select: any)=>{
const index = this.items.findIndex((item:any) => Object.is(item.srfkey,select.srfkey));
if(index != -1){
this.handleClick(this.items[index]);
}
})
}else{
this.handleClick(this.items[0]);
}
}
<#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
this.group();
......
......@@ -651,7 +651,12 @@ import UIService from '@/uiservice/ui-service';
// 导航中选中第一条配置的默认选中,没有选中第一条
if(this.isSelectFirstDefault){
if(this.isSingleSelect){
let index = items.findIndex((item: any) => item.selected);
let index: number = -1;
if(this.selectedNodes && this.selectedNodes.length > 0){
this.selectedNodes.forEach((select: any) => {
index = items.findIndex((item: any) => Object.is(select.srfkey,item.srfkey));
});
}
if(index === -1) {
if(isRoot){
index = 0;
......
......@@ -752,7 +752,7 @@ import { Environment } from '@/environments/environment';
this.totalrow = response.total;
this.items = JSON.parse(JSON.stringify(data));
// 清空selections,gridItemsModel
this.selections = [];
//this.selections = [];
this.gridItemsModel = [];
this.items.forEach(()=>{this.gridItemsModel.push(this.getGridRowModel())});
this.items.forEach((item:any)=>{
......@@ -763,7 +763,16 @@ import { Environment } from '@/environments/environment';
let _this = this;
setTimeout(() => {
if(_this.isSelectFirstDefault){
_this.rowClick(_this.items[0]);
if(_this.selections && _this.selections.length > 0){
_this.selections.forEach((select: any)=>{
const index = _this.items.findIndex((item:any) => Object.is(item.srfkey,select.srfkey));
if(index != -1){
_this.rowClick(_this.items[index]);
}
})
}else{
_this.rowClick(this.items[0]);
}
}
if(_this.selectedData){
const refs: any = _this.$refs;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册