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

update:更新

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