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

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

上级 ccc1d12d
...@@ -12,21 +12,21 @@ ...@@ -12,21 +12,21 @@
}, },
"dependencies": { "dependencies": {
"@floating-ui/dom": "^1.0.11", "@floating-ui/dom": "^1.0.11",
"@ibiz-template/command": "^0.0.1-beta.49", "@ibiz-template/command": "^0.0.1-beta.50",
"@ibiz-template/controller": "^0.0.1-beta.49", "@ibiz-template/controller": "^0.0.1-beta.50",
"@ibiz-template/core": "^0.0.1-beta.49", "@ibiz-template/core": "^0.0.1-beta.50",
"@ibiz-template/model": "^0.0.1-beta.49", "@ibiz-template/model": "^0.0.1-beta.50",
"@ibiz-template/runtime": "^0.0.1-beta.49", "@ibiz-template/runtime": "^0.0.1-beta.50",
"@ibiz-template/service": "^0.0.1-beta.49", "@ibiz-template/service": "^0.0.1-beta.50",
"@ibiz-template/theme": "^0.0.1-beta.49", "@ibiz-template/theme": "^0.0.1-beta.50",
"@ibiz-template/vue-util": "^0.0.1-beta.49", "@ibiz-template/vue-util": "^0.0.1-beta.50",
"@ibiz/dynamic-model-api": "^2.1.11", "@ibiz/dynamic-model-api": "^2.1.17",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"path-browserify": "^1.0.1", "path-browserify": "^1.0.1",
"pinia": "^2.0.28", "pinia": "^2.0.28",
"qs": "^6.11.0", "qs": "^6.11.0",
"qx-util": "^0.4.4", "qx-util": "^0.4.8",
"ramda": "^0.28.0", "ramda": "^0.28.0",
"view-design": "^4.7.0", "view-design": "^4.7.0",
"vue": "^2.7.14", "vue": "^2.7.14",
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.3.0", "@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0", "@commitlint/config-conventional": "^17.3.0",
"@types/lodash-es": "^4.17.6", "@types/lodash-es": "^4.17.7",
"@types/node": "^18.11.15", "@types/node": "^18.11.15",
"@types/path-browserify": "^1.0.0", "@types/path-browserify": "^1.0.0",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
...@@ -55,23 +55,23 @@ ...@@ -55,23 +55,23 @@
"eslint-plugin-vue": "^9.8.0", "eslint-plugin-vue": "^9.8.0",
"husky": "^8.0.2", "husky": "^8.0.2",
"lint-staged": "^13.1.0", "lint-staged": "^13.1.0",
"postcss": "^8.4.20", "postcss": "^8.4.21",
"postcss-scss": "^4.0.6", "postcss-scss": "^4.0.6",
"prettier": "^2.8.1", "prettier": "^2.8.7",
"rollup-plugin-visualizer": "^5.8.3", "rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.56.2", "sass": "^1.56.2",
"stylelint": "^14.16.0", "stylelint": "^14.16.0",
"stylelint-config-prettier": "^9.0.4", "stylelint-config-prettier": "^9.0.5",
"stylelint-config-recess-order": "^3.0.0", "stylelint-config-recess-order": "^3.0.0",
"stylelint-config-standard": "^29.0.0", "stylelint-config-standard": "^29.0.0",
"stylelint-config-standard-scss": "^6.1.0", "stylelint-config-standard-scss": "^6.1.0",
"stylelint-scss": "^4.3.0", "stylelint-scss": "^4.3.0",
"terser": "^5.16.1", "terser": "^5.16.1",
"typescript": "^4.9.4", "typescript": "^4.9.4",
"vite": "^4.0.1", "vite": "^4.2.1",
"vite-plugin-eslint": "^1.8.1", "vite-plugin-eslint": "^1.8.1",
"vue-eslint-parser": "^9.1.0", "vue-eslint-parser": "^9.1.1",
"vue-tsc": "^1.0.13" "vue-tsc": "^1.2.0"
}, },
"lint-staged": { "lint-staged": {
"*.{ts,vue}": "eslint --fix", "*.{ts,vue}": "eslint --fix",
......
此差异已折叠。
...@@ -23,7 +23,10 @@ async function loadAppPlugins(): Promise<void> { ...@@ -23,7 +23,10 @@ async function loadAppPlugins(): Promise<void> {
) { ) {
const config = JSON.parse(pluginRef.rTObjectRepo); const config = JSON.parse(pluginRef.rTObjectRepo);
if (config && config.app === true) { if (config && config.app === true) {
await ibiz.plugin.loadPluginRef(pluginRef); await ibiz.plugin.loadPluginRef(
pluginRef.rTObjectName,
pluginRef.rTObjectRepo,
);
} }
} }
}); });
......
import Vue from 'vue';
import { RuntimeError } from '@ibiz-template/core'; import { RuntimeError } from '@ibiz-template/core';
import { DefectModelError } from '@ibiz-template/model'; import { DefectModelError } from '@ibiz-template/model';
import { import {
IPluginFactory, IPluginFactory,
IPluginItem,
RemotePluginConfig, RemotePluginConfig,
RemotePluginItem, RemotePluginItem,
} from '@ibiz-template/runtime'; } from '@ibiz-template/runtime';
import { IPSAppPFPluginRef, IPSSysPFPlugin } from '@ibiz/dynamic-model-api'; import { IPSAppPFPluginRef, IPSSysPFPlugin } from '@ibiz/dynamic-model-api';
import { basename, dirname, join } from 'path-browserify'; import { join } from 'path-browserify';
import { VueConstructor, PluginObject } from 'vue';
/** /**
* 插件工具类 * 插件工具类
...@@ -56,6 +57,79 @@ export class PluginFactory implements IPluginFactory { ...@@ -56,6 +57,79 @@ export class PluginFactory implements IPluginFactory {
*/ */
protected pluginCache: Map<string, RemotePluginItem> = new Map(); protected pluginCache: Map<string, RemotePluginItem> = new Map();
/**
* 所有的插件
*
* @author chitanda
* @date 2023-02-02 16:02:55
* @protected
* @type {PluginObject<unknown>[]}
*/
protected pluginCodes: PluginObject<unknown>[] = [];
/**
* 预定义插件集合
*
* @author chitanda
* @date 2023-03-09 17:03:46
* @protected
* @type {Map<string, IPluginItem>}
*/
protected predefinedPlugins: Map<string, IPluginItem> = new Map();
/**
* 注册视图默认插件
*
* @author chitanda
* @date 2023-02-06 21:02:10
* @param {IPluginItem} plugin
*/
registerPredefinedPlugin(plugin: IPluginItem): void {
this.predefinedPlugins.set(plugin.name, plugin);
}
/**
* 给入应用实例,将已经加载的过插件注入。主要用于多实例的情况
*
* @author chitanda
* @date 2023-02-02 16:02:51
* @param {App} app
*/
register(app: VueConstructor): void {
this.pluginCodes.forEach(plugin => {
app.use(plugin);
});
}
/**
* 加载预置插件
*
* @author chitanda
* @date 2023-03-09 18:03:48
* @param {string} name
* @return {*} {Promise<void>}
*/
async loadPredefinedPlugin(name: string): Promise<void> {
if (this.predefinedPlugins.has(name)) {
const plugin = this.predefinedPlugins.get(name)!;
if (plugin) {
await this.loadPluginRef(plugin.name, plugin.path);
}
}
}
/**
* 插件刚加载完成回来,设置到目前所有的 vue 实例当中
*
* @author chitanda
* @date 2023-02-02 17:02:38
* @protected
* @param {PluginObject<unknown>} code
*/
protected setPluginCode(code: PluginObject<unknown>): void {
this.pluginCodes.push(code);
}
/** /**
* 设置开发插件,用于本地调试 * 设置开发插件,用于本地调试
* *
...@@ -80,41 +154,62 @@ export class PluginFactory implements IPluginFactory { ...@@ -80,41 +154,62 @@ export class PluginFactory implements IPluginFactory {
if (plugin.runtimeObject === true) { if (plugin.runtimeObject === true) {
const pluginRef = plugin as unknown as IPSAppPFPluginRef; const pluginRef = plugin as unknown as IPSAppPFPluginRef;
if (pluginRef) { if (pluginRef) {
return this.loadPluginRef(pluginRef); try {
await this.loadPluginRef(
pluginRef.rTObjectName,
pluginRef.rTObjectRepo,
);
} catch (error) {
throw new DefectModelError(pluginRef, `配置加载失败`);
}
} }
} }
return false; return false;
} }
/** /**
* 加载应用饮用插件 * 加载应用插件
* *
* @author chitanda * @author chitanda
* @date 2022-10-31 16:10:57 * @date 2022-10-31 16:10:57
* @param {IPSAppPFPluginRef} pluginRef * @param {IPSAppPFPluginRef} pluginRef
* @return {*} {Promise<boolean>} * @return {*} {Promise<boolean>}
*/ */
async loadPluginRef(pluginRef: IPSAppPFPluginRef): Promise<boolean> { async loadPluginRef(
if (this.pluginCache.has(pluginRef.rTObjectName)) { rtObjectName: string,
rtObjectRepo: string,
): Promise<boolean> {
if (this.pluginCache.has(rtObjectName)) {
return true; return true;
} }
let config: IParams = {}; let configData: unknown = null;
try { const fn = this.devPackages.get(rtObjectName);
config = JSON.parse(pluginRef.rTObjectRepo); if (fn) {
} catch (err) { configData = await fn();
throw new DefectModelError( } else {
pluginRef, const pluginPath: string = rtObjectRepo;
`插件[${pluginRef.name}]参数格式异常请检查`, const configUrl = this.urlReg.test(pluginPath)
); ? `${pluginPath}/package.json`
: `${ibiz.env.pluginBaseUrl}/${join(pluginPath, 'package.json')}`;
const res = await ibiz.net.axios({
method: 'get',
headers: { 'Access-Control-Allow-Origin': '*' },
url: configUrl,
});
if (res.status !== 200) {
throw new Error(`配置加载失败`);
}
configData = res.data;
} }
const remotePlugin = new RemotePluginItem( const remotePlugin = new RemotePluginItem(
pluginRef.rTObjectName, rtObjectName,
config as unknown as RemotePluginConfig, rtObjectRepo,
configData as RemotePluginConfig,
); );
if (remotePlugin) { if (remotePlugin) {
try { try {
await this.loadScript(remotePlugin); await this.loadScript(remotePlugin);
this.pluginCache.set(pluginRef.rTObjectName, remotePlugin); this.pluginCache.set(rtObjectName, remotePlugin);
return true; return true;
} catch (error) { } catch (error) {
ibiz.log.error(error); ibiz.log.error(error);
...@@ -133,10 +228,20 @@ export class PluginFactory implements IPluginFactory { ...@@ -133,10 +228,20 @@ export class PluginFactory implements IPluginFactory {
* @return {*} {Promise<void>} * @return {*} {Promise<void>}
*/ */
protected async loadScript(remotePlugin: RemotePluginItem): Promise<void> { protected async loadScript(remotePlugin: RemotePluginItem): Promise<void> {
const { baseUrl, name, version, system, module } = remotePlugin.config; const pluginPath: string = remotePlugin.repo;
const scriptUrl = this.devPackages.has(name) const { name, version, system, module } = remotePlugin.config;
? join(baseUrl, `${name}@${version}`, module) let scriptUrl = '';
: join(baseUrl, `${name}@${version}`, system); if (this.devPackages.has(name)) {
scriptUrl = join(`${name}@${version}`, module);
} else if (ibiz.env.dev) {
scriptUrl = this.urlReg.test(pluginPath)
? `${pluginPath}/${join(module)}`
: `${ibiz.env.pluginBaseUrl}/${pluginPath}/${join(module)}`;
} else {
scriptUrl = `${pluginPath}${pluginPath.endsWith('/') ? '' : '/'}${join(
system,
)}`;
}
if (scriptUrl) { if (scriptUrl) {
if (this.cache.has(scriptUrl)) { if (this.cache.has(scriptUrl)) {
return; return;
...@@ -148,67 +253,31 @@ export class PluginFactory implements IPluginFactory { ...@@ -148,67 +253,31 @@ export class PluginFactory implements IPluginFactory {
const fn = this.devPackages.get(name)!; const fn = this.devPackages.get(name)!;
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const pluginModule = (await fn()) as any; const pluginModule = (await fn()) as any;
Vue.use(pluginModule.default, remotePlugin); this.setPluginCode(pluginModule.default);
this.cache.set(scriptUrl, true); this.cache.set(scriptUrl, true);
const mateUrl: string = pluginModule.default.mateUrl || ''; } else if (ibiz.env.dev) {
await this.loadStyles( data = await import(scriptUrl /* @vite-ignore */);
remotePlugin,
mateUrl.split('/').splice(3).join('/'),
);
} else { } else {
data = await System.import(url); System.addImportMap({
if (data) { imports: {
if (data.default) { [name]: url,
Vue.use(data.default, remotePlugin); },
} else { });
throw new RuntimeError( data = await System.import(name);
`远程插件加载失败, 远程插件未找到[default]默认导出`, }
); if (data) {
} if (data.default) {
this.cache.set(scriptUrl, true); this.setPluginCode(data.default);
await this.loadStyles(remotePlugin, url);
} else { } else {
throw new RuntimeError(`远程插件加载失败, 未找到文件`); throw new RuntimeError(
`远程插件加载失败, 远程插件未找到[default]默认导出`,
);
} }
} this.cache.set(scriptUrl, true);
} } else {
} throw new RuntimeError(
`远程插件加载失败, 未找到文件或文件内容格式不正确`,
/** );
* 加载插件样式文件
*
* @author chitanda
* @date 2022-11-02 21:11:51
* @protected
* @param {RemotePluginItem} remotePlugin
* @param {string} [rootJsPath] 入口 js 文件全路径,用于计算拼接 css 文件所在路径
* @return {*} {Promise<void>}
*/
protected async loadStyles(
remotePlugin: RemotePluginItem,
rootJsPath: string,
): Promise<void> {
const { styles } = remotePlugin.config;
if (styles) {
const arr = styles instanceof Array ? styles : [styles];
if (arr && arr.length > 0) {
const folder = dirname(rootJsPath);
const all = arr.map(styleUrl => {
const url = `${folder}/${basename(styleUrl)}`;
if (this.cache.has(url)) {
return false;
}
return new Promise((resolve, reject) => {
const linkDom = document.createElement('link');
linkDom.setAttribute('type', 'text/css');
linkDom.setAttribute('rel', 'stylesheet');
linkDom.setAttribute('href', url);
linkDom.onload = resolve;
linkDom.onerror = reject;
document.head.appendChild(linkDom);
});
});
await Promise.all(all);
} }
} }
} }
...@@ -232,6 +301,6 @@ export class PluginFactory implements IPluginFactory { ...@@ -232,6 +301,6 @@ export class PluginFactory implements IPluginFactory {
} }
return `${ibiz.env.pluginBaseUrl}/${script}`; return `${ibiz.env.pluginBaseUrl}/${script}`;
} }
return `./${join(ibiz.env.pluginBaseUrl, script)}`; return `${join(ibiz.env.pluginBaseUrl, script)}`;
} }
} }
...@@ -10,7 +10,7 @@ function IBizVitePlugin(): Plugin[] { ...@@ -10,7 +10,7 @@ function IBizVitePlugin(): Plugin[] {
closeBundle() { closeBundle() {
// 其他第三方依赖包 // 其他第三方依赖包
const map = { const map = {
'node_modules/qx-util/dist/umd/qx-util.umd.js': 'node_modules/qx-util/dist/qx-util.umd.js':
'dist/extras/js/qx-util.min.js', 'dist/extras/js/qx-util.min.js',
'node_modules/@ibiz/dynamic-model-api/dist/ibiz-dynamic-model-api.system.min.js': 'node_modules/@ibiz/dynamic-model-api/dist/ibiz-dynamic-model-api.system.min.js':
'dist/extras/js/ibiz-dynamic-model-api.system.min.js', 'dist/extras/js/ibiz-dynamic-model-api.system.min.js',
......
...@@ -1219,16 +1219,16 @@ ...@@ -1219,16 +1219,16 @@
"mOSFilePath" : "pssysapps/TemplatePublish/psappviewmsggroups/VMGroup2", "mOSFilePath" : "pssysapps/TemplatePublish/psappviewmsggroups/VMGroup2",
"name" : "视图消息组2", "name" : "视图消息组2",
"getPSAppViewMsgGroupDetails" : [ { "getPSAppViewMsgGroupDetails" : [ {
"name" : "视图消息", "name" : "视图消息2",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg2" "id" : "ViewMsg3"
} }
}, { }, {
"name" : "视图消息2", "name" : "视图消息",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg3" "id" : "ViewMsg2"
} }
} ], } ],
"rTMOSFilePath" : "pssysapps/TemplatePublish/psappviewmsggroups/VMGroup2" "rTMOSFilePath" : "pssysapps/TemplatePublish/psappviewmsggroups/VMGroup2"
......
...@@ -2311,6 +2311,114 @@ ...@@ -2311,6 +2311,114 @@
"modelref" : true, "modelref" : true,
"id" : "Begin" "id" : "Begin"
} }
}, {
"codeName" : "gridSelectionChange",
"defaultParamName" : "Default",
"logicName" : "表格数据变更",
"mOSFilePath" : "pssysapps/Web/psappdataentities/TEST/psappdeuilogics/gridSelectionChange",
"name" : "表格数据变更",
"getPSDEUILogicNodes" : [ {
"codeName" : "Begin",
"leftPos" : 200,
"logicNodeType" : "BEGIN",
"mOSFilePath" : "psappdeuilogicnodes/Begin",
"name" : "开始",
"getPSDEUILogicLinks" : [ {
"getDstPSDEUILogicNode" : {
"modelref" : true,
"id" : "PREPAREJSPARAM1"
},
"linkMode" : 0,
"name" : "连接名称",
"getSrcPSDEUILogicNode" : {
"modelref" : true,
"id" : "Begin"
}
} ],
"rTMOSFilePath" : "psappdeuilogicnodes/Begin",
"topPos" : 200,
"parallelOutput" : true
}, {
"codeName" : "PREPAREJSPARAM1",
"leftPos" : 160,
"logicNodeType" : "PREPAREJSPARAM",
"mOSFilePath" : "psappdeuilogicnodes/PREPAREJSPARAM1",
"name" : "准备参数",
"getPSDEUILogicLinks" : [ {
"getDstPSDEUILogicNode" : {
"modelref" : true,
"id" : "VIEWCTRLINVOKE1"
},
"linkMode" : 0,
"name" : "连接名称",
"getSrcPSDEUILogicNode" : {
"modelref" : true,
"id" : "PREPAREJSPARAM1"
}
} ],
"getPSDEUILogicNodeParams" : [ {
"dstFieldName" : "data",
"getDstPSDEUILogicParam" : {
"modelref" : true,
"id" : "invokeParams"
},
"name" : "Default ==> invokeParams[data]",
"paramAction" : "SETPARAMVALUE",
"getSrcPSDEUILogicParam" : {
"modelref" : true,
"id" : "Default"
},
"srcValueType" : "SRCDLPARAM"
} ],
"rTMOSFilePath" : "psappdeuilogicnodes/PREPAREJSPARAM1",
"topPos" : 370
}, {
"codeName" : "VIEWCTRLINVOKE1",
"getInvokeCtrl" : {
"modelref" : true,
"id" : "toolbar"
},
"invokeMethod" : "calcButtonState",
"getInvokeParam" : {
"modelref" : true,
"id" : "invokeParams"
},
"leftPos" : 160,
"logicNodeType" : "VIEWCTRLINVOKE",
"mOSFilePath" : "psappdeuilogicnodes/VIEWCTRLINVOKE1",
"name" : "视图部件调用",
"rTMOSFilePath" : "psappdeuilogicnodes/VIEWCTRLINVOKE1",
"topPos" : 506
} ],
"getPSDEUILogicParams" : [ {
"codeName" : "Default",
"logicName" : "传入变量",
"mOSFilePath" : "psappdeuilogicparams/Default",
"name" : "传入变量",
"rTMOSFilePath" : "psappdeuilogicparams/Default",
"default" : true,
"entityParam" : true
}, {
"codeName" : "invokeParams",
"logicName" : "操作参数",
"mOSFilePath" : "psappdeuilogicparams/invokeParams",
"name" : "操作参数",
"rTMOSFilePath" : "psappdeuilogicparams/invokeParams",
"simpleParam" : true
}, {
"codeName" : "toolbar",
"logicName" : "工具栏",
"mOSFilePath" : "psappdeuilogicparams/toolbar",
"name" : "工具栏",
"paramTag" : "CUSTOMTOOLBAR",
"rTMOSFilePath" : "psappdeuilogicparams/toolbar",
"ctrlParam" : true
} ],
"rTMOSFilePath" : "pssysapps/Web/psappdataentities/TEST/psappdeuilogics/gridSelectionChange",
"getStartPSDEUILogicNode" : {
"modelref" : true,
"id" : "Begin"
}
} ], } ],
"getAllPSAppViews" : [ { "getAllPSAppViews" : [ {
"modelref" : true, "modelref" : true,
......
...@@ -37,6 +37,67 @@ ...@@ -37,6 +37,67 @@
} }
} ], } ],
"getPSDEFormItemVRs" : [ { "getPSDEFormItemVRs" : [ {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule2",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"name" : "field值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "VALUERANGE2",
"dEFName" : "FIELD",
"maxValue" : 20.0,
"minValue" : 10.0,
"name" : "[数值范围] 大于等于 10.0 且 小于等于 20.0",
"ruleInfo" : "10<=field<=20",
"includeMaxValue" : true,
"includeMinValue" : true
} ],
"ruleInfo" : "10<=field<=20"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"ruleInfo" : "10<=field<=20",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule3",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"name" : "field2值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "REGEX",
"dEFName" : "FIELD2",
"name" : "[正则式](^[0-9]*$)",
"regExCode" : "^[0-9]*$",
"ruleInfo" : "只能写数字"
} ],
"ruleInfo" : "只能写数字"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"ruleInfo" : "只能写数字",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field2",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3, "checkMode" : 3,
"name" : "表单项值规则", "name" : "表单项值规则",
"getPSDEFValueRule" : { "getPSDEFValueRule" : {
...@@ -330,67 +391,6 @@ ...@@ -330,67 +391,6 @@
}, },
"getPSDEFormItemName" : "field5", "getPSDEFormItemName" : "field5",
"valueRuleType" : "DEFVALUERULE" "valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule2",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"name" : "field值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "VALUERANGE2",
"dEFName" : "FIELD",
"maxValue" : 20.0,
"minValue" : 10.0,
"name" : "[数值范围] 大于等于 10.0 且 小于等于 20.0",
"ruleInfo" : "10<=field<=20",
"includeMaxValue" : true,
"includeMinValue" : true
} ],
"ruleInfo" : "10<=field<=20"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"ruleInfo" : "10<=field<=20",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule3",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"name" : "field2值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "REGEX",
"dEFName" : "FIELD2",
"name" : "[正则式](^[0-9]*$)",
"regExCode" : "^[0-9]*$",
"ruleInfo" : "只能写数字"
} ],
"ruleInfo" : "只能写数字"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"ruleInfo" : "只能写数字",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field2",
"valueRuleType" : "DEFVALUERULE"
} ], } ],
"getPSDEFormItems" : [ { "getPSDEFormItems" : [ {
"id" : "srfupdatedate", "id" : "srfupdatedate",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"id" : "fetch" "id" : "fetch"
}, },
"groupMode" : "NONE", "groupMode" : "NONE",
"hookEventNames" : [ "ONBEFORELOAD" ], "hookEventNames" : [ "ONBEFORELOAD", "ONSELECTIONCHANGE" ],
"logicName" : "自定义表格", "logicName" : "自定义表格",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdegrids/CustomGrid", "mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdegrids/CustomGrid",
"getPSAppDataEntity" : { "getPSAppDataEntity" : {
...@@ -26,6 +26,15 @@ ...@@ -26,6 +26,15 @@
"modelref" : true, "modelref" : true,
"id" : "VIWELOGICBEFORELOAD" "id" : "VIWELOGICBEFORELOAD"
} }
}, {
"eventNames" : "onSelectionChange",
"logicTag" : "CUSTOMGRID",
"logicType" : "APPVIEWLOGIC",
"name" : "GRIDSELECTIONCHANGE",
"getPSAppViewLogic" : {
"modelref" : true,
"id" : "GRIDSELECTIONCHANGE"
}
} ], } ],
"getPSDEGridColumns" : [ { "getPSDEGridColumns" : [ {
"align" : "LEFT", "align" : "LEFT",
......
...@@ -93,6 +93,20 @@ ...@@ -93,6 +93,20 @@
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/TEST.json" "path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/TEST.json"
}, },
"getPSViewCtrlName" : "CUSTOMSEARCHFORM" "getPSViewCtrlName" : "CUSTOMSEARCHFORM"
}, {
"eventNames" : "onSelectionChange",
"logicTrigger" : "CTRLEVENT",
"logicType" : "DEUILOGIC",
"name" : "GRIDSELECTIONCHANGE",
"getPSAppDEUILogic" : {
"modelref" : true,
"id" : "gridSelectionChange"
},
"getPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/TEST.json"
},
"getPSViewCtrlName" : "CUSTOMGRID"
}, { }, {
"eventNames" : "onBeforeLoad", "eventNames" : "onBeforeLoad",
"logicName" : "gridBeforeLoad", "logicName" : "gridBeforeLoad",
...@@ -276,7 +290,7 @@ ...@@ -276,7 +290,7 @@
"id" : "fetch" "id" : "fetch"
}, },
"groupMode" : "NONE", "groupMode" : "NONE",
"hookEventNames" : [ "ONBEFORELOAD" ], "hookEventNames" : [ "ONBEFORELOAD", "ONSELECTIONCHANGE" ],
"logicName" : "自定义表格", "logicName" : "自定义表格",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdegrids/CustomGrid", "mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdegrids/CustomGrid",
"getPSAppDataEntity" : { "getPSAppDataEntity" : {
...@@ -374,6 +388,15 @@ ...@@ -374,6 +388,15 @@
"modelref" : true, "modelref" : true,
"id" : "VIWELOGICBEFORELOAD" "id" : "VIWELOGICBEFORELOAD"
} }
}, {
"eventNames" : "onSelectionChange",
"logicTag" : "CUSTOMGRID",
"logicType" : "APPVIEWLOGIC",
"name" : "GRIDSELECTIONCHANGE",
"getPSAppViewLogic" : {
"modelref" : true,
"id" : "GRIDSELECTIONCHANGE"
}
} ], } ],
"getPSControlParam" : { "getPSControlParam" : {
"autoLoad" : true, "autoLoad" : true,
......
...@@ -166,6 +166,67 @@ ...@@ -166,6 +166,67 @@
"id" : "FORM" "id" : "FORM"
}, },
"getPSDEFormItemVRs" : [ { "getPSDEFormItemVRs" : [ {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule2",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"name" : "field值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "VALUERANGE2",
"dEFName" : "FIELD",
"maxValue" : 20.0,
"minValue" : 10.0,
"name" : "[数值范围] 大于等于 10.0 且 小于等于 20.0",
"ruleInfo" : "10<=field<=20",
"includeMaxValue" : true,
"includeMinValue" : true
} ],
"ruleInfo" : "10<=field<=20"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"ruleInfo" : "10<=field<=20",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule3",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"name" : "field2值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "REGEX",
"dEFName" : "FIELD2",
"name" : "[正则式](^[0-9]*$)",
"regExCode" : "^[0-9]*$",
"ruleInfo" : "只能写数字"
} ],
"ruleInfo" : "只能写数字"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"ruleInfo" : "只能写数字",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field2",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3, "checkMode" : 3,
"name" : "表单项值规则", "name" : "表单项值规则",
"getPSDEFValueRule" : { "getPSDEFValueRule" : {
...@@ -459,67 +520,6 @@ ...@@ -459,67 +520,6 @@
}, },
"getPSDEFormItemName" : "field5", "getPSDEFormItemName" : "field5",
"valueRuleType" : "DEFVALUERULE" "valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule2",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"name" : "field值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "VALUERANGE2",
"dEFName" : "FIELD",
"maxValue" : 20.0,
"minValue" : 10.0,
"name" : "[数值范围] 大于等于 10.0 且 小于等于 20.0",
"ruleInfo" : "10<=field<=20",
"includeMaxValue" : true,
"includeMinValue" : true
} ],
"ruleInfo" : "10<=field<=20"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD/psdefvaluerules/ValueRule2",
"ruleInfo" : "10<=field<=20",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
"codeName" : "ValueRule3",
"mOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"name" : "field2值规则",
"getPSDEFVRGroupCondition" : {
"condOp" : "AND",
"condType" : "GROUP",
"name" : "默认组",
"getPSDEFVRConditions" : [ {
"condType" : "REGEX",
"dEFName" : "FIELD2",
"name" : "[正则式](^[0-9]*$)",
"regExCode" : "^[0-9]*$",
"ruleInfo" : "只能写数字"
} ],
"ruleInfo" : "只能写数字"
},
"rTMOSFilePath" : "psmodules/Test/psdataentities/TEST/psdefields/FIELD2/psdefvaluerules/ValueRule3",
"ruleInfo" : "只能写数字",
"checkDefault" : false,
"defaultMode" : false,
"enableBackend" : true,
"enableFront" : true
},
"getPSDEFormItemName" : "field2",
"valueRuleType" : "DEFVALUERULE"
} ], } ],
"getPSDEFormItems" : [ { "getPSDEFormItems" : [ {
"id" : "srfupdatedate", "id" : "srfupdatedate",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册