agilebuilder-ui 1.1.41-rc1 → 1.1.41-sit2

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.
@@ -1,30 +1,34 @@
1
1
  <template>
2
- <div v-resize="onResize" class="grid-search-row">
3
- <el-row>
4
- <el-col v-for="(column, index) of filterSearchableColumns" :key="index" :span="span">
5
- <search-form-item
6
- :label-width="labelWidth"
7
- :search-form="searchForm"
8
- :column="column"
9
- :code="code"
10
- :is-sql="isSql"
11
- :table-name="tableName"
12
- :is-join-table="isJoinTable"
13
- />
14
- </el-col>
15
- <el-col :span="span" class="search-btns-view" :class="{ 'no-show-open': !isShowOpen, 'no-search-button-auto': isSearchButtonAuto }">
16
- <search-button
17
- ref="searchBtnOpen"
18
- :is-open="myOpen"
19
- :is-show-open="isShowOpen"
20
- @submit-form="$emit('submit-form')"
21
- @reset-form="$emit('reset-form')"
22
- @save-condition="$emit('save-condition')"
23
- @open-fold="openFold"
24
- />
25
- </el-col>
26
- </el-row>
27
- </div>
2
+ <div v-resize="onResize" class="grid-search-row">
3
+ <el-row>
4
+ <el-col v-for="(column, index) of filterSearchableColumns" :key="index" :span="span">
5
+ <search-form-item
6
+ :label-width="labelWidth"
7
+ :search-form="searchForm"
8
+ :column="column"
9
+ :code="code"
10
+ :is-sql="isSql"
11
+ :table-name="tableName"
12
+ :is-join-table="isJoinTable"
13
+ />
14
+ </el-col>
15
+ <el-col
16
+ :span="span"
17
+ class="search-btns-view"
18
+ :class="{ 'no-show-open': !isShowOpen, 'no-search-button-auto': isSearchButtonAuto }"
19
+ >
20
+ <search-button
21
+ ref="searchBtnOpen"
22
+ :is-open="myOpen"
23
+ :is-show-open="isShowOpen"
24
+ @submit-form="$emit('submit-form')"
25
+ @reset-form="$emit('reset-form')"
26
+ @save-condition="$emit('save-condition')"
27
+ @open-fold="openFold"
28
+ />
29
+ </el-col>
30
+ </el-row>
31
+ </div>
28
32
  </template>
29
33
  <script>
30
34
  import searchMethods from './search-methods'
@@ -32,138 +36,140 @@ import SearchFormItem from './search-form-item.vue'
32
36
  import SearchButton from './search-button.vue'
33
37
 
34
38
  export default {
35
- name: 'SearchFormOpen',
36
- components: {
37
- SearchFormItem,
38
- SearchButton,
39
- },
40
- props: {
41
- // 第一行的字段集合
42
- searchableColumns: {
43
- type: Array,
44
- default: null,
45
- },
46
- // 查询表单信息
47
- searchForm: {
48
- type: Object,
49
- default: null,
50
- },
51
- code: {
52
- type: String,
53
- default: null,
54
- },
55
- isSql: {
56
- type: Boolean,
57
- default: false,
58
- },
59
- tableName: {
60
- type: String,
61
- default: null,
62
- },
63
- isJoinTable: {
64
- type: Boolean,
65
- default: false,
66
- },
67
- spanNum: {
68
- type: Number,
69
- default: 8,
70
- },
71
- // 每行几个字段
72
- fieldNum: {
73
- type: Number,
74
- default: null,
75
- },
76
- // 一共多少行
77
- rowNum: {
78
- type: Number,
79
- default: null,
80
- },
81
- // 查询条件是否展开
82
- isOpen: {
83
- type: Boolean,
84
- default: false,
85
- },
86
- },
87
- data() {
88
- return {
89
- rowWidth: undefined, // 当前模块宽度
90
- maxLength: undefined,
91
- minLength: undefined,
92
- myOpen: this.isOpen ?? false
93
- }
94
- },
95
- computed: {
96
- // 是否展示 展开按钮
97
- isShowOpen() {
98
- return this.showColumn < this.searchableColumns.length + 1
99
- },
100
- // 是否开启按钮右边固定
101
- isSearchButtonAuto() {
102
- return (this.showColumn - this.searchableColumns.length) > 1
103
- },
104
- filterSearchableColumns() {
105
- return this.searchableColumns.filter((_, index) => !this.myOpen && this.isShowOpen && index > (this.showColumn - 2) ? false : true)
106
- },
107
- // 检测label 最大宽度
108
- labelWidth() {
109
- try {
110
- if (!this.maxLength || !this.minLength) return ''
111
- if (this.maxLength >= 10) return 82
112
- if (this.maxLength === this.minLength && this.minLength <= 4) return 45
113
- return 72
114
- } catch (error) {
115
- return ''
116
- }
117
- },
118
- // 列布局
119
- span() {
120
- return 24 / this.showColumn
121
- },
122
- // 显示多少列
123
- showColumn() {
124
- if (this.rowWidth) {
125
- if (this.rowWidth >= 1500) return 4
126
- if (this.rowWidth <= 768) return 2
127
- }
128
- return 3
129
- }
130
- },
131
- watch: {
132
- filterSearchableColumns() {
133
- const combinedArray = this.filterSearchableColumns.map(({ label, searchLabel }) => ( (searchLabel ?? label)?.replace(/[\u4e00-\u9fa5]/g, '**') ?? '').length)
134
- this.maxLength = Math.max(...combinedArray)
135
- this.minLength = Math.max(...combinedArray)
136
- },
137
- myOpen() {
138
- },
139
- },
140
- methods: {
141
- ...searchMethods,
142
- onResize(entry) {
143
- this.rowWidth = entry.contentRect.width
144
- // console.log('新尺寸:', entry.contentRect)
145
- // console.log('宽度:', entry.contentRect.width)
146
- // console.log('高度:', entry.contentRect.height)
147
- },
148
- openFold(isOpen) {
149
- this.myOpen = isOpen
150
- this.$emit('open-fold', isOpen)
151
- },
152
- // 查询完毕
153
- searchComplete() {
154
- if (this.$refs.searchBtnOpen) {
155
- if (Array.isArray(this.$refs.searchBtnOpen)) {
156
- if (this.$refs.searchBtnOpen.length > 0) {
157
- this.$refs.searchBtnOpen[0].searchComplete()
158
- }
159
- } else {
160
- this.$refs.searchBtnOpen.searchComplete()
161
- }
162
- }
163
- },
164
- },
39
+ name: 'SearchFormOpen',
40
+ components: {
41
+ SearchFormItem,
42
+ SearchButton
43
+ },
44
+ props: {
45
+ // 第一行的字段集合
46
+ searchableColumns: {
47
+ type: Array,
48
+ default: null
49
+ },
50
+ // 查询表单信息
51
+ searchForm: {
52
+ type: Object,
53
+ default: null
54
+ },
55
+ code: {
56
+ type: String,
57
+ default: null
58
+ },
59
+ isSql: {
60
+ type: Boolean,
61
+ default: false
62
+ },
63
+ tableName: {
64
+ type: String,
65
+ default: null
66
+ },
67
+ isJoinTable: {
68
+ type: Boolean,
69
+ default: false
70
+ },
71
+ spanNum: {
72
+ type: Number,
73
+ default: 8
74
+ },
75
+ // 每行几个字段
76
+ fieldNum: {
77
+ type: Number,
78
+ default: null
79
+ },
80
+ // 一共多少行
81
+ rowNum: {
82
+ type: Number,
83
+ default: null
84
+ },
85
+ // 查询条件是否展开
86
+ isOpen: {
87
+ type: Boolean,
88
+ default: false
89
+ }
90
+ },
91
+ data() {
92
+ return {
93
+ rowWidth: undefined, // 当前模块宽度
94
+ maxLength: undefined,
95
+ minLength: undefined,
96
+ myOpen: this.isOpen ?? false
97
+ }
98
+ },
99
+ computed: {
100
+ // 是否展示 展开按钮
101
+ isShowOpen() {
102
+ return this.showColumn < this.searchableColumns.length + 1
103
+ },
104
+ // 是否开启按钮右边固定
105
+ isSearchButtonAuto() {
106
+ return this.showColumn - this.searchableColumns.length > 1
107
+ },
108
+ filterSearchableColumns() {
109
+ return this.searchableColumns.filter((_, index) =>
110
+ !this.myOpen && this.isShowOpen && index > this.showColumn - 2 ? false : true
111
+ )
112
+ },
113
+ // 检测label 最大宽度
114
+ labelWidth() {
115
+ try {
116
+ if (!this.maxLength || !this.minLength) return ''
117
+ if (this.maxLength >= 10) return 82
118
+ if (this.maxLength === this.minLength && this.minLength <= 4) return 45
119
+ return 72
120
+ } catch (error) {
121
+ return ''
122
+ }
123
+ },
124
+ // 列布局
125
+ span() {
126
+ return 24 / this.showColumn
127
+ },
128
+ // 显示多少列
129
+ showColumn() {
130
+ if (this.rowWidth) {
131
+ if (this.rowWidth >= 1500) return 4
132
+ if (this.rowWidth <= 768) return 2
133
+ }
134
+ return 3
135
+ }
136
+ },
137
+ watch: {
138
+ filterSearchableColumns() {
139
+ const combinedArray = this.filterSearchableColumns.map(
140
+ ({ label, searchLabel }) => ((searchLabel ?? label)?.replace(/[\u4e00-\u9fa5]/g, '**') ?? '').length
141
+ )
142
+ this.maxLength = Math.max(...combinedArray)
143
+ this.minLength = Math.max(...combinedArray)
144
+ },
145
+ myOpen() {}
146
+ },
147
+ methods: {
148
+ ...searchMethods,
149
+ onResize(entry) {
150
+ this.rowWidth = entry.contentRect.width
151
+ // console.log('新尺寸:', entry.contentRect)
152
+ // console.log('宽度:', entry.contentRect.width)
153
+ // console.log('高度:', entry.contentRect.height)
154
+ },
155
+ openFold(isOpen) {
156
+ this.myOpen = isOpen
157
+ this.$emit('open-fold', isOpen)
158
+ },
159
+ // 查询完毕
160
+ searchComplete() {
161
+ if (this.$refs.searchBtnOpen) {
162
+ if (Array.isArray(this.$refs.searchBtnOpen)) {
163
+ if (this.$refs.searchBtnOpen.length > 0) {
164
+ this.$refs.searchBtnOpen[0].searchComplete()
165
+ }
166
+ } else {
167
+ this.$refs.searchBtnOpen.searchComplete()
168
+ }
169
+ }
170
+ }
171
+ }
165
172
  }
166
173
  </script>
167
174
 
168
- <style lang="scss" scoped>
169
- </style>
175
+ <style lang="scss" scoped></style>
@@ -92,7 +92,6 @@
92
92
  @cell-dblclick="cellDblClick"
93
93
  >
94
94
  <row-detail v-if="detailColumn" :column="detailColumn" :list-code="code" @show-detail="openRowForm" />
95
-
96
95
  <component
97
96
  :is="getComponentType(column)"
98
97
  v-for="({ column, ...item }, index) in visibleColumnsComponentData"
@@ -454,7 +453,9 @@ export default {
454
453
  computed: {
455
454
  // 高度偏移
456
455
  heightOffset() {
457
- return Number(this.manualHeightOffset ?? this.options?.configureObj?.props?.size?.pc?.heightOffset ?? 33)
456
+ //去掉之前的偏移量33,解决偏移导致横向滚动条被遮住无法显示问题
457
+ return Number(this.manualHeightOffset ?? this.options?.configureObj?.props?.size?.pc?.heightOffset ?? 0)
458
+ // return Number(this.manualHeightOffset ?? this.options?.configureObj?.props?.size?.pc?.heightOffset ?? 33)
458
459
  },
459
460
  // 限制高度最低值
460
461
  hasMaxHeight() {
@@ -1382,6 +1383,9 @@ export default {
1382
1383
  param.additionalParamMap = gridParams.additionalParamMap
1383
1384
  param.pageContext = this.pageContext
1384
1385
  param.configureOb = this.configureObj
1386
+ if (param.row) {
1387
+ param.row = this.handRowKeyToUpperCase(param.row)
1388
+ }
1385
1389
  return gridParams.options.rowStyleRender.call(this, param)
1386
1390
  }
1387
1391
  if (this.options && this.options.renderRow && this.options.renderRow.hasOwnProperty(param.rowIndex)) {
@@ -1414,6 +1418,9 @@ export default {
1414
1418
  param.pageContext = this.pageContext
1415
1419
  param.configureObj = this.configureObj
1416
1420
  param.cellStyle = columnStyleSetting
1421
+ if (param.row) {
1422
+ param.row = this.handRowKeyToUpperCase(param.row)
1423
+ }
1417
1424
  return gridParams.options.cellStyleRender.call(this, param)
1418
1425
  } else if (
1419
1426
  funName !== null &&
@@ -1432,6 +1439,9 @@ export default {
1432
1439
  rowIndex: param.rowIndex,
1433
1440
  cellStyle: columnStyleSetting
1434
1441
  }
1442
+ if (params.row) {
1443
+ params.row = this.handRowKeyToUpperCase(params.row)
1444
+ }
1435
1445
  return gridParams.options['eventCallBack'][funName].call(this, params)
1436
1446
  }
1437
1447
  },
@@ -3394,8 +3404,22 @@ export default {
3394
3404
  getSuperGridRef() {
3395
3405
  return this.$refs.superGrid
3396
3406
  },
3397
- getColumns() {
3398
- return this.columns
3407
+ handRowKeyToUpperCase(row) {
3408
+ // 把row对象的所有key都转成大写
3409
+ if (row) {
3410
+ const newRow = {}
3411
+ try {
3412
+ for (const key in row) {
3413
+ if (Object.prototype.hasOwnProperty.call(row, key)) {
3414
+ newRow[key.toUpperCase()] = row[key]
3415
+ }
3416
+ }
3417
+ } catch (error) {
3418
+ console.error('handRowKeyToUpperCase error:', error)
3419
+ return row
3420
+ }
3421
+ return newRow
3422
+ }
3399
3423
  }
3400
3424
  },
3401
3425
  emits: [