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

update:更新

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