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

update: 界面行为新建和编辑

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