提交 32dfe5f3 编写于 作者: Mosher's avatar Mosher

update:更新

上级 2a5b03cf
......@@ -8,7 +8,6 @@ import ViewEngine from "./view-engine";
* @extends {ViewEngine}
*/
export class ExpViewEngine extends ViewEngine {
/**
* 导航栏部件
*
......@@ -45,7 +44,7 @@ export class ExpViewEngine extends ViewEngine {
super.load();
if (this.getExpBar() && this.isLoadDefault) {
const tag = this.getExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
this.setViewState2({ tag: tag, action: "load", viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
......@@ -60,7 +59,7 @@ export class ExpViewEngine extends ViewEngine {
public search(data: any) {
const expBar = this.getExpBar();
if (expBar) {
this.setViewState2({ tag: expBar.name, action: 'load', viewdata: null });
this.setViewState2({ tag: expBar.name, action: "load", viewdata: null });
}
}
......@@ -83,7 +82,7 @@ export class ExpViewEngine extends ViewEngine {
*/
public handleNavViewRefresh(tag: string) {
if (this.view && this.view.viewState && this.isRealSelected) {
this.setViewState2({ tag, action: 'load', viewdata: this.view.viewparams });
this.setViewState2({ tag, action: "load", viewdata: this.view.viewparams });
}
}
......@@ -97,10 +96,10 @@ export class ExpViewEngine extends ViewEngine {
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any) {
const expBar = this.getExpBar();
if (ctrlName === expBar?.name) {
if (expBar && ctrlName === expBar.name) {
this.handleExpBarEvents(eventName, args);
}
if (ctrlName === expBar?.xDataControlName) {
if (expBar && ctrlName === expBar.xDataControlName) {
this.handleXDataControlEvents(eventName, args);
}
}
......@@ -114,15 +113,15 @@ export class ExpViewEngine extends ViewEngine {
* @memberof ExpViewEngine
*/
protected handleExpBarEvents(eventName: string, args: any) {
if (Object.is(eventName, 'load')) {
this.view.$emit('viewload', args);
if (Object.is(eventName, "load")) {
this.view.$emit("viewload", args);
}
if (Object.is(eventName, 'selectionchange')) {
if (Object.is(eventName, "selectionchange")) {
if (this.isCloseNavView) {
this.isCloseNavView = false;
return;
}
if (this.view && args && args.srfnavdata && args.srfnavdata.context && args.srfnavdata.context.viewpath) {
if (this.view && args && args.srfnavdata && args.srfnavdata.context) {
this.view.navItem = args;
if (this.view.backSplit !== 0) {
this.view.split = this.view.backSplit;
......@@ -131,20 +130,20 @@ export class ExpViewEngine extends ViewEngine {
if (args && args.data && args.data[0]) {
const selectedData = args.data[0];
const result = Object.keys(selectedData).find((key: string) => {
return selectedData[key] !== null && key !== 'srfchecked';
})
if(result){
return selectedData[key] !== null && key !== "srfchecked";
});
if (result) {
this.isRealSelected = true;
}else{
} else {
this.isRealSelected = false;
}
}
this.view.$forceUpdate();
// this.view.$forceUpdate();
}
this.view.$emit('viewdataschange', args?.data);
this.view.$emit("viewdataschange", args && args.data ? args.data : []);
}
if (Object.is(eventName, 'activated')) {
this.view.$emit('viewdatasactivated', args);
if (Object.is(eventName, "activated")) {
this.view.$emit("viewdatasactivated", args);
}
}
......@@ -157,7 +156,7 @@ export class ExpViewEngine extends ViewEngine {
* @memberof ExpViewEngine
*/
protected handleXDataControlEvents(eventName: string, args: any) {
if (Object.is(eventName, 'beforeload')) {
if (Object.is(eventName, "beforeload")) {
this.handleBeforeLoad(args);
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册