imatrix-ui 2.7.31 → 2.7.32

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.31",
3
+ "version": "2.7.32",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
package/src/utils/util.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import i18n from '../i18n/i18n'
2
2
  import Vue from 'vue'
3
- import { executeExpression } from './calculator/calculator-util'
3
+ import {
4
+ executeExpression
5
+ } from './calculator/calculator-util'
4
6
  export function getI18n() {
5
7
  if (!window.$locale) {
6
8
  i18n.locale = 'cn'
@@ -43,7 +45,10 @@ export function findOptionsByDynamicDataSource(dynamicSourceCode, searchText, en
43
45
  const value = item[valueAttribute]
44
46
  // 显示的标签
45
47
  const label = item['_label_']
46
- options.push({ label, value })
48
+ options.push({
49
+ label,
50
+ value
51
+ })
47
52
  })
48
53
  }
49
54
  if (!options) {
@@ -235,6 +240,7 @@ function parseCondition(entity, conditionList, isSql, tableName, additionalParam
235
240
  return eval('(' + conditions + ')')
236
241
  }
237
242
  const REPLACE_DOT = '__'
243
+
238
244
  function getValue(entityData, fieldName, isSql) {
239
245
  let value = null
240
246
  if (entityData && entityData !== null) {
@@ -285,12 +291,12 @@ function getSubEntityValue(entityData, fieldName) {
285
291
  }
286
292
 
287
293
  /**
288
- * 获得关联表字段的值。
289
- * 处理sql 或 实体情况。
290
- * @param subEntityData
291
- * @param fieldName
292
- * @return
293
- */
294
+ * 获得关联表字段的值。
295
+ * 处理sql 或 实体情况。
296
+ * @param subEntityData
297
+ * @param fieldName
298
+ * @return
299
+ */
294
300
  function getSubEntityFieldValue(subEntityData, fieldName) {
295
301
  if (subEntityData === undefined || subEntityData === null) {
296
302
  return null
@@ -383,19 +389,35 @@ export function setEntityFieldValue(entity, prop, value) {
383
389
  }
384
390
  }
385
391
 
392
+ /**
393
+ * 获得字段的值,不需要处理大小写转换
394
+ * @param {*} entity
395
+ * @param {*} prop
396
+ * @returns
397
+ */
398
+ export function getEntityFieldValueWithOutCase(entity, prop) {
399
+ if (prop && prop.indexOf('.') > 0) {
400
+ const parentOjbect = getParentObjectUtil(prop, entity)
401
+ const modelName = prop.substring(prop.lastIndexOf('.') + 1)
402
+ return parentOjbect[modelName]
403
+ } else {
404
+ return entity[prop]
405
+ }
406
+ }
407
+
386
408
  /**
387
409
  * 获得实体entity中某属性的值,处理子表对象的情况
388
410
  * @param {*} entity
389
411
  * @param {*} prop
390
412
  * @returns
391
413
  */
392
- export function getEntityFieldValue(entity, prop) {
414
+ export function getEntityFieldValue(entity, prop, isLowerCase) {
393
415
  let value = getEntityFieldValueWithCase(entity, prop)
394
416
  if (value === undefined) {
395
417
  // 兼容mysql数据库
396
418
  value = getEntityFieldValueWithCase(entity, prop.toLowerCase())
397
419
  }
398
- if (value === undefined) {
420
+ if (value === undefined && isLowerCase === undefined) {
399
421
  // 兼容oracle数据库
400
422
  value = getEntityFieldValueWithCase(entity, prop.toUpperCase())
401
423
  }
@@ -466,7 +488,11 @@ export function findSystemInfoByCode(systemCode) {
466
488
 
467
489
  Vue.prototype.$http.get(Vue.prototype.baseAPI + '/component/business-systems/' + systemCode).then(system => {
468
490
  if (system) {
469
- resolve({ zh_CN: system.name, en_US: system.enName, frontendUrl: system.frontendUrl })
491
+ resolve({
492
+ zh_CN: system.name,
493
+ en_US: system.enName,
494
+ frontendUrl: system.frontendUrl
495
+ })
470
496
  } else {
471
497
  resolve('系统:' + systemCode + '不存在')
472
498
  }