imatrix-ui 2.7.36 → 2.7.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imatrix-ui",
3
- "version": "2.7.36",
3
+ "version": "2.7.40",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
@@ -1,7 +1,14 @@
1
1
  import sessionStorage from 'sessionstorage'
2
2
  import Vue from 'vue'
3
- import { analysisCondition, analysisValue, getEntityFieldValue, setEntityFieldValue } from './util'
4
- import { getSystemFrontendUrl } from './common-util'
3
+ import {
4
+ analysisCondition,
5
+ analysisValue,
6
+ getEntityFieldValue,
7
+ setEntityFieldValue
8
+ } from './util'
9
+ import {
10
+ getSystemFrontendUrl
11
+ } from './common-util'
5
12
  // 解析初始化条件,api方法;additionalParamMap是上个页面传过来的附加参数集合
6
13
  export function initialization(jumpPage, entity, isSql, additionalParamerter, contextParameter, tableName, parentFormData) {
7
14
  const result = {}
@@ -86,13 +93,19 @@ export function openPage(pageSetting) {
86
93
  const popPageSetting = openPageParams
87
94
  const path = popPageSetting._path
88
95
  if (jumpMode === 'popup') {
89
- let jumpPageWidth = 400
90
- let jumpPageHeight = 400
96
+ let jumpPageWidth
97
+ let jumpPageHeight
98
+
91
99
  if (openPageParams.jumpPageWidth) {
92
100
  jumpPageWidth = openPageParams.jumpPageWidth
101
+ } else {
102
+ jumpPageWidth = window.innerWidth - 150
93
103
  }
104
+
94
105
  if (openPageParams.jumpPageHeight) {
95
106
  jumpPageHeight = openPageParams.jumpPageHeight
107
+ } else {
108
+ jumpPageHeight = window.innerHeight - 150
96
109
  }
97
110
  // 弹出页面
98
111
  window.open(path, '', `height=` + jumpPageHeight + `,width=` + jumpPageWidth + `,top=100,left=100,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no`)
@@ -151,6 +164,7 @@ export function jumpToPage(jumpPageSetting, system, dataId, entity, additionalPa
151
164
  })
152
165
  })
153
166
  }
167
+
154
168
  function getSystem(system, jumpPageUrl) {
155
169
  return new Promise((resolve, reject) => {
156
170
  if (isFullPath(jumpPageUrl)) {
@@ -197,7 +211,7 @@ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode) {
197
211
  return
198
212
  }
199
213
  if (jumpPageUrl.indexOf('page:') === 0) {
200
- // 表示是自定义系统跳转页面编码
214
+ // 表示是自定义系统跳转页面编码
201
215
  jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode).then((openPageParams) => {
202
216
  resolve(openPageParams)
203
217
  })
@@ -210,13 +224,13 @@ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode) {
210
224
  path = jumpPageUrl.substring(jumpPageUrl.indexOf('path:') + 'path:'.length)
211
225
  }
212
226
  if (isFullPath(path)) {
213
- // 表示是全路径,例如:http://www.baidu.com 或 http://localhost:9600/demo/#/demo/plan/list
214
- jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPageSetting, ids, buttonCode)
227
+ // 表示是全路径,例如:http://www.baidu.com 或 http://localhost:9600/demo/#/demo/plan/list
215
228
  } else if (system) {
216
- // 表示是路由路径,例如:/demo/plan/list
217
- // TODO 配置系统暂时不支持该配置,只能选页面或全路径
218
- // jumpToPageWithPath(dataId, path, additionalParameterStr, system, jumpPage)
229
+ // 表示是路由路径,例如:/demo/plan/list
230
+ const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
231
+ path = frontendUrl + '/#' + path
219
232
  }
233
+ jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPageSetting, ids, buttonCode)
220
234
  resolve()
221
235
  }
222
236
  })
@@ -248,10 +262,22 @@ function jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPage,
248
262
  }
249
263
  if (jumpMode === 'popup') {
250
264
  // 弹框
251
- const jumpPageWidth = jumpPage.jumpPageWidth
252
- const jumpPageHeight = jumpPage.jumpPageHeight
265
+ let jumpPageWidth
266
+ let jumpPageHeight
267
+
268
+ if (jumpPage.jumpPageWidth) {
269
+ jumpPageWidth = jumpPage.jumpPageWidth
270
+ } else {
271
+ jumpPageWidth = window.innerWidth - 150
272
+ }
273
+
274
+ if (jumpPage.jumpPageHeight) {
275
+ jumpPageHeight = jumpPage.jumpPageHeight
276
+ } else {
277
+ jumpPageHeight = window.innerHeight - 150
278
+ }
253
279
  const features = 'height=' + jumpPageHeight + ', width=' + jumpPageWidth + ', top=0, left=0, toolbar=no, menubar=no,' +
254
- 'scrollbars=no,resizable=no, location=no, status=no' // 设置新窗口的特性
280
+ 'scrollbars=no,resizable=no, location=no, status=no' // 设置新窗口的特性
255
281
  window.open(path, 'newW', features) // 打开新窗口
256
282
  } else if (jumpMode === 'newTab') {
257
283
  // 新页签
@@ -335,13 +361,19 @@ function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, bu
335
361
  popPageSetting._path = path
336
362
  resolve(popPageSetting)
337
363
  } else if (jumpMode === 'newTab') {
338
- // 新页签打开
364
+ // 新页签打开
339
365
  const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode)
340
366
  window.open(path)
341
367
  resolve()
342
368
  } else {
343
369
  // 刷新页面
344
- const queryParam = { pageCode: pageCode, customSystem: system.code, jumpMode: jumpMode, buttonCode: buttonCode, ids: ids ? ids.join(',') : '' }
370
+ const queryParam = {
371
+ pageCode: pageCode,
372
+ customSystem: system.code,
373
+ jumpMode: jumpMode,
374
+ buttonCode: buttonCode,
375
+ ids: ids ? ids.join(',') : ''
376
+ }
345
377
  if (jumpPageSetting.isNeedId === undefined || jumpPageSetting.isNeedId === null || jumpPageSetting.isNeedId === true) {
346
378
  if (dataId) {
347
379
  // 表示是修改或查看页面,封装id参数
@@ -369,8 +401,7 @@ function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, bu
369
401
  * @param {*} buttonCode
370
402
  */
371
403
  function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode, ids, buttonCode) {
372
- const popPageSetting = {
373
- }
404
+ const popPageSetting = {}
374
405
  if (jumpPageSetting) {
375
406
  popPageSetting.jumpPageTitle = jumpPageSetting.jumpPageTitle
376
407
  popPageSetting.jumpPageWidth = jumpPageSetting.jumpPageWidth
@@ -436,7 +467,7 @@ export function updateWithPageValue(sourceModel, sourceTableName, jumpPageSettin
436
467
  if (sourceModel && sourceModel !== null && entity && entity !== null && jumpPageSetting && jumpPageSetting !== null && jumpPageSetting.valueMappings) {
437
468
  let sourceEntity = sourceModel
438
469
  if (Array.isArray(sourceModel) && sourceModel.length > 0) {
439
- // 弹出框中列表选择了多行时,默认只赋值第一行记录
470
+ // 弹出框中列表选择了多行时,默认只赋值第一行记录
440
471
  sourceEntity = sourceModel[0]
441
472
  }
442
473
  const valueMappings = jumpPageSetting.valueMappings
@@ -464,4 +495,3 @@ export function updateWithPageValue(sourceModel, sourceTableName, jumpPageSettin
464
495
  })
465
496
  }
466
497
  }
467
-
package/src/utils/util.js CHANGED
@@ -183,7 +183,7 @@ function parseCondition(entity, conditionList, isSql, tableName, additionalParam
183
183
  } else {
184
184
  leftValue = getValue(entity, propName, isSql)
185
185
  }
186
- if (leftValue !== undefined && leftValue !== null) {
186
+ if (leftValue === undefined || leftValue === null) {
187
187
  leftValue = getValue(entity, propDbName, isSql)
188
188
  }
189
189
  }