提交 26e50880 编写于 作者: ibizdev's avatar ibizdev

zhujiamin 部署微服务应用 [TrainSys,网页端]

上级 1b251801
import { Util } from "../utils";
import { ViewEngine } from "./view-engine";
/**
......@@ -42,6 +43,47 @@ export class PanelViewEngine extends ViewEngine {
this.isLoadDefault = false;
}
/**
* 加载模型
*
* @memberof PanelViewEngine
*/
public loadModel() {
const _this = this.view;
if (_this.context[_this.appDeCodeName.toLowerCase()]) {
let tempContext: any = Util.deepCopy(_this.context);
if (tempContext && tempContext.srfsessionid) {
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
_this.appEntityService?.getViewData(tempContext, {}, false).then((response: any) => {
if (!response || response.status !== 200) {
_this.$throw(`${response.data?.message ? response.data.message : '发生未知错误!'}`)
return;
}
const { data: _data } = response;
if(_data.srfopprivs){
_this.$store.commit('authresource/setSrfappdeData', { key: `${_this.deName}-${_data[_this.appDeKeyFieldName.toLowerCase()]}`, value: _data.srfopprivs });
}
if (_data[_this.appDeMajorFieldName.toLowerCase()]) {
_this.model.dataInfo = _data[_this.appDeMajorFieldName.toLowerCase()];
if (_this.$tabPageExp) {
_this.$tabPageExp.setCurPageCaption({
caption: _this.model.srfCaption,
title: _this.model.srfCaption,
info: _this.model.dataInfo,
viewtag: _this.viewtag,
cacheRoutePath: _this.cacheRoutePath
});
}
if (_this.$route) {
_this.$route.meta.info = _this.model.dataInfo;
}
}
})
}
}
/**
* 刷新
*
......
......@@ -77,7 +77,7 @@ export class PortalViewEngine extends ViewEngine {
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
_this.appEntityService?.getDataInfo?.(tempContext, {}, false).then((response: any) => {
_this.appEntityService?.getViewData?.(tempContext, {}, false).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
......
......@@ -64,7 +64,7 @@ export class TabExpViewEngine extends ViewEngine {
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
_this.appEntityService?.getDataInfo(tempContext, {}, false).then((response: any) => {
_this.appEntityService?.getViewData(tempContext, {}, false).then((response: any) => {
if (!response || response.status !== 200) {
_this.$throw(`${response.data?.message ? response.data.message : '发生未知错误!'}`)
return;
......
......@@ -1434,7 +1434,7 @@ export class DataBaseService<T extends IEntityBase> implements IEntityLocalDataS
}
/**
* getDataInfo接口方法
* getViewData接口方法
*
* @param {*} [context={}]
* @param {*} [data]
......@@ -1442,7 +1442,7 @@ export class DataBaseService<T extends IEntityBase> implements IEntityLocalDataS
* @returns {Promise<any>}
* @memberof EntityService
*/
public async getDataInfo(context: any = {}, data: any, isloading?: boolean): Promise<any> {
public async getViewData(context: any = {}, data: any, isloading?: boolean): Promise<any> {
if (context[this.APPDENAME.toLowerCase()]) {
return this.execute('Get', context, data);
}
......
......@@ -5,6 +5,7 @@ export { XMLWriter } from './util/xml-writer';
export { DataTypes } from './util/data-types';
export { LayoutTool } from './util/layout-tool';
export { ModelUtil } from './util/model-util';
export { EleSelector } from './util/ele-selector';
export { UIActionTool } from './ui-tools/uiaction-tool';
export { AppEmbeddedUILogic } from './ui-tools/app-embedded-uilogic';
export { ViewTool } from './ui-tools/view-tool';
......
/**
* 元素选择对象
*/
export class EleSelector {
/**
* 操作上下文
*/
private actionContext: any;
/**
* 构造EleSelector对象
*/
public constructor(actionContext: any) {
this.actionContext = actionContext;
}
/**
* 元素选择器(顶层路由视图)
* @param tag (id选择/class类名选择/css元素选择)
* @returns Array<any>
*/
public selector(tag: string): Array<any> {
const targetRange = this.getTargetRange('TOPVIEW');
return this.getTargetElement(targetRange, tag);
}
/**
* 元素选择器(当前视图)
* @param tag (id选择/class类名选择/css元素选择)
* @returns Array<any>
*/
public viewSelector(tag: string): Array<any> {
const targetRange = this.getTargetRange('VIEW');
return this.getTargetElement(targetRange, tag);
}
/**
* 元素选择器(当前应用)
* @param tag (id选择/class类名选择/css元素选择)
* @returns Array<any>
*/
public appSelector(tag: string): Array<any> {
const targetRange = this.getTargetRange('APP');
return this.getTargetElement(targetRange, tag);
}
/**
* 获取目标范围
* @param scope
*/
private getTargetRange(scope: 'VIEW' | 'TOPVIEW' | 'APP') {
if (!this.actionContext || !this.actionContext.viewCtx) {
return document;
}
const viewCtx = this.actionContext.viewCtx;
if (Object.is(scope, 'VIEW')) {
let viewElement: any;
const view = viewCtx.view;
if (view && view.viewInstance) {
viewElement = document.querySelector(`#${view.viewInstance.codeName}`);
}
return viewElement ? viewElement : document;
} else if (Object.is(scope, 'TOPVIEW')) {
let topViewElement: any;
const topView = viewCtx.topview;
if (topView && topView.viewInstance) {
topViewElement = document.querySelector(`#${topView.viewInstance.codeName}`);
}
return topViewElement ? topViewElement : document;
} else {
return document;
}
}
/**
* 获取目标元素
* @param range 选中范围
* @param tag 选择器tag
*/
private getTargetElement(range: any, tag: string): Array<any> {
if (!range || !tag) {
return [];
}
// id选择若存在返回数组
const tryIdEle = range.querySelector(`#${tag}`);
if (tryIdEle) {
return [tryIdEle];
}
// class类名选择返回数组
const tryclsNameEle = range.querySelector(`.${tag}`);
if (tryclsNameEle) {
return [tryclsNameEle];
}
// 通过css元素器获取第一个符合条件的元素的数组
const tryqueryEle = range.querySelector(tag);
if (tryqueryEle) {
return [tryqueryEle];
}
// 未找到返回[]
return [];
}
}
\ No newline at end of file
......@@ -728,23 +728,6 @@ export class Util {
})
}
/**
* 元素选择器
* @param tag (id选择/class类名选择/css元素选择)
*/
public static selector(tag: string) {
// id选择直接返回
if (document.getElementById(tag)) {
return document.getElementById(tag);
}
// class选择返回找到的第一个元素
if (document.getElementsByClassName(tag)) {
return document.getElementsByClassName(tag)[0];
}
// 通过css元素器获取第一个符合条件的元素
return document.querySelector(tag);
}
}
/**
* 创建 UUID
......
import { LogUtil, Util } from 'ibiz-core';
import { EleSelector, LogUtil } from 'ibiz-core';
import { AppDEUIAction } from './app-ui-action';
export class AppCustomAction extends AppDEUIAction {
......@@ -39,7 +39,10 @@ export class AppCustomAction extends AppDEUIAction {
if (this.actionModel && this.actionModel.scriptCode) {
// 准备自定义脚本数据(context:应用上下文,params:视图参数,data:业务数据)
const data = args;
const selector = Util.selector;
const eleSelector = new EleSelector(actionContext);
const selector = eleSelector.selector.bind(eleSelector);
const viewselector = eleSelector.viewSelector.bind(eleSelector);
const appselector = eleSelector.appSelector.bind(eleSelector);
eval(this.actionModel.scriptCode);
} else {
LogUtil.warn(`自定义界面行为暂未实现`);
......
......@@ -24,17 +24,19 @@ export class AppDefaultDePanelViewLayout extends AppDefaultViewLayout {
public engineInit(opts: any = {}) {
const controls: any[] = this.containerModel.getPSControls() || [];
const panel = ModelTool.findPSControlByType('PANEL', controls);
const engineOpts: any = {
view: this,
p2k: '0',
isLoadDefault: true,
keyPSDEField: this.appDeCodeName.toLowerCase(),
majorPSDEField: this.appDeMajorFieldName.toLowerCase()
}
if (panel) {
const engineOpts: any = {
view: this,
p2k: '0',
isLoadDefault: true,
keyPSDEField: this.appDeCodeName.toLowerCase(),
majorPSDEField: this.appDeMajorFieldName.toLowerCase(),
Object.assign(engineOpts,{
panel: (this.$refs[panel.name] as any).ctrl
}
this.engine.init(engineOpts);
})
}
this.engine.init(engineOpts);
}
}
\ No newline at end of file
......@@ -24,7 +24,7 @@
.app-horizontal-layout {
.view-container {
height: calc(100% - 32px);
height: calc(100% - 24px) !important;
width: calc(100% - 24px);
margin: 12px;
}
......
import { IPSControl, IPSPanelButton, IPSPanelContainer, IPSPanelItem, IPSPanelRawItem, IPSPanelTabPage, IPSPanelTabPanel, IPSSysPanelButton, IPSSysPanelField, IPSViewLayoutPanel } from '@ibiz/dynamic-model-api';
import { IPSControl, IPSDEToolbar, IPSPanelButton, IPSPanelContainer, IPSPanelItem, IPSPanelRawItem, IPSPanelTabPage, IPSPanelTabPanel, IPSSysPanelButton, IPSSysPanelField, IPSViewLayoutPanel } from '@ibiz/dynamic-model-api';
import { appEngineService, AppServiceBase, debounce, ModelTool, PanelButtonModel, PanelContainerModel, PanelControlModel, PanelCtrlPosModel, PanelFieldModel, PanelRawitemModel, PanelTabPageModel, PanelTabPanelModel, PanelUserControlModel, PluginService, throttle, Util } from 'ibiz-core';
import { Subject } from 'rxjs';
import { Prop, Component } from 'vue-property-decorator';
......@@ -329,7 +329,10 @@ export class AppDefaultViewLayout extends ControlContainer {
* @memberof AppDefaultViewLayout
*/
public async initViewLayOut() {
this.viewIsshowToolbar = ModelTool.findPSControlByType("TOOLBAR", this.viewInstance?.getPSControls()) ? true : false;
const viewToolBar: IPSDEToolbar = ModelTool.findPSControlByType("TOOLBAR", this.viewInstance?.getPSControls());
if (viewToolBar && viewToolBar.getPSDEToolbarItems()) {
this.viewIsshowToolbar = true;
}
if (this.viewLayoutPanel && !this.viewLayoutPanel.useDefaultLayout) {
await this.initDetailsModel(null, this.viewLayoutPanel?.getRootPSPanelItems());
this.viewIsInit = true;
......@@ -640,7 +643,7 @@ export class AppDefaultViewLayout extends ControlContainer {
<card class={cardClass} disHover={true} bordered={false}>
{(this.showCaption || (this.viewIsshowToolbar && this.$slots.toolbar)) && (
<div slot='title' class='header-container' key='view-header'>
{[this.showCaption ? <span class='caption-info'>{this.$slots['layout-captionbar'] ? this.$slots['layout-captionbar'] : this.model.srfCaption}</span> : null,
{[this.renderProxyViewCaption(),
this.viewIsshowToolbar ? <div class='toolbar-container'>
{this.$slots.toolbar}
</div> : null]}
......@@ -656,6 +659,25 @@ export class AppDefaultViewLayout extends ControlContainer {
);
}
/**
* 绘制代理视图标题
*
* @memberof AppDefaultViewLayout
*/
public renderProxyViewCaption() {
if (this.showCaption) {
if (this.viewProxyMode) {
if (this.model.dataInfo && this.model.srfCaption) {
return <span class='caption-info'>{this.model.srfCaption + '-' + this.model.dataInfo}</span>
} else {
return <span class='caption-info'>{this.$slots['layout-captionbar'] ? this.$slots['layout-captionbar'] : this.model.srfCaption}</span>
}
} else {
return <span class='caption-info'>{this.$slots['layout-captionbar'] ? this.$slots['layout-captionbar'] : this.model.srfCaption}</span>
}
}
}
/**
* 根据detailType绘制对应detail
*
......
......@@ -171,7 +171,7 @@ html, body{
position: absolute;
top: 0;
background-color: rgba(125,125,125, .3);
background-image: url("/assets/img/empty-data.svg");
background-image: url("~@/assets/img/empty-data.svg");
background-repeat: no-repeat;
background-position: center;
.empty-data-shade-tip {
......@@ -179,7 +179,7 @@ html, body{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50px, 90px);
transform: translate(-50px, 100px);
font-size: 20px;
}
&+.no-nodata-shade-child {
......
......@@ -3,7 +3,7 @@ services:
trainsys-app-web:
image: dstimage
ports:
- "80:80"
- "50100:80"
networks:
- agent_network
environment:
......
......@@ -55,6 +55,15 @@
git clone -b master $para2 trainsys/
export NODE_OPTIONS=--max-old-space-size=4096
cd trainsys/
mkdir -p /var/lib/jenkins/appcache/A3064A91-F42D-4D7F-BC1C-4173A4F5772C
if [ -e app_Web/.dynamic ]
then
cd app_Web
else
cd app_Web/app
fi
sed -i "s#dstimage#registry.cn-shanghai.aliyuncs.com/ibizsys/ibizcloud-standardsys-app-webapp:2022.07.29.003#g" swarm.yaml
docker -H $para1 stack deploy --compose-file=swarm.yaml ebsx --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -50,7 +50,7 @@
</changeSet>
<!--输出实体[BOOK]数据结构 -->
<changeSet author="root" id="tab-book-171-3">
<changeSet author="root" id="tab-book-173-3">
<createTable tableName="T_BOOK">
<column name="BOOKNAME" remarks="" type="VARCHAR(200)">
</column>
......
......@@ -3721,6 +3721,12 @@
"name" : "书实体编辑视图(测试编辑器)",
"realModelSubType" : "DEEDITVIEW",
"realModelType" : "PSDEVIEWBASE"
}, {
"codeName" : "Usr2GridView",
"logicName" : "书实体测试编辑器表格视图",
"name" : "书实体测试编辑器表格视图",
"realModelSubType" : "DEGRIDVIEW",
"realModelType" : "PSDEVIEWBASE"
}, {
"codeName" : "PickupGridView",
"logicName" : "书实体选择表格视图(部件视图)",
......
{
"aggMode" : "NONE",
"codeName" : "TestEditorGrid",
"columnEnableLink" : 2,
"controlType" : "GRID",
"dynaModelFilePath" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book/PSGRIDS/TestEditorGrid.json",
"getFetchPSControlAction" : {
"modelref" : true,
"id" : "fetch"
},
"groupMode" : "NONE",
"hookEventNames" : [ "ROWDBLCLICK", "SELECTIONCHANGE", "REMOVE", "LOAD", "BEFORELOAD" ],
"logicName" : "测试行编辑",
"getPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book.json"
},
"getPSControlLogics" : [ {
"eventNames" : "ROWDBLCLICK;SELECTIONCHANGE;REMOVE;LOAD;BEFORELOAD",
"logicTag" : "grid",
"logicType" : "APPVIEWENGINE",
"name" : "engine_grid",
"getPSAppViewEngine" : {
"modelref" : true,
"id" : "engine"
}
} ],
"getPSDEGridColumns" : [ {
"align" : "LEFT",
"cLConvertMode" : "NONE",
"caption" : "书名称",
"codeName" : "bookname",
"columnType" : "DEFGRIDCOLUMN",
"dataItemName" : "bookname",
"excelCaption" : "书名称",
"name" : "bookname",
"noPrivDisplayMode" : 1,
"getPSAppDEField" : {
"name" : "BOOKNAME",
"codeName" : "BookName"
},
"width" : 150,
"widthUnit" : "PX",
"enableSort" : true
}, {
"align" : "LEFT",
"cLConvertMode" : "FRONT",
"caption" : "更新人",
"codeName" : "updateman",
"columnType" : "DEFGRIDCOLUMN",
"dataItemName" : "updateman",
"excelCaption" : "更新人",
"name" : "updateman",
"noPrivDisplayMode" : 1,
"getPSAppCodeList" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPCODELISTS/SysOperator.json"
},
"getPSAppDEField" : {
"name" : "UPDATEMAN",
"codeName" : "UpdateMan"
},
"width" : 150,
"widthUnit" : "PX",
"enableSort" : true
}, {
"align" : "LEFT",
"cLConvertMode" : "NONE",
"caption" : "更新时间",
"codeName" : "updatedate",
"columnType" : "DEFGRIDCOLUMN",
"dataItemName" : "updatedate",
"excelCaption" : "更新时间",
"name" : "updatedate",
"noPrivDisplayMode" : 1,
"getPSAppDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
},
"valueFormat" : "YYYY-MM-DD HH:mm:ss",
"width" : 150,
"widthUnit" : "PX",
"enableSort" : true
}, {
"align" : "LEFT",
"cLConvertMode" : "NONE",
"caption" : "类型",
"codeName" : "type",
"columnType" : "DEFGRIDCOLUMN",
"dataItemName" : "type",
"excelCaption" : "类型",
"name" : "type",
"noPrivDisplayMode" : 1,
"getPSAppDEField" : {
"name" : "TYPE",
"codeName" : "Type"
},
"width" : 100,
"widthUnit" : "PX",
"enableSort" : true
} ],
"getPSDEGridDataItems" : [ {
"dataType" : 25,
"name" : "bookname",
"getPSAppDEField" : {
"name" : "BOOKNAME",
"codeName" : "BookName"
}
}, {
"dataType" : 25,
"name" : "updateman",
"getPSAppDEField" : {
"name" : "UPDATEMAN",
"codeName" : "UpdateMan"
}
}, {
"format" : "YYYY-MM-DD HH:mm:ss",
"dataType" : 5,
"name" : "updatedate",
"getPSAppDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
}
}, {
"dataType" : 25,
"name" : "type",
"getPSAppDEField" : {
"name" : "TYPE",
"codeName" : "Type"
}
}, {
"dataType" : 25,
"name" : "srfkey",
"getPSAppDEField" : {
"name" : "BOOKID",
"codeName" : "BookId"
}
}, {
"dataType" : 25,
"name" : "srfdataaccaction",
"getPSAppDEField" : {
"name" : "BOOKID",
"codeName" : "BookId"
},
"dataAccessAction" : true
}, {
"dataType" : 25,
"name" : "srfmajortext",
"getPSAppDEField" : {
"name" : "BOOKNAME",
"codeName" : "BookName"
}
} ],
"getPSDEGridEditItems" : [ {
"caption" : "书标识",
"codeName" : "srfkey",
"enableCond" : 3,
"ignoreInput" : 0,
"name" : "srfkey",
"getPSAppDEField" : {
"name" : "BOOKID",
"codeName" : "BookId"
},
"getPSEditor" : {
"editorType" : "HIDDEN",
"name" : "srfkey"
},
"allowEmpty" : true
} ],
"pagingSize" : 20,
"getRemovePSControlAction" : {
"actionName" : "Remove",
"actionType" : "DEACTION",
"dataAccessAction" : "DELETE",
"name" : "remove",
"getPSAppDEMethod" : {
"modelref" : true,
"id" : "Remove"
},
"getPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book.json"
}
},
"sortMode" : "REMOTE",
"hasWFDataItems" : false,
"enableColFilter" : false,
"enableCustomized" : true,
"enableGroup" : false,
"enablePagingBar" : true,
"enableRowEdit" : false,
"enableRowEditOrder" : false,
"enableRowNew" : false,
"forceFit" : false,
"hideHeader" : false,
"noSort" : false,
"singleSelect" : false,
"modelid" : "0DBB175D-29C0-4062-879E-F0927B0629C9",
"modeltype" : "PSDEGRID"
}
\ No newline at end of file
......@@ -1128,6 +1128,12 @@
"viewType" : "DEEDITVIEW",
"resource" : "BXDMX",
"view" : "EditView"
}, {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookUsr2GridView.json",
"viewType" : "DEGRIDVIEW",
"resource" : "Book",
"view" : "Usr2GridView"
}, {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookUsr2EditView2.json",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册