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

update:更新

1、调整视图及部件状态参数导出逻辑
2、数据视图样式调整
3、卡片视图部件支持面板
上级 10ad4d5c
......@@ -12,6 +12,7 @@ import net.ibizsys.model.control.IPSControl;
import net.ibizsys.model.control.IPSControlContainer;
import net.ibizsys.model.control.dashboard.IPSDBContainerPortletPart;
import net.ibizsys.model.control.dashboard.IPSDBPortletPart;
import net.ibizsys.model.control.dataview.IPSDEDataView;
import net.ibizsys.model.control.grid.IPSDEGrid;
import net.ibizsys.model.control.grid.IPSDEGridColumn;
import net.ibizsys.model.control.list.IPSList;
......@@ -122,6 +123,7 @@ public class CtrlModel extends BaseModel{
public void handleChildControls() {
IPSControl control = getControl();
// 具有子部件的容器部件
if (control instanceof IPSControlContainer) {
IPSControlContainer controlContainer = (IPSControlContainer)control;
List<IPSControl> controls = controlContainer.getPSControls();
......@@ -204,6 +206,7 @@ public class CtrlModel extends BaseModel{
}
}
}
// 列表部件项布局面板
if (control instanceof IPSList) {
IPSList list = (IPSList)control;
IPSLayoutPanel layoutPanel = list.getItemPSLayoutPanel();
......@@ -220,6 +223,24 @@ public class CtrlModel extends BaseModel{
}
}
}
// 卡片视图部件项布局面板
if (control instanceof IPSDEDataView) {
IPSDEDataView dataView = (IPSDEDataView) control;
IPSLayoutPanel layoutPanel = dataView.getItemPSLayoutPanel();
if (layoutPanel != null) {
CtrlModel ctrlModel = new CtrlModel(app, layoutPanel);
if (ctrlModel.getControl().getPSAppDataEntity() != null) {
AppEntityModel ctrlAppEntity = app.getAppEntity(ctrlModel.getControl().getPSAppDataEntity().getCodeName());
ctrlModel.setAppEntity(ctrlAppEntity);
ctrlAppEntity.addCtrl(ctrlModel.getId(), ctrlModel);
}
addCtrl(ctrlModel.getId(), ctrlModel);
if(!app.getCtrlsMap().containsKey(ctrlModel.getId())) {
app.getCtrlsMap().put(ctrlModel.getId(),ctrlModel);
}
}
}
}
public void handleAllPortlets(IPSControlContainer control) {
......
......@@ -7,5 +7,11 @@ import { MainControlProps } from "../main-control";
* @extends {MainControlProps}
*/
export interface PanelControlProps extends MainControlProps {
/**
* 导航数据
*
* @type {any[]}
* @memberof PanelControlProps
*/
navDatas: any[];
}
\ No newline at end of file
import { IActionParam, IParam } from "@core";
import { MainControl } from "../main-control";
import { PanelControlProps } from "./panel-control-prop";
import { PanelControlState } from "./panel-control-state";
/**
......@@ -17,6 +18,14 @@ export class PanelControl extends MainControl {
*/
public declare state: PanelControlState;
/**
* 面板部件输入参数
*
* @type {PanelControlProps}
* @memberof PanelControl
*/
public declare props: PanelControlProps;
/**
* 获取当前激活数据
*
......@@ -34,14 +43,9 @@ export class PanelControl extends MainControl {
* @memberof PanelControl
*/
protected useNavDatas() {
const navDatas: any = toRef(this.props, 'navDatas');
if (this.props.panelType === 'LAYOUT') {
this.load();
}
watch(navDatas, (newVal: any, oldVal: any) => {
watch(() => this.props.navDatas, (newVal: any, oldVal: any) => {
this.load();
});
this.state.navDatas = navDatas;
}, { immediate: true, deep: true });
}
/**
......@@ -60,7 +64,8 @@ export class PanelControl extends MainControl {
const { viewSubject, controlName } = this.state;
const load = async (opts: IParam = {}) => {
const { dataMode } = this.state;
const { navDatas, data } = toRefs(this.state);
const { navDatas } = toRefs(this.props);
const { data } = toRefs(this.state);
if (dataMode === 0) {
// 不获取,使用传入数据
if (navDatas && navDatas.value && navDatas.value.length) {
......@@ -153,10 +158,10 @@ export class PanelControl extends MainControl {
*/
public moduleInstall() {
const superParams = super.moduleInstall();
this.useLoad();
this.useNavDatas();
return {
...superParams,
load: this.useLoad(),
onPanelItemEvents: this.onPanelItemEvents.bind(this)
}
}
......
export const viewState = {
{{> @macro/front-end/views/view-base-config.hbs}}
{{#if page.defPSAppView}}
defaultView: '{{page.defPSAppView.codeName}}',
{{/if}}
export const viewState = () => {
return {
{{> @macro/front-end/views/view-base-config.hbs}}
{{#if page.defPSAppView}}
defaultView: '{{page.defPSAppView.codeName}}',
{{/if}}
}
};
\ No newline at end of file
......@@ -31,7 +31,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const indexView = new IndexView(viewState, props, emit).moduleInstall();
const indexView = new IndexView(viewState(), props, emit).moduleInstall();
const { state, menu } = indexView;
const collapsed: Ref<boolean> = ref(false);
const collapsedChange = () => {
......
export const viewState = {
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const portalView = new PortalView(viewState, props, emit).moduleInstall();
const portalView = new PortalView(viewState(), props, emit).moduleInstall();
const { state, dashboard, onCtrlEvent } = portalView;
</script>
......
export const viewState = {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -14,7 +14,7 @@ import { {{codeName}}SearchForm } from '@widgets/{{spinalCase psAppDataEntity.co
import { {{codeName}}QuickSearchForm } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-quick-search-form';
{{/if}}
{{#eq controlType "SEARCHBAR"}}
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchBar';
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchbar';
{{/eq}}
{{/page.ctrls}}
......@@ -39,7 +39,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const dataView = new DataView(viewState, props, emit).moduleInstall();
const dataView = new DataView(viewState(), props, emit).moduleInstall();
const { state, dataViewControl, searchForm, quickSearchForm, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSearchEvent } = dataView;
{{#if page.psAppCounterRefs}}
// 计数器数据
......
export const viewState = {
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const editView = new EditView(viewState, props, emit).moduleInstall();
const editView = new EditView(viewState(), props, emit).moduleInstall();
const { state, form, onToolbarEvent, onCtrlEvent } = editView;
{{#if page.psAppCounterRefs}}
// 计数器数据
......
export const viewState = {
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "GRIDEXPBAR")}}
gridExpBarName: '{{ctrl.name}}',
{{/if}}
{{/each}}
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "GRIDEXPBAR")}}
gridExpBarName: '{{ctrl.name}}',
{{/if}}
{{/each}}
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -25,7 +25,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块
const gridExpView = new GridExpView(viewState, props, emit).moduleInstall()
const gridExpView = new GridExpView(viewState(), props, emit).moduleInstall()
const { state, onCtrlEvent, onToolbarEvent } = gridExpView;
</script>
......
export const viewState = {
gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{else}}false{{/if}},
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{else}}false{{/if}},
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -14,7 +14,7 @@ import { {{codeName}}SearchForm } from '@widgets/{{spinalCase psAppDataEntity.co
import { {{codeName}}QuickSearchForm } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-quick-search-form';
{{/if}}
{{#eq controlType "SEARCHBAR"}}
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchBar';
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchbar';
{{/eq}}
{{/page.ctrls}}
......@@ -39,7 +39,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const gridView = new GridView(viewState, props, emit).moduleInstall();
const gridView = new GridView(viewState(), props, emit).moduleInstall();
const { state, grid, searchForm, quickSearchForm, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSearchEvent } = gridView;
{{#if page.psAppCounterRefs}}
// 计数器数据
......
export const viewState = {
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "LISTEXPBAR")}}
listExpBarName: '{{ctrl.name}}',
{{/if}}
{{/each}}
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "LISTEXPBAR")}}
listExpBarName: '{{ctrl.name}}',
{{/if}}
{{/each}}
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -25,7 +25,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块
const listExpView = new ListExpView(viewState, props, emit).moduleInstall()
const listExpView = new ListExpView(viewState(), props, emit).moduleInstall()
const { state, onCtrlEvent, onToolbarEvent } = listExpView;
</script>
......
export const viewState = {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -14,7 +14,7 @@ import { {{codeName}}SearchForm } from '@widgets/{{spinalCase psAppDataEntity.co
import { {{codeName}}QuickSearchForm } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-quick-search-form';
{{/if}}
{{#eq controlType "SEARCHBAR"}}
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchBar';
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchbar';
{{/eq}}
{{/page.ctrls}}
......@@ -39,7 +39,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const listView = new ListView(viewState, props, emit).moduleInstall();
const listView = new ListView(viewState(), props, emit).moduleInstall();
const { state, list, searchForm, quickSearchForm, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSearchEvent } = listView;
{{#if page.psAppCounterRefs}}
// 计数器数据
......
export const viewState = {
// 实际选中数据
selections: [],
selectedData: [],
// 右侧面板选中数据
rightPanelSelections: [],
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
// 实际选中数据
selections: [],
selectedData: [],
// 右侧面板选中数据
rightPanelSelections: [],
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const mpickupView = new MPickupView(viewState, props, emit).moduleInstall();
const mpickupView = new MPickupView(viewState(), props, emit).moduleInstall();
const { state, pickupViewPanel, onCancel, onConfirm, onCtrlEvent, onMoveRight, onMoveLeft, onAllMoveRight, onAllMoveLeft, onRightPanelClick } = mpickupView;
</script>
......
export const viewState = {
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const panelView = new PanelView(viewState, props, emit).moduleInstall();
const panelView = new PanelView(viewState(), props, emit).moduleInstall();
const { state, panel, onToolbarEvent, onCtrlEvent } = panelView;
{{#if page.psAppCounterRefs}}
// 计数器数据
......
export const viewState = {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -40,7 +40,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const pickupGridView = new PickupGridView(viewState, props, emit).moduleInstall();
const pickupGridView = new PickupGridView(viewState(), props, emit).moduleInstall();
const { state, grid, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pickupGridView;
</script>
......
export const viewState = {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -40,7 +40,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const pickupTreeView = new PickupTreeView(viewState, props, emit).moduleInstall();
const pickupTreeView = new PickupTreeView(viewState(), props, emit).moduleInstall();
const { state, tree, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pickupTreeView;
</script>
......
export const viewState = {
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -28,7 +28,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const pickupView = new PickupView(viewState, props, emit).moduleInstall();
const pickupView = new PickupView(viewState(), props, emit).moduleInstall();
const { state, onCancel, onConfirm, onCtrlEvent } = pickupView;
</script>
......
export const viewState = {
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -28,7 +28,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const tabExpView = new TabExpView(viewState, props, emit).moduleInstall();
const tabExpView = new TabExpView(viewState(), props, emit).moduleInstall();
const { state, onCtrlEvent } = tabExpView;
</script>
......
export const viewState = {
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "TREEEXPBAR")}}
treeExpBarName: '{{ctrl.name}}',
{{/if}}
{{/each}}
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "TREEEXPBAR")}}
treeExpBarName: '{{ctrl.name}}',
{{/if}}
{{/each}}
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -25,7 +25,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块
const treeExpView = new TreeExpView(viewState, props, emit).moduleInstall()
const treeExpView = new TreeExpView(viewState(), props, emit).moduleInstall()
const { state, onCtrlEvent, onToolbarEvent } = treeExpView;
</script>
......
export const viewState = {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
export const viewState = () => {
return {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
}
};
\ No newline at end of file
......@@ -13,7 +13,7 @@ import { {{codeName}}SearchForm } from '@widgets/{{spinalCase psAppDataEntity.co
import { {{codeName}}QuickSearchForm } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-quick-search-form';
{{/if}}
{{#eq controlType "SEARCHBAR"}}
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchBar';
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-searchbar';
{{/eq}}
{{/page.ctrls}}
......@@ -38,7 +38,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const treeView = new TreeView(viewState, props, emit).moduleInstall();
const treeView = new TreeView(viewState(), props, emit).moduleInstall();
const { state, tree, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSearchEvent } = treeView;
{{#if page.psAppCounterRefs}}
// 计数器数据
......
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
defaultOpens: [],
defaultSelect: [],
menus: [
{{#each ctrl.psAppMenuItems as | item |}}
{{> @macro/front-end/widgets/menu-detail/include-menu.hbs type="MENUITEM" item=item}}
{{/each}}
],
funcs: App.getAllFuncs(),
};
\ No newline at end of file
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
defaultOpens: [],
defaultSelect: [],
menus: [
{{#each ctrl.psAppMenuItems as | item |}}
{{> @macro/front-end/widgets/menu-detail/include-menu.hbs type="MENUITEM" item=item}}
{{/each}}
],
funcs: App.getAllFuncs(),
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ interface CtrlEmit {
}
const emit = defineEmits <CtrlEmit> ();
const { name, state, onMenuSelect, load } = new MenuControl(ctrlState, props, emit).moduleInstall();
const { name, state, onMenuSelect, load } = new MenuControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state, load });
......
......@@ -10,13 +10,15 @@
{{~/eq~}}
{{/inline}}
// 部件配置对象
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
isEnableCustomized: {{ctrl.enableCustomized}},
portlets: [
{{~#each ctrl.psControls as | portlet |~}}
{{> getPortlet portlet=portlet}}{{#unless @last}},{{/unless}}
{{~/each~}}
]
};
\ No newline at end of file
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
isEnableCustomized: {{ctrl.enableCustomized}},
portlets: [
{{~#each ctrl.psControls as | portlet |~}}
{{> getPortlet portlet=portlet}}{{#unless @last}},{{/unless}}
{{~/each~}}
]
}
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const dashboardControl = new DashboardControl(ctrlState, props, emit).moduleInstall();
const dashboardControl = new DashboardControl(ctrlState(), props, emit).moduleInstall();
const { name, state, onCtrlEvent } = dashboardControl;
// 暴露内部状态及能力
......
......@@ -27,73 +27,75 @@ export class ControlVO extends ControlVOBase {
{{/each}}
}
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new DataViewService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
selections: [],
// 多数据部件分组
mdCtrlGroup: {
enableGroup: {{ctrl.enableGroup}},
groupMode: "{{ctrl.groupMode}}",
groupField: "{{lowerCase ctrl.groupPSAppDEField.codeName}}",
{{#if ctrl.groupPSCodeList}}
groupCodeList: {
codeListTag: "{{ctrl.groupPSCodeList.codeListTag}}",
codeListType: "{{ctrl.groupPSCodeList.codeListType}}",
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new DataViewService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
selections: [],
// 多数据部件分组
mdCtrlGroup: {
enableGroup: {{ctrl.enableGroup}},
groupMode: "{{ctrl.groupMode}}",
groupField: "{{lowerCase ctrl.groupPSAppDEField.codeName}}",
{{#if ctrl.groupPSCodeList}}
groupCodeList: {
codeListTag: "{{ctrl.groupPSCodeList.codeListTag}}",
codeListType: "{{ctrl.groupPSCodeList.codeListType}}",
},
{{/if}}
},
// 多数据部件排序
mdCtrlSort: {
noSort: {{ctrl.noSort}},
minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{/if}}",
minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}",
},
// 多数据部件分页
mdCtrlPaging: {
enablePagingBar: true,
current: 1,
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {}
},
{{#if ctrl.quickToolBarItems}}
{{#ctrl.quickToolBarItems}}
quickToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.quickToolBarItems}}
{{/if}}
{{#if ctrl.batchToolBarItems}}
{{#ctrl.batchToolBarItems}}
batchToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.batchToolBarItems}}
{{/if}}
},
// 多数据部件排序
mdCtrlSort: {
noSort: {{ctrl.noSort}},
minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{/if}}",
minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}",
},
// 多数据部件分页
mdCtrlPaging: {
enablePagingBar: true,
current: 1,
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {}
},
{{#if ctrl.quickToolBarItems}}
{{#ctrl.quickToolBarItems}}
quickToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.quickToolBarItems}}
{{/if}}
{{#if ctrl.batchToolBarItems}}
{{#ctrl.batchToolBarItems}}
batchToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.batchToolBarItems}}
{{/if}}
// 界面行为
uIActions: {
{{#each ctrl.psDEDataViewItems as | dataViewItem |}}
{{#and (eq dataViewItem.itemType 'ACTIONITEM') dataViewItem.psDEUIActionGroup dataViewItem.psDEUIActionGroup.psUIActionGroupDetails}}
{{#dataViewItem}}
{{#each dataViewItem.psDEUIActionGroup.psUIActionGroupDetails as | uiActionDetail |}}
{{#if uiActionDetail.getPSUIAction}}
{{#uiActionDetail.getPSUIAction}}
{{uIActionTag}}: { caption: '{{caption}}', tooltip: '{{tooltip}}', showCaption: {{../showCaption}}, showIcon: {{../showIcon}}, uIActionTag: '{{uIActionTag}}', uIActionType: '{{uIActionType}}', dataAccessAction: '{{dataAccessAction}}', noPrivDisplayMode: '{{noPrivDisplayMode}}', uIActionMode: '{{uIActionMode}}', disabled: false, visible: true, {{#if coutnerId}}counterId: '{{counterId}}', {{/if}}{{#if psSysImage}}cssClass: '{{psSysImage.cssClass}}', {{#if psSysImage.cssClass}}{{/if}}{{#if psSysImage.imagePath}}imagePath: '{{psSysImage.imagePath}}'{{/if}}{{/if}} },
{{/uiActionDetail.getPSUIAction}}
{{/if}}
{{/each}}
{{/dataViewItem}}
{{/and}}
{{/each}}
// 界面行为
uIActions: {
{{#each ctrl.psDEDataViewItems as | dataViewItem |}}
{{#and (eq dataViewItem.itemType 'ACTIONITEM') dataViewItem.psDEUIActionGroup dataViewItem.psDEUIActionGroup.psUIActionGroupDetails}}
{{#dataViewItem}}
{{#each dataViewItem.psDEUIActionGroup.psUIActionGroupDetails as | uiActionDetail |}}
{{#if uiActionDetail.getPSUIAction}}
{{#uiActionDetail.getPSUIAction}}
{{uIActionTag}}: { caption: '{{caption}}', tooltip: '{{tooltip}}', showCaption: {{../showCaption}}, showIcon: {{../showIcon}}, uIActionTag: '{{uIActionTag}}', uIActionType: '{{uIActionType}}', dataAccessAction: '{{dataAccessAction}}', noPrivDisplayMode: '{{noPrivDisplayMode}}', uIActionMode: '{{uIActionMode}}', disabled: false, visible: true, {{#if coutnerId}}counterId: '{{counterId}}', {{/if}}{{#if psSysImage}}cssClass: '{{psSysImage.cssClass}}', {{#if psSysImage.cssClass}}{{/if}}{{#if psSysImage.imagePath}}imagePath: '{{psSysImage.imagePath}}'{{/if}}{{/if}} },
{{/uiActionDetail.getPSUIAction}}
{{/if}}
{{/each}}
{{/dataViewItem}}
{{/and}}
{{/each}}
}
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
const { name, state, onUIAction, newRow, remove, save, load, refresh, getData, xDataControl, exportExcel, onToolbarEvent, useCustom } = new DataViewControl(ctrlState, props, emit).moduleInstall();
const { name, state, onUIAction, newRow, remove, save, load, refresh, getData, xDataControl, exportExcel, onToolbarEvent, useCustom } = new DataViewControl(ctrlState(), props, emit).moduleInstall();
const { onDataViewItemSelected, isSelected } = useCustom();
// 暴露内部状态及能力
......@@ -54,7 +54,20 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData, export
justify="start">
<template v-for="(item, index) in state.items" :key="index">
<a-col {{#if ctrl.cardWidth}}:style="{ width: '{{ctrl.cardWidth}}px'{{#if ctrl.cardHeight}}, height: '{{ctrl.cardHeight}}px'{{/if}} }"{{else}}:span="6"{{#if ctrl.cardHeight}}:style="{ height: '{{ctrl.cardHeight}}px' }"{{/if}}{{/if}}>
<a-card :class="['app-dataview-item', isSelected(item) ? 'app-dataview-item__selection' : '']" @click="(event) => onDataViewItemSelected(item, event)">
{{#if ctrl.itemPSLayoutPanel}}
<{{ctrl.itemPSLayoutPanel.codeName}}Panel
:class="['app-dataview-item', isSelected(item) ? 'app-dataview-item__selection' : '']"
{{#if ctrl.cardHeight}}
:style="{ height: '{{ctrl.cardHeight}}px' }"
{{/if}}
@click="(event) => onDataViewItemSelected(item, event)"
:context="state.context"
:viewParams="state.viewParams"
:navDatas="[item]"
panelType="LAYOUT">
</{{ctrl.itemPSLayoutPanel.codeName}}Panel>
{{else}}
<a-card :class="['app-dataview-item', isSelected(item) ? 'app-dataview-item__selection' : '']" @click="(event) => onDataViewItemSelected(item, event)" {{#if ctrl.cardHeight}}:style="{ height: '{{ctrl.cardHeight}}px' }"{{/if}}>
<template #title>
\{{item.srfmajortext}}
</template>
......@@ -77,6 +90,7 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData, export
</template>
<span class="app-dataview-item__description">\{{item.srfdescription}}</span>
</a-card>
{{/if}}
</a-col>
</template>
</a-row>
......
......@@ -46,124 +46,126 @@ export class ControlVO extends ControlVOBase {
}
// 部件配置对象
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
enableAutoSave: {{ctrl.enableAutoSave}},
// 错误信息
errorMessages: [],
// 关系界面计数器
drCount: 0,
// 新建默认值
createDefaultItems: [
{{#each ctrl.psDEFormItems as | formItem |}}
{{#formItem}}
{{#if (or createDV createDVT)}}
{
createDV: "{{createDV}}",
createDVT: "{{createDVT}}",
property: "{{lowerCase id}}",
{{#if (and psEditor psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if psAppDEField}}
valueFormat: "{{psAppDEField.valueFormat}}",
{{/if}}
{{#if psAppDEField}}
dataType: "{{psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
enableAutoSave: {{ctrl.enableAutoSave}},
// 错误信息
errorMessages: [],
// 关系界面计数器
drCount: 0,
// 新建默认值
createDefaultItems: [
{{#each ctrl.psDEFormItems as | formItem |}}
{{#formItem}}
{{#if (or createDV createDVT)}}
{
createDV: "{{createDV}}",
createDVT: "{{createDVT}}",
property: "{{lowerCase id}}",
{{#if (and psEditor psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if psAppDEField}}
valueFormat: "{{psAppDEField.valueFormat}}",
{{/if}}
{{/formItem}}
{{/each}}
],
// 更新默认值
updateDefaultItems: [
{{#each ctrl.psDEFormItems as | formItem |}}
{{#formItem}}
{{#if (or updateDV updateDVT)}}
{
updateDV: "{{updateDV}}",
updateDVT: "{{updateDVT}}",
property: "{{lowerCase id}}",
{{#if (and psEditor psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if psAppDEField}}
valueFormat: "{{psAppDEField.valueFormat}}",
{{/if}}
{{#if psAppDEField}}
dataType: "{{psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
{{#if psAppDEField}}
dataType: "{{psAppDEField.stdDataType}}"
{{/if}}
{{/formItem}}
{{/each}}
],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type="FORMDETAILSMODEL" item=FormPage}}
{{/each}}
{{/if}}
},
actionModel: {
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type="FORMACTIONMODEL" item=FormPage}}
{{/each}}
},
rules: {
{{#each ctrl.psDEFormItemVRs as | ruleItem |}}
{{ruleItem.psDEFormItemName}}: [
{{#if (eq ruleItem.valueRuleType 'SYSVALUERULE')}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/formItem}}
{{/each}}
],
// 更新默认值
updateDefaultItems: [
{{#each ctrl.psDEFormItems as | formItem |}}
{{#formItem}}
{{#if (or updateDV updateDVT)}}
{
{{#eq ruleItem.psSysValueRule.ruleType 'REG'}}
trigger: ['change', 'blur'],
pattern: /{{ruleItem.psSysValueRule.regExCode}}/,
message:'{{ruleItem.psSysValueRule.ruleInfo}}'
{{/eq}}
{{#eq ruleItem.psSysValueRule.ruleType 'SCRIPT'}}
validator: (rule: any, value: any, callback: any) => {
if (isEmpty(value)) {
updateDV: "{{updateDV}}",
updateDVT: "{{updateDVT}}",
property: "{{lowerCase id}}",
{{#if (and psEditor psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if psAppDEField}}
valueFormat: "{{psAppDEField.valueFormat}}",
{{/if}}
{{#if psAppDEField}}
dataType: "{{psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/formItem}}
{{/each}}
],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type="FORMDETAILSMODEL" item=FormPage}}
{{/each}}
{{/if}}
},
actionModel: {
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type="FORMACTIONMODEL" item=FormPage}}
{{/each}}
},
rules: {
{{#each ctrl.psDEFormItemVRs as | ruleItem |}}
{{ruleItem.psDEFormItemName}}: [
{{#if (eq ruleItem.valueRuleType 'SYSVALUERULE')}}
{
{{#eq ruleItem.psSysValueRule.ruleType 'REG'}}
trigger: ['change', 'blur'],
pattern: /{{ruleItem.psSysValueRule.regExCode}}/,
message:'{{ruleItem.psSysValueRule.ruleInfo}}'
{{/eq}}
{{#eq ruleItem.psSysValueRule.ruleType 'SCRIPT'}}
validator: (rule: any, value: any, callback: any) => {
if (isEmpty(value)) {
return Promise.resolve();
}
let source: any = { '{{ruleItem.psDEFormItemName}}': value };
try {
eval(`{{ruleItem.psSysValueRule.scriptCode}}`);
} catch (error: any) {
App.getNotificationService().error({ message: '校验脚本值规则异常' });
}
return Promise.resolve();
}
let source: any = { '{{ruleItem.psDEFormItemName}}': value };
try {
eval(`{{ruleItem.psSysValueRule.scriptCode}}`);
} catch (error: any) {
App.getNotificationService().error({ message: '校验脚本值规则异常' });
}
return Promise.resolve();
}
{{/eq}}
},
{{else if (eq ruleItem.valueRuleType 'DEFVALUERULE')}}
{
validator: async (rule: any, value: any, callback: any) => {
if (isEmpty(value)) {
{{/eq}}
},
{{else if (eq ruleItem.valueRuleType 'DEFVALUERULE')}}
{
validator: async (rule: any, value: any, callback: any) => {
if (isEmpty(value)) {
return Promise.resolve();
}
let source: any = { '{{ruleItem.psDEFormItemName}}': value };
const { isPast, infoMessage } = Verify.verifyDeRules(
'{{ruleItem.getPSDEFormItemName}}',
source,
{{> @macro/front-end/common/derules.hbs item=ruleItem.psDEFValueRule.getPSDEFVRGroupCondition}}
);
if (!isPast) {
return Promise.reject(infoMessage || '{{ruleItem.psDEFValueRule.ruleInfo}}');
}
return Promise.resolve();
}
let source: any = { '{{ruleItem.psDEFormItemName}}': value };
const { isPast, infoMessage } = Verify.verifyDeRules(
'{{ruleItem.getPSDEFormItemName}}',
source,
{{> @macro/front-end/common/derules.hbs item=ruleItem.psDEFValueRule.getPSDEFVRGroupCondition}}
);
if (!isPast) {
return Promise.reject(infoMessage || '{{ruleItem.psDEFValueRule.ruleInfo}}');
}
return Promise.resolve();
}
}
{{/if}}
],
{{/each}}
},
// 锚点数据集合
anchorDatas: [],
{{/if}}
],
{{/each}}
},
// 锚点数据集合
anchorDatas: [],
}
};
\ No newline at end of file
......@@ -40,7 +40,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, load, loadDraft, save, remove, refresh, onEditorEvent, onComponentEvent, getData, xDataCtrl } = new FormControl(ctrlState, props, emit).moduleInstall();
const { name, state, load, loadDraft, save, remove, refresh, onEditorEvent, onComponentEvent, getData, xDataCtrl } = new FormControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state, load, loadDraft, save, remove, refresh, getData });
......
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
counter: 0,
enableSearch: {{ctrl.enableSearch}},
xDataControlName: '{{ctrl.xDataControlName}}',
selection: {},
searchValue: '',
showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
split: 0.2,
title: '{{ctrl.title}}',
titleRes: '{{#if ctrl.titlePSLanguageRes}}{{ctrl.titlePSLanguageRes.lanResTag}}{{/if}}',
{{#each ctrl.psControls as | childCtrl |}}
{{#eq childCtrl.controlType 'TOOLBAR'}}
toolbar: [
{{#childCtrl.psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
{{/childCtrl.psDEToolbarItems}}
],
{{/eq}}
{{#eq childCtrl.controlType 'GRID'}}
{{childCtrl.name}}: {
action:{
loadAction: '{{childCtrl.getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{childCtrl.removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{childCtrl.updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{childCtrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{childCtrl.createPSControlAction.psAppDEMethod.codeName}}',
fetchAction:'{{childCtrl.fetchPSControlAction.psAppDEMethod.codeName}}'
}
},
{{#and childCtrl.navPSDER childCtrl.navPSDER.minorCodeName}}
navPSDer: 'n_{{lowerCase childCtrl.navPSDER.minorCodeName}}_eq',
{{/and}}
{{#if childCtrl.navFilter}}
navFilter: '{{lowerCase childCtrl.navFilter}}',
{{/if}}
{{#if childCtrl.navPSAppView}}
navViewName: '{{childCtrl.navPSAppView.name}}',
{{/if}}
{{#if childCtrl.psNavigateContexts}}
navigateContexts: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateContexts}},
{{/if}}
{{#if childCtrl.psNavigateParams}}
navigateParams: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateParams}},
{{/if}}
{{/eq}}
{{/each}}
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
counter: 0,
enableSearch: {{ctrl.enableSearch}},
xDataControlName: '{{ctrl.xDataControlName}}',
selection: {},
searchValue: '',
showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
split: 0.2,
title: '{{ctrl.title}}',
titleRes: '{{#if ctrl.titlePSLanguageRes}}{{ctrl.titlePSLanguageRes.lanResTag}}{{/if}}',
{{#each ctrl.psControls as | childCtrl |}}
{{#eq childCtrl.controlType 'TOOLBAR'}}
toolbar: [
{{#childCtrl.psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
{{/childCtrl.psDEToolbarItems}}
],
{{/eq}}
{{#eq childCtrl.controlType 'GRID'}}
{{childCtrl.name}}: {
action:{
loadAction: '{{childCtrl.getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{childCtrl.removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{childCtrl.updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{childCtrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{childCtrl.createPSControlAction.psAppDEMethod.codeName}}',
fetchAction:'{{childCtrl.fetchPSControlAction.psAppDEMethod.codeName}}'
}
},
{{#and childCtrl.navPSDER childCtrl.navPSDER.minorCodeName}}
navPSDer: 'n_{{lowerCase childCtrl.navPSDER.minorCodeName}}_eq',
{{/and}}
{{#if childCtrl.navFilter}}
navFilter: '{{lowerCase childCtrl.navFilter}}',
{{/if}}
{{#if childCtrl.navPSAppView}}
navViewName: '{{childCtrl.navPSAppView.name}}',
{{/if}}
{{#if childCtrl.psNavigateContexts}}
navigateContexts: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateContexts}},
{{/if}}
{{#if childCtrl.psNavigateParams}}
navigateParams: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateParams}},
{{/if}}
{{/eq}}
{{/each}}
}
};
......@@ -34,7 +34,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, onCtrlEvent, xDataControl, search, onToolbarEvent } = new GridExpBarControl(ctrlState, props, emit).moduleInstall();
const { name, state, onCtrlEvent, xDataControl, search, onToolbarEvent } = new GridExpBarControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state });
......
......@@ -27,242 +27,244 @@ export class ControlVO extends ControlVOBase {
}
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
totalColumnWidth: {{ctrl.totalColumnWidth}},
selectColumnWidth: {{#if (neq ctrl.aggMode 'NONE')}}100{{else}}50{{/if}},
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new GridService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
// 新建默认值
createDefaultItems: [
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#if (and editItem.codeName (or editItem.createDV editItem.createDVT))}}
{
createDV: "{{editItem.createDV}}",
createDVT: "{{editItem.createDVT}}",
{{#if editItem.dataItemName}}
property: "{{lowerCase editItem.dataItemName}}",
{{else}}
property: "{{lowerCase editItem.codeName}}",
{{/if}}
{{#if (and editItem.psEditor editItem.psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if editItem.psAppDEField}}
valueFormat: "{{editItem.psAppDEField.valueFormat}}",
{{/if}}
{{#if editItem.psAppDEField}}
dataType: "{{editItem.psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/each}}
],
// 错误信息
errorMessages: [],
{{#if (and ctrl.psDEDataExport ctrl.psDEDataExport.psDEDataExportItems)}}
// 数据导出
exportItems: [
{{#each ctrl.psDEDataExport.psDEDataExportItems as | exportItem |}}
{
field: '{{lowerCase exportItem.psAppDEField.codeName}}',
{{#if exportItem.psCodeList}}
codeListTag: '{{exportItem.psCodeList.codeListTag}}',
{{/if}}
label: '{{exportItem.caption}}',
lanResTag: '{{#if (and exportItem.capPSLanguageRes exportItem.capPSLanguageRes.lanResTag)}}{{exportItem.capPSLanguageRes}}{{/if}}',
show: true
}{{#unless @last}},{{/unless}}
{{/each}}
],
{{/if}}
items: [],
selections: [],
selectedRowKeys: [],
// 多数据部件分组
mdCtrlGroup: {
enableGroup: {{ctrl.enableGroup}},
groupMode: "{{ctrl.groupMode}}",
groupField: "{{lowerCase ctrl.groupPSAppDEField.codeName}}",
{{#if ctrl.groupPSCodeList}}
groupCodeList: {
codeListTag: "{{ctrl.groupPSCodeList.codeListTag}}",
codeListType: "{{ctrl.groupPSCodeList.codeListType}}",
},
{{/if}}
},
// 多数据部件排序
mdCtrlSort: {
noSort: {{ctrl.noSort}},
minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{/if}}",
minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}",
},
// 多数据部件分页
mdCtrlPaging: {
enablePagingBar: {{ctrl.enablePagingBar}},
current: 1,
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {{#if ctrl.enablePagingBar}}{
position: ['bottomRight'],
defaultPageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
showQuickJumper: true,
showTotal: (total: number, range: IParam[]) => `显示 ${range[0]} - ${range[1]} 条数据,共 ${total} 条数据`,
pageSizeOptions: ['10','20','50','100'],
}{{else}}false{{/if}},
},
gridAgg: {
aggMode: "{{ctrl.aggMode}}",
aggData: [],
{{#if ctrl.aggPSAppDataEntity}}
aggEntity: "{{ctrl.aggPSAppDataEntity.codeName}}",
aggDataSet: "{{ctrl.aggPSAppDEDataSet.codeName}}",
{{/if}}
},
uAColumnModel: {
{{#each ctrl.psDEGridColumns as | column |}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="UACOLUMNMODEL" item=column}}
{{/each}}
},
gridEditState:{
{{#each ctrl.psDEGridEditItems as | column |}}
{{#if column.codeName }}
{{column.codeName}}:{},
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
totalColumnWidth: {{ctrl.totalColumnWidth}},
selectColumnWidth: {{#if (neq ctrl.aggMode 'NONE')}}100{{else}}50{{/if}},
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new GridService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
// 新建默认值
createDefaultItems: [
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#if (and editItem.codeName (or editItem.createDV editItem.createDVT))}}
{
createDV: "{{editItem.createDV}}",
createDVT: "{{editItem.createDVT}}",
{{#if editItem.dataItemName}}
property: "{{lowerCase editItem.dataItemName}}",
{{else}}
property: "{{lowerCase editItem.codeName}}",
{{/if}}
{{#if (and editItem.psEditor editItem.psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if editItem.psAppDEField}}
valueFormat: "{{editItem.psAppDEField.valueFormat}}",
{{/if}}
{{#if editItem.psAppDEField}}
dataType: "{{editItem.psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/each}}
},
columnsModel: [
{{#if ctrl.enableGroup}}
{{#if ctrl.groupPSAppDEField}}
{
title: "分组",
align: "left",
columnType: "GROUP",
width: 100,
resizable: true,
ellipsis: true,
dataIndex: "grid_group",
},
{{/if}}
],
// 错误信息
errorMessages: [],
{{#if (and ctrl.psDEDataExport ctrl.psDEDataExport.psDEDataExportItems)}}
// 数据导出
exportItems: [
{{#each ctrl.psDEDataExport.psDEDataExportItems as | exportItem |}}
{
field: '{{lowerCase exportItem.psAppDEField.codeName}}',
{{#if exportItem.psCodeList}}
codeListTag: '{{exportItem.psCodeList.codeListTag}}',
{{/if}}
label: '{{exportItem.caption}}',
lanResTag: '{{#if (and exportItem.capPSLanguageRes exportItem.capPSLanguageRes.lanResTag)}}{{exportItem.capPSLanguageRes}}{{/if}}',
show: true
}{{#unless @last}},{{/unless}}
{{/each}}
],
{{/if}}
{{!-- 适配表格操作列浮动 --}}
items: [],
selections: [],
selectedRowKeys: [],
// 多数据部件分组
mdCtrlGroup: {
enableGroup: {{ctrl.enableGroup}},
groupMode: "{{ctrl.groupMode}}",
groupField: "{{lowerCase ctrl.groupPSAppDEField.codeName}}",
{{#if ctrl.groupPSCodeList}}
groupCodeList: {
codeListTag: "{{ctrl.groupPSCodeList.codeListTag}}",
codeListType: "{{ctrl.groupPSCodeList.codeListType}}",
},
{{/if}}
},
// 多数据部件排序
mdCtrlSort: {
noSort: {{ctrl.noSort}},
minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{/if}}",
minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}",
},
// 多数据部件分页
mdCtrlPaging: {
enablePagingBar: {{ctrl.enablePagingBar}},
current: 1,
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {{#if ctrl.enablePagingBar}}{
position: ['bottomRight'],
defaultPageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
showQuickJumper: true,
showTotal: (total: number, range: IParam[]) => `显示 ${range[0]} - ${range[1]} 条数据,共 ${total} 条数据`,
pageSizeOptions: ['10','20','50','100'],
}{{else}}false{{/if}},
},
gridAgg: {
aggMode: "{{ctrl.aggMode}}",
aggData: [],
{{#if ctrl.aggPSAppDataEntity}}
aggEntity: "{{ctrl.aggPSAppDataEntity.codeName}}",
aggDataSet: "{{ctrl.aggPSAppDEDataSet.codeName}}",
{{/if}}
},
uAColumnModel: {
{{#each ctrl.psDEGridColumns as | column |}}
{{#unless (eq column.columnType 'UAGRIDCOLUMN')}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="COLUMNMODEL" item=column}}
{{/unless}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="UACOLUMNMODEL" item=column}}
{{/each}}
{{#if ctrl.needEmptyColumn}}
{
title: "",
columnType: "EMPTYCOLUMN",
dataIndex: "autowidthcolumn",
align: "center",
resizable: true,
ellipsis: true,
aggMode: "NONE",
},
{{/if}}
{{#each ctrl.psDEGridColumns as | column |}}
{{#if (eq column.columnType 'UAGRIDCOLUMN')}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="COLUMNMODEL" item=column}}
gridEditState:{
{{#each ctrl.psDEGridEditItems as | column |}}
{{#if column.codeName }}
{{column.codeName}}:{},
{{/if}}
{{/each}}
],
// 是否单选
isSingleSelect:{{#if ctrl.singleSelect}}{{ctrl.singleSelect}}{{else}}false{{/if}},
// 更新默认值
updateDefaultItems: [
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#if (and editItem.codeName (or editItem.updateDV editItem.updateDVT))}}
{
updateDV: "{{editItem.updateDV}}",
updateDVT: "{{editItem.updateDVT}}",
{{#if editItem.dataItemName}}
property: "{{lowerCase editItem.dataItemName}}",
{{else}}
property: "{{lowerCase editItem.codeName}}",
{{/each}}
},
columnsModel: [
{{#if ctrl.enableGroup}}
{{#if ctrl.groupPSAppDEField}}
{
title: "分组",
align: "left",
columnType: "GROUP",
width: 100,
resizable: true,
ellipsis: true,
dataIndex: "grid_group",
},
{{/if}}
{{#if (and editItem.psEditor editItem.psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if editItem.psAppDEField}}
valueFormat: "{{editItem.psAppDEField.valueFormat}}",
{{/if}}
{{#if editItem.psAppDEField}}
dataType: "{{editItem.psAppDEField.stdDataType}}"
{{!-- 适配表格操作列浮动 --}}
{{#each ctrl.psDEGridColumns as | column |}}
{{#unless (eq column.columnType 'UAGRIDCOLUMN')}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="COLUMNMODEL" item=column}}
{{/unless}}
{{/each}}
{{#if ctrl.needEmptyColumn}}
{
title: "",
columnType: "EMPTYCOLUMN",
dataIndex: "autowidthcolumn",
align: "center",
resizable: true,
ellipsis: true,
aggMode: "NONE",
},
{{/if}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/each}}
],
{{#if ctrl.quickToolBarItems}}
{{#ctrl.quickToolBarItems}}
quickToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.quickToolBarItems}}
{{/if}}
{{#if ctrl.batchToolBarItems}}
{{#ctrl.batchToolBarItems}}
batchToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.batchToolBarItems}}
{{/if}}
rules:{
{{#each ctrl.psDEGridEditItemVRs as | ruleItem |}}
{{ruleItem.psDEGridEditItemName}}: [
{{#eq ruleItem.valueRuleType 'SYSVALUERULE'}}
{{#each ctrl.psDEGridColumns as | column |}}
{{#if (eq column.columnType 'UAGRIDCOLUMN')}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="COLUMNMODEL" item=column}}
{{/if}}
{{/each}}
],
// 是否单选
isSingleSelect:{{#if ctrl.singleSelect}}{{ctrl.singleSelect}}{{else}}false{{/if}},
// 更新默认值
updateDefaultItems: [
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#if (and editItem.codeName (or editItem.updateDV editItem.updateDVT))}}
{
{{#eq ruleItem.psSysValueRule.ruleType 'REG'}}
trigger: ['change', 'blur'],
pattern: /{{ruleItem.psSysValueRule.regExCode}}/,
message:'{{ruleItem.psSysValueRule.ruleInfo}}'
{{/eq}}
{{#eq ruleItem.psSysValueRule.ruleType 'SCRIPT'}}
validator: (rule: any, value: any, callback: any, source: any) => {
if (isEmpty(value)) {
updateDV: "{{editItem.updateDV}}",
updateDVT: "{{editItem.updateDVT}}",
{{#if editItem.dataItemName}}
property: "{{lowerCase editItem.dataItemName}}",
{{else}}
property: "{{lowerCase editItem.codeName}}",
{{/if}}
{{#if (and editItem.psEditor editItem.psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if editItem.psAppDEField}}
valueFormat: "{{editItem.psAppDEField.valueFormat}}",
{{/if}}
{{#if editItem.psAppDEField}}
dataType: "{{editItem.psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/each}}
],
{{#if ctrl.quickToolBarItems}}
{{#ctrl.quickToolBarItems}}
quickToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.quickToolBarItems}}
{{/if}}
{{#if ctrl.batchToolBarItems}}
{{#ctrl.batchToolBarItems}}
batchToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.batchToolBarItems}}
{{/if}}
rules:{
{{#each ctrl.psDEGridEditItemVRs as | ruleItem |}}
{{ruleItem.psDEGridEditItemName}}: [
{{#eq ruleItem.valueRuleType 'SYSVALUERULE'}}
{
{{#eq ruleItem.psSysValueRule.ruleType 'REG'}}
trigger: ['change', 'blur'],
pattern: /{{ruleItem.psSysValueRule.regExCode}}/,
message:'{{ruleItem.psSysValueRule.ruleInfo}}'
{{/eq}}
{{#eq ruleItem.psSysValueRule.ruleType 'SCRIPT'}}
validator: (rule: any, value: any, callback: any, source: any) => {
if (isEmpty(value)) {
return Promise.resolve();
}
try {
eval(`{{ruleItem.psSysValueRule.scriptCode}}`);
} catch (error: any) {
App.getNotificationService().error({ message: '校验脚本值规则异常' });
}
return Promise.resolve();
}
try {
eval(`{{ruleItem.psSysValueRule.scriptCode}}`);
} catch (error: any) {
App.getNotificationService().error({ message: '校验脚本值规则异常' });
}
return Promise.resolve();
}
{{/eq}}
},
{{/eq}}
},
{{/eq}}
{{#eq ruleItem.valueRuleType 'DEFVALUERULE'}}
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#eq editItem.codeName ruleItem.psDEGridEditItemName}}
{
validator: async (rule: any, value: any, callback: any, source: any) => {
if (!source || isEmpty(source['{{#if editItem.valueItemName}}{{editItem.valueItemName}}{{else if editItem.dataItemName}}{{editItem.dataItemName}}{{else}}{{ruleItem.psDEGridEditItemName}}{{/if}}'])) {
{{#eq ruleItem.valueRuleType 'DEFVALUERULE'}}
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#eq editItem.codeName ruleItem.psDEGridEditItemName}}
{
validator: async (rule: any, value: any, callback: any, source: any) => {
if (!source || isEmpty(source['{{#if editItem.valueItemName}}{{editItem.valueItemName}}{{else if editItem.dataItemName}}{{editItem.dataItemName}}{{else}}{{ruleItem.psDEGridEditItemName}}{{/if}}'])) {
return Promise.resolve();
}
const { isPast, infoMessage } = Verify.verifyDeRules(
'{{#if editItem.valueItemName}}{{editItem.valueItemName}}{{else if editItem.dataItemName}}{{editItem.dataItemName}}{{else}}{{ruleItem.psDEGridEditItemName}}{{/if}}',
source,
{{> @macro/front-end/common/derules.hbs item=ruleItem.psDEFValueRule.psDEFVRGroupCondition}}
);
if (!isPast) {
return Promise.reject(infoMessage || '{{ruleItem.psDEFValueRule.ruleInfo}}');
}
return Promise.resolve();
}
const { isPast, infoMessage } = Verify.verifyDeRules(
'{{#if editItem.valueItemName}}{{editItem.valueItemName}}{{else if editItem.dataItemName}}{{editItem.dataItemName}}{{else}}{{ruleItem.psDEGridEditItemName}}{{/if}}',
source,
{{> @macro/front-end/common/derules.hbs item=ruleItem.psDEFValueRule.psDEFVRGroupCondition}}
);
if (!isPast) {
return Promise.reject(infoMessage || '{{ruleItem.psDEFValueRule.ruleInfo}}');
}
return Promise.resolve();
}
}
{{/eq}}
{{/each}}
{{/eq}}
],
{{/each}}
{{/eq}}
{{/each}}
{{/eq}}
],
{{/each}}
}
}
};
\ No newline at end of file
......@@ -39,7 +39,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
const { name, state, useCustom, onEditorEvent, onToolbarEvent, onActionColEvent, newRow, remove, save, load, refresh, getData, exportExcel } = new GridControl(ctrlState, props, emit).moduleInstall();
const { name, state, useCustom, onEditorEvent, onToolbarEvent, onActionColEvent, newRow, remove, save, load, refresh, getData, exportExcel } = new GridControl(ctrlState(), props, emit).moduleInstall();
const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelectionOption, onResizeColumn, onGridChange, useExpandedRowKeys, onExpandedRowsChange, formRef } = useCustom;
{{#if ctrl.batchToolBarItems}}
const renderBatchToolbar = (total: number, range: IParam[]) => {
......
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
counter: 0,
enableSearch: {{ctrl.enableSearch}},
xDataControlName: '{{ctrl.xDataControlName}}',
selection: {},
searchValue: '',
showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
split: 0.2,
title: '{{ctrl.title}}',
titleRes: '{{#if ctrl.titlePSLanguageRes}}{{ctrl.titlePSLanguageRes.lanResTag}}{{/if}}',
{{#each ctrl.psControls as | childCtrl |}}
{{#eq childCtrl.controlType 'TOOLBAR'}}
toolbar: [
{{#childCtrl.psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
{{/childCtrl.psDEToolbarItems}}
],
{{/eq}}
{{#eq childCtrl.controlType 'LIST'}}
{{childCtrl.name}}: {
action:{
loadAction: '{{childCtrl.getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{childCtrl.removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{childCtrl.updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{childCtrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{childCtrl.createPSControlAction.psAppDEMethod.codeName}}',
fetchAction:'{{childCtrl.fetchPSControlAction.psAppDEMethod.codeName}}'
}
},
{{#and childCtrl.navPSDER childCtrl.navPSDER.minorCodeName}}
navPSDer: 'n_{{lowerCase childCtrl.navPSDER.minorCodeName}}_eq',
{{/and}}
{{#if childCtrl.navFilter}}
navFilter: '{{lowerCase childCtrl.navFilter}}',
{{/if}}
{{#if childCtrl.navPSAppView}}
navViewName: '{{childCtrl.navPSAppView.name}}',
{{/if}}
{{#if childCtrl.psNavigateContexts}}
navigateContexts: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateContexts}},
{{/if}}
{{#if childCtrl.psNavigateParams}}
navigateParams: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateParams}},
{{/if}}
{{/eq}}
{{/each}}
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
counter: 0,
enableSearch: {{ctrl.enableSearch}},
xDataControlName: '{{ctrl.xDataControlName}}',
selection: {},
searchValue: '',
showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
split: 0.2,
title: '{{ctrl.title}}',
titleRes: '{{#if ctrl.titlePSLanguageRes}}{{ctrl.titlePSLanguageRes.lanResTag}}{{/if}}',
{{#each ctrl.psControls as | childCtrl |}}
{{#eq childCtrl.controlType 'TOOLBAR'}}
toolbar: [
{{#childCtrl.psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
{{/childCtrl.psDEToolbarItems}}
],
{{/eq}}
{{#eq childCtrl.controlType 'LIST'}}
{{childCtrl.name}}: {
action:{
loadAction: '{{childCtrl.getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{childCtrl.removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{childCtrl.updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{childCtrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{childCtrl.createPSControlAction.psAppDEMethod.codeName}}',
fetchAction:'{{childCtrl.fetchPSControlAction.psAppDEMethod.codeName}}'
}
},
{{#and childCtrl.navPSDER childCtrl.navPSDER.minorCodeName}}
navPSDer: 'n_{{lowerCase childCtrl.navPSDER.minorCodeName}}_eq',
{{/and}}
{{#if childCtrl.navFilter}}
navFilter: '{{lowerCase childCtrl.navFilter}}',
{{/if}}
{{#if childCtrl.navPSAppView}}
navViewName: '{{childCtrl.navPSAppView.name}}',
{{/if}}
{{#if childCtrl.psNavigateContexts}}
navigateContexts: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateContexts}},
{{/if}}
{{#if childCtrl.psNavigateParams}}
navigateParams: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateParams}},
{{/if}}
{{/eq}}
{{/each}}
}
};
......@@ -34,7 +34,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, onCtrlEvent, xDataControl, search, onToolbarEvent } = new ListExpBarControl(ctrlState, props, emit).moduleInstall();
const { name, state, onCtrlEvent, xDataControl, search, onToolbarEvent } = new ListExpBarControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state });
......
......@@ -35,89 +35,91 @@ export class ControlVO extends ControlVOBase {
{{/each}}
}
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new ListService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
selections: [],
dataItems: [
{{#if ctrl.psDEListDataItems}}
{{#each ctrl.psDEListDataItems as | dataItem |}}
{
name: '{{dataItem.name}}',
caption: '{{dataItem.caption}}',
{{#if dataItem.customCode}}
customCode: true,
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new ListService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
selections: [],
dataItems: [
{{#if ctrl.psDEListDataItems}}
{{#each ctrl.psDEListDataItems as | dataItem |}}
{
name: '{{dataItem.name}}',
caption: '{{dataItem.caption}}',
{{#if dataItem.customCode}}
customCode: true,
{{/if}}
{{#if dataItem.psAppDEField}}
property: '{{lowerCase dataItem.psAppDEField.codeName}}'
{{/if}}
}{{#unless @last}},{{/unless}}
{{/each}}
{{/if}}
{{#if dataItem.psAppDEField}}
property: '{{lowerCase dataItem.psAppDEField.codeName}}'
],
// 多数据部件分组
mdCtrlGroup: {
enableGroup: {{ctrl.enableGroup}},
groupMode: "{{ctrl.groupMode}}",
groupField: "{{lowerCase ctrl.groupPSAppDEField.codeName}}",
{{#if ctrl.groupPSCodeList}}
groupCodeList: {
codeListTag: "{{ctrl.groupPSCodeList.codeListTag}}",
codeListType: "{{ctrl.groupPSCodeList.codeListType}}",
},
{{/if}}
}{{#unless @last}},{{/unless}}
{{/each}}
{{/if}}
],
// 多数据部件分组
mdCtrlGroup: {
enableGroup: {{ctrl.enableGroup}},
groupMode: "{{ctrl.groupMode}}",
groupField: "{{lowerCase ctrl.groupPSAppDEField.codeName}}",
{{#if ctrl.groupPSCodeList}}
groupCodeList: {
codeListTag: "{{ctrl.groupPSCodeList.codeListTag}}",
codeListType: "{{ctrl.groupPSCodeList.codeListType}}",
},
// 多数据部件排序
mdCtrlSort: {
noSort: {{ctrl.noSort}},
minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{/if}}",
minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}",
},
// 多数据部件分页
mdCtrlPaging: {
enablePagingBar: true,
current: 1,
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {}
},
{{#if ctrl.quickToolBarItems}}
{{#ctrl.quickToolBarItems}}
quickToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.quickToolBarItems}}
{{/if}}
},
// 多数据部件排序
mdCtrlSort: {
noSort: {{ctrl.noSort}},
minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{/if}}",
minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}",
},
// 多数据部件分页
mdCtrlPaging: {
enablePagingBar: true,
current: 1,
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {}
},
{{#if ctrl.quickToolBarItems}}
{{#ctrl.quickToolBarItems}}
quickToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.quickToolBarItems}}
{{/if}}
{{#if ctrl.batchToolBarItems}}
{{#ctrl.batchToolBarItems}}
batchToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.batchToolBarItems}}
{{/if}}
// 界面行为
uIActions: {
{{#each ctrl.psDEListItems as | listItem |}}
{{#and listItem.psDEUIActionGroup listItem.psDEUIActionGroup.psUIActionGroupDetails}}
{{#listItem}}
{{#each psDEUIActionGroup.psUIActionGroupDetails as | uiActionDetail |}}
{{#if uiActionDetail.getPSUIAction}}
{{#uiActionDetail.getPSUIAction}}
{{uIActionTag}}: { caption: '{{caption}}', tooltip: '{{tooltip}}', showCaption: {{../showCaption}}, showIcon: {{../showIcon}}, uIActionTag: '{{uIActionTag}}', uIActionType: '{{uIActionType}}', dataAccessAction: '{{dataAccessAction}}', noPrivDisplayMode: '{{noPrivDisplayMode}}', uIActionMode: '{{uIActionMode}}', disabled: false, visible: true, {{#if coutnerId}}counterId: '{{counterId}}', {{/if}}{{#if psSysImage}}cssClass: '{{psSysImage.cssClass}}', {{#if psSysImage.cssClass}}{{/if}}{{#if psSysImage.imagePath}}imagePath: '{{psSysImage.imagePath}}'{{/if}}{{/if}} },
{{/uiActionDetail.getPSUIAction}}
{{/if}}
{{/each}}
{{/listItem}}
{{/and}}
{{/each}}
}
{{#if ctrl.batchToolBarItems}}
{{#ctrl.batchToolBarItems}}
batchToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.batchToolBarItems}}
{{/if}}
// 界面行为
uIActions: {
{{#each ctrl.psDEListItems as | listItem |}}
{{#and listItem.psDEUIActionGroup listItem.psDEUIActionGroup.psUIActionGroupDetails}}
{{#listItem}}
{{#each psDEUIActionGroup.psUIActionGroupDetails as | uiActionDetail |}}
{{#if uiActionDetail.getPSUIAction}}
{{#uiActionDetail.getPSUIAction}}
{{uIActionTag}}: { caption: '{{caption}}', tooltip: '{{tooltip}}', showCaption: {{../showCaption}}, showIcon: {{../showIcon}}, uIActionTag: '{{uIActionTag}}', uIActionType: '{{uIActionType}}', dataAccessAction: '{{dataAccessAction}}', noPrivDisplayMode: '{{noPrivDisplayMode}}', uIActionMode: '{{uIActionMode}}', disabled: false, visible: true, {{#if coutnerId}}counterId: '{{counterId}}', {{/if}}{{#if psSysImage}}cssClass: '{{psSysImage.cssClass}}', {{#if psSysImage.cssClass}}{{/if}}{{#if psSysImage.imagePath}}imagePath: '{{psSysImage.imagePath}}'{{/if}}{{/if}} },
{{/uiActionDetail.getPSUIAction}}
{{/if}}
{{/each}}
{{/listItem}}
{{/and}}
{{/each}}
}
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
const { name, state, onUIAction, newRow, remove, save, load, refresh, getData, xDataControl, exportExcel, useCustom, onToolbarEvent} = new ListControl(ctrlState, props, emit).moduleInstall();
const { name, state, onUIAction, newRow, remove, save, load, refresh, getData, xDataControl, exportExcel, useCustom, onToolbarEvent} = new ListControl(ctrlState(), props, emit).moduleInstall();
const { onListItemSelected, isSelected, loadMore } = useCustom;
// 暴露内部状态及能力
......
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
data: {},
dataMode: {{ctrl.dataMode}},
detailsModel: {
{{#each ctrl.rootPSPanelItems as | panelItem |}}
{{> @macro/front-end/widgets/panel-detail/panel-detail-model.hbs item=panelItem}}
{{/each}}
},
navDatas: []
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
data: {},
dataMode: {{ctrl.dataMode}},
detailsModel: {
{{#each ctrl.rootPSPanelItems as | panelItem |}}
{{> @macro/front-end/widgets/panel-detail/panel-detail-model.hbs item=panelItem}}
{{/each}}
},
navDatas: []
}
}
\ No newline at end of file
......@@ -28,13 +28,14 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, load, onPanelItemEvents, getData, xDataCtrl } = new PanelControl(ctrlState, props, emit).moduleInstall();
const { name, state, onPanelItemEvents, getData, xDataControl } = new PanelControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state, load, getData });
defineExpose({ name, state, getData });
</script>
<template>
<AppRow
ref="xDataControl"
:class="[
'app-panel',
panelType === 'LAYOUT' ? 'app-layout-panel' : '',
......
export const ctrlState = {
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
selectedData: [],
data: {},
items: []
export const ctrlState = () => {
return {
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
selectedData: [],
data: {},
items: []
}
};
\ No newline at end of file
......@@ -37,7 +37,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, onViewEvent } = new PickupViewPanelControl(ctrlState, props, emit).moduleInstall();
const { name, state, onViewEvent } = new PickupViewPanelControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state });
......
// 部件配置对象
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
portletType: '{{ctrl.portletType}}',
showCaption: {{ctrl.showTitleBar}},
childControls: [
{{~#if ctrl.psControls~}}
{{~#each ctrl.psControls as | control |~}}
'{{control.name}}'
{{~/each~}}
{{~/if~}}
],
{{#if ctrl.psAppDataEntity}}
// 实体名称
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
{{/if}}
{{#if ctrl.psUIActionGroup.psUIActionGroupDetails}}
// 操作栏模型
actionBarModelData: {
{{#each ctrl.psUIActionGroup.psUIActionGroupDetails as | groupDetail |}}
{{groupDetail.psUIAction.uIActionTag}} : {
viewlogicname: '{{groupDetail.name}}',
showCaption:{{groupDetail.showCaption}},
actionName: '{{groupDetail.psUIAction.caption}}',
icon: '{{groupDetail.psUIAction.psSysImage.cssClass}}',
imgPath: '{{groupDetail.psUIAction.psSysImage.imagePath}}',
disabled: false,
visabled: true,
dataAccessAction: {{#if groupDetail.psUIAction.dataAccessAction}}false{{else}}true{{/if}},
getNoPrivDisplayMode: {{#if groupDetail.psUIAction.noPrivDisplayMode}}groupDetail.psUIAction.noPrivDisplayMode{{else}}6{{/if}},
codeName:'{{groupDetail.psUIAction.codeName}}',
fullCodeName:'{{groupDetail.psUIAction.fullCodeName}}',
uIActionMode:'{{groupDetail.psUIAction.uIActionMode}}',
uIActionTag:'{{groupDetail.psUIAction.uIActionTag}}',
uIActionType:'{{groupDetail.psUIAction.uIActionType}}'
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
portletType: '{{ctrl.portletType}}',
showCaption: {{ctrl.showTitleBar}},
childControls: [
{{~#if ctrl.psControls~}}
{{~#each ctrl.psControls as | control |~}}
'{{control.name}}'
{{~/each~}}
{{~/if~}}
],
{{#if ctrl.psAppDataEntity}}
// 实体名称
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
{{/if}}
{{#if ctrl.psUIActionGroup.psUIActionGroupDetails}}
// 操作栏模型
actionBarModelData: {
{{#each ctrl.psUIActionGroup.psUIActionGroupDetails as | groupDetail |}}
{{groupDetail.psUIAction.uIActionTag}} : {
viewlogicname: '{{groupDetail.name}}',
showCaption:{{groupDetail.showCaption}},
actionName: '{{groupDetail.psUIAction.caption}}',
icon: '{{groupDetail.psUIAction.psSysImage.cssClass}}',
imgPath: '{{groupDetail.psUIAction.psSysImage.imagePath}}',
disabled: false,
visabled: true,
dataAccessAction: {{#if groupDetail.psUIAction.dataAccessAction}}false{{else}}true{{/if}},
getNoPrivDisplayMode: {{#if groupDetail.psUIAction.noPrivDisplayMode}}groupDetail.psUIAction.noPrivDisplayMode{{else}}6{{/if}},
codeName:'{{groupDetail.psUIAction.codeName}}',
fullCodeName:'{{groupDetail.psUIAction.fullCodeName}}',
uIActionMode:'{{groupDetail.psUIAction.uIActionMode}}',
uIActionTag:'{{groupDetail.psUIAction.uIActionTag}}',
uIActionType:'{{groupDetail.psUIAction.uIActionType}}'
},
{{/each}}
},
{{/each}}
},
{{/if}}
{{#and (eq ctrl.portletType 'HTML') ctrl.pageUrl}}
// 网页地址
pageUrl: '{{ctrl.pageUrl}}',
{{/and}}
{{#eq ctrl.portletType 'RAWITEM'}}
// 内容类型
contentType: '{{ctrl.contentType}}',
{{#eq ctrl.contentType 'RAW'}}
rawContent: `{{ctrl.rawContent}}`,
{{/if}}
{{#and (eq ctrl.portletType 'HTML') ctrl.pageUrl}}
// 网页地址
pageUrl: '{{ctrl.pageUrl}}',
{{/and}}
{{#eq ctrl.portletType 'RAWITEM'}}
// 内容类型
contentType: '{{ctrl.contentType}}',
{{#eq ctrl.contentType 'RAW'}}
rawContent: `{{ctrl.rawContent}}`,
{{/eq}}
{{#eq ctrl.contentType 'HTML'}}
rawContent: `{{ctrl.htmlContent}}`,
{{/eq}}
{{/eq}}
{{#eq ctrl.contentType 'HTML'}}
rawContent: `{{ctrl.htmlContent}}`,
{{/eq}}
{{/eq}}
{{#if ctrl.rawContent}}
// 直接内容
rawContent: `{{ctrl.rawContent}}`,
{{/if}}
{{#eq ctrl.portletType 'LIST'}}
{{#ctrl.psControls}}
{{name}}: {
action:{
loadAction: '{{getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{createPSControlAction.psAppDEMethod.codeName}}',
fetchAction:'{{fetchPSControlAction.psAppDEMethod.codeName}}'
{{#if ctrl.rawContent}}
// 直接内容
rawContent: `{{ctrl.rawContent}}`,
{{/if}}
{{#eq ctrl.portletType 'LIST'}}
{{#ctrl.psControls}}
{{name}}: {
action:{
loadAction: '{{getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{createPSControlAction.psAppDEMethod.codeName}}',
fetchAction:'{{fetchPSControlAction.psAppDEMethod.codeName}}'
}
}
{{/ctrl.psControls}}
{{/eq}}
}
{{/ctrl.psControls}}
{{/eq}}
};
\ No newline at end of file
......@@ -42,7 +42,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, onViewEvent, onCtrlEvent, handleItemClick, handleActionClick } = new PortletControl(ctrlState, props, emit).moduleInstall();
const { name, state, onViewEvent, onCtrlEvent, handleItemClick, handleActionClick } = new PortletControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state });
......
......@@ -49,41 +49,43 @@ export class ControlVO extends ControlVOBase {
}
// 部件配置对象
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
showPopover: false,
selectHistoryItem: {},
historyItems: [],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type='FORMDETAILSMODEL' item=FormPage}}
{{/each}}
{{/if}}
},
rules: {
{{#each ctrl.psDEFormEditItemVRs as | ruleItem |}}
{{#neq ruleItem 2}}
{{#if ruleItem.valueRuleType 'DEFVALUERULE'}}
{{psDEFormEditItemName}}: [
{{#each ruleItem.psDEFVRGroupCondition as | condition |}}
{trigger: ['change', 'blur'],
validator: (_rule: RuleObject, value: string) => verifyRules(_rule,value,{
{{#condition.condType}}type: '{{condition.condType}}',{{/condition.condType}}
{{#condition.name}}name: '{{condition.name}}',{{/condition.name}}
{{#condition.maxValue}}maxValue: '{{condition.maxValue}}',{{/condition.maxValue}}
{{#condition.minValue}}minValue: '{{condition.minValue}}',{{/condition.minValue}}
{{#condition.ruleInfo}}ruleInfo: '{{condition.ruleInfo}}',{{/condition.ruleInfo}}
{{#condition.includeMaxValue}}includeMaxValue: '{{condition.includeMaxValue}}',{{/condition.includeMaxValue}}
{{#condition.includeMinValue}}includeMinValue: '{{condition.includeMinValue}}',{{/condition.includeMinValue}}
}) }
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
showPopover: false,
selectHistoryItem: {},
historyItems: [],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type='FORMDETAILSMODEL' item=FormPage}}
{{/each}}
]
{{/if}}
{{/neq}}
{{/each}}
},
{{/if}}
},
rules: {
{{#each ctrl.psDEFormEditItemVRs as | ruleItem |}}
{{#neq ruleItem 2}}
{{#if ruleItem.valueRuleType 'DEFVALUERULE'}}
{{psDEFormEditItemName}}: [
{{#each ruleItem.psDEFVRGroupCondition as | condition |}}
{trigger: ['change', 'blur'],
validator: (_rule: RuleObject, value: string) => verifyRules(_rule,value,{
{{#condition.condType}}type: '{{condition.condType}}',{{/condition.condType}}
{{#condition.name}}name: '{{condition.name}}',{{/condition.name}}
{{#condition.maxValue}}maxValue: '{{condition.maxValue}}',{{/condition.maxValue}}
{{#condition.minValue}}minValue: '{{condition.minValue}}',{{/condition.minValue}}
{{#condition.ruleInfo}}ruleInfo: '{{condition.ruleInfo}}',{{/condition.ruleInfo}}
{{#condition.includeMaxValue}}includeMaxValue: '{{condition.includeMaxValue}}',{{/condition.includeMaxValue}}
{{#condition.includeMinValue}}includeMinValue: '{{condition.includeMinValue}}',{{/condition.includeMinValue}}
}) }
{{/each}}
]
{{/if}}
{{/neq}}
{{/each}}
}
}
};
\ No newline at end of file
......@@ -27,7 +27,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { name, state, getData, onEditorEvent } = new QuickSearchFormControl(ctrlState, props, emit).moduleInstall();
const { name, state, getData, onEditorEvent } = new QuickSearchFormControl(ctrlState(), props, emit).moduleInstall();
defineExpose({ name, state, getData });
</script>
......
import {{ctrl.codeName}}SearchBar from "./{{spinalCase ctrl.codeName}}-searchBar.vue";
import {{ctrl.codeName}}SearchBar from "./{{spinalCase ctrl.codeName}}-searchbar.vue";
export { {{ctrl.codeName}}SearchBar };
\ No newline at end of file
export const CtrlConfig = {
controlCodeName: "{{ctrl.codeName}}",
controlName: "{{ctrl.name}}",
detailsModel: {
{{#each ctrl.psSearchBarFilters as | filter | }}
{{filter.name}} : {
label: '{{filter.psAppDEField.logicName}}',
name: '{{filter.name}}',
prop: '{{lowerCase filter.psAppDEField.codeName}}',
disabled: false,
{{#if filter.psDEFSearchMode}}mode: '{{filter.psDEFSearchMode.valueOP}}',{{/if}}
},
{{/each}}
},
}
\ No newline at end of file
<script setup lang="ts">
import { Subject } from 'rxjs';
import { CtrlConfig } from './{{spinalCase ctrl.codeName}}-searchBar-config';
import { ctrlState } from './{{spinalCase ctrl.codeName}}-searchbar-state';
import { SearchBarControl, IActionParam, IParam, IContext, ControlAction, deepCopy } from '@core';
interface Props {
......@@ -22,7 +21,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { name, state } = new SearchBarControl(CtrlConfig, props, emit).moduleInstall();
const { name, state } = new SearchBarControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state});
......
export const ctrlState = () => {
return {
controlCodeName: "{{ctrl.codeName}}",
controlName: "{{ctrl.name}}",
detailsModel: {
{{#each ctrl.psSearchBarFilters as | filter | }}
{{filter.name}} : {
label: '{{filter.psAppDEField.logicName}}',
name: '{{filter.name}}',
prop: '{{lowerCase filter.psAppDEField.codeName}}',
disabled: false,
{{#if filter.psDEFSearchMode}}mode: '{{filter.psDEFSearchMode.valueOP}}',{{/if}}
},
{{/each}}
},
}
}
\ No newline at end of file
......@@ -48,42 +48,44 @@ export class ControlVO extends ControlVOBase {
}
// 部件配置对象
export const ctrlState = {
autoSearch: {{ctrl.enableAutoSearch}},
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
showPopover: false,
selectHistoryItem: {},
historyItems: [],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type="FORMDETAILSMODEL" item=FormPage}}
{{/each}}
{{/if}}
},
rules: {
{{#each ctrl.psDEFormEditItemVRs as | ruleItem |}}
{{#neq ruleItem 2}}
{{#if ruleItem.valueRuleType 'DEFVALUERULE'}}
{{psDEFormEditItemName}}: [
{{#each ruleItem.psDEFVRGroupCondition as | condition |}}
{trigger: ['change', 'blur'],
validator: (_rule: RuleObject, value: string) => verifyRules(_rule,value,{
{{#condition.condType}}type: '{{condition.condType}}',{{/condition.condType}}
{{#condition.name}}name: '{{condition.name}}',{{/condition.name}}
{{#condition.maxValue}}maxValue: '{{condition.maxValue}}',{{/condition.maxValue}}
{{#condition.minValue}}minValue: '{{condition.minValue}}',{{/condition.minValue}}
{{#condition.ruleInfo}}ruleInfo: '{{condition.ruleInfo}}',{{/condition.ruleInfo}}
{{#condition.includeMaxValue}}includeMaxValue: '{{condition.includeMaxValue}}',{{/condition.includeMaxValue}}
{{#condition.includeMinValue}}includeMinValue: '{{condition.includeMinValue}}',{{/condition.includeMinValue}}
}) }
export const ctrlState = () => {
return {
autoSearch: {{ctrl.enableAutoSearch}},
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
showPopover: false,
selectHistoryItem: {},
historyItems: [],
detailsModel: {
{{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type="FORMDETAILSMODEL" item=FormPage}}
{{/each}}
]
{{/if}}
{{/neq}}
{{/each}}
},
{{/if}}
},
rules: {
{{#each ctrl.psDEFormEditItemVRs as | ruleItem |}}
{{#neq ruleItem 2}}
{{#if ruleItem.valueRuleType 'DEFVALUERULE'}}
{{psDEFormEditItemName}}: [
{{#each ruleItem.psDEFVRGroupCondition as | condition |}}
{trigger: ['change', 'blur'],
validator: (_rule: RuleObject, value: string) => verifyRules(_rule,value,{
{{#condition.condType}}type: '{{condition.condType}}',{{/condition.condType}}
{{#condition.name}}name: '{{condition.name}}',{{/condition.name}}
{{#condition.maxValue}}maxValue: '{{condition.maxValue}}',{{/condition.maxValue}}
{{#condition.minValue}}minValue: '{{condition.minValue}}',{{/condition.minValue}}
{{#condition.ruleInfo}}ruleInfo: '{{condition.ruleInfo}}',{{/condition.ruleInfo}}
{{#condition.includeMaxValue}}includeMaxValue: '{{condition.includeMaxValue}}',{{/condition.includeMaxValue}}
{{#condition.includeMinValue}}includeMinValue: '{{condition.includeMinValue}}',{{/condition.includeMinValue}}
}) }
{{/each}}
]
{{/if}}
{{/neq}}
{{/each}}
},
}
};
\ No newline at end of file
......@@ -27,7 +27,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { name, state, getData, onEditorEvent, onComponentEvent, onSearch, loadDraft, onSaveHistoryItem, onCancel, onRemoveHistoryItem } = new SearchFormControl(ctrlState, props, emit).moduleInstall();
const { name, state, getData, onEditorEvent, onComponentEvent, onSearch, loadDraft, onSaveHistoryItem, onCancel, onRemoveHistoryItem } = new SearchFormControl(ctrlState(), props, emit).moduleInstall();
defineExpose({ name, state, getData });
</script>
<template>
......
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
data: {},
{{#if ctrl.psAppCounterRefs}}
appCounterRefs: [
{{#each ctrl.psAppCounterRefs as | counterRef |}}
{{#if counterRef.psAppCounter}}
{{#with counterRef.psAppCounter as | counter |}}
{
id: '{{counterRef.id}}',
getAction: '{{counter.getPSAppDEAction.codeName}}',
timer: {{#if counter.timer}}{{counter.timer}}{{else}}6000{{/if}},
{{#if counter.psAppDataEntity}}
deCodeName: '{{lowerCase counter.psAppDataEntity.codeName}}'
{{/if}}
}{{#unless @last}},{{/unless}}
{{/with}}
{{/if}}
{{/each}}
],
counterServices: [],
{{#if ctrl.psControls}}
{{#each ctrl.psControls as | viewPanel |}}
{{#and viewPanel.psAppCounterRef viewPanel.psAppCounterRef.psAppCounter viewPanel.counterId}}
{{viewPanel.name}}Counter: { id: '{{viewPanel.psAppCounterRef.id}}', counterId: '{{viewPanel.counterId}}' },
{{/and}}
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
data: {},
{{#if ctrl.psAppCounterRefs}}
appCounterRefs: [
{{#each ctrl.psAppCounterRefs as | counterRef |}}
{{#if counterRef.psAppCounter}}
{{#with counterRef.psAppCounter as | counter |}}
{
id: '{{counterRef.id}}',
getAction: '{{counter.getPSAppDEAction.codeName}}',
timer: {{#if counter.timer}}{{counter.timer}}{{else}}6000{{/if}},
{{#if counter.psAppDataEntity}}
deCodeName: '{{lowerCase counter.psAppDataEntity.codeName}}'
{{/if}}
}{{#unless @last}},{{/unless}}
{{/with}}
{{/if}}
{{/each}}
],
counterServices: [],
{{#if ctrl.psControls}}
{{#each ctrl.psControls as | viewPanel |}}
{{#and viewPanel.psAppCounterRef viewPanel.psAppCounterRef.psAppCounter viewPanel.counterId}}
{{viewPanel.name}}Counter: { id: '{{viewPanel.psAppCounterRef.id}}', counterId: '{{viewPanel.counterId}}' },
{{/and}}
{{/each}}
{{/if}}
{{/if}}
{{/if}}
}
};
\ No newline at end of file
......@@ -36,7 +36,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const tabExpPanelControl = new TabExpPanelControl(ctrlState, props, emit).moduleInstall();
const tabExpPanelControl = new TabExpPanelControl(ctrlState(), props, emit).moduleInstall();
const { name, state, onCtrlEvent, getCounterData } = tabExpPanelControl;
// 暴露内部状态及能力
......
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appDeCodeName: '{{ctrl.psAppDataEntity.codeName}}',
navFilter: "{{ctrl.navFilter}}",
{{#if ctrl.navPSDER}}
navPSDer: {
{{#if ctrl.navPSDER.majorPSDataEntity}}
major: '{{lowerCase ctrl.navPSDER.majorPSDataEntity.codeName}}',
majorKey: '{{lowerCase ctrl.navPSDER.majorPSDataEntity.keyPSDEField.codeName}}'
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
appDeCodeName: '{{ctrl.psAppDataEntity.codeName}}',
navFilter: "{{ctrl.navFilter}}",
{{#if ctrl.navPSDER}}
navPSDer: {
{{#if ctrl.navPSDER.majorPSDataEntity}}
major: '{{lowerCase ctrl.navPSDER.majorPSDataEntity.codeName}}',
majorKey: '{{lowerCase ctrl.navPSDER.majorPSDataEntity.keyPSDEField.codeName}}'
{{/if}}
}
{{/if}}
}
{{#if ctrl.psNavigateContexts}}
navContexts:{{> @macro/front-end/common/navparam.hbs appNavParams=ctrl.psNavigateContexts}},
{{/if}}
{{#if ctrl.psNavigateParams}}
navParams:{{> @macro/front-end/common/navparam.hbs appNavParams=ctrl.psNavigateParams}},
{{/if}}
{{#if ctrl.psNavigateContexts}}
navContexts:{{> @macro/front-end/common/navparam.hbs appNavParams=ctrl.psNavigateContexts}},
{{/if}}
{{#if ctrl.psNavigateParams}}
navParams:{{> @macro/front-end/common/navparam.hbs appNavParams=ctrl.psNavigateParams}},
{{/if}}
}
};
\ No newline at end of file
......@@ -30,7 +30,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, onViewEvent } = new TabViewPanelControl(ctrlState, props, emit).moduleInstall();
const { name, state, onViewEvent } = new TabViewPanelControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state });
......
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
counter: 0,
enableSearch: {{ctrl.enableSearch}},
xDataControlName: '{{ctrl.xDataControlName}}',
selection: {},
searchValue: '',
showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
split: 0.2,
title: '{{ctrl.title}}',
titleRes: '{{#if ctrl.titlePSLanguageRes}}{{ctrl.titlePSLanguageRes.lanResTag}}{{/if}}',
{{#each ctrl.psControls as | childCtrl |}}
{{#eq childCtrl.controlType 'TOOLBAR'}}
toolbar: [
{{#childCtrl.psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
{{/childCtrl.psDEToolbarItems}}
],
{{/eq}}
{{/each}}
viewRefs: [
{{#each ctrl.psAppViewRefs as | viewRef |}}
{
name: '{{viewRef.name}}',
{{#if viewRef.refPSAppView}}
viewName: '{{viewRef.refPSAppView.name}}',
{{#if viewRef.refPSAppView.psAppDataEntity}}
deKeyField: '{{viewRef.refPSAppView.psAppDataEntity.codeName}}',
{{/if}}
{{/if}}
},
export const ctrlState = () => {
return {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
counter: 0,
enableSearch: {{ctrl.enableSearch}},
xDataControlName: '{{ctrl.xDataControlName}}',
selection: {},
searchValue: '',
showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
split: 0.2,
title: '{{ctrl.title}}',
titleRes: '{{#if ctrl.titlePSLanguageRes}}{{ctrl.titlePSLanguageRes.lanResTag}}{{/if}}',
{{#each ctrl.psControls as | childCtrl |}}
{{#eq childCtrl.controlType 'TOOLBAR'}}
toolbar: [
{{#childCtrl.psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
{{/childCtrl.psDEToolbarItems}}
],
{{/eq}}
{{/each}}
]
viewRefs: [
{{#each ctrl.psAppViewRefs as | viewRef |}}
{
name: '{{viewRef.name}}',
{{#if viewRef.refPSAppView}}
viewName: '{{viewRef.refPSAppView.name}}',
{{#if viewRef.refPSAppView.psAppDataEntity}}
deKeyField: '{{viewRef.refPSAppView.psAppDataEntity.codeName}}',
{{/if}}
{{/if}}
},
{{/each}}
]
}
};
......@@ -55,7 +55,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, onCtrlEvent, xDataControl, search, onToolbarEvent } = new TreeExpBarControl(ctrlState, props, emit).moduleInstall();
const { name, state, onCtrlEvent, xDataControl, search, onToolbarEvent } = new TreeExpBarControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state });
......
......@@ -184,47 +184,49 @@ export class ControlVO extends ControlVOBase implements TreeControlVO {
}
}
export const ctrlState = {
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
{{#and ctrl.psAppCounterRef ctrl.psAppCounterRef.psAppCounter}}
appCounterRef: {
{{#with ctrl.psAppCounterRef.psAppCounter as | counter |}}
id: '{{ctrl.psAppCounterRef.id}}',
getAction: '{{counter.getPSAppDEAction.codeName}}',
timer: {{#if counter.timer}}{{counter.timer}}{{else}}6000{{/if}},
{{#if counter.psAppDataEntity}}
deCodeName: '{{lowerCase counter.psAppDataEntity.codeName}}'
{{/if}}
{{/with}}
},
counterService: {},
{{/and}}
contextMenus: {
{{#each ctrl.psDETreeNodes as | treeNode |}}
{{#if (and treeNode.psDEContextMenu treeNode.psDEContextMenu.psDEToolbarItems)}}
{{treeNode.nodeType}}: [
{{#each treeNode.psDEContextMenu.psDEToolbarItems as | item |}}
{{#neq item.itemType "SEPERATOR"}}
{{> @macro/front-end/widgets/tree-detail/tree-node-context-menu-item.hbs item=item owner=treeNode.nodeType}}
{{/neq}}
{{/each}}
],
{{/if}}
{{/each}}
},
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new TreeService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
currentSelectedNode: {},
items: [],
outputIconDefault: {{#eq ctrl.outputIconDefault false}}false{{else}}true{{/eq}},
echoSelectedNodes: [],
expandedKeys: [],
selectedKeys: [],
selectedNodes: [],
selections: []
export const ctrlState = () => {
return {
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
{{#and ctrl.psAppCounterRef ctrl.psAppCounterRef.psAppCounter}}
appCounterRef: {
{{#with ctrl.psAppCounterRef.psAppCounter as | counter |}}
id: '{{ctrl.psAppCounterRef.id}}',
getAction: '{{counter.getPSAppDEAction.codeName}}',
timer: {{#if counter.timer}}{{counter.timer}}{{else}}6000{{/if}},
{{#if counter.psAppDataEntity}}
deCodeName: '{{lowerCase counter.psAppDataEntity.codeName}}'
{{/if}}
{{/with}}
},
counterService: {},
{{/and}}
contextMenus: {
{{#each ctrl.psDETreeNodes as | treeNode |}}
{{#if (and treeNode.psDEContextMenu treeNode.psDEContextMenu.psDEToolbarItems)}}
{{treeNode.nodeType}}: [
{{#each treeNode.psDEContextMenu.psDEToolbarItems as | item |}}
{{#neq item.itemType "SEPERATOR"}}
{{> @macro/front-end/widgets/tree-detail/tree-node-context-menu-item.hbs item=item owner=treeNode.nodeType}}
{{/neq}}
{{/each}}
],
{{/if}}
{{/each}}
},
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new TreeService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
currentSelectedNode: {},
items: [],
outputIconDefault: {{#eq ctrl.outputIconDefault false}}false{{else}}true{{/eq}},
echoSelectedNodes: [],
expandedKeys: [],
selectedKeys: [],
selectedNodes: [],
selections: []
}
};
\ No newline at end of file
......@@ -49,7 +49,7 @@ const getCustomText = (scriptCode: any) => {
}
// 安装功能模块,提供状态和能力方法
const { name, state, load, refresh, onTreeNodeSelect, onContextMenuClick, onRightClick, onCheck, getCounterData } = new TreeControl(ctrlState, props, emit).moduleInstall();
const { name, state, load, refresh, onTreeNodeSelect, onContextMenuClick, onRightClick, onCheck, getCounterData } = new TreeControl(ctrlState(), props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state, load, refresh });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册