agilebuilder-ui 1.1.52 → 1.1.53-rc1

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.
@@ -119,6 +119,14 @@
119
119
  filterable
120
120
  @change="setValueToModelProp(column.prop, $event)"
121
121
  >
122
+ <template v-if="column.dataType !== 'BOOLEAN'" #header>
123
+ <el-checkbox
124
+ v-model="checkEmptyValue"
125
+ @change="checkEmptyChange"
126
+ >
127
+ {{$t('imatrixUIPublicModel.emptyValue')}}
128
+ </el-checkbox>
129
+ </template>
122
130
  <el-option v-for="item in column.valueSet" :key="item.value" :label="item.label" :value="item.value" />
123
131
  </el-select>
124
132
  <el-select
@@ -133,6 +141,14 @@
133
141
  filterable
134
142
  @change="setValueToModelProp(column.prop, $event)"
135
143
  >
144
+ <template v-if="column.dataType !== 'BOOLEAN'" #header>
145
+ <el-checkbox
146
+ v-model="checkEmptyValue"
147
+ @change="checkEmptyChange"
148
+ >
149
+ {{$t('imatrixUIPublicModel.emptyValue')}}
150
+ </el-checkbox>
151
+ </template>
136
152
  <el-option v-for="item in column.valueSet" :key="item.value" :label="item.label" :value="item.value" />
137
153
  </el-select>
138
154
  <el-select
@@ -146,6 +162,14 @@
146
162
  multiple
147
163
  @change="setValueToModelProp(column.prop, $event)"
148
164
  >
165
+ <template #header>
166
+ <el-checkbox
167
+ v-model="checkEmptyValue"
168
+ @change="checkEmptyChange"
169
+ >
170
+ {{$t('imatrixUIPublicModel.emptyValue')}}
171
+ </el-checkbox>
172
+ </template>
149
173
  <el-option v-for="item in column.valueSet" :key="item.value" :label="item.label" :value="item.value" />
150
174
  </el-select>
151
175
  <template
@@ -156,6 +180,7 @@
156
180
  "
157
181
  >
158
182
  <dynamic-source-select
183
+ ref="selectRef"
159
184
  v-model:value="searchForm[column.prop]"
160
185
  :allow-create="dataSourceOptions?.controlConfig?.allowCreate"
161
186
  :base-props="{
@@ -168,7 +193,9 @@
168
193
  :list-toolbar-form-data="listToolbarFormData"
169
194
  :options="dataSourceOptions"
170
195
  :table-name="tableName"
196
+ :is-search="true"
171
197
  @change="multiselectChange"
198
+ @changeEmptyValue="checkEmptyChange"
172
199
  />
173
200
  </template>
174
201
  <!--
@@ -290,8 +317,8 @@ export default {
290
317
  dateVal: this.getFormItemValue(this.column.prop),
291
318
  controlConfig: getControlConfig(this.column),
292
319
  isShowEmtptyFlag: false,
293
- dataSourceOptions: {}
294
- // checkedEmpty: false,
320
+ dataSourceOptions: {},
321
+ checkEmptyValue: false // 是否选中空值
295
322
  }
296
323
  },
297
324
  computed: {
@@ -320,6 +347,22 @@ export default {
320
347
  }
321
348
  }
322
349
  },
350
+ watch:{
351
+ // 重置按钮时,清空下拉选中 空值 的选中状态
352
+ 'column._resetValue': {
353
+ deep: true,
354
+ handler(newValue) {
355
+ if (newValue) {
356
+ // 表示是点击了重置按钮
357
+ this.checkEmptyValue = false
358
+ if(this.$refs.selectRef){
359
+ this.$refs.selectRef.clearEmptyValue()
360
+ }
361
+ this.column._resetValue = undefined
362
+ }
363
+ }
364
+ }
365
+ },
323
366
  created() {
324
367
  if (this.column.valueSetOptions) {
325
368
  this.moduleConfig = JSON.parse(this.column.valueSetOptions)
@@ -509,13 +552,11 @@ export default {
509
552
  }
510
553
  },
511
554
  multiselectChange(arr, selectedItem) {
512
- debugger
513
555
  if (arr && arr.indexOf('saveAll') !== -1) {
514
556
  if (this.searchForm[this.column.prop] && typeof this.searchForm[this.column.prop] === 'string') {
515
557
  this.searchForm[this.column.prop] = this.searchForm[this.column.prop].split(',')
516
558
  }
517
559
  } else {
518
- debugger
519
560
  this.searchForm[this.column.prop] = arr
520
561
  }
521
562
  },
@@ -237,11 +237,28 @@ const searchMethods = {
237
237
  // if (!Array.isArray(values)) {
238
238
  // selectValues = values.split(',')
239
239
  // }
240
+ // 是否已经封装了左括号
241
+ let isHasFirstLeftBracket = false
242
+ if(param.isEmptyValue){
243
+ const selectParam = Object.assign({}, param)
244
+ if(selectParam){
245
+ if(selectValues.length > 0){
246
+ selectParam.joinSign = 'or' // 将条件连接符修改为or,否则无法查询到值
247
+ isHasFirstLeftBracket = true
248
+ selectParam.leftBracket = '1' // 左边有1个括号
249
+ } else {
250
+ selectParam.joinSign = 'and' // 将条件连接符修改为or,否则无法查询到值
251
+ }
252
+ searchParams.push(selectParam)
253
+ }
254
+ // 用完该变量就修改这个变量的值,否则会导致下面的查询字段报错
255
+ param.isEmptyValue = false
256
+ }
240
257
  let num = 0
241
258
  selectValues.forEach((val) => {
242
259
  const selectParam = Object.assign({}, param)
243
260
  selectParam.joinSign = 'or' // 将条件连接符修改为or,否则无法查询到值
244
- if (num === 0) {
261
+ if (num === 0 && !isHasFirstLeftBracket) {
245
262
  selectParam.leftBracket = '1' // 左边有1个括号
246
263
  }
247
264
  if (num === selectValues.length - 1) {
@@ -944,7 +944,7 @@ export default {
944
944
  ...events,
945
945
  ...publicMethods,
946
946
  ...superGridService,
947
- ...searchMethods,
947
+ ...searchMethods,
948
948
  ...apis,
949
949
  onResize(entry) {
950
950
  this.resizeTableHeight()
@@ -1639,6 +1639,7 @@ export default {
1639
1639
  gridParams.subTableData = this.subTableData
1640
1640
  this.gridData = this.getSubTableGridData(this.subTableData)
1641
1641
  } else {
1642
+ this.subTableAddGuId(subTableData)
1642
1643
  this.gridData = subTableData
1643
1644
  }
1644
1645
  gridParams.gridData = this.gridData
@@ -1698,8 +1699,16 @@ export default {
1698
1699
  if (gridData === undefined || gridData === null) {
1699
1700
  gridData = []
1700
1701
  }
1702
+ this.subTableAddGuId(gridData)
1701
1703
  return gridData
1702
1704
  },
1705
+ subTableAddGuId(data) {
1706
+ data.forEach((item) => {
1707
+ if (!item.$rowDataGuId) {
1708
+ item.$rowDataGuId = getGuId()
1709
+ }
1710
+ })
1711
+ },
1703
1712
  fetchListData(searchParam, isSearch, parentRowIds, resove) {
1704
1713
  this.isLoading = true
1705
1714
  this.hasLoadData = false
@@ -3381,7 +3390,8 @@ export default {
3381
3390
  refresPortData: this.refresPortData,
3382
3391
  refresPortsData: this.refresPortsData,
3383
3392
  refresMainTableFields: this.refresMainTableFields,
3384
- prohibitToEdit: this.prohibitToEdit
3393
+ prohibitToEdit: this.prohibitToEdit,
3394
+ batchDeleteSubTableRow: this.batchDeleteSubTableRow
3385
3395
  }
3386
3396
  }
3387
3397
  } catch (error) {
@@ -3448,6 +3458,10 @@ export default {
3448
3458
  }
3449
3459
  return newRow
3450
3460
  }
3461
+ },
3462
+ batchDeleteSubTableRow() {
3463
+ const selectRows = this.$refs.superGrid.getSelectionRows()
3464
+ this.batchDeleteSubTableRowApi(this.code, selectRows, this.getRowKeyProp)
3451
3465
  }
3452
3466
  },
3453
3467
  emits: [
@@ -44,7 +44,8 @@ const cn = {
44
44
  forbidden: '禁用',
45
45
  startUsing: '启用',
46
46
  systemCode: '系统编码',
47
- code: '编码'
47
+ code: '编码',
48
+ emptyValue: '空值'
48
49
  },
49
50
  imatrixUIMessage: {
50
51
  whetherToConfirmDeletion: '是否确认删除',
@@ -84,7 +85,8 @@ const cn = {
84
85
  uploadFileTip: '上传的文件不超过{fileSize}M',
85
86
  asyncExportJumpMsg: '或点击我跳转到下载页面',
86
87
  mustFill: '{label} 必须填写',
87
- filePathNotFound: '文件UUID未找到,请检查配置'
88
+ filePathNotFound: '文件UUID未找到,请检查配置',
89
+ pleaseSelectDeleteData: '请选择要删除的数据'
88
90
  },
89
91
  // 列表组件
90
92
  superGrid: {
@@ -275,7 +277,8 @@ const cn = {
275
277
  fsUpload: {
276
278
  upload: '上传',
277
279
  download: '下载',
278
- delete: '删除',
280
+ delete: '删除',
281
+ deleteSuccessful: '删除成功',
279
282
  preview: '预览',
280
283
  name: '名称',
281
284
  picture: '图片',
@@ -44,7 +44,8 @@ const en = {
44
44
  forbidden: 'forbidden',
45
45
  startUsing: 'Start Using',
46
46
  systemCode: 'System Code',
47
- code: 'Code'
47
+ code: 'Code',
48
+ emptyValue: 'Empty Value'
48
49
  },
49
50
  imatrixUIMessage: {
50
51
  whetherToConfirmDeletion: 'Whether To Confirm Deletion',
@@ -85,7 +86,8 @@ const en = {
85
86
  uploadFileTip: 'The file size should lower {fileSize}M',
86
87
  asyncExportJumpMsg: 'Or click me to jump to download page.',
87
88
  mustFill: '{label} must fill',
88
- filePathNotFound: 'File UUID not found, please check the configuration'
89
+ filePathNotFound: 'File UUID not found, please check the configuration',
90
+ pleaseSelectDeleteData: 'Please select the data to delete'
89
91
  },
90
92
  superGrid: {
91
93
  editablePlaceholder: 'Please click to input',
@@ -275,6 +277,7 @@ const en = {
275
277
  upload: 'Upload',
276
278
  download: 'Download',
277
279
  delete: 'Delete',
280
+ deleteSuccessful: 'Delete successful',
278
281
  preview: 'Preview',
279
282
  name: 'Name',
280
283
  picture: 'Picture',
@@ -1,30 +1,35 @@
1
1
  //to reset element-ui default css
2
2
  .el-upload {
3
- input[type="file"] {
4
- display: none !important;
5
- }
6
- }
3
+ input[type="file"] {
4
+ display: none !important;
5
+ }
6
+ }
7
7
 
8
- .el-upload__input {
9
- display: none;
10
- }
8
+ .el-upload__input {
9
+ display: none;
10
+ }
11
11
 
12
- //暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461 Dialog内select tree等组件在点击箭头时有虚晃
13
- // 去掉这个配置是因为margin: 0 auto;影响弹框位置,紧贴浏览器顶部,没有间距。例如:权限系统/授权管理/分支字段权限管理/新建按钮弹框
14
- // .el-dialog {
15
- // transform: none;
16
- // left: 0;
17
- // position: relative;
18
- // margin: 0 auto;
19
- // }
12
+ .el-input-group__append .el-button+.el-button {
13
+ margin-left: 12px;
14
+ }
20
15
 
21
- //element ui upload
22
- .upload-container {
23
- .el-upload {
24
- width: 100%;
25
- .el-upload-dragger {
26
- width: 100%;
27
- height: 200px;
28
- }
29
- }
30
- }
16
+ //暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461 Dialog内select tree等组件在点击箭头时有虚晃
17
+ // 去掉这个配置是因为margin: 0 auto;影响弹框位置,紧贴浏览器顶部,没有间距。例如:权限系统/授权管理/分支字段权限管理/新建按钮弹框
18
+ // .el-dialog {
19
+ // transform: none;
20
+ // left: 0;
21
+ // position: relative;
22
+ // margin: 0 auto;
23
+ // }
24
+
25
+ //element ui upload
26
+ .upload-container {
27
+ .el-upload {
28
+ width: 100%;
29
+
30
+ .el-upload-dragger {
31
+ width: 100%;
32
+ height: 200px;
33
+ }
34
+ }
35
+ }
package/src/utils/util.js CHANGED
@@ -259,14 +259,14 @@ function parseCondition(
259
259
  // 再获取属于那张表
260
260
  const propDbNameArr = propDbName.split('_+_')
261
261
  propDbName = propDbNameArr[1]
262
- if (pageContext && propDbName && propDbName.indexOf('${')>=0) {
262
+ if (pageContext && propDbName && propDbName.indexOf('${') >= 0) {
263
263
  leftValue = getPropValueNew(propDbName, pageContext, entity)
264
264
  } else {
265
265
  leftValue = getValue(parentFormData, propDbName, isSql)
266
266
  }
267
267
  // leftValue = getValue(parentFormData, propDbName, isSql)
268
268
  } else {
269
- if (pageContext && propDbName && propDbName.indexOf('${')>=0) {
269
+ if (pageContext && propDbName && propDbName.indexOf('${') >= 0) {
270
270
  leftValue = getPropValueNew(propDbName, pageContext, entity)
271
271
  } else {
272
272
  leftValue = getValue(entity, propDbName, isSql)
@@ -277,7 +277,7 @@ function parseCondition(
277
277
  if (tableName && propDbName.toLowerCase().startsWith(tableName.toLowerCase() + '.')) {
278
278
  // 表示是当前表的字段
279
279
  const myProp = propDbName.substring(propDbName.indexOf('.'))
280
- if (pageContext && myProp && myProp.indexOf('${')>=0) {
280
+ if (pageContext && myProp && myProp.indexOf('${') >= 0) {
281
281
  leftValue = getPropValueNew(myProp, pageContext, entity)
282
282
  } else {
283
283
  leftValue = getValue(entity, myProp, isSql)
@@ -290,14 +290,14 @@ function parseCondition(
290
290
  propName = propName.replace('parent_+_', '')
291
291
  const propNameArr = propName.split('_+_')
292
292
  propName = propNameArr[1]
293
- if (pageContext && propName && propName.indexOf('${')>=0) {
293
+ if (pageContext && propName && propName.indexOf('${') >= 0) {
294
294
  leftValue = getPropValueNew(propName, pageContext, entity)
295
295
  } else {
296
- leftValue =getValue(parentFormData, propName, isSql)
296
+ leftValue = getValue(parentFormData, propName, isSql)
297
297
  }
298
298
  // leftValue = getValue(parentFormData, propName, isSql)
299
299
  } else {
300
- if (pageContext && propName && propName.indexOf('${')>=0) {
300
+ if (pageContext && propName && propName.indexOf('${') >= 0) {
301
301
  leftValue = getPropValueNew(propName, pageContext, entity)
302
302
  } else {
303
303
  leftValue = getValue(entity, propName, isSql)
@@ -305,7 +305,7 @@ function parseCondition(
305
305
  // leftValue = getValue(entity, propName, isSql)
306
306
  }
307
307
  if (propDbName && (leftValue === undefined || leftValue === null)) {
308
- if (pageContext && propDbName && propDbName.indexOf('${')>=0) {
308
+ if (pageContext && propDbName && propDbName.indexOf('${') >= 0) {
309
309
  leftValue = getPropValueNew(propDbName, pageContext, entity)
310
310
  } else {
311
311
  leftValue = getValue(entity, propDbName, isSql)
@@ -638,7 +638,7 @@ export function getPropValue(
638
638
 
639
639
  function getAdditionalParamMap(pageContext) {
640
640
  if (pageContext && pageContext.entity) {
641
- let additionalParamMap = pageContext.entity.page
641
+ let additionalParamMap = { ...pageContext.entity.page }
642
642
  if (!additionalParamMap) {
643
643
  additionalParamMap = {}
644
644
  }
package/vite.config.js CHANGED
@@ -12,7 +12,7 @@ export default defineConfig(({ mode }) => ({
12
12
  terser({
13
13
  compress: {
14
14
  drop_debugger: ['production'].includes(mode),
15
- // pure_funcs: ['production'].includes(mode) ? ['console.log', 'console.info', 'console.warn', 'console.debug'] : [],
15
+ pure_funcs: ['production'].includes(mode) ? ['console.log', 'console.info', 'console.warn', 'console.debug'] : [],
16
16
  },
17
17
  output: {
18
18
  // 对于console.error,不做任何处理