提交 1d272f42 编写于 作者: ibizdev's avatar ibizdev

Mosher 发布系统代码 [后台服务,演示应用]

上级 0c670ce0
import ViewEngine from "./view-engine";
/**
* 导航视图引擎
*
* @export
* @class ExpViewEngine
* @extends {ViewEngine}
*/
export class ExpViewEngine extends ViewEngine {
/**
* 导航栏部件
*
* @protected
* @type {*}
* @memberof ExpViewEngine
*/
protected expBar: any = null;
/**
* 是否真正选中
*
* @protected
* @type {boolean}
* @memberof ExpViewEngine
*/
protected isRealSelected: boolean = false;
/**
* 是否关闭导航视图
*
* @protected
* @type {boolean}
* @memberof ExpViewEngine
*/
protected isCloseNavView: boolean = false;
/**
* 引擎加载
*
* @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 });
} else {
this.isLoadDefault = true;
}
}
/**
* 搜索
*
* @param {*} data
* @memberof ExpViewEngine
*/
public search(data: any) {
const expBar = this.getExpBar();
if (expBar) {
this.setViewState2({ tag: expBar.name, action: 'load', viewdata: null });
}
}
/**
* 关闭导航视图
*
* @memberof ExpViewEngine
*/
public closeNavView() {
this.view.backSplit = this.view.split;
this.view.split = 1;
this.view.navItem = null;
this.isCloseNavView = true;
}
/**
* 处理导航视图重绘(有选中项,且导航视图需要刷新则通知嵌入导航视图执行刷新逻辑)
*
* @memberof ExpViewEngine
*/
public handleNavViewRefresh(tag: string) {
if (this.view && this.view.viewState && this.isRealSelected) {
this.setViewState2({ tag, action: 'load', viewdata: this.view.viewparams });
}
}
/**
* 事件处理
*
* @param {string} ctrlName 事件标识
* @param {string} eventName
* @param {*} args
* @memberof ExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any) {
const expBar = this.getExpBar();
if (ctrlName === expBar?.name) {
this.handleExpBarEvents(eventName, args);
}
if (ctrlName === expBar?.xDataControlName) {
this.handleXDataControlEvents(eventName, args);
}
}
/**
* 处理导航栏事件
*
* @protected
* @param {string} eventName
* @param {*} args
* @memberof ExpViewEngine
*/
protected handleExpBarEvents(eventName: string, args: any) {
if (Object.is(eventName, 'load')) {
this.view.$emit('viewload', args);
}
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) {
this.view.navItem = args;
if (this.view.backSplit !== 0) {
this.view.split = this.view.backSplit;
}
// 计算真实选中值
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){
this.isRealSelected = true;
}else{
this.isRealSelected = false;
}
}
this.view.$forceUpdate();
}
this.view.$emit('viewdataschange', args?.data);
}
if (Object.is(eventName, 'activated')) {
this.view.$emit('viewdatasactivated', args);
}
}
/**
* 处理导航栏数据部件事件
*
* @protected
* @param {string} eventName
* @param {*} args
* @memberof ExpViewEngine
*/
protected handleXDataControlEvents(eventName: string, args: any) {
if (Object.is(eventName, 'beforeload')) {
this.handleBeforeLoad(args);
}
}
/**
* 导航栏数据部件加载之前
*
* @protected
* @param {*} args
* @memberof ExpViewEngine
*/
protected handleBeforeLoad(args: any) {
if (this.view && this.view.quickGroupData) {
Object.assign(args, { viewparams: this.view.quickGroupData });
}
}
/**
* 获取导航栏
*
* @return {*}
* @memberof ExpViewEngine
*/
public getExpBar() {
return this.expBar;
}
/**
* @description 视图销毁
* @memberof ExpViewEngine
*/
public destroyed() {
this.expBar = null;
}
}
\ No newline at end of file
import ViewEngine from './view-engine'; import { ExpViewEngine } from './exp-view-engine';
/** /**
* 表格导航视图界面引擎 * 表格导航视图界面引擎
...@@ -7,24 +7,7 @@ import ViewEngine from './view-engine'; ...@@ -7,24 +7,7 @@ import ViewEngine from './view-engine';
* @class GridExpViewEngine * @class GridExpViewEngine
* @extends {ViewEngine} * @extends {ViewEngine}
*/ */
export default class GridExpViewEngine extends ViewEngine { export default class GridExpViewEngine extends ExpViewEngine {
/**
* 表格导航栏部件
*
* @type {*}
* @memberof GridExpViewEngine
*/
public gridExpBar: any = null;
/**
* Creates an instance of GridExpViewEngine.
*
* @memberof GridExpViewEngine
*/
constructor() {
super();
}
/** /**
* 初始化引擎 * 初始化引擎
...@@ -33,79 +16,17 @@ export default class GridExpViewEngine extends ViewEngine { ...@@ -33,79 +16,17 @@ export default class GridExpViewEngine extends ViewEngine {
* @memberof GridExpViewEngine * @memberof GridExpViewEngine
*/ */
public init(options: any): void { public init(options: any): void {
this.gridExpBar = options.gridexpbar; this.expBar = options.gridexpbar;
super.init(options); super.init(options);
} }
/** /**
* 引擎加载 * @description 视图销毁
*
* @memberof GridExpViewEngine * @memberof GridExpViewEngine
*/ */
public load(): void { public destroyed() {
super.load(); super.destroyed();
if (this.getGridExpBar() && this.isLoadDefault) { this.expBar = null;
const tag = this.getGridExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'gridexpbar')) {
this.gridExpBarEvent(eventName, args);
}
} }
/**
* 表格导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof GridExpViewEngine
*/
public gridExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.view.$emit('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.view.$emit('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.view.$emit('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof GridExpViewEngine
*/
public getGridExpBar(): any {
return this.gridExpBar;
}
/**
* @description 销毁
* @memberof GridExpViewEngine
*/
public destroy() {
super.destroy();
this.gridExpBar = null;
}
} }
\ No newline at end of file
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
</div> </div>
<div slot="right"> <div slot="right">
<component <component
v-if="selection.view && !Object.is(this.selection.view.viewname, '')" v-if="navItem && navItem.navView"
:is="selection.view.viewname" :is="navItem.navView"
class="viewcontainer2" class="viewcontainer2"
:viewDefaultUsage="false" :viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.context)" :viewdata="JSON.stringify(navItem.srfnavdata.context)"
:viewparam="JSON.stringify(selection.viewparam)"> :viewparam="JSON.stringify(navItem.srfnavdata.viewparams)">
</component> </component>
</div> </div>
</split> </split>
...@@ -788,10 +788,18 @@ export default class IBIZOrderGridExpViewBase extends Vue { ...@@ -788,10 +788,18 @@ export default class IBIZOrderGridExpViewBase extends Vue {
/** /**
* 分隔值 * 分隔值
* *
* @type {string} * @type {number}
* @memberof IBIZOrderGridExpViewBase
*/
public split: number = 0.5;
/**
* 导航项
*
* @type {*}
* @memberof IBIZOrderGridExpViewBase * @memberof IBIZOrderGridExpViewBase
*/ */
public split: number = 0.3; public navItem: any = {};
/** /**
* split值变化事件 * split值变化事件
......
...@@ -621,7 +621,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface ...@@ -621,7 +621,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
*/ */
public load(opt: any = {}): void { public load(opt: any = {}): void {
if(!this.loadAction){ if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.searchForm.notConfig.loadAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCalendarView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return; return;
} }
const arg: any = { ...opt }; const arg: any = { ...opt };
...@@ -657,7 +657,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface ...@@ -657,7 +657,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
*/ */
public loadDraft(opt: any = {},mode?:string): void { public loadDraft(opt: any = {},mode?:string): void {
if(!this.loaddraftAction){ if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCalendarView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return; return;
} }
const arg: any = { ...opt } ; const arg: any = { ...opt } ;
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
</div> </div>
<div class="container-header"> <div class="container-header">
<div class='search-container'> <div class='search-container'>
<i-input :search="true" <i-input
@on-change="($event) => { this.searchText = $event.target.value; }" v-model="searchText"
:search="true"
:placeholder="placeholder" :placeholder="placeholder"
@on-search="onSearch"> @on-search="onSearch">
</i-input> </i-input>
...@@ -348,15 +349,7 @@ export default class GridExpViewgridexpbarBase extends Vue implements ControlInt ...@@ -348,15 +349,7 @@ export default class GridExpViewgridexpbarBase extends Vue implements ControlInt
* @type {(string)} * @type {(string)}
* @memberof GridExpViewgridexpbarBase * @memberof GridExpViewgridexpbarBase
*/ */
public searchText:string = ""; public searchText: string = "";
/**
* 分割宽度
*
* @type {number}
* @memberof GridExpViewgridexpbarBase
*/
public split: number = 0.5;
/** /**
...@@ -530,36 +523,42 @@ export default class GridExpViewgridexpbarBase extends Vue implements ControlInt ...@@ -530,36 +523,42 @@ export default class GridExpViewgridexpbarBase extends Vue implements ControlInt
* @memberof GridExpViewgridexpbarBase * @memberof GridExpViewgridexpbarBase
*/ */
public gridexpbar_selectionchange(args: any [], tag?: string, $event2?: any): void { public gridexpbar_selectionchange(args: any [], tag?: string, $event2?: any): void {
let tempContext:any = {}; const tempContext: any = {};
let tempViewParam:any = {}; const tempViewParam: any = {};
if (args.length === 0) { if (args.length === 0) {
this.calcToolbarItemState(true); this.calcToolbarItemState(true);
return ; return ;
} }
const arg:any = args[0]; const arg: any = args[0];
if(this.context){ if (this.context) {
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context))); Object.assign(tempContext, JSON.parse(JSON.stringify(this.context)));
}
Object.assign(tempContext, { 'ibizorder': arg['ibizorder']});
Object.assign(tempContext, { srfparentdename: 'IBIZOrder', srfparentkey:arg['ibizorder']});
if (this.navFilter && !Object.is(this.navFilter, "")) {
Object.assign(tempViewParam, { [this.navFilter]: arg['ibizorder']});
}
if (this.navPSDer && !Object.is(this.navPSDer,"")) {
Object.assign(tempViewParam, { [this.navPSDer]: arg['ibizorder']});
} }
Object.assign(tempContext,{'ibizorder':arg['ibizorder']}); if (this.navigateContext && Object.keys(this.navigateContext).length > 0) {
Object.assign(tempContext,{srfparentdename:'IBIZOrder',srfparentkey:arg['ibizorder']}); let _context:any = this.$util.computedNavData(arg, tempContext, tempViewParam, this.navigateContext);
if(this.navFilter && !Object.is(this.navFilter,"")){ Object.assign(tempContext, _context);
Object.assign(tempViewParam,{[this.navFilter]:arg['ibizorder']});
} }
if(this.navPSDer && !Object.is(this.navPSDer,"")){ if (this.navigateParams && Object.keys(this.navigateParams).length > 0) {
Object.assign(tempViewParam,{[this.navPSDer]:arg['ibizorder']}); let _params:any = this.$util.computedNavData(arg, tempContext, tempViewParam, this.navigateParams);
Object.assign(tempViewParam, _params);
} }
if(this.navigateContext && Object.keys(this.navigateContext).length >0){ const navItem: any = {
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateContext); navView: this.navViewName,
Object.assign(tempContext,_context); data: args,
srfnavdata: {
context: tempContext,
viewparams: tempViewParam
} }
if(this.navigateParams && Object.keys(this.navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
} }
this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, context:tempContext,viewparam:tempViewParam });
this.calcToolbarItemState(false); this.calcToolbarItemState(false);
this.$forceUpdate(); this.$emit('selectionchange', navItem);
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册