super-page-runtime 2.0.99 → 2.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/runtime/utils/api/api-util.js +2 -8
- package/dist/es/components/runtime/utils/api/page-expose-util.js +38 -0
- package/dist/es/components/runtime/utils/events/event-util.js +16 -0
- package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
- package/dist/es/components/runtime/utils/page-init-util.js +1 -0
- package/dist/es/components/runtime/views/super-page.vue.js +1 -1
- package/package.json +1 -1
|
@@ -204,11 +204,8 @@ function changePermissionListToMap(pageContext) {
|
|
|
204
204
|
changeActionPermissionToMap(pageContext);
|
|
205
205
|
}
|
|
206
206
|
function changeFieldPermissionToMap(pageContext) {
|
|
207
|
-
let fieldPermissionMap =
|
|
207
|
+
let fieldPermissionMap = /* @__PURE__ */ new Map();
|
|
208
208
|
const fieldPermissions = pageContext.fieldPermissions;
|
|
209
|
-
if (fieldPermissionMap === null || fieldPermissionMap === void 0) {
|
|
210
|
-
fieldPermissionMap = /* @__PURE__ */ new Map();
|
|
211
|
-
}
|
|
212
209
|
if (typeof fieldPermissions !== "undefined") {
|
|
213
210
|
for (let i = 0; i < fieldPermissions.length; i++) {
|
|
214
211
|
const prop = fieldPermissions[i].name;
|
|
@@ -265,11 +262,8 @@ function changeFieldPermissionToMap(pageContext) {
|
|
|
265
262
|
}
|
|
266
263
|
function changeActionPermissionToMap(pageContext) {
|
|
267
264
|
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
268
|
-
let actionPermissionMap =
|
|
265
|
+
let actionPermissionMap = /* @__PURE__ */ new Map();
|
|
269
266
|
const actionPermissions = pageContext.actionPermissions;
|
|
270
|
-
if (actionPermissionMap === null || actionPermissionMap === void 0) {
|
|
271
|
-
actionPermissionMap = /* @__PURE__ */ new Map();
|
|
272
|
-
}
|
|
273
267
|
if (typeof actionPermissions !== "undefined" && actionPermissions !== null) {
|
|
274
268
|
const subModelNames = Object.keys(actionPermissions);
|
|
275
269
|
subModelNames.forEach((subModelName) => {
|
|
@@ -228,6 +228,44 @@ const functions = {
|
|
|
228
228
|
eventParams: {},
|
|
229
229
|
configureObj: { props: { linkPage: openParam } }
|
|
230
230
|
});
|
|
231
|
+
},
|
|
232
|
+
/**
|
|
233
|
+
* 刷新表单中子表内容
|
|
234
|
+
* @param {*} pageContext 页面配置信息
|
|
235
|
+
* @param {*} tableCode 表格组件中“自定义编码”的值
|
|
236
|
+
*/
|
|
237
|
+
refreshSubTableHandle: function(pageContext, tableCode) {
|
|
238
|
+
let tableUuid;
|
|
239
|
+
const ref = getComponentRefByCode(pageContext, tableCode);
|
|
240
|
+
if (ref) {
|
|
241
|
+
const configure = ref.getConfigure();
|
|
242
|
+
if (configure && configure.uuid && configure.name && configure.name === "table") {
|
|
243
|
+
tableUuid = configure.uuid;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (tableUuid) {
|
|
247
|
+
eventBus.$emit("_refreshSubTableHandle_" + tableUuid);
|
|
248
|
+
} else {
|
|
249
|
+
console.error("tableUUid is undefined");
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
// 对外开放的api方法更新子表集合
|
|
253
|
+
refreshChildData(pageContext, tableCode, data) {
|
|
254
|
+
let tableUuid;
|
|
255
|
+
const ref = getComponentRefByCode(pageContext, tableCode);
|
|
256
|
+
if (ref) {
|
|
257
|
+
const configure = ref.getConfigure();
|
|
258
|
+
if (configure && configure.uuid && configure.name && configure.name === "table") {
|
|
259
|
+
tableUuid = configure.uuid;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (tableUuid) {
|
|
263
|
+
setTimeout(() => {
|
|
264
|
+
eventBus.$emit("_refreshChildData_" + tableUuid, data);
|
|
265
|
+
}, 10);
|
|
266
|
+
} else {
|
|
267
|
+
console.error("tableUUid is undefined");
|
|
268
|
+
}
|
|
231
269
|
}
|
|
232
270
|
};
|
|
233
271
|
function packageAllFeildsRules(pageContext, item) {
|
|
@@ -94,6 +94,22 @@ function handleEvent($event, pageContext, configure, eventType, otherParams) {
|
|
|
94
94
|
return handleEventUtil($event, pageContext, configure, eventType, true, otherParams, false);
|
|
95
95
|
}
|
|
96
96
|
function handleFormEvent($event, pageContext, configure, eventType, otherParams) {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
if (eventType && eventType === "change") {
|
|
99
|
+
const subTableWatchProps = pageContext.subTableWatchProps;
|
|
100
|
+
if (subTableWatchProps) {
|
|
101
|
+
for (let tableUuid in subTableWatchProps) {
|
|
102
|
+
const mainFormProps = subTableWatchProps[tableUuid];
|
|
103
|
+
const propName = (_b = (_a = configure.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop;
|
|
104
|
+
if (mainFormProps && mainFormProps.indexOf(propName) >= 0) {
|
|
105
|
+
eventBus.$emit(
|
|
106
|
+
"_refreshSubTable_" + tableUuid,
|
|
107
|
+
{ propName }
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
97
113
|
return handleEventUtil($event, pageContext, configure, eventType, true, otherParams, true);
|
|
98
114
|
}
|
|
99
115
|
function getHandleEvent($event, pageContext, configure, eventType, otherParams) {
|
|
@@ -69,6 +69,7 @@ export interface PageDesign extends Component {
|
|
|
69
69
|
subTablePageInfo?: object;
|
|
70
70
|
customEvents?: Array<any>;
|
|
71
71
|
contextParam?: object;
|
|
72
|
+
subTableWatchProps?: object;
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
75
|
* 运行时页面对象
|
|
@@ -137,6 +138,7 @@ export interface PageContext extends Component {
|
|
|
137
138
|
selectOptions?: object;
|
|
138
139
|
chartDataSourceMap?: any;
|
|
139
140
|
refercePropMap?: object;
|
|
141
|
+
subTableWatchProps?: object;
|
|
140
142
|
[otherProp: string]: any;
|
|
141
143
|
}
|
|
142
144
|
/**
|
|
@@ -48,6 +48,7 @@ function convertToPageContext(pageDesign, pageRequest) {
|
|
|
48
48
|
workflowVersion: pageDesign.workflowVersion,
|
|
49
49
|
refercePropMap: (_a = pageDesign.runtime) == null ? void 0 : _a.refercePropMap,
|
|
50
50
|
//当前表单页面中引用字段信息集合,get请求时需要使用,格式为{tableName:[字段名,.. ... ], tableName:[字段名,.. ... ]}
|
|
51
|
+
subTableWatchProps: pageDesign.subTableWatchProps,
|
|
51
52
|
entity: {
|
|
52
53
|
data: {},
|
|
53
54
|
task: {},
|