提交 a90e910d 编写于 作者: WodahsOrez's avatar WodahsOrez

update: 界面行为新建和编辑

上级 3749de6a
......@@ -4,7 +4,6 @@
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{capFirst "dddd"}}
{{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}"
{{/if}}
......
{{> @macro/front-end/views/include-view-control}}
{{!-- 视图基本信息 --}}
viewCodeName: '{{page.codeName}}',
viewName: '{{page.name}}',
viewCaption: '{{page.caption}}',
subCaption: '{{page.subCaption}}',
viewSysCss: '{{page.psSysCss.cssName}}',
{{!-- viewSysImage: '{{page.psSysImage}}', --}}
showCaptionBar: {{page.showCaptionBar}},
viewType: '{{page.viewType}}',
viewStyle: '{{page.viewStyle}}',
xDataControlName:'{{page.xDataControlName}}',
height: '{{page.height}}',
width: '{{page.width}}',
appEntityName: '{{page.appEntity.codeName}}',
keyPSDEField: '{{lowerCase page.appEntity.codeName}}',
isLoadDefault: {{#if (or page.loadDefault (eq page.loadDefault false))}}{{page.loadDefault}}{{else}}true{{/if}},
appViewNavContexts:{{> @macro/front-end/common/navparam.hbs appNavParams=page.psAppViewNavContexts}},
appViewNavParams:{{> @macro/front-end/common/navparam.hbs appNavParams=page.getPSAppViewNavParams}},
{{!-- 快速分组代码表 --}}
enableQuickGroup: {{#if page.enableQuickGroup}}true{{else}}false{{/if}},
{{#if page.quickGroupPSCodeList}}
quickGroupPSCodeList: {
......@@ -20,21 +34,29 @@
{{#eq page.viewType 'APPINDEXVIEW'}}
menuAlign: '{{#if page.mainMenuAlign}}{{page.mainMenuAlign}}{{else}}LEFT{{/if}}',
{{/eq}}
appEntityName: '{{page.appEntity.codeName}}',
isLoadDefault: {{#if (or page.loadDefault (eq page.loadDefault false))}}{{page.loadDefault}}{{else}}true{{/if}},
keyPSDEField: '{{lowerCase page.appEntity.codeName}}',
{{!-- viewMsgGroup: '{{page.psAppViewMsgGroup}}', --}}
{{!-- viewUIActions: '{{page.psAppViewUIActions}}', --}}
viewSysCss: '{{page.psSysCss.cssName}}',
{{!-- viewSysImage: '{{page.psSysImage}}', --}}
subCaption: '{{page.subCaption}}',
viewType: '{{page.viewType}}',
viewStyle: '{{page.viewStyle}}',
showCaptionBar: {{page.showCaptionBar}},
xDataControlName:'{{page.xDataControlName}}',
openDataViewName: 'ExampleEditorEditView',
appViewNavContexts:{{> @macro/front-end/common/navparam.hbs appNavParams=page.psAppViewNavContexts}},
appViewNavParams:{{> @macro/front-end/common/navparam.hbs appNavParams=page.getPSAppViewNavParams}},
{{!-- 视图逻辑 --}}
viewLogics: {
{{#each page.psAppViewLogics as |viewLogic|}}
{{#if (eq viewLogic.name 'newdata')}}
newData:{
{{#if viewLogic.psAppUILogic.newDataPSAppView.openMode}}
openMode: '{{viewLogic.psAppUILogic.newDataPSAppView.openMode}}'
{{/if}}
newDataViewName: '{{viewLogic.psAppUILogic.newDataPSAppView.refPSAppView.codeName}}',
},
{{/if}}
{{#if (eq viewLogic.name 'opendata')}}
openData:{
{{#if viewLogic.psAppUILogic.newDataPSAppView.openMode}}
openMode: '{{viewLogic.psAppUILogic.newDataPSAppView.openMode}}'
{{/if}}
openDataViewName: '{{viewLogic.psAppUILogic.openDataPSAppView.refPSAppView.codeName}}',
},
{{/if}}
{{/each}}
},
toolbar: [
{{#page.viewToolBarItems}}
{{#items}}
......
/**
* 新建数据视图 视图逻辑配置信息
*
* @export
* @interface IViewLogics
*/
export interface INewDataViewLogics {
/**
* 打开方式
*
* @type {string}
* @memberof ViewDetail
*/
openMode?: 'INDEXViewDetailTAB' | 'POPUPAPP' | 'POPUPMODAL' | 'DRAWER' | 'POPOVER' | string;
/**
* 新建数据视图名称
*
*/
newDataViewName?: string;
}
/**
* 编辑数据视图 视图逻辑配置信息
*
* @export
* @interface IViewLogics
*/
export interface IOpenDataViewLogics {
/**
* 打开方式
*
* @type {string}
* @memberof ViewDetail
*/
openMode?: 'INDEXViewDetailTAB' | 'POPUPAPP' | 'POPUPMODAL' | 'DRAWER' | 'POPOVER' | string;
/**
* 新建数据视图名称
*
*/
openDataViewName?: string;
}
/**
* 视图逻辑配置信息
*
* @export
* @interface IViewLogics
*/
export interface IViewLogics {
/**
* 新建数据视图 视图逻辑配置信息
*/
newData?: INewDataViewLogics;
/**
* 编辑数据视图 视图逻辑配置信息
*/
openData?: IOpenDataViewLogics;
}
......@@ -2,4 +2,5 @@ export * from './i-context';
export * from './i-param';
export * from './i-action-param';
export * from './i-control-action';
export * from './i-view-detail';
\ No newline at end of file
export * from './i-view-detail';
export * from './i-view-logics';
\ No newline at end of file
......@@ -39,10 +39,10 @@ export class AppSysAction {
*/
public static Edit(params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }) {
const { actionEnvironment } = params
if (!actionEnvironment?.viewState?.editDataViewName) {
if (!actionEnvironment?.state?.viewLogics?.openData?.openDataViewName) {
return;
}
const viewName = actionEnvironment?.viewState?.editDataViewName;
const viewName = actionEnvironment?.state.viewLogics.openData.openDataViewName;
const view = App.getViewInfo(viewName);
if (!view) {
return;
......@@ -59,10 +59,10 @@ export class AppSysAction {
*/
public static New(params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }) {
const { actionEnvironment } = params
if (!actionEnvironment?.viewState?.openDataViewName) {
if (!actionEnvironment?.state?.viewLogics?.newData?.newDataViewName) {
return;
}
const viewName = actionEnvironment?.viewState?.openDataViewName;
const viewName = actionEnvironment?.state.viewLogics.newData.newDataViewName;
const view = App.getViewInfo(viewName);
if (!view) {
return;
......
import { ControlAction, ViewStateBase } from '@core';
import { ControlAction, IViewLogics, ViewStateBase } from '@core';
/**
* @description 实体部件状态
......@@ -22,4 +22,12 @@ export interface MainViewState extends ViewStateBase {
* @memberof MainViewState
*/
appEntityName: string;
/**
* 视图逻辑配置
*
* @type {*}
* @memberof MainViewState
*/
viewLogics: IViewLogics;
}
......@@ -3,7 +3,7 @@ import { IContext, IParam, ViewDetail } from "@core";
export class ViewUtil {
/**
* 打开新建数据视图
* 打开编辑数据视图
*
* @param {any[]} args 数据参数
* @param {*} actionEnvironment 视图容器对象
......@@ -71,7 +71,7 @@ export class ViewUtil {
context: context,
viewParams: viewParams
})
subject?.subscribe((result) => {
subject?.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
......@@ -82,7 +82,8 @@ export class ViewUtil {
/**
*
* 打开编辑视图逻辑
* 打开的视图正常关闭后会刷新当前视图
*
* @static
* @param {ViewDetail} view
......@@ -105,7 +106,7 @@ export class ViewUtil {
context: context,
viewParams: viewParams
});
subject?.subscribe((result) => {
subject?.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
......
......@@ -62,9 +62,11 @@ export const ctrlState = {
{{/each}}
enableAutoSave: {{ctrl.enableAutoSave}},
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{>(lookup 'FORMDETAILSMODEL') formDetail=FormPage}}
{{/each}}
{{/if}}
},
actionModel: {
{{#each ctrl.psDEFormPages as | FormPage | }}
......
......@@ -58,9 +58,11 @@ export const ctrlState = {
selectHistoryItem: {},
historyItems: [],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{>(lookup 'FORMDETAILSMODEL') items=FormPage.psDEFormDetails}}
{{>(lookup 'FORMDETAILSMODEL') formDetail=FormPage}}
{{/each}}
{{/if}}
},
rules: {
{{#each ctrl.psDEFormEditItemVRs as | ruleItem |}}
......
......@@ -58,9 +58,11 @@ export const ctrlState = {
selectHistoryItem: {},
historyItems: [],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{>(lookup 'FORMDETAILSMODEL') formDetail=FormPage}}
{{/each}}
{{/if}}
},
rules: {
{{#each ctrl.psDEFormEditItemVRs as | ruleItem |}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册