agilebuilder-ui 1.0.78 → 1.0.79-temp2
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
|
@@ -399,7 +399,7 @@ function exportListData(
|
|
|
399
399
|
// 获得文件中心/导出任务菜单的路由地址
|
|
400
400
|
function getDcExportPageUrl() {
|
|
401
401
|
let exportPageUrl
|
|
402
|
-
const baseAPI =
|
|
402
|
+
const baseAPI = window.$vueApp.config.globalProperties.baseAPI
|
|
403
403
|
if (baseAPI) {
|
|
404
404
|
// 获得平台的域名和端口
|
|
405
405
|
const baseUrls = baseAPI.split('/')
|
|
@@ -444,12 +444,12 @@ export default {
|
|
|
444
444
|
if (this.column.controlConfig) {
|
|
445
445
|
controlConfig = JSON.parse(this.column.controlConfig)
|
|
446
446
|
}
|
|
447
|
-
|
|
447
|
+
|
|
448
448
|
let scanEnable = false
|
|
449
|
-
if(controlConfig.scanEnable){
|
|
449
|
+
if (controlConfig.scanEnable) {
|
|
450
450
|
scanEnable = true
|
|
451
451
|
}
|
|
452
|
-
const componentId = this.listCode+'_'+this.column.prop
|
|
452
|
+
const componentId = this.listCode + '_' + this.column.prop
|
|
453
453
|
return {
|
|
454
454
|
selectRow: null,
|
|
455
455
|
that: this,
|
|
@@ -1046,7 +1046,7 @@ export default {
|
|
|
1046
1046
|
* 设置条码扫描解析规则
|
|
1047
1047
|
*/
|
|
1048
1048
|
setScanRuleSets() {
|
|
1049
|
-
if(this.scanEnable && this.controlConfig && this.controlConfig.scanRuleList) {
|
|
1049
|
+
if (this.scanEnable && this.controlConfig && this.controlConfig.scanRuleList) {
|
|
1050
1050
|
formatScanRuleSets(this.controlConfig.scanRuleList).then((res) => {
|
|
1051
1051
|
//扫描处理
|
|
1052
1052
|
this.column._scanRuleSets = res
|
|
@@ -1068,6 +1068,7 @@ export default {
|
|
|
1068
1068
|
.m-requried {
|
|
1069
1069
|
float: left;
|
|
1070
1070
|
white-space: nowrap;
|
|
1071
|
+
width: 100%;
|
|
1071
1072
|
}
|
|
1072
1073
|
|
|
1073
1074
|
.m-requried::after {
|
|
@@ -87,7 +87,7 @@ const ArrowKeyAction = {
|
|
|
87
87
|
return null
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
}
|
|
90
|
+
}
|
|
91
91
|
}
|
|
92
92
|
export { ArrowKeyAction }
|
|
93
93
|
|
|
@@ -101,10 +101,7 @@ export function setCurrentRow(rowIndex, listCode) {
|
|
|
101
101
|
// 新建时会传过来比记录条数大的行号
|
|
102
102
|
if (gridParams.isMulitiSelect) {
|
|
103
103
|
gridParams.superGrid.clearSelection()
|
|
104
|
-
gridParams.superGrid.toggleRowSelection(
|
|
105
|
-
gridParams.gridData[rowIndex],
|
|
106
|
-
true
|
|
107
|
-
)
|
|
104
|
+
gridParams.superGrid.toggleRowSelection(gridParams.gridData[rowIndex], true)
|
|
108
105
|
} else {
|
|
109
106
|
gridParams.superGrid.setCurrentRow(gridParams.gridData[rowIndex])
|
|
110
107
|
}
|
|
@@ -160,17 +157,11 @@ export function isLastEditRowSave(listCode) {
|
|
|
160
157
|
// 表示有正在编辑的行,不能编辑其他行
|
|
161
158
|
return false
|
|
162
159
|
}
|
|
163
|
-
if (
|
|
164
|
-
typeof gridParams.$rowIndex === 'undefined' ||
|
|
165
|
-
gridParams.$rowIndex === null
|
|
166
|
-
) {
|
|
160
|
+
if (typeof gridParams.$rowIndex === 'undefined' || gridParams.$rowIndex === null) {
|
|
167
161
|
// 表示没有在该列表编辑任何行,可以编辑行
|
|
168
162
|
return true
|
|
169
163
|
}
|
|
170
|
-
if (
|
|
171
|
-
typeof gridParams.$lastSaveRowIndex === 'undefined' ||
|
|
172
|
-
gridParams.$lastSaveRowIndex === null
|
|
173
|
-
) {
|
|
164
|
+
if (typeof gridParams.$lastSaveRowIndex === 'undefined' || gridParams.$lastSaveRowIndex === null) {
|
|
174
165
|
// 表示没有在该列表保存任何行,可以编辑行
|
|
175
166
|
return true
|
|
176
167
|
}
|
|
@@ -197,10 +188,7 @@ export function isCanRefreshGrid(listCode) {
|
|
|
197
188
|
return false
|
|
198
189
|
}
|
|
199
190
|
|
|
200
|
-
if (
|
|
201
|
-
typeof gridParams.isCreateRow !== 'undefined' &&
|
|
202
|
-
gridParams.isCreateRow === true
|
|
203
|
-
) {
|
|
191
|
+
if (typeof gridParams.isCreateRow !== 'undefined' && gridParams.isCreateRow === true) {
|
|
204
192
|
// 说明刚刚新建的行还没有保存 或 撤销编辑,表示当前列表中有编辑行,不能刷新列表数据
|
|
205
193
|
return false
|
|
206
194
|
}
|
|
@@ -237,16 +225,12 @@ export function isDisableEdit(prop, listCode, row) {
|
|
|
237
225
|
const fieldPermissions = gridParams.options.validateRules
|
|
238
226
|
if (fieldPermissions) {
|
|
239
227
|
const fieldRule = fieldPermissions.filter(
|
|
240
|
-
(item) =>
|
|
241
|
-
item.name && (item.name === prop || item.name === 'all_fields')
|
|
228
|
+
(item) => item.name && (item.name === prop || item.name === 'all_fields')
|
|
242
229
|
)
|
|
243
230
|
let canEdit = true
|
|
244
231
|
if (fieldRule && fieldRule.length > 0) {
|
|
245
232
|
for (let i = 0; i < fieldRule.length; i++) {
|
|
246
|
-
if (
|
|
247
|
-
fieldRule[i].rowIndexes === undefined ||
|
|
248
|
-
fieldRule[i].rowIndexes === null
|
|
249
|
-
) {
|
|
233
|
+
if (fieldRule[i].rowIndexes === undefined || fieldRule[i].rowIndexes === null) {
|
|
250
234
|
canEdit = fieldRule[i].canEdit
|
|
251
235
|
} else if (fieldRule[i].rowIndexes.indexOf(rowId) >= 0) {
|
|
252
236
|
canEdit = fieldRule[i].canEdit
|
|
@@ -342,10 +326,7 @@ export function isHasEditOption(event, listCode) {
|
|
|
342
326
|
listCode = store.get('_list_code')
|
|
343
327
|
}
|
|
344
328
|
const gridParams = store.get(listCode)
|
|
345
|
-
if (
|
|
346
|
-
gridParams.options.lineEditOptions &&
|
|
347
|
-
gridParams.options.lineEditOptions[event]
|
|
348
|
-
) {
|
|
329
|
+
if (gridParams.options.lineEditOptions && gridParams.options.lineEditOptions[event]) {
|
|
349
330
|
return true
|
|
350
331
|
}
|
|
351
332
|
return false
|
|
@@ -356,10 +337,7 @@ export function isEditOptionFunction(event, listCode) {
|
|
|
356
337
|
listCode = store.get('_list_code')
|
|
357
338
|
}
|
|
358
339
|
const gridParams = store.get(listCode)
|
|
359
|
-
if (
|
|
360
|
-
gridParams.options.lineEditOptions &&
|
|
361
|
-
typeof gridParams.options.lineEditOptions[event] === 'function'
|
|
362
|
-
) {
|
|
340
|
+
if (gridParams.options.lineEditOptions && typeof gridParams.options.lineEditOptions[event] === 'function') {
|
|
363
341
|
return true
|
|
364
342
|
}
|
|
365
343
|
return false
|
|
@@ -424,7 +402,7 @@ export function getGridParams() {
|
|
|
424
402
|
isRestoreByEsc: true, // 点击ESC时,是否撤销编辑,
|
|
425
403
|
aftersaveIsCancelEditState: true, // 保存后,是否取消编辑状态
|
|
426
404
|
afterRestoreIsCancelEditState: true, // 撤销编辑后,是否取消编辑状态
|
|
427
|
-
input: function () {}
|
|
405
|
+
input: function () {} // 数据改变时触发
|
|
428
406
|
// 'beforeSave': function() { return true }, // 保存行数据前的回调
|
|
429
407
|
// 'saveSuccess': function() {}, // 保存行数据成功的回调
|
|
430
408
|
// 'saveError': function() {}, // 保存行数据发生异常的回调
|
|
@@ -451,7 +429,7 @@ export function getGridParams() {
|
|
|
451
429
|
// urlToSaveRow:'', // 保存行记录的url,如果设置了以该设置的为准
|
|
452
430
|
// isEnableValidate: true, // 保存行记录时,是否启用必填验证
|
|
453
431
|
// saveRow: function(){return new Promise((resolve, reject) => {...resolve(data)})} // 需要返回的是保存后的行记录的值
|
|
454
|
-
}
|
|
432
|
+
}
|
|
455
433
|
// 自定义行编辑
|
|
456
434
|
// customFormatter: {
|
|
457
435
|
// },
|
|
@@ -516,7 +494,7 @@ export function getGridParams() {
|
|
|
516
494
|
// actionPermission: { 'canAdd': true, 'canUpdate': true, 'canDelete': true }, // 列表行编辑时控制按钮的权限
|
|
517
495
|
// formData: {}, // 主表单的实体信息
|
|
518
496
|
// hiddenColumns:['operation','xx]
|
|
519
|
-
}
|
|
497
|
+
}
|
|
520
498
|
}
|
|
521
499
|
return Vue.reactive(gridParams)
|
|
522
500
|
}
|
|
@@ -599,7 +577,7 @@ export function getTableHeight(superGrid, listCode, pageHeight) {
|
|
|
599
577
|
topDivHeight = 0
|
|
600
578
|
}
|
|
601
579
|
let totalHeight = pageHeight - topDivHeight
|
|
602
|
-
if(superGrid){
|
|
580
|
+
if (superGrid) {
|
|
603
581
|
totalHeight = pageHeight - superGrid.$el.offsetTop - topDivHeight
|
|
604
582
|
}
|
|
605
583
|
// const cur = document.querySelectorAll("div[class='grid-area']")
|
|
@@ -634,7 +612,7 @@ export function getTableHeight(superGrid, listCode, pageHeight) {
|
|
|
634
612
|
|
|
635
613
|
export function getExtraParam(searchParam, gridParams) {
|
|
636
614
|
const param = {
|
|
637
|
-
searchParam: searchParam
|
|
615
|
+
searchParam: searchParam
|
|
638
616
|
}
|
|
639
617
|
param.withDataPermission = gridParams.options.isWithDataPermission
|
|
640
618
|
param.isWorkflowEntity = gridParams.options.isWorkflowEntity
|
|
@@ -675,25 +653,17 @@ export function analysisFileSetObj(fileSetObj, isSql) {
|
|
|
675
653
|
}
|
|
676
654
|
return {
|
|
677
655
|
showName: showName,
|
|
678
|
-
serverPath: serverPath
|
|
656
|
+
serverPath: serverPath
|
|
679
657
|
}
|
|
680
658
|
}
|
|
681
659
|
|
|
682
|
-
export function otherFilesToStandard(
|
|
683
|
-
fileSetObj,
|
|
684
|
-
keyValueParam,
|
|
685
|
-
files,
|
|
686
|
-
filesStringData
|
|
687
|
-
) {
|
|
660
|
+
export function otherFilesToStandard(fileSetObj, keyValueParam, files, filesStringData) {
|
|
688
661
|
const standardFiles = []
|
|
689
662
|
if (files) {
|
|
690
663
|
if (files && files.length > 0) {
|
|
691
664
|
for (var i = 0; i < files.length; i++) {
|
|
692
665
|
const file = files[i]
|
|
693
|
-
const standardFile = packageFile(
|
|
694
|
-
file[keyValueParam.showName],
|
|
695
|
-
file[keyValueParam.serverPath]
|
|
696
|
-
)
|
|
666
|
+
const standardFile = packageFile(file[keyValueParam.showName], file[keyValueParam.serverPath])
|
|
697
667
|
standardFiles.push(standardFile)
|
|
698
668
|
}
|
|
699
669
|
}
|
|
@@ -720,31 +690,15 @@ export function packageFile(showName, serverPath) {
|
|
|
720
690
|
standardFile.showName = showName
|
|
721
691
|
standardFile.serverPath = serverPath
|
|
722
692
|
|
|
723
|
-
if (
|
|
724
|
-
standardFile.showName &&
|
|
725
|
-
/\.(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|bmp|BMP|psd|PSD|tif|TIF)$/.test(
|
|
726
|
-
showName
|
|
727
|
-
)
|
|
728
|
-
) {
|
|
693
|
+
if (standardFile.showName && /\.(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|bmp|BMP|psd|PSD|tif|TIF)$/.test(showName)) {
|
|
729
694
|
standardFile.isImg = true
|
|
730
695
|
}
|
|
731
696
|
const token = getToken()
|
|
732
|
-
let url =
|
|
733
|
-
window.$vueApp.config.globalProperties.baseURL +
|
|
734
|
-
'/common/super-form/downloads?jwt=' +
|
|
735
|
-
token
|
|
697
|
+
let url = window.$vueApp.config.globalProperties.baseURL + '/common/super-form/downloads?jwt=' + token
|
|
736
698
|
if (isPlateSys(window.$vueApp.config.globalProperties.systemCode)) {
|
|
737
|
-
url =
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
token
|
|
741
|
-
}
|
|
742
|
-
const src =
|
|
743
|
-
url +
|
|
744
|
-
'&showName=' +
|
|
745
|
-
encodeURI(standardFile.showName) +
|
|
746
|
-
'&serverPath=' +
|
|
747
|
-
standardFile.serverPath
|
|
699
|
+
url = window.$vueApp.config.globalProperties.baseAPI + '/component/super-form/downloads?jwt=' + token
|
|
700
|
+
}
|
|
701
|
+
const src = url + '&showName=' + encodeURI(standardFile.showName) + '&serverPath=' + standardFile.serverPath
|
|
748
702
|
standardFile.src = src
|
|
749
703
|
return standardFile
|
|
750
704
|
}
|
|
@@ -754,8 +708,7 @@ export function getFileList(row, column, isSql) {
|
|
|
754
708
|
if (
|
|
755
709
|
column.fileSet &&
|
|
756
710
|
column.fileSet !== '' &&
|
|
757
|
-
(column.componentType === 'annex' ||
|
|
758
|
-
column.componentType === 'multipartUpload')
|
|
711
|
+
(column.componentType === 'annex' || column.componentType === 'multipartUpload')
|
|
759
712
|
) {
|
|
760
713
|
const fileSetObj = JSON.parse(column.fileSet)
|
|
761
714
|
const keyValueParam = analysisFileSetObj(fileSetObj, isSql)
|
|
@@ -764,23 +717,13 @@ export function getFileList(row, column, isSql) {
|
|
|
764
717
|
// const lowerStr = fileSetObj.childAnnexDataTableCode.toLowerCase()
|
|
765
718
|
const fileArr = row[column.prop]
|
|
766
719
|
// 子表
|
|
767
|
-
fileList = otherFilesToStandard(
|
|
768
|
-
fileSetObj,
|
|
769
|
-
keyValueParam,
|
|
770
|
-
fileArr,
|
|
771
|
-
null
|
|
772
|
-
)
|
|
720
|
+
fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
|
|
773
721
|
} else {
|
|
774
722
|
const filesStringData = {
|
|
775
723
|
showName: getEntityFieldValue(row, keyValueParam.showName),
|
|
776
|
-
serverPath: getEntityFieldValue(row, keyValueParam.serverPath)
|
|
724
|
+
serverPath: getEntityFieldValue(row, keyValueParam.serverPath)
|
|
777
725
|
}
|
|
778
|
-
fileList = otherFilesToStandard(
|
|
779
|
-
fileSetObj,
|
|
780
|
-
keyValueParam,
|
|
781
|
-
null,
|
|
782
|
-
filesStringData
|
|
783
|
-
)
|
|
726
|
+
fileList = otherFilesToStandard(fileSetObj, keyValueParam, null, filesStringData)
|
|
784
727
|
}
|
|
785
728
|
} else {
|
|
786
729
|
const showName = getEntityFieldValue(row, keyValueParam.showName)
|
|
@@ -794,10 +737,7 @@ export function getFileList(row, column, isSql) {
|
|
|
794
737
|
export function getDynamicDataSourceOptions(column, isSql, additionalParamMap) {
|
|
795
738
|
let additionalParameter
|
|
796
739
|
if (additionalParamMap) {
|
|
797
|
-
console.log(
|
|
798
|
-
'getDynamicDataSourceOptions--additionalParamMap=',
|
|
799
|
-
additionalParamMap
|
|
800
|
-
)
|
|
740
|
+
console.log('getDynamicDataSourceOptions--additionalParamMap=', additionalParamMap)
|
|
801
741
|
if (additionalParamMap && typeof additionalParamMap === 'object') {
|
|
802
742
|
additionalParameter = JSON.stringify(additionalParamMap)
|
|
803
743
|
} else if (additionalParamMap && additionalParamMap !== '') {
|
|
@@ -806,7 +746,7 @@ export function getDynamicDataSourceOptions(column, isSql, additionalParamMap) {
|
|
|
806
746
|
}
|
|
807
747
|
const options = {
|
|
808
748
|
isSql: isSql,
|
|
809
|
-
additionalParameter: additionalParameter
|
|
749
|
+
additionalParameter: additionalParameter
|
|
810
750
|
}
|
|
811
751
|
// 如果是多选文件类型,需要解析(需要设置临时字段,判断文件还是图片,图片需要预览)
|
|
812
752
|
if (column.valueSetOptions) {
|
|
@@ -814,10 +754,7 @@ export function getDynamicDataSourceOptions(column, isSql, additionalParamMap) {
|
|
|
814
754
|
if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
|
|
815
755
|
options.valueSetOptions = valueSetOptionsObj.valueSetOptions
|
|
816
756
|
}
|
|
817
|
-
if (
|
|
818
|
-
valueSetOptionsObj.dynamicDataSourceCode &&
|
|
819
|
-
valueSetOptionsObj.dynamicDataSourceCode !== ''
|
|
820
|
-
) {
|
|
757
|
+
if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
|
|
821
758
|
options.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
|
|
822
759
|
}
|
|
823
760
|
}
|
|
@@ -826,11 +763,7 @@ export function getDynamicDataSourceOptions(column, isSql, additionalParamMap) {
|
|
|
826
763
|
|
|
827
764
|
// 值设置是否是动态数据源类型的数据源
|
|
828
765
|
export function isDynamicDataSourceSource(column) {
|
|
829
|
-
if (
|
|
830
|
-
column.valueSet &&
|
|
831
|
-
column.valueSet.length > 0 &&
|
|
832
|
-
column.valueSet[0].value === 'dynamicDataSource'
|
|
833
|
-
) {
|
|
766
|
+
if (column.valueSet && column.valueSet.length > 0 && column.valueSet[0].value === 'dynamicDataSource') {
|
|
834
767
|
return true
|
|
835
768
|
} else {
|
|
836
769
|
return false
|
|
@@ -840,11 +773,7 @@ export function isDynamicDataSourceSource(column) {
|
|
|
840
773
|
export function getLastPageNum(total, rowsPerPage) {
|
|
841
774
|
if (total === undefined || total === null || total === 0) {
|
|
842
775
|
return 1
|
|
843
|
-
} else if (
|
|
844
|
-
rowsPerPage === undefined ||
|
|
845
|
-
rowsPerPage === null ||
|
|
846
|
-
rowsPerPage === 0
|
|
847
|
-
) {
|
|
776
|
+
} else if (rowsPerPage === undefined || rowsPerPage === null || rowsPerPage === 0) {
|
|
848
777
|
return 1
|
|
849
778
|
} else {
|
|
850
779
|
return Math.ceil(total / rowsPerPage)
|
|
@@ -852,31 +781,20 @@ export function getLastPageNum(total, rowsPerPage) {
|
|
|
852
781
|
}
|
|
853
782
|
// 纵向滚动条滚动最底部功能
|
|
854
783
|
export function scrollYToBottom(listCode) {
|
|
855
|
-
const scrollDivElement = document.querySelector(
|
|
856
|
-
'.' + listCode + ' .el-table--scrollable-y .el-table__body-wrapper'
|
|
857
|
-
)
|
|
784
|
+
const scrollDivElement = document.querySelector('.' + listCode + ' .el-table--scrollable-y .el-table__body-wrapper')
|
|
858
785
|
console.log('scrollDivElement==', scrollDivElement)
|
|
859
786
|
if (scrollDivElement && scrollDivElement !== null) {
|
|
860
787
|
// 表示有滚动条,需要将滚动条滚动最底部
|
|
861
|
-
console.log(
|
|
862
|
-
'scrollDivElement==scrollDivElement.scrollHeight=',
|
|
863
|
-
scrollDivElement.scrollHeight
|
|
864
|
-
)
|
|
788
|
+
console.log('scrollDivElement==scrollDivElement.scrollHeight=', scrollDivElement.scrollHeight)
|
|
865
789
|
scrollDivElement.scrollTop = scrollDivElement.scrollHeight
|
|
866
790
|
}
|
|
867
791
|
}
|
|
868
792
|
|
|
869
793
|
export function getAdditionalParamMap(gridParams) {
|
|
870
794
|
let additionalParamMap = null
|
|
871
|
-
if (
|
|
872
|
-
gridParams.additionalParamMap &&
|
|
873
|
-
typeof gridParams.additionalParamMap === 'object'
|
|
874
|
-
) {
|
|
795
|
+
if (gridParams.additionalParamMap && typeof gridParams.additionalParamMap === 'object') {
|
|
875
796
|
additionalParamMap = gridParams.additionalParamMap
|
|
876
|
-
} else if (
|
|
877
|
-
gridParams.additionalParamMap &&
|
|
878
|
-
gridParams.additionalParamMap !== ''
|
|
879
|
-
) {
|
|
797
|
+
} else if (gridParams.additionalParamMap && gridParams.additionalParamMap !== '') {
|
|
880
798
|
additionalParamMap = JSON.parse(gridParams.additionalParamMap)
|
|
881
799
|
}
|
|
882
800
|
return additionalParamMap
|
|
@@ -884,7 +802,7 @@ export function getAdditionalParamMap(gridParams) {
|
|
|
884
802
|
|
|
885
803
|
// 获得控件的配置信息,例如:自定义控件的附加配置等
|
|
886
804
|
export function getControlConfig(column) {
|
|
887
|
-
let controlConfig
|
|
805
|
+
let controlConfig = {}
|
|
888
806
|
if (column && column.controlConfig) {
|
|
889
807
|
controlConfig = JSON.parse(column.controlConfig)
|
|
890
808
|
}
|