提交 39fd95ee 编写于 作者: ibizdev's avatar ibizdev

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

上级 4fc1f538
......@@ -201,7 +201,7 @@ export default {
ibizsample0001id: "IBIZSAMPLE0001标识",
},
uiactions: {
help: "Help",
ibizsample0001_opendocument: "打开文档",
},
},
main5_form: {
......
......@@ -200,7 +200,7 @@ export default {
ibizsample0001id: "IBIZSAMPLE0001标识",
},
uiactions: {
help: "帮助",
ibizsample0001_opendocument: "打开文档",
},
},
main5_form: {
......
......@@ -13,6 +13,9 @@
<div class='content-container'>
<div style="margin-bottom:6px;">
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" @valuechange="quickGroupValueChange"></app-quick-group>
</div>
<div class="quick-search-container">
<view_quicksearchform
:viewState="viewState"
......@@ -661,7 +664,7 @@ export default class IBIZBOOKListViewBase extends Vue {
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
_this.loadQuickGroupModel();
}
......@@ -1151,6 +1154,100 @@ export default class IBIZBOOKListViewBase extends Vue {
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof IBIZBOOKListViewBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 快速分组数据对象
*
* @memberof IBIZBOOKListViewBase
*/
public quickGroupData:any;
/**
* 快速分组是否有抛值
*
* @memberof IBIZBOOKListViewBase
*/
public isEmitQuickGroupValue:boolean = false;
/**
* 快速分组模型
*
* @memberof IBIZBOOKListViewBase
*/
public quickGroupModel:Array<any> = [];
/**
* 加载快速分组模型
*
* @memberof IBIZBOOKListViewBase
*/
public loadQuickGroupModel(){
let quickGroupCodeList:any = {tag:'Bookgroup',codelistType:'STATIC'};
if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(quickGroupCodeList.tag);
if (codelist) {
this.quickGroupModel = [...this.handleDynamicData(JSON.parse(JSON.stringify(codelist.items)))];
} else {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
}
}else if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"DYNAMIC")){
this.codeListService.getItems(quickGroupCodeList.tag,{},{}).then((res:any) => {
this.quickGroupModel = res;
}).catch((error:any) => {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
});
}
}
/**
* 处理快速分组模型动态数据部分(%xxx%)
*
* @memberof IBIZBOOKListViewBase
*/
public handleDynamicData(inputArray:Array<any>){
if(inputArray.length >0){
inputArray.forEach((item:any) =>{
if(item.data && Object.keys(item.data).length >0){
Object.keys(item.data).forEach((name:any) =>{
let value: any = item.data[name];
if (value && typeof(value)=='string' && value.startsWith('%') && value.endsWith('%')) {
const key = (value.substring(1, value.length - 1)).toLowerCase();
if (this.context[key]) {
value = this.context[key];
} else if(this.viewparams[key]){
value = this.viewparams[key];
}
}
item.data[name] = value;
})
}
})
}
return inputArray;
}
/**
* 快速分组值变化
*
* @memberof IBIZBOOKListViewBase
*/
public quickGroupValueChange($event:any){
if($event){
this.quickGroupData = $event.data;
if(this.isEmitQuickGroupValue){
this.onSearch($event);
}
}
this.isEmitQuickGroupValue = true;
}
/**
* 快速搜索栏数据对象
*
......
......@@ -118,6 +118,46 @@ export default class IBIZSample0001UIServiceBase extends UIService {
public initDeMainStateOPPrivsMap(){
}
/**
* 打开文档
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBIZSample0001_openDocument(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'NONE';
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
Object.assign(context,parentObj);
const openPopupApp = (url: string) => {
window.open(url, '_blank');
return null;
}
const url = `https://www.yuque.com/ibiz/wuf19n`;
openPopupApp(url);
}
/**
* 获取指定数据的重定向页面
......
......@@ -135,7 +135,7 @@
<i-col v-show="detailsModel.button1.visible" :style="{}" :sm="{ span: 2, offset: 0 }" :md="{ span: 2, offset: 0 }" :lg="{ span: 2, offset: 0 }">
<i-button type="primary" :disabled="detailsModel.button1.disabled" @click="button1_click($event)" class="app-form-button"
style="">
<menu-icon :item="{iconcls: 'fa fa-question'}" />
<menu-icon :item="{iconcls: 'fa fa-twitter'}" />
<span >{{$t('entities.ibizsample0001.main3_form.details.button1')}}</span>
</i-button>
......@@ -337,23 +337,10 @@ export default class Main3Base extends Vue implements ControlInterface {
datas = [params];
}
// 界面行为
this.Help(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
const curUIService:IBIZSample0001UIService = new IBIZSample0001UIService();
curUIService.IBIZSample0001_openDocument(datas,contextJO, paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 帮助
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001SF2EditViewBase
*/
public Help(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '帮助未支持' });
}
/**
* 转化数据
......@@ -837,7 +824,7 @@ export default class Main3Base extends Vue implements ControlInterface {
grouppanel1: new FormGroupPanelModel({ caption: '基础表单项-关系界面', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: true, form: this, isControlledContent: false , uiActionGroup: { caption: '', langbase: 'entities.ibizsample0001.main3_form', extractMode: 'ITEM', details: [] }, isManageContainer: false, showMoreModeItems: [] })
,
button1: new FormButtonModel({ caption: '表单按钮', detailType: 'BUTTON', name: 'button1', visible: true, isShowCaption: true, form: this, isControlledContent: false ,disabled: false, uiaction: { type: 'DEUIACTION',
tag: 'Help',noprivdisplaymode:2,visabled: true,disabled: false} })
tag: 'openDocument',actiontarget: 'NONE',noprivdisplaymode:2,visabled: true,disabled: false} })
,
grouppanel3: new FormGroupPanelModel({ caption: '基础表单项-表单按钮', detailType: 'GROUPPANEL', name: 'grouppanel3', visible: true, isShowCaption: true, form: this, isControlledContent: false , uiActionGroup: { caption: '', langbase: 'entities.ibizsample0001.main3_form', extractMode: 'ITEM', details: [] }, isManageContainer: false, showMoreModeItems: [] })
,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册