提交 599220cf 编写于 作者: ibizdev's avatar ibizdev

zhujiamin 发布系统代码 [TrainSys,网页端]

上级 ae6deb42
......@@ -38,7 +38,7 @@ export class IndexPickupDataViewEngine extends MDViewEngine {
* @memberof IndexPickupDataViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any) {
if (Object.is(ctrlName, '')) {
if (Object.is(ctrlName, 'dataview')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
......
......@@ -242,6 +242,9 @@ export class AppUITriggerEngine {
case 'calcnodestyle':
scriptCode = this.handleScriptCode(scriptCode);
return AppEmbeddedUILogic.calNodeStyle(opts, scriptCode);
case 'calcaggrowmergecol':
scriptCode = this.handleScriptCode(scriptCode);
return AppEmbeddedUILogic.calcAggRowMergeCol(opts, scriptCode);
default:
scriptCode = this.handleScriptCode(scriptCode, true);
return this.executeDefaultScriptLogic(opts, scriptCode);
......
import { IPSAppCodeList, IPSAppDEMethod } from "@ibiz/dynamic-model-api";
import { IContext, IEntityEnvContext, IParams } from "../../../interface";
import { HttpResponse, LogUtil } from "../../../utils";
import { AppMethod } from "./app-method";
/**
* 代码表
*
* @export
* @class AppCodeListMethod
* @extends {AppMethod}
*/
export class AppCodeListMethod extends AppMethod {
/**
* @description 代码表对象
* @type {IPSAppCodeList}
* @memberof AppCodeListMethod
*/
codeList: IPSAppCodeList;
public constructor(entityEnvContext: IEntityEnvContext, appDEMethod: IPSAppDEMethod) {
super(entityEnvContext, appDEMethod)
const { dataEntity, dataService } = entityEnvContext;
this.codeList = (appDEMethod as any).getPSAppCodeList?.();
}
/**
* @description 执行方法
* @param {IContext} context 上下文
* @param {IParams} data 数据
* @return {*} {Promise<HttpResponse>}
* @memberof AppCodeListMethod
*/
public async execute(context: IContext, data: IParams): Promise<HttpResponse> {
LogUtil.log(`执行实体内置方法,[方法名称]:${this.codeName}`);
try {
const targetResult: Array<any> = [];
if (this.codeList) {
const codeListItems: any = this.codeList.getPSCodeItems();
if (codeListItems && codeListItems.length > 0) {
codeListItems.forEach((element: any) => {
targetResult.push({ [this.dataService.APPDEKEY]: element.value, [this.dataService.APPDETEXT]: element.text });
});
}
}
const headers = new Headers({
'x-total': targetResult.length.toString(),
});
return new HttpResponse(targetResult, { headers });
} catch (error: any) {
return new HttpResponse({ message: error.message }, {
ok: false,
status: 500
});
}
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import { AppLogicMethod } from "./app-logic-method";
import { AppPluginMethod } from "./app-plugin-method";
import { AppRemoteMethod } from "./app-remote-method";
import { AppScriptMethod } from "./app-script-method";
import { AppCodeListMethod } from "./app-codelist-method";
export class AppMethodHelp {
/**
......@@ -32,6 +32,10 @@ export class AppMethodHelp {
if((appDEMethod as IPSAppDEAction).customCode){
return new AppScriptMethod(entityEnvContext, appDEMethod);
}
// 预置集合为代码表类型
if ((appDEMethod as any).dataSetType == 'CODELIST') {
return new AppCodeListMethod(entityEnvContext, appDEMethod);
}
// 当前应用实体本地存储模式为仅本地存储和DTO成员(无存储)【临时模式】
if(dataEntity.storageMode === 1 || dataEntity.storageMode === 4){
return new AppLocalMethod(entityEnvContext, appDEMethod);
......
......@@ -6,3 +6,4 @@ export { AppPluginMethod } from "./app-plugin-method";
export { AppRemoteMethod } from "./app-remote-method";
export { AppScriptMethod } from "./app-script-method";
export { AppMethodHelp } from "./app-method-help";
export { AppCodeListMethod } from "./app-codelist-method";
\ No newline at end of file
......@@ -67,4 +67,16 @@
return result;
}
/**
* 合计行列合并
*
* @memberof AppEmbeddedUILogic
*/
public static calcAggRowMergeCol(opts: any, scriptCode: string) {
let result: any;
const { arg } = opts;
const { columns, data } = arg;
eval(scriptCode);
return result;
}
}
import { IPSAppDataEntity, IPSAppDEACMode, IPSAppDEDataSet, IPSAppDEField, IPSAppView, IPSEditor, IPSFlexLayout, IPSFlexLayoutPos, IPSGridLayoutPos, IPSLayout, IPSLayoutPos, IPSNumberEditor, IPSDEGrid, IPSDEGridColumn, IPSDEGridEditItem, IPSDEGridDataItem, IPSAppCodeList } from "@ibiz/dynamic-model-api";
import { IPSDEGridFieldColumn, IPSAppDataEntity, IPSAppDEACMode, IPSAppDEDataSet, IPSAppDEField, IPSAppView, IPSEditor, IPSNumberEditor, IPSDEGrid, IPSDEGridColumn, IPSDEGridEditItem, IPSDEGridDataItem, IPSAppCodeList } from "@ibiz/dynamic-model-api";
import { AppServiceBase } from "../../service";
import { DataTypes } from "./data-types";
import { Util } from "./util";
......@@ -192,6 +192,20 @@ export class ModelTool {
}
}
/**
* 获取表格数据列名称
*
* @memberof ModelTool
*/
public static getGridDataColName(colInstance: IPSDEGridFieldColumn): string {
let name = colInstance.dataItemName;
const codeList: IPSAppCodeList | null = colInstance.getPSAppCodeList();
if (codeList && codeList.codeListType == 'DYNAMIC' && codeList.predefinedType && name.endsWith('_text')) {
name = name.substring(0, name.length - 5);
}
return name
}
/**
* @description 获取自填模式项插件
* @static
......
......@@ -101,7 +101,7 @@ export class AppDefaultGridColumn extends Vue {
if (codeList && cLConvertMode == "FRONT") { // 代码表
return (
<codelist
value={this.row[dataItemName]}
value={this.row[ModelTool.getGridDataColName(columnModel)]}
codeList={codeList}
>
</codelist>
......
......@@ -138,7 +138,30 @@ export default class AppModelButton extends Vue {
*
* @memberof AppModelButton
*/
public styleContent: string = '';
get styleContent(){
let tempStyle = '';
let { width, height} = this.modelJson;
// 初始化样式 统一转成字符串传给下面原子组件
if (width > 0) {
tempStyle += `width: ${width}px;`;
}
if (height > 0) {
tempStyle += `height: ${width}px;`;
}
if (this.modelJson && this.modelJson.M && this.modelJson.M.buttonCssStyle) {
tempStyle += this.getContentStyle(this.modelJson.M.buttonCssStyle) + ';';
}
if (this.dynaStyle) {
if (typeof this.dynaStyle == 'string') {
tempStyle += this.dynaStyle + ';';
} else if (typeof this.dynaStyle == 'object') {
for (const [key, value] of Object.entries(this.dynaStyle)) {
tempStyle += `${key}: ${value};`;
}
}
}
return tempStyle;
}
/**
* 按钮类名
......@@ -216,7 +239,7 @@ export default class AppModelButton extends Vue {
public created() {
const _this = this;
if (this.modelJson) {
let { width, height, caption, showCaption, name, tooltip } = this.modelJson;
let { caption, showCaption, name, tooltip } = this.modelJson;
const uiAction = this.modelJson.getPSUIAction() as IPSAppDEUIAction;
this.name = name;
this.caption = this.$tl(uiAction?.getCapPSLanguageRes()?.lanResTag, caption);
......@@ -238,25 +261,6 @@ export default class AppModelButton extends Vue {
if (this.modelJson.iconAlign) {
this.iconAlign = this.modelJson.iconAlign;
}
// 初始化样式 统一转成字符串传给下面原子组件
if (width > 0) {
this.styleContent += `width: ${width}px;`;
}
if (height > 0) {
this.styleContent += `height: ${width}px;`;
}
if (this.modelJson && this.modelJson.M && this.modelJson.M.buttonCssStyle) {
this.styleContent += this.getContentStyle(this.modelJson.M.buttonCssStyle) + ';';
}
if (this.dynaStyle) {
if (typeof this.dynaStyle == 'string') {
this.styleContent += this.dynaStyle + ';';
} else if (typeof this.dynaStyle == 'object') {
for (const [key, value] of Object.entries(this.dynaStyle)) {
this.styleContent += `${key}: ${value};`;
}
}
}
// 初始化类名 统一转成字符串传给下面原子组件
if (this.dynaClass) {
if (typeof this.dynaClass == 'string') {
......
......@@ -844,6 +844,7 @@ export class AppGridBase extends GridControlBase {
return (
<app-form-item gridError={this.gridItemsModel[$index]?.[column.property]?.error}>
<app-default-editor
name={ModelTool.getGridDataColName(item as IPSDEGridFieldColumn)}
editorInstance={editor}
ref={editor.name}
parentItem={editItem}
......
......@@ -721,7 +721,7 @@ export class ControlBase extends Vue implements ControlInterface {
}
}
// 目标逻辑类型类型为视图逻辑
if (element && Object.is(element.logicType, 'APPVIEWLOGIC') && opts.getPSAppViewLogics()) {
if (element && Object.is(element.logicType, 'APPVIEWLOGIC') && opts.getPSAppViewLogics?.()) {
const targetViewLogic = opts.getPSAppViewLogics().find((viewLogic: any) => {
return viewLogic.name === element.name;
})
......
......@@ -597,6 +597,7 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
//开启分组
if (this.isEnableGroup) {
const groupCodeList: IPSAppCodeList = this.controlInstance.getGroupPSCodeList() as IPSAppCodeList;
this.groupAppField = this.controlInstance.getGroupPSAppDEField()?.codeName.toLowerCase() || '';
if (groupCodeList && groupCodeList.codeName) {
this.codelistTag = groupCodeList.codeName;
this.codelistType = groupCodeList.codeListType || 'STATIC';
......@@ -1735,15 +1736,11 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
// 分组
let groupTree: Array<any> = [];
let allGroup: Array<any> = [];
let allGroupField: Array<any> = [];
//其他
let otherItems: Array<any> = [];
if (this.codelistTag && this.codelistType) {
allGroup = await this.codeListService.getDataItems({ tag: this.codelistTag, type: this.codelistType, data: this.codelist, context: this.context });
}
if (this.groupAppFieldCodelistTag && this.groupAppFieldCodelistType) {
allGroupField = await this.codeListService.getDataItems({ tag: this.groupAppFieldCodelistTag, type: this.groupAppFieldCodelistType, data: this.groupAppFieldCodelist, context: this.context });
}
if (!this.items || this.items.length == 0) {
return;
}
......@@ -1763,7 +1760,7 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
groupById: Util.createUUID(),
group: ""
});
const i = allGroup.findIndex((group: any) => !Object.is(allGroupField && allGroupField.length > 0 ? group.label : group.value, item[this.groupAppField]));
const i = allGroup.findIndex((group: any) => !Object.is(group.value, item[this.groupAppField]));
if (i < 0) {
otherItems.push(item);
}
......@@ -1772,8 +1769,7 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
allGroup.forEach((group: any, index: number) => {
let children: Array<any> = [];
this.items.forEach((item: any, _index: number) => {
const field = allGroupField && allGroupField.length > 0 ? group.label : group.value;
if (Object.is(item[this.groupAppField], field)) {
if (Object.is(item[this.groupAppField], group.value)) {
children.push(item);
}
})
......@@ -2631,10 +2627,15 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
}
const { columns, data } = param;
const sums: Array<any> = [];
const ctrlParams = this.controlInstance.getPSControlParam()?.ctrlParams;
let aggTitle: any = (this.$t('app.grid.dataaggregate.dataaggregate') as string);
if (ctrlParams && ctrlParams.hasOwnProperty('AGGTITLE')) {
aggTitle = ctrlParams.AGGTITLE
}
if (Object.is(this.aggMode, "PAGE")) {
columns.forEach((column: any, index: number) => {
if (index === 0) {
sums[index] = (this.$t('app.grid.dataaggregate.dataaggregate') as string);
sums[index] = aggTitle;
return;
}
this.allColumnsInstance.forEach((columnInstance: any) => {
......@@ -2701,11 +2702,12 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
sums[index] = '';
}
});
this.calcAggRowMergeCol(columns, data);
return sums;
} else if (Object.is(this.aggMode, "ALL")) {
columns.forEach((column: any, index: number) => {
if (index === 0) {
sums[index] = (this.$t('app.grid.dataaggregate.dataaggregate') as string);
sums[index] = aggTitle;
return;
} else if (index === (columns.length - 1)) {
sums[index] = '';
......@@ -2739,10 +2741,23 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
}
}
});
this.calcAggRowMergeCol(columns, data);
return sums;
}
}
/**
* @description 计算合计行合并列
* @param {*} column 当前列
* @param {*} data 表格数据
* @memberof GridControlBase
*/
public calcAggRowMergeCol(columns: any[], data: any) {
if (this.ctrlTriggerLogicMap.get('calcaggrowmergecol')) {
return this.ctrlTriggerLogicMap.get('calcaggrowmergecol').executeUILogic({ arg: { columns, data } });
}
}
/**
* 合并分组行
*
......
......@@ -22,7 +22,6 @@
> .ivu-modal-body {
padding: 0;
height: 100%;
> .studio-view.view-container {
border-radius: 0px 0px 5px 5px;
.app-form-group{
......
......@@ -3,7 +3,7 @@ services:
trainsys-app-web:
image: dstimage
ports:
- "50100:80"
- "80:80"
networks:
- agent_network
environment:
......
......@@ -55,15 +55,6 @@
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>
......
......@@ -2,7 +2,7 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<!--输出实体[BOOK]数据结构 -->
<changeSet author="root" id="tab-book-18-1">
<changeSet author="root" id="tab-book-19-1">
<createTable tableName="T_BOOK">
<column name="BOOKNAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -74,25 +74,6 @@
</createTable>
</changeSet>
<!--输出实体[RAWMATERIAL]数据结构 -->
<changeSet author="root" id="tab-rawmaterial-9-4">
<createTable tableName="T_RAWMATERIAL">
<column name="RAWMATERIALID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_RAWMATERIAL"/>
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="RAWMATERIALNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
</createTable>
</changeSet>
<!--输出实体[REGINFO]数据结构 -->
<changeSet author="root" id="tab-reginfo-34-5">
<createTable tableName="T_REGINFO">
......
......@@ -1586,6 +1586,12 @@
"name" : "书实体表格视图",
"realModelSubType" : "DEGRIDVIEW",
"realModelType" : "PSDEVIEWBASE"
}, {
"codeName" : "MapView",
"logicName" : "书实体地图视图",
"name" : "书实体地图视图",
"realModelSubType" : "DEMAPVIEW",
"realModelType" : "PSDEVIEWBASE"
}, {
"codeName" : "PickupGridView",
"logicName" : "书实体选择表格视图(部件视图)",
......
......@@ -174,14 +174,6 @@
},
"builtinAction" : true
} ],
"getAllPSDEDBConfigs" : [ {
"dBType" : "MYSQL5",
"name" : "MYSQL5",
"objNameCase" : "DEFAULT",
"standardTableName" : "`T_RAWMATERIAL`",
"tableName" : "T_RAWMATERIAL",
"valid" : true
} ],
"getAllPSDEDBTables" : [ {
"getAllPSDEFields" : [ {
"name" : "RAWMATERIALID",
......
{
"codeName" : "Map",
"controlType" : "MAP",
"dynaModelFilePath" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book/PSMAPS/Map.json",
"legendPos" : "NONE",
"getPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book.json"
},
"modelid" : "5ef3fa7e256948747aee83a29020c3ce_map",
"modeltype" : "PSSYSMAPVIEW"
}
\ No newline at end of file
{
"accUserMode" : 2,
"caption" : "书",
"codeName" : "bookMapView",
"dynaModelFilePath" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookMapView.json",
"mDCtrlActiveMode" : 2,
"name" : "bookMapView",
"getPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book.json"
},
"getPSAppViewLogics" : [ {
"logicTrigger" : "CUSTOM",
"logicType" : "SYSUILOGIC",
"name" : "newdata",
"getPSAppUILogic" : {
"actionAfterWizard" : "DEFAULT",
"logicType" : "PREDEFINED",
"name" : "新建数据",
"getNewDataPSAppView" : {
"getRefPSAppView" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookEditView.json",
"viewType" : "DEEDITVIEW"
}
},
"getPSAppUILogicRefViews" : [ {
"getRefPSAppView" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookEditView.json",
"viewType" : "DEEDITVIEW"
}
} ],
"viewLogicType" : "APP_NEWDATA",
"batchAddOnly" : false,
"enableBatchAdd" : false,
"enableWizardAdd" : false
}
}, {
"logicTrigger" : "CUSTOM",
"logicType" : "SYSUILOGIC",
"name" : "opendata",
"getPSAppUILogic" : {
"logicType" : "PREDEFINED",
"name" : "打开数据",
"getOpenDataPSAppView" : {
"getRefPSAppView" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookEditView.json",
"viewType" : "DEEDITVIEW"
}
},
"getPSAppUILogicRefViews" : [ {
"getRefPSAppView" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookEditView.json",
"viewType" : "DEEDITVIEW"
}
} ],
"viewLogicType" : "APP_OPENDATA",
"editMode" : true
}
} ],
"getPSAppViewRefs" : [ {
"name" : "NEWDATA",
"realTitle" : "书编辑视图",
"getRefPSAppView" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookEditView.json",
"viewType" : "DEEDITVIEW"
}
}, {
"name" : "EDITDATA",
"realTitle" : "书编辑视图",
"getRefPSAppView" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookEditView.json",
"viewType" : "DEEDITVIEW"
}
} ],
"getPSControls" : [ {
"codeName" : "Map",
"controlType" : "MAP",
"dynaModelFilePath" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book/PSMAPS/Map.json",
"legendPos" : "NONE",
"getPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book.json"
},
"getPSControlHandler" : {
"enableDEFieldPrivilege" : false,
"id" : "map"
},
"getPSControlParam" : {
"autoLoad" : true,
"showBusyIndicator" : true,
"id" : "MAP"
},
"name" : "map",
"modelid" : "5ef3fa7e256948747aee83a29020c3ce_map",
"modeltype" : "PSSYSMAPVIEW"
} ],
"getPSDEViewCodeName" : "MapView",
"getPSDEViewId" : "868BC4EF-2A95-4C2A-A3D2-A9129E82A78D",
"getPSViewLayoutPanel" : {
"codeName" : "Layoutpanel",
"controlStyle" : "APPDEMAPVIEW",
"controlType" : "VIEWLAYOUTPANEL",
"name" : "layoutpanel",
"getPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/Book.json"
},
"getPSControlParam" : { },
"layoutBodyOnly" : true,
"layoutPanel" : true,
"useDefaultLayout" : true
},
"title" : "书地图视图",
"viewStyle" : "DEFAULT",
"viewType" : "DEMAPVIEW",
"xDataControlName" : "map",
"enableDP" : true,
"enableFilter" : false,
"modelid" : "5ef3fa7e256948747aee83a29020c3ce",
"modeltype" : "PSAPPDEVIEW"
}
\ No newline at end of file
......@@ -646,6 +646,12 @@
"path" : "PSSYSAPPS/Web/PSAPPINDEXVIEWS/AppIndex.json",
"viewType" : "APPINDEXVIEW",
"view" : "AppIndex"
}, {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/bookMapView.json",
"viewType" : "DEMAPVIEW",
"resource" : "Book",
"view" : "MapView"
}, {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDEVIEWS/phoneEditView.json",
......
......@@ -70,7 +70,7 @@
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<imageName>dstimage</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
......@@ -107,7 +107,7 @@
<argument>--platform</argument>
<argument>linux/amd64,linux/arm64</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}:latest</argument>
<argument>dstimage</argument>
<argument>${project.basedir}/src/main/docker</argument>
<argument>--push</argument>
</arguments>
......
version: "3.2"
services:
trainsys-provider:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/trainsys-provider:latest
image: dstimage
ports:
- "8081:8081"
networks:
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册