提交 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 {
/** /**
* 导航栏部件 * 导航栏部件
* *
...@@ -39,13 +38,13 @@ export class ExpViewEngine extends ViewEngine { ...@@ -39,13 +38,13 @@ export class ExpViewEngine extends ViewEngine {
/** /**
* 引擎加载 * 引擎加载
* *
* @memberof ExpViewEngine * @memberof ExpViewEngine
*/ */
public load() { public load() {
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 });
} }
} }
...@@ -78,12 +77,12 @@ export class ExpViewEngine extends ViewEngine { ...@@ -78,12 +77,12 @@ export class ExpViewEngine extends ViewEngine {
/** /**
* 处理导航视图重绘(有选中项,且导航视图需要刷新则通知嵌入导航视图执行刷新逻辑) * 处理导航视图重绘(有选中项,且导航视图需要刷新则通知嵌入导航视图执行刷新逻辑)
* *
* @memberof ExpViewEngine * @memberof ExpViewEngine
*/ */
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 });
} }
} }
...@@ -91,16 +90,16 @@ export class ExpViewEngine extends ViewEngine { ...@@ -91,16 +90,16 @@ export class ExpViewEngine extends ViewEngine {
* 事件处理 * 事件处理
* *
* @param {string} ctrlName 事件标识 * @param {string} ctrlName 事件标识
* @param {string} eventName * @param {string} eventName
* @param {*} args * @param {*} args
* @memberof ExpViewEngine * @memberof ExpViewEngine
*/ */
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);
} }
} }
...@@ -178,7 +177,7 @@ export class ExpViewEngine extends ViewEngine { ...@@ -178,7 +177,7 @@ export class ExpViewEngine extends ViewEngine {
/** /**
* 获取导航栏 * 获取导航栏
* *
* @return {*} * @return {*}
* @memberof ExpViewEngine * @memberof ExpViewEngine
*/ */
public getExpBar() { public getExpBar() {
...@@ -192,4 +191,4 @@ export class ExpViewEngine extends ViewEngine { ...@@ -192,4 +191,4 @@ export class ExpViewEngine extends ViewEngine {
public destroyed() { public destroyed() {
this.expBar = null; this.expBar = null;
} }
} }
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册