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

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

上级 256263f4
......@@ -62,6 +62,16 @@ export class PanelViewEngine extends ViewEngine {
return;
}
const { data: _data } = response;
if(_this.viewCtx && _this.viewCtx.view){
_this.viewCtx['viewGlobal']['srfactiveviewdata'] = _data;
// 当前视图为顶层视图
if(_this.viewCtx.topview && Object.is(_this.viewCtx.view._uid,_this.viewCtx.topview._uid)){
_this.$store.commit('addRouteViewGlobal', { tag: _this.context.srfsessionid, param: { srfactiveviewdata: _data } });
}
if(_this.forceRefresh && _this.forceRefresh instanceof Function){
_this.forceRefresh();
}
}
if(_data.srfopprivs){
_this.$store.commit('authresource/setSrfappdeData', { key: `${_this.deName}-${_data[_this.appDeKeyFieldName.toLowerCase()]}`, value: _data.srfopprivs });
}
......
......@@ -82,6 +82,16 @@ export class PortalViewEngine extends ViewEngine {
return;
}
const { data: _data } = response;
if(_this.viewCtx && _this.viewCtx.view){
_this.viewCtx['viewGlobal']['srfactiveviewdata'] = _data;
// 当前视图为顶层视图
if(_this.viewCtx.topview && Object.is(_this.viewCtx.view._uid,_this.viewCtx.topview._uid)){
_this.$store.commit('addRouteViewGlobal', { tag: _this.context.srfsessionid, param: { srfactiveviewdata: _data } });
}
if(_this.forceRefresh && _this.forceRefresh instanceof Function){
_this.forceRefresh();
}
}
if (_data.srfopprivs) {
_this.$store.commit('authresource/setSrfappdeData', { key: `${_this.deName}-${_data[_this.appDeKeyFieldName.toLowerCase()]}`, value: _data.srfopprivs });
}
......
......@@ -70,6 +70,16 @@ export class TabExpViewEngine extends ViewEngine {
return;
}
const { data: _data } = response;
if(_this.viewCtx && _this.viewCtx.view){
_this.viewCtx['viewGlobal']['srfactiveviewdata'] = _data;
// 当前视图为顶层视图
if(_this.viewCtx.topview && Object.is(_this.viewCtx.view._uid,_this.viewCtx.topview._uid)){
_this.$store.commit('addRouteViewGlobal', { tag: _this.context.srfsessionid, param: { srfactiveviewdata: _data } });
}
if(_this.forceRefresh && _this.forceRefresh instanceof Function){
_this.forceRefresh();
}
}
if(_data.srfopprivs){
_this.$store.commit('authresource/setSrfappdeData', { key: `${_this.deName}-${_data[_this.appDeKeyFieldName.toLowerCase()]}`, value: _data.srfopprivs });
}
......
......@@ -23,10 +23,10 @@ export class PanelContainerModel extends PanelDetailModel {
/**
* 数据源类型
* @description 值模式 [数据面板源(全部)] {DEACTION:实体行为、 DEDATASET:实体集合、 DELOGIC:实体逻辑 }
* @type {( string | 'DEACTION' | 'DEDATASET' | 'DELOGIC')}
* @description 值模式 [数据面板源(全部)] {DEACTION:实体行为、 DEDATASET:实体集合、 DELOGIC:实体逻辑、 APPGLOBALPARAM:绑定应用全局变量、 TOPVIEWSESSIONPARAM:绑定顶级视图会话共享变量、 VIEWSESSIONPARAM:绑定当前视图会话共享变量 }
* @type {( string | 'DEACTION' | 'DEDATASET' | 'DELOGIC' | 'APPGLOBALPARAM' | 'TOPVIEWSESSIONPARAM' | 'VIEWSESSIONPARAM')}
*/
public dataSourceType: string | 'DEACTION' | 'DEDATASET' | 'DELOGIC' = '';
public dataSourceType: string | 'DEACTION' | 'DEDATASET' | 'DELOGIC' | 'APPGLOBALPARAM' | 'TOPVIEWSESSIONPARAM' | 'VIEWSESSIONPARAM';
/**
* 数据刷新模式
......@@ -171,6 +171,7 @@ export class PanelContainerModel extends PanelDetailModel {
*/
public async loadData(): Promise<any> {
const deCodeName = (this.panelItemModel as IPSPanelContainer)?.getPSAppDataEntity?.()?.codeName;
const dataName = (this.panelItemModel as any).dataName;
try {
if (this.dataSourceType === 'DEACTION' || this.dataSourceType === 'DEDATASET') {
const method = (this.panelItemModel as IPSPanelContainer)?.getPSAppDEMethod?.()?.codeName;
......@@ -192,6 +193,15 @@ export class PanelContainerModel extends PanelDetailModel {
return data;
}
}
}else if(this.dataSourceType === 'APPGLOBALPARAM'){
const dataRange = this.panel.viewCtx.appGlobal;
return dataRange[dataName];
}else if(this.dataSourceType === 'TOPVIEWSESSIONPARAM'){
const dataRange = this.panel.viewCtx.routeViewGlobal;
return dataRange[dataName];
}else if(this.dataSourceType === 'VIEWSESSIONPARAM'){
const dataRange = this.panel.viewCtx.viewGlobal;
return dataRange[dataName];
}
} catch (error) {
LogUtil.error(`面板--- ${this.caption} ---加载数据失败`);
......
......@@ -241,7 +241,7 @@ export class AppDefaultViewLayout extends ControlContainer {
}
if (this.engine) {
this.engineInit();
if(this.engine.loadModel instanceof Function) {
if (this.engine.loadModel instanceof Function) {
this.engine.loadModel();
}
}
......@@ -501,7 +501,7 @@ export class AppDefaultViewLayout extends ControlContainer {
public renderViewCaption(renderMode?: any): any {
const content = [
this.$slots['layout-captionbar'] ? this.$slots['layout-captionbar'] : this.model?.srfCaption,
this.model.dataInfo ? [<span>-</span>,this.$slots['layout-datainfobar']] : ''
this.model.dataInfo ? [<span>-</span>, this.$slots['layout-datainfobar']] : ''
]
switch (renderMode) {
case 'TEXT':
......@@ -759,11 +759,11 @@ export class AppDefaultViewLayout extends ControlContainer {
<div style={container.showCaption ? '' : detailStyle} class={detailClass} onClick={(event: any) => { this.handlePanelItemEvent(container.name, name, 'onclick', { hasMulParent, index, event }) }} >
{container.showCaption ? <row class="viewlayoutpanel-container-header">
<span>{this.$tl(container.getCapPSLanguageRes?.()?.lanResTag, container.caption)}</span>
{this.layoutDetailsModel[name].titleBarClose ? <i class={{ 'caption-icon': true, 'el-icon-arrow-down': this.layoutDetailsModel[name].extendState, 'el-icon-arrow-right': !this.layoutDetailsModel[name].extendState}} on-click={() => this.switchExtendState(this.layoutDetailsModel[name])}></i> : null}
{this.layoutDetailsModel[name].titleBarClose ? <i class={{ 'caption-icon': true, 'el-icon-arrow-down': this.layoutDetailsModel[name].extendState, 'el-icon-arrow-right': !this.layoutDetailsModel[name].extendState }} on-click={() => this.switchExtendState(this.layoutDetailsModel[name])}></i> : null}
</row> : null}
{
container.showCaption ?
<div style={{ ...detailStyle, 'display': !this.layoutDetailsModel[name].titleBarClose || (this.layoutDetailsModel[name].titleBarClose && this.layoutDetailsModel[name].extendState) ? 'block' : 'none'}} class="viewlayoutpanel-container-content">
<div style={{ ...detailStyle, 'display': !this.layoutDetailsModel[name].titleBarClose || (this.layoutDetailsModel[name].titleBarClose && this.layoutDetailsModel[name].extendState) ? 'block' : 'none' }} class="viewlayoutpanel-container-content">
{container.dataRegionType === 'MULTIDATA' && this.layoutDetailsModel[name]?.getData()?.length > 0 ?
this.layoutDetailsModel[name]?.getData().map((data: any, index: number) => {
return this.renderChildItems(container, panelItems, index);
......@@ -776,17 +776,17 @@ export class AppDefaultViewLayout extends ControlContainer {
}
</div>
);
}else if(layout && Object.is(layout, 'SIMPLEFLEX')){
} else if (layout && Object.is(layout, 'SIMPLEFLEX')) {
// 存在三种情况(1:该容器为多数据容器; 2: 父容器为多数据容器; 3: 正常容器)
return (
<div style={container.showCaption ? '' : detailStyle} class={detailClass} onClick={(event: any) => { this.handlePanelItemEvent(container.name, name, 'onclick', { hasMulParent, index, event }) }} >
{container.showCaption ? <row class="viewlayoutpanel-container-header">
<span>{this.$tl(container.getCapPSLanguageRes?.()?.lanResTag, container.caption)}</span>
{this.layoutDetailsModel[name].titleBarClose ? <i class={{ 'caption-icon': true, 'el-icon-arrow-down': this.layoutDetailsModel[name].extendState, 'el-icon-arrow-right': !this.layoutDetailsModel[name].extendState}} on-click={() => this.switchExtendState(this.layoutDetailsModel[name])}></i> : null}
{this.layoutDetailsModel[name].titleBarClose ? <i class={{ 'caption-icon': true, 'el-icon-arrow-down': this.layoutDetailsModel[name].extendState, 'el-icon-arrow-right': !this.layoutDetailsModel[name].extendState }} on-click={() => this.switchExtendState(this.layoutDetailsModel[name])}></i> : null}
</row> : null}
{
container.showCaption ?
<div style={{ ...detailStyle, 'display': !this.layoutDetailsModel[name].titleBarClose || (this.layoutDetailsModel[name].titleBarClose && this.layoutDetailsModel[name].extendState) ? 'block' : 'none'}} class="viewlayoutpanel-container-content">
<div style={{ ...detailStyle, 'display': !this.layoutDetailsModel[name].titleBarClose || (this.layoutDetailsModel[name].titleBarClose && this.layoutDetailsModel[name].extendState) ? 'block' : 'none' }} class="viewlayoutpanel-container-content">
{container.dataRegionType === 'MULTIDATA' && this.layoutDetailsModel[name]?.getData()?.length > 0 ?
this.layoutDetailsModel[name]?.getData().map((data: any, index: number) => {
return <app-simpleflex-container inMulParent={true} panelItems={panelItems} index={index} renderCallBack={this.renderByDetailType.bind(this)}></app-simpleflex-container>;
......@@ -800,15 +800,15 @@ export class AppDefaultViewLayout extends ControlContainer {
}
</div>
);
}else {
} else {
// 存在三种情况(1:该容器为多数据容器; 2: 父容器为多数据容器; 3: 正常容器)
return (
<row style={detailStyle} class={detailClass} nativeOn={{ 'click': (event: any) => { this.handlePanelItemEvent(container.name, name, 'onclick', { hasMulParent, index, event }) } }}>
{container.showCaption ? <row class="viewlayoutpanel-container-header">
<span>{this.$tl(container.getCapPSLanguageRes?.()?.lanResTag, container.caption)}</span>
{this.layoutDetailsModel[name].titleBarClose ? <i class={{ 'caption-icon': true, 'el-icon-arrow-down': this.layoutDetailsModel[name].extendState, 'el-icon-arrow-right': !this.layoutDetailsModel[name].extendState}} on-click={() => this.switchExtendState(this.layoutDetailsModel[name])}></i> : null}
{this.layoutDetailsModel[name].titleBarClose ? <i class={{ 'caption-icon': true, 'el-icon-arrow-down': this.layoutDetailsModel[name].extendState, 'el-icon-arrow-right': !this.layoutDetailsModel[name].extendState }} on-click={() => this.switchExtendState(this.layoutDetailsModel[name])}></i> : null}
</row> : null}
<div style={{...detailStyle, 'display': !this.layoutDetailsModel[name].titleBarClose || (this.layoutDetailsModel[name].titleBarClose && this.layoutDetailsModel[name].extendState) ? 'block' : 'none'}} class="viewlayoutpanel-container-content">
<div style={{ ...detailStyle, 'display': !this.layoutDetailsModel[name].titleBarClose || (this.layoutDetailsModel[name].titleBarClose && this.layoutDetailsModel[name].extendState) ? 'block' : 'none' }} class="viewlayoutpanel-container-content">
{
container.dataRegionType === 'MULTIDATA' && this.layoutDetailsModel[name]?.getData()?.length > 0 ?
this.layoutDetailsModel[name]?.getData().map((data: any, index: number) => {
......@@ -1071,7 +1071,7 @@ export class AppDefaultViewLayout extends ControlContainer {
const detailStyle = this.layoutDetailsModel[name]?.getBoxStyle();
const sysImage = modelJson.getPSSysImage()?.cssClass;
let sysImgurl = modelJson.getPSSysImage()?.imagePath;
if(modelJson.getPSSysImage()?.rawContent){
if (modelJson.getPSSysImage()?.rawContent) {
sysImgurl = modelJson.getPSSysImage()?.rawContent;
}
const content = this.layoutData[name];
......@@ -1246,7 +1246,7 @@ export class AppDefaultViewLayout extends ControlContainer {
public async handlePanelItemEvent(tag: string, name: string, eventName: string, args?: any) {
const tempTag: string = `${tag.toLowerCase()}-${eventName.toLowerCase()}`;
if (this.containerTriggerLogicMap.get(tempTag)) {
if(args?.event){
if (args?.event) {
args.event.stopPropagation();
}
const data = { value: this.layoutDetailsModel[name].getData(), data: this.layoutData };
......@@ -1257,4 +1257,14 @@ export class AppDefaultViewLayout extends ControlContainer {
return result;
}
}
/**
* 强制刷新
*
* @memberof AppDefaultViewLayout
*/
public async forceRefresh() {
await this.initDetailsModel(null, this.viewLayoutPanel?.getRootPSPanelItems());
this.$forceUpdate();
}
}
\ No newline at end of file
......@@ -377,7 +377,13 @@ export const removeAppGlobal = (state: any, tag: string) => {
*/
export const addRouteViewGlobal = (state: any, args: { tag: string, param: any }) => {
if (args && args.tag && args.param) {
if(!state.routeViewGlobal[args.tag]){
state.routeViewGlobal[args.tag] = args.param;
}else{
const cacheValue = state.routeViewGlobal[args.tag];
Object.assign(cacheValue,args.param);
state.routeViewGlobal[args.tag] = cacheValue;
}
}
}
......
......@@ -194,7 +194,7 @@
</changeSet>
<!--输出实体[REGINFO]数据结构 -->
<changeSet author="root" id="tab-reginfo-38-8">
<changeSet author="root" id="tab-reginfo-42-8">
<createTable tableName="T_REGINFO">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......
......@@ -34,6 +34,52 @@
"id" : "engine"
}
} ],
"getPSDEFormItemVRs" : [ {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Age",
"getPSSysValueRule" : {
"codeName" : "ValueRule20",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule20.json",
"name" : "脚本值规则测试",
"ruleInfo" : "脚本校验",
"ruleType" : "SCRIPT",
"scriptCode" : "return false",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Name",
"getPSSysValueRule" : {
"codeName" : "ValueRule14",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule14.json",
"name" : "由26个英文字母组成的字符串",
"regExCode" : "[A-Za-z]+",
"ruleInfo" : "内容必须为26个英文字母组成的字符串",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "StuNo",
"getPSSysValueRule" : {
"codeName" : "ValueRule3",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule3.json",
"name" : "非负整数(正整数 + 0)",
"regExCode" : "\\d+",
"ruleInfo" : "内容必须为非负整数(正整数 + 0)",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
} ],
"getPSDEFormItems" : [ {
"id" : "srfupdatedate",
"hidden" : true,
......
......@@ -1020,6 +1020,52 @@
"showBusyIndicator" : true,
"id" : "FORM"
},
"getPSDEFormItemVRs" : [ {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Age",
"getPSSysValueRule" : {
"codeName" : "ValueRule20",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule20.json",
"name" : "脚本值规则测试",
"ruleInfo" : "脚本校验",
"ruleType" : "SCRIPT",
"scriptCode" : "return false",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Name",
"getPSSysValueRule" : {
"codeName" : "ValueRule14",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule14.json",
"name" : "由26个英文字母组成的字符串",
"regExCode" : "[A-Za-z]+",
"ruleInfo" : "内容必须为26个英文字母组成的字符串",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "StuNo",
"getPSSysValueRule" : {
"codeName" : "ValueRule3",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule3.json",
"name" : "非负整数(正整数 + 0)",
"regExCode" : "\\d+",
"ruleInfo" : "内容必须为非负整数(正整数 + 0)",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
} ],
"getPSDEFormItems" : [ {
"id" : "srfupdatedate",
"hidden" : true,
......
......@@ -530,6 +530,9 @@
}, {
"modelref" : true,
"path" : "PSSYSVALUERULES/ValueRule4.json"
}, {
"modelref" : true,
"path" : "PSSYSVALUERULES/ValueRule20.json"
}, {
"modelref" : true,
"path" : "PSSYSVALUERULES/ValueRule7.json"
......
{
"codeName" : "ValueRule20",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule20.json",
"name" : "脚本值规则测试",
"ruleInfo" : "脚本校验",
"ruleType" : "SCRIPT",
"scriptCode" : "return false",
"enableBackend" : true,
"enableFront" : true
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册