提交 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} ---加载数据失败`);
......
......@@ -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) {
state.routeViewGlobal[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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册