提交 8b03aaa6 编写于 作者: chitanda's avatar chitanda

feat: 修正

上级 591b6115
export default {
"caption": "首页视图布局(预置模型承载)",
"codeName": "AppIndexViewLayout",
"controls": [
{
"layoutMode": "TABLE_24COL",
"autoLoad": true,
"showBusyIndicator": true,
"codeName": "Usr0427030074Menu",
"controlType": "APPMENU",
"logicName": "应用首页视图菜单",
"controlParam": {},
"name": "appmenu",
"id": "usr0427030074menu"
},
{
"caption": "首页视图布局(预置模型承载)",
"codeName": "captionbar",
"controlType": "CAPTIONBAR",
"controlParam": {},
"id": "captionbar"
}
],
"viewLayoutPanel": {
"layoutMode": "FLEX",
"rootPanelItems": [
{
......@@ -218,12 +195,4 @@ export default {
"controlParam": {},
"name": "layoutpanel",
"id": "indexviewlayout"
},
"title": "首页视图布局(预置模型承载)",
"viewStyle": "DEFAULT",
"viewType": "APPINDEXVIEW",
"enableDP": true,
"showCaptionBar": true,
"name": "AppIndexViewLayout",
"id": "web.appindexviewlayout"
}
import { DSLHelper } from '@ibiz/rt-model-api';
import { IAppView } from '@ibiz/model-core';
import fs from 'fs-extra';
import path from 'path';
// 当前所有的
const layoutViews = ['ViewLayoutModelRepositoryDEGridViewLayout', 'AppIndexViewLayout'];
// 输出目录
const output = path.resolve(process.cwd(), 'layout-out');
// 模型目录
const basePath = '/root/workspace/train/TrainSys/trainsys-core/src/main/resources/model/cn/ibizlab/trainsys';
// 应用目录
const appPath = 'PSSYSAPPS/Web';
// dsl 转换器
const helper = new DSLHelper();
// 根据模型路径读取模型
async function getModel(pathStr: string): Promise<IModel> {
return new Promise(resolve => {
pathStr = pathStr.replace(appPath, '');
fs.readFile(path.join(basePath, appPath, pathStr), 'utf-8').then((data: string) => {
resolve(JSON.parse(data));
});
});
}
// 输出目录不存在则创建
if (fs.existsSync(output) === false) {
fs.mkdirSync(output);
}
// 输出 json 文件
function writeJsonFile(view: IAppView) {
fs.writeFileSync(path.resolve(output, `${view.codeName!.replace('ViewLayoutModelRepository', '')}.json`), JSON.stringify(view.viewLayoutPanel, null ,2));
}
async function main(): Promise<void> {
const app = await getModel('PSSYSAPP.json');
const viewModels: IModel[] = app.getAllPSAppViews || [];
const views = await Promise.all(viewModels.map(ref => getModel(ref.path)));
const dslViews = helper.appViews(views.filter(item => {
return item.getPSViewLayoutPanel.useDefaultLayout !== true && layoutViews.includes(item.codeName);
})) as IAppView[];
dslViews.forEach(item => {
writeJsonFile(item);
});
}
main();
export default {
"gridRowActiveMode": 2,
"xdataControlName": "grid",
"loadDefault": true,
"deviewCodeName": "DEGridViewLayout",
"deviewId": "4446682B-B7F2-4622-8A12-82D18FAC7DDA",
"accUserMode": 2,
"caption": "视图布局模型存储",
"codeName": "ViewLayoutModelRepositoryDEGridViewLayout",
"appDataEntityId": "web.viewlayoutmodelrepository",
"appViewEngines": [
{
"engineCat": "VIEW",
"engineType": "GridView",
"params": [
{
"appViewLogicName": "opendata",
"paramType": "LOGIC",
"name": "OPENDATA",
"id": "opendata"
},
{
"appViewLogicName": "newdata",
"paramType": "LOGIC",
"name": "NEWDATA",
"id": "newdata"
},
{
"ctrlName": "grid",
"paramType": "CTRL",
"name": "GRID",
"id": "grid"
},
{
"ctrlName": "searchform",
"paramType": "CTRL",
"name": "SEARCHFORM",
"id": "searchform"
}
],
"id": "engine"
}
],
"appViewLogics": [
{
"logicTrigger": "CUSTOM",
"logicType": "SYSUILOGIC",
"builtinAppUILogic": {
"actionAfterWizard": "DEFAULT",
"newDataAppView": {
"refAppViewId": "web.viewlayoutmodelrepositoryeditview"
},
"appUILogicRefViews": [
{
"refAppViewId": "web.viewlayoutmodelrepositoryeditview"
}
],
"builtinLogic": true,
"logicType": "PREDEFINED",
"viewLogicType": "APP_NEWDATA",
"id": "新建数据"
},
"builtinLogic": true,
"id": "newdata"
},
{
"logicTrigger": "CUSTOM",
"logicType": "SYSUILOGIC",
"builtinAppUILogic": {
"openDataAppView": {
"refAppViewId": "web.viewlayoutmodelrepositoryeditview"
},
"editMode": true,
"appUILogicRefViews": [
{
"refAppViewId": "web.viewlayoutmodelrepositoryeditview"
}
],
"builtinLogic": true,
"logicType": "PREDEFINED",
"viewLogicType": "APP_OPENDATA",
"id": "打开数据"
},
"builtinLogic": true,
"id": "opendata"
}
],
"appViewRefs": [
{
"realTitle": "视图布局模型存储编辑视图",
"refAppViewId": "web.viewlayoutmodelrepositoryeditview",
"name": "NEWDATA",
"id": "newdata"
},
{
"realTitle": "视图布局模型存储编辑视图",
"refAppViewId": "web.viewlayoutmodelrepositoryeditview",
"name": "EDITDATA",
"id": "editdata"
}
],
"controls": [
{
"searchButtonStyle": "DEFAULT",
"deformPages": [
{
"layout": {
"columnCount": 24,
"layout": "TABLE_24COL"
},
"deformDetails": [
{
"dataType": 25,
"enableCond": 3,
"labelPos": "LEFT",
"labelWidth": 130,
"noPrivDisplayMode": 1,
"appDEFieldId": "viewlayoutmodelrepositoryname",
"editor": {
"editorType": "TEXTBOX",
"valueType": "SIMPLE",
"editable": true,
"id": "n_viewlayoutmodelrepositoryname_like"
},
"allowEmpty": true,
"caption": "视图布局模型存储名称(%)",
"codeName": "n_viewlayoutmodelrepositoryname_like",
"detailStyle": "DEFAULT",
"detailType": "FORMITEM",
"layoutPos": {
"colMD": 24,
"layout": "TABLE_24COL"
},
"showCaption": true,
"id": "n_viewlayoutmodelrepositoryname_like"
}
],
"caption": "常规条件",
"codeName": "formpage1",
"detailStyle": "DEFAULT",
"detailType": "FORMPAGE",
"id": "formpage1"
}
],
"layout": {
"columnCount": 24,
"layout": "TABLE_24COL"
},
"tabHeaderPos": "TOP",
"noTabHeader": true,
"autoLoad": true,
"showBusyIndicator": true,
"codeName": "Default",
"controlType": "SEARCHFORM",
"logicName": "默认搜索表单",
"appDataEntityId": "web.viewlayoutmodelrepository",
"controlLogics": [
{
"eventNames": "SEARCH;LOAD;SAVE",
"logicTag": "searchform",
"logicType": "APPVIEWENGINE",
"appViewEngineId": "engine",
"triggerType": "CTRLEVENT",
"id": "engine_searchform"
}
],
"controlParam": {
"id": "searchform"
},
"name": "searchform",
"id": "web.viewlayoutmodelrepository.default"
},
{
"aggMode": "NONE",
"columnEnableFilter": 2,
"columnEnableLink": 2,
"groupMode": "NONE",
"degridColumns": [
{
"clconvertMode": "NONE",
"dataItemName": "viewlayoutmodelrepositoryname",
"excelCaption": "视图布局模型存储名称",
"appDEFieldId": "viewlayoutmodelrepositoryname",
"valueType": "SIMPLE",
"aggMode": "NONE",
"align": "LEFT",
"caption": "视图布局模型存储名称",
"codeName": "viewlayoutmodelrepositoryname",
"columnType": "DEFGRIDCOLUMN",
"noPrivDisplayMode": 1,
"width": 150,
"widthUnit": "PX",
"enableSort": true,
"id": "viewlayoutmodelrepositoryname"
},
{
"clconvertMode": "FRONT",
"dataItemName": "updateman",
"excelCaption": "更新人",
"appCodeListId": "web.sysoperator",
"appDEFieldId": "updateman",
"valueType": "SIMPLE",
"aggMode": "NONE",
"align": "LEFT",
"caption": "更新人",
"codeName": "updateman",
"columnType": "DEFGRIDCOLUMN",
"noPrivDisplayMode": 1,
"width": 150,
"widthUnit": "PX",
"enableSort": true,
"id": "updateman"
},
{
"clconvertMode": "NONE",
"dataItemName": "updatedate",
"excelCaption": "更新时间",
"appDEFieldId": "updatedate",
"valueFormat": "YYYY-MM-DD HH:mm:ss",
"valueType": "SIMPLE",
"aggMode": "NONE",
"align": "LEFT",
"caption": "更新时间",
"codeName": "updatedate",
"columnType": "DEFGRIDCOLUMN",
"noPrivDisplayMode": 1,
"width": 150,
"widthUnit": "PX",
"enableSort": true,
"id": "updatedate"
}
],
"degridDataItems": [
{
"appDEFieldId": "viewlayoutmodelrepositoryname",
"valueType": "SIMPLE",
"dataType": 25,
"id": "viewlayoutmodelrepositoryname"
},
{
"appDEFieldId": "updateman",
"valueType": "SIMPLE",
"dataType": 25,
"id": "updateman"
},
{
"format": "YYYY-MM-DD HH:mm:ss",
"appDEFieldId": "updatedate",
"valueType": "SIMPLE",
"dataType": 5,
"id": "updatedate"
},
{
"appDEFieldId": "viewlayoutmodelrepositoryid",
"valueType": "SIMPLE",
"dataType": 25,
"id": "srfkey"
},
{
"appDEFieldId": "viewlayoutmodelrepositoryid",
"valueType": "SIMPLE",
"dataType": 25,
"id": "srfdataaccaction"
},
{
"appDEFieldId": "viewlayoutmodelrepositoryname",
"valueType": "SIMPLE",
"dataType": 25,
"id": "srfmajortext"
}
],
"degridEditItems": [
{
"caption": "视图布局模型存储标识",
"codeName": "srfkey",
"appDEFieldId": "viewlayoutmodelrepositoryid",
"editor": {
"editorType": "HIDDEN",
"valueType": "SIMPLE",
"editable": true,
"id": "srfkey"
},
"id": "srfkey"
}
],
"pagingSize": 20,
"sortMode": "REMOTE",
"enableCustomized": true,
"enablePagingBar": true,
"fetchControlAction": {
"appDEMethodId": "fetchdefault",
"appDataEntityId": "web.viewlayoutmodelrepository",
"id": "fetch"
},
"removeControlAction": {
"appDEMethodId": "remove",
"appDataEntityId": "web.viewlayoutmodelrepository",
"id": "remove"
},
"autoLoad": true,
"showBusyIndicator": true,
"codeName": "Main",
"controlType": "GRID",
"logicName": "主表格",
"appDataEntityId": "web.viewlayoutmodelrepository",
"controlLogics": [
{
"eventNames": "ROWDBLCLICK;SELECTIONCHANGE;REMOVE;LOAD;BEFORELOAD",
"logicTag": "grid",
"logicType": "APPVIEWENGINE",
"appViewEngineId": "engine",
"triggerType": "CTRLEVENT",
"id": "engine_grid"
}
],
"controlParam": {
"id": "grid"
},
"name": "grid",
"id": "web.viewlayoutmodelrepository.main"
},
{
"detoolbarItems": [
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "new",
"valid": true,
"capLanguageRes": {
"defaultContent": "新建",
"lanResTag": "TBB.TEXT.*.NEW",
"lanResType": "TBB.TEXT",
"name": "工具栏按钮文本[*.NEW]",
"refFlag": true,
"id": "工具栏按钮文本[*.new]"
},
"caption": "新建",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-file-text-o",
"glyph": "xf0f6@FontAwesome"
},
"tooltip": "新建",
"tooltipLanguageRes": {
"defaultContent": "新建",
"lanResTag": "TBB.TOOLTIP.*.NEW",
"lanResType": "TBB.TOOLTIP",
"name": "工具栏按钮提示[*.NEW]",
"refFlag": true,
"id": "工具栏按钮提示[*.new]"
},
"showCaption": true,
"showIcon": true,
"id": "tbitem3"
},
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "edit",
"uiactionTarget": "SINGLEKEY",
"valid": true,
"capLanguageRes": {
"defaultContent": "编辑",
"lanResTag": "TBB.TEXT.*.EDIT",
"lanResType": "TBB.TEXT",
"name": "工具栏按钮文本[*.EDIT]",
"refFlag": true,
"id": "工具栏按钮文本[*.edit]"
},
"caption": "编辑",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-edit",
"glyph": "xf044@FontAwesome"
},
"tooltip": "编辑",
"tooltipLanguageRes": {
"defaultContent": "编辑",
"lanResTag": "TBB.TOOLTIP.*.EDIT",
"lanResType": "TBB.TOOLTIP",
"name": "工具栏按钮提示[*.EDIT]",
"refFlag": true,
"id": "工具栏按钮提示[*.edit]"
},
"showCaption": true,
"showIcon": true,
"id": "tbitem4"
},
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "copy",
"uiactionTarget": "SINGLEKEY",
"valid": true,
"capLanguageRes": {
"defaultContent": "拷贝",
"lanResTag": "TBB.TEXT.*.COPY",
"lanResType": "TBB.TEXT",
"name": "工具栏按钮文本[*.COPY]",
"refFlag": true,
"id": "工具栏按钮文本[*.copy]"
},
"caption": "拷贝",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-copy",
"glyph": "xf0c5@FontAwesome"
},
"tooltip": "拷贝",
"tooltipLanguageRes": {
"defaultContent": "拷贝",
"lanResTag": "TBB.TOOLTIP.*.COPY",
"lanResType": "TBB.TOOLTIP",
"name": "工具栏按钮提示[*.COPY]",
"refFlag": true,
"id": "工具栏按钮提示[*.copy]"
},
"showCaption": true,
"showIcon": true,
"id": "tbitem6"
},
{
"itemType": "SEPERATOR",
"id": "tbitem7"
},
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "remove",
"uiactionTarget": "MULTIKEY",
"valid": true,
"capLanguageRes": {
"defaultContent": "删除",
"lanResTag": "TBB.TEXT.*.REMOVE",
"lanResType": "TBB.TEXT",
"name": "工具栏按钮文本[*.REMOVE]",
"refFlag": true,
"id": "工具栏按钮文本[*.remove]"
},
"caption": "删除",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-remove",
"glyph": "xf00d@FontAwesome"
},
"tooltip": "删除",
"tooltipLanguageRes": {
"defaultContent": "删除",
"lanResTag": "TBB.TOOLTIP.*.REMOVE",
"lanResType": "TBB.TOOLTIP",
"name": "工具栏按钮提示[*.REMOVE]",
"refFlag": true,
"id": "工具栏按钮提示[*.remove]"
},
"showCaption": true,
"showIcon": true,
"id": "tbitem8"
},
{
"itemType": "SEPERATOR",
"id": "tbitem9"
},
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "exportexcel",
"valid": true,
"capLanguageRes": {
"defaultContent": "导出",
"lanResTag": "TBB.TEXT.*.EXPORT",
"lanResType": "TBB.TEXT",
"name": "工具栏按钮文本[*.EXPORT]",
"refFlag": true,
"id": "工具栏按钮文本[*.export]"
},
"caption": "导出",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-file-excel-o",
"glyph": "xf1c3@FontAwesome"
},
"tooltip": "导出",
"tooltipLanguageRes": {
"defaultContent": "导出",
"lanResTag": "TBB.TOOLTIP.*.EXPORT",
"lanResType": "TBB.TOOLTIP",
"name": "工具栏按钮提示[*.EXPORT]",
"refFlag": true,
"id": "工具栏按钮提示[*.export]"
},
"showCaption": true,
"showIcon": true,
"id": "tbitem13"
},
{
"itemType": "SEPERATOR",
"id": "tbitem10"
},
{
"detoolbarItems": [
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "exportmodel",
"valid": true,
"capLanguageRes": {
"lanResTag": "MENUITEM.CAPTION.*.EXPORTSRF",
"lanResType": "MENUITEM.CAPTION",
"name": "菜单项文本[*.EXPORTSRF]",
"refFlag": true,
"id": "菜单项文本[*.exportsrf]"
},
"caption": "导出数据模型",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-download",
"glyph": "xf019@FontAwesome"
},
"tooltip": "导出数据模型",
"showCaption": true,
"showIcon": true,
"id": "tbitem21"
},
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "import",
"valid": true,
"caption": "数据导入",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-upload",
"glyph": "xf093@FontAwesome"
},
"tooltip": "数据导入",
"showCaption": true,
"showIcon": true,
"id": "tbitem23"
}
],
"valid": true,
"caption": "其它",
"itemType": "ITEMS",
"tooltip": "其它",
"showCaption": true,
"showIcon": true,
"id": "tbitem16"
},
{
"itemType": "SEPERATOR",
"id": "tbitem17"
},
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "togglefilter",
"enableToggleMode": true,
"valid": true,
"capLanguageRes": {
"defaultContent": "查找",
"lanResTag": "TBB.TEXT.*.FILTER",
"lanResType": "TBB.TEXT",
"name": "工具栏按钮文本[*.FILTER]",
"refFlag": true,
"id": "工具栏按钮文本[*.filter]"
},
"caption": "过滤",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-filter",
"glyph": "xf0b0@FontAwesome"
},
"tooltip": "过滤",
"tooltipLanguageRes": {
"defaultContent": "查找",
"lanResTag": "TBB.TOOLTIP.*.FILTER",
"lanResType": "TBB.TOOLTIP",
"name": "工具栏按钮提示[*.FILTER]",
"refFlag": true,
"id": "工具栏按钮提示[*.filter]"
},
"showCaption": true,
"showIcon": true,
"id": "tbitem19"
},
{
"actionLevel": 100,
"noPrivDisplayMode": 2,
"uiactionId": "help",
"valid": true,
"capLanguageRes": {
"defaultContent": "帮助",
"lanResTag": "TBB.TEXT.*.HELP",
"lanResType": "TBB.TEXT",
"name": "工具栏按钮文本[*.HELP]",
"refFlag": true,
"id": "工具栏按钮文本[*.help]"
},
"caption": "帮助",
"itemType": "DEUIACTION",
"sysImage": {
"cssClass": "fa fa-question",
"glyph": "xf128@FontAwesome"
},
"tooltip": "帮助",
"tooltipLanguageRes": {
"defaultContent": "帮助",
"lanResTag": "TBB.TOOLTIP.*.HELP",
"lanResType": "TBB.TOOLTIP",
"name": "工具栏按钮提示[*.HELP]",
"refFlag": true,
"id": "工具栏按钮提示[*.help]"
},
"showCaption": true,
"showIcon": true,
"id": "tbitem18"
}
],
"xdataControlName": "grid",
"codeName": "DEGridViewLayouttoolbar",
"controlType": "TOOLBAR",
"logicName": "工具栏模板(默认表格界面)",
"appDataEntityId": "web.viewlayoutmodelrepository",
"controlParam": {
"id": "toolbar"
},
"name": "toolbar",
"id": "degridviewlayouttoolbar"
},
{
"quickSearchMode": 1,
"enableQuickSearch": true,
"controlType": "SEARCHBAR",
"appDataEntityId": "web.viewlayoutmodelrepository",
"controlParam": {
"id": "searchbar"
},
"id": "searchbar"
},
{
"caption": "视图布局模型存储",
"codeName": "DEGridViewLayoutcaptionbar",
"controlType": "CAPTIONBAR",
"appDataEntityId": "web.viewlayoutmodelrepository",
"controlParam": {},
"name": "captionbar",
"id": "degridviewlayoutcaptionbar"
}
],
"viewLayoutPanel": {
"layoutMode": "FLEX",
"rootPanelItems": [
{
......@@ -787,12 +138,4 @@ export default {
"controlParam": {},
"name": "layoutpanel",
"id": "gridviewlayout"
},
"title": "视图布局模型存储表格视图",
"viewStyle": "DEFAULT",
"viewType": "DEGRIDVIEW",
"enableDP": true,
"showCaptionBar": true,
"name": "ViewLayoutModelRepositoryDEGridViewLayout",
"id": "web.viewlayoutmodelrepositorydegridviewlayout"
}
{{#eq page.codeName 'AppIndexViewLayout'}}
export default {{jsonStringify pageDSL 2}}
export default {{jsonStringify pageDSL.viewLayoutPanel 2}}
{{/eq}}
\ No newline at end of file
{{#eq page.codeName 'ViewLayoutModelRepositoryDEGridViewLayout'}}
export default {{jsonStringify pageDSL 2}}
export default {{jsonStringify pageDSL.viewLayoutPanel 2}}
{{/eq}}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册