agilebuilder-ui 1.0.90-tmp21 → 1.0.90-tmp22

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": "agilebuilder-ui",
3
- "version": "1.0.90-tmp21",
3
+ "version": "1.0.90-tmp22",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -419,11 +419,11 @@ const apis = {
419
419
  // 不是操作列,才需要设值
420
420
  const defaultValueSet = column.defaultValue
421
421
  let defaultValue = null
422
- console.log('setColumnsDefaultValue111------getDefaultValueFunc--', getDefaultValueFunc, 'column=',column,'defaultValueSet=', defaultValueSet)
422
+ //console.log('setColumnsDefaultValue111------getDefaultValueFunc--', getDefaultValueFunc, 'column=',column,'defaultValueSet=', defaultValueSet)
423
423
  if(getDefaultValueFunc) {
424
- console.log('setColumnsDefaultValue22---getDefaultValueFunc222---')
424
+ //console.log('setColumnsDefaultValue22---getDefaultValueFunc222---')
425
425
  defaultValue = getDefaultValueFunc(gridParams.pageContext, defaultValueSet, null, null)
426
- console.log('setColumnsDefaultValue33---defaultValue---', defaultValue)
426
+ //console.log('setColumnsDefaultValue33---defaultValue---', defaultValue)
427
427
  if(defaultValue === undefined) {
428
428
  defaultValue = null
429
429
  }
@@ -1499,7 +1499,7 @@ const apis = {
1499
1499
  }
1500
1500
  const gridParams = store.get(listCode)
1501
1501
  const orgHiddenColumns = gridParams.hiddenColumns
1502
- console.log('doLayout----orgHiddenColumns=', orgHiddenColumns)
1502
+ // console.log('doLayout----orgHiddenColumns=', orgHiddenColumns)
1503
1503
  if(hiddenColumns && hiddenColumns.length > 0){
1504
1504
  let hiddenColumnsResult = orgHiddenColumns
1505
1505
  if(!hiddenColumnsResult){
@@ -1515,7 +1515,7 @@ const apis = {
1515
1515
  }
1516
1516
  })
1517
1517
  }
1518
- console.log('doLayout----hiddenColumnsResult=', hiddenColumnsResult)
1518
+ // console.log('doLayout----hiddenColumnsResult=', hiddenColumnsResult)
1519
1519
  this.options.hiddenColumns = hiddenColumnsResult
1520
1520
  } else {
1521
1521
  this.options.hiddenColumns = orgHiddenColumns
@@ -712,18 +712,20 @@ export default {
712
712
  this.setInputNumberConfig()
713
713
  }
714
714
  // 如果是多选文件类型,需要解析(需要设置临时字段,判断文件还是图片,图片需要预览)
715
- if (this.column.valueSetOptions && this.column.componentType !== 'inputNumber') {
716
- const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
717
- if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
718
- this.valueSetOptions = valueSetOptionsObj.valueSetOptions
719
- }
720
- if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
721
- this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
722
- }
723
- } else if (this.column.componentType === 'switch' && this.column.valueSetOptions) {
724
- const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
725
- if (valueSetOptionsObj) {
726
- this.valueSetOptions = valueSetOptionsObj
715
+ if (this.column.valueSetOptions) {
716
+ if (this.column.componentType === 'switch') {
717
+ const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
718
+ if (valueSetOptionsObj) {
719
+ this.valueSetOptions = valueSetOptionsObj
720
+ }
721
+ } else if (this.column.componentType !== 'inputNumber') {
722
+ const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
723
+ if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
724
+ this.valueSetOptions = valueSetOptionsObj.valueSetOptions
725
+ }
726
+ if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
727
+ this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
728
+ }
727
729
  }
728
730
  }
729
731
  if (this.column.orgTreeSet) {
@@ -1762,7 +1764,12 @@ export default {
1762
1764
  },
1763
1765
  getSwitchConfig(switchProp) {
1764
1766
  if (this.valueSetOptions && this.valueSetOptions[switchProp]) {
1765
- return this.valueSetOptions[switchProp]
1767
+ const value = this.valueSetOptions[switchProp]
1768
+ if ('true' === value || 'false' === value) {
1769
+ return 'true' === value
1770
+ } else {
1771
+ return this.valueSetOptions[switchProp]
1772
+ }
1766
1773
  } else {
1767
1774
  if (switchProp === 'activeValue') {
1768
1775
  if (this.dataSourceType === 'mysql') {
@@ -11,7 +11,7 @@
11
11
  :width="getColumnWidth()"
12
12
  >
13
13
  <template v-slot:header>
14
- <span v-if="!column.customHeader" :class="{is_req: isFieldRequired()}">
14
+ <span v-if="!column.customHeader" :class="{ is_req: isFieldRequired() }">
15
15
  <span :title="$escapeHtml(label)" class="cell--span required__label" v-html="$escapeHtml(label)" />
16
16
  </span>
17
17
  <component
@@ -27,7 +27,7 @@
27
27
  </el-icon>
28
28
  </template>
29
29
  <template v-slot="scope">
30
- <!-- :pagination="pagination" -->
30
+ <!-- :pagination="pagination" -->
31
31
  <NormalColumnContent
32
32
  :ref="column.prop"
33
33
  :is-sql="isSql"
@@ -63,13 +63,7 @@
63
63
  <script>
64
64
  import { CirclePlus, ZoomIn as ElIconZoomIn } from '@element-plus/icons-vue'
65
65
  import { $emit, $off, $on } from '../../utils/gogocodeTransfer'
66
- import {
67
- getColumnValues,
68
- isRequiredEdit,
69
- getContentAlign,
70
- getHeaderAlign,
71
- getHeaderLable
72
- } from './utils'
66
+ import { getColumnValues, isRequiredEdit, getContentAlign, getHeaderAlign, getHeaderLable } from './utils'
73
67
  import DynamicInput from './dynamic-input.vue'
74
68
  import store from './store'
75
69
  import customFormatter from './custom-formatter'
@@ -284,7 +278,7 @@ export default {
284
278
  }
285
279
  const align = getContentAlign(this.column, gridParams)
286
280
  if (align) {
287
- this.align = gridParams.options.align
281
+ this.align = align
288
282
  }
289
283
  const headerAlign = getHeaderAlign(this.column, gridParams)
290
284
  if (headerAlign) {
@@ -302,10 +296,8 @@ export default {
302
296
  gridParams.options &&
303
297
  gridParams.options.showOperationButton
304
298
  },
305
- mounted() {
306
- },
307
- unmounted() {
308
- },
299
+ mounted() {},
300
+ unmounted() {},
309
301
  methods: {
310
302
  ...customFormatter,
311
303
  ...apis,
@@ -323,7 +315,7 @@ export default {
323
315
  $emit(this, 'refresPortData', port, value, index)
324
316
  },
325
317
  refresPortsData(map, index) {
326
- $emit(this, 'refresPortsData', map, index)
318
+ $emit(this, 'refresPortsData', map, index)
327
319
  },
328
320
  refresMainTableFields(map) {
329
321
  $emit(this, 'refresMainTableFields', map)
@@ -362,7 +354,7 @@ export default {
362
354
  this.$emit('open-page', openPageParams)
363
355
  }
364
356
  },
365
- emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit',]
357
+ emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
366
358
  }
367
359
  </script>
368
360
 
@@ -545,6 +545,7 @@ export default {
545
545
  if (
546
546
  hiddenColumns &&
547
547
  hiddenColumns.length > 0 &&
548
+ column.prop &&
548
549
  hiddenColumns.indexOf(column.prop) !== -1
549
550
  ) {
550
551
  // 如果当前字段包含在隐藏字段集合中,则不显示该字段
@@ -801,9 +801,9 @@ export function getControlConfig(column) {
801
801
  return controlConfig
802
802
  }
803
803
 
804
- export function getContentAlign(column, gridParams){
804
+ export function getContentAlign(column, gridParams) {
805
805
  let align
806
- if (typeof gridParams.options.align !== 'undefined') {
806
+ if (gridParams.options?.align && gridParams.options.align !== '') {
807
807
  align = gridParams.options.align
808
808
  } else if (column.contAlign && column.contAlign !== '') {
809
809
  align = column.contAlign
@@ -811,20 +811,16 @@ export function getContentAlign(column, gridParams){
811
811
  return align
812
812
  }
813
813
 
814
- export function getHeaderAlign(column, gridParams){
814
+ export function getHeaderAlign(column, gridParams) {
815
815
  let headerAlign
816
- if (typeof gridParams.options.headerAlign !== 'undefined') {
816
+ if (gridParams.options?.headerAlign && gridParams.options.headerAlign !== '') {
817
817
  headerAlign = gridParams.options.headerAlign
818
818
  } else if (column.titleAlign && column.titleAlign !== '') {
819
819
  headerAlign = column.titleAlign
820
- } else {
821
- // 如果没有配置表头对齐方式,默认使用内容对齐方式
822
- headerAlign = 'left'
823
820
  }
824
821
  return headerAlign
825
822
  }
826
823
 
827
-
828
824
  export function getHeaderLable(column) {
829
825
  let label = column.label
830
826
  if (!column.titleValueSet) {
@@ -840,4 +836,4 @@ export function getHeaderLable(column) {
840
836
 
841
837
  function formatHeader(column) {
842
838
  return doFormatWithValueSet(column.titleValueSetValue, column.label)
843
- }
839
+ }
@@ -101,13 +101,13 @@ class TextCalculator extends CalculatorFactory {
101
101
  this.result = false
102
102
  } else {
103
103
  if (operator === 'NET') {
104
- this.result = leftVale !== rightValue
104
+ this.result = (leftVale+'') !== (rightValue+'')
105
105
  } else if (operator === 'EQ') {
106
- this.result = leftVale === rightValue
106
+ this.result = (leftVale+'') === (rightValue+'')
107
107
  } else if (operator === 'NOT_CONTAIN') {
108
- this.result = !leftVale.includes(rightValue)
108
+ this.result = !(leftVale+'').includes(rightValue+'')
109
109
  } else if (operator === 'CONTAIN') {
110
- this.result = leftVale.includes(rightValue)
110
+ this.result = (leftVale+'') .includes(rightValue+'')
111
111
  } else if (operator === 'IS_NULL') {
112
112
  this.result =
113
113
  leftVale === undefined || leftVale === null || leftVale === ''