agilebuilder-ui 1.0.90-tmp185 → 1.0.90-tmp19
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/lib/super-ui.css +1 -1
- package/lib/super-ui.js +47325 -49132
- package/lib/super-ui.umd.cjs +97 -94
- package/package.json +1 -1
- package/packages/super-grid/src/apis.js +410 -244
- package/packages/super-grid/src/dynamic-input.vue +33 -45
- package/packages/super-grid/src/normal-column-content.vue +16 -25
- package/packages/super-grid/src/normal-column.vue +16 -8
- package/packages/super-grid/src/utils.js +9 -5
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
:parent="parentFormData"
|
|
15
15
|
:prop="column.prop"
|
|
16
16
|
:row="row"
|
|
17
|
-
:page-context="gridOptions?.pageContext"
|
|
18
17
|
:row-index="position ? position.row : null"
|
|
19
18
|
:select-options="options"
|
|
20
19
|
:value="innerValue"
|
|
@@ -713,20 +712,18 @@ export default {
|
|
|
713
712
|
this.setInputNumberConfig()
|
|
714
713
|
}
|
|
715
714
|
// 如果是多选文件类型,需要解析(需要设置临时字段,判断文件还是图片,图片需要预览)
|
|
716
|
-
if (this.column.valueSetOptions) {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
|
|
729
|
-
}
|
|
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
|
|
730
727
|
}
|
|
731
728
|
}
|
|
732
729
|
if (this.column.orgTreeSet) {
|
|
@@ -743,29 +740,25 @@ export default {
|
|
|
743
740
|
}
|
|
744
741
|
}
|
|
745
742
|
this.getDateAllowTime()
|
|
746
|
-
if
|
|
743
|
+
if(!this.gridOptions.customRules){
|
|
747
744
|
this.gridOptions.customRules = {}
|
|
748
745
|
}
|
|
749
|
-
this.$watch(
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
immediate: true,
|
|
766
|
-
deep: true
|
|
767
|
-
}
|
|
768
|
-
)
|
|
746
|
+
this.$watch('gridOptions.customRules.'+this.column.prop,
|
|
747
|
+
(newVal, oldVal)=> {
|
|
748
|
+
this.packageCustomRules(newVal)
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
immediate: true,
|
|
752
|
+
deep: true,
|
|
753
|
+
})
|
|
754
|
+
this.$watch('gridOptions.customRules._all_fields',
|
|
755
|
+
(newVal, oldVal)=> {
|
|
756
|
+
this.packageCustomRules(newVal)
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
immediate: true,
|
|
760
|
+
deep: true,
|
|
761
|
+
})
|
|
769
762
|
},
|
|
770
763
|
mounted() {
|
|
771
764
|
// 去掉该监听,否则导致焦点总是跳到第一个编辑框
|
|
@@ -1769,12 +1762,7 @@ export default {
|
|
|
1769
1762
|
},
|
|
1770
1763
|
getSwitchConfig(switchProp) {
|
|
1771
1764
|
if (this.valueSetOptions && this.valueSetOptions[switchProp]) {
|
|
1772
|
-
|
|
1773
|
-
if ('true' === value || 'false' === value) {
|
|
1774
|
-
return 'true' === value
|
|
1775
|
-
} else {
|
|
1776
|
-
return this.valueSetOptions[switchProp]
|
|
1777
|
-
}
|
|
1765
|
+
return this.valueSetOptions[switchProp]
|
|
1778
1766
|
} else {
|
|
1779
1767
|
if (switchProp === 'activeValue') {
|
|
1780
1768
|
if (this.dataSourceType === 'mysql') {
|
|
@@ -1829,13 +1817,13 @@ export default {
|
|
|
1829
1817
|
},
|
|
1830
1818
|
packageCustomRules(columnRule) {
|
|
1831
1819
|
console.log('packageCustomRules---columnRule=', columnRule)
|
|
1832
|
-
if
|
|
1820
|
+
if(!columnRule){
|
|
1833
1821
|
return
|
|
1834
1822
|
}
|
|
1835
|
-
if
|
|
1823
|
+
if(columnRule.disabled !== undefined){
|
|
1836
1824
|
this.$emit('change-disabled', columnRule.disabled)
|
|
1837
1825
|
}
|
|
1838
|
-
if
|
|
1826
|
+
if(columnRule.required !== undefined){
|
|
1839
1827
|
this.$emit('change-required', columnRule.required)
|
|
1840
1828
|
}
|
|
1841
1829
|
}
|
|
@@ -72,20 +72,20 @@
|
|
|
72
72
|
</template>
|
|
73
73
|
</el-dropdown>
|
|
74
74
|
<component
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
:is="operation.props.customControl"
|
|
76
|
+
v-else-if="operation.props.customControl"
|
|
77
|
+
v-permission="operation.props.permission"
|
|
78
|
+
:key="column.prop+'_'+rowIndex+'_'+currentPage"
|
|
79
|
+
:disabled="true"
|
|
80
|
+
:row="pageGridData[rowIndex]"
|
|
81
|
+
:entity="pageGridData[rowIndex]"
|
|
82
|
+
:prop="column.prop"
|
|
83
|
+
:parent="parentFormData"
|
|
84
|
+
:row-index="rowIndex"
|
|
85
|
+
:grid-data="gridData"
|
|
86
|
+
:page-grid-data="pageGridData"
|
|
87
|
+
:current-page="currentPage"
|
|
88
|
+
@refresh-list="refreshList"
|
|
89
89
|
/>
|
|
90
90
|
<row-operation
|
|
91
91
|
v-else
|
|
@@ -119,7 +119,6 @@
|
|
|
119
119
|
:value="getCellValue(row)"
|
|
120
120
|
:additional-param-map="additionalParamMap"
|
|
121
121
|
:additional-settings="additionalSettings"
|
|
122
|
-
:pageContext="options.pageContext"
|
|
123
122
|
/>
|
|
124
123
|
</span>
|
|
125
124
|
<!-- 自定义格式的时候 -->
|
|
@@ -156,7 +155,6 @@
|
|
|
156
155
|
:listCode="listCode"
|
|
157
156
|
:component-id="componentId"
|
|
158
157
|
:additional-settings="additionalSettings"
|
|
159
|
-
:pageContext="options.pageContext"
|
|
160
158
|
@prohibitToEdit="prohibitToEdit"
|
|
161
159
|
@refresh-list="refreshList"
|
|
162
160
|
/></span>
|
|
@@ -976,14 +974,7 @@ export default {
|
|
|
976
974
|
},
|
|
977
975
|
isRequired(editing) {
|
|
978
976
|
console.log('isRequired---this.lineEdit=', this.lineEdit)
|
|
979
|
-
if (
|
|
980
|
-
!this.isFormSubTable &&
|
|
981
|
-
this.lineEdit &&
|
|
982
|
-
this.lineEdit.editable &&
|
|
983
|
-
this.isEditable &&
|
|
984
|
-
editing &&
|
|
985
|
-
this.column.validations
|
|
986
|
-
) {
|
|
977
|
+
if (!this.isFormSubTable && this.lineEdit && this.lineEdit.editable && this.isEditable && editing && this.column.validations) {
|
|
987
978
|
if (this.column.validations.indexOf('"required":true') > 0) {
|
|
988
979
|
return true
|
|
989
980
|
}
|
|
@@ -1037,7 +1028,7 @@ export default {
|
|
|
1037
1028
|
}
|
|
1038
1029
|
},
|
|
1039
1030
|
changeRequired(required) {
|
|
1040
|
-
this.requiredClass = required
|
|
1031
|
+
this.requiredClass = required? 'm-requried' : ''
|
|
1041
1032
|
}
|
|
1042
1033
|
},
|
|
1043
1034
|
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:width="getColumnWidth()"
|
|
12
12
|
>
|
|
13
13
|
<template v-slot:header>
|
|
14
|
-
<span v-if="!column.customHeader" :class="{
|
|
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
|
-
|
|
30
|
+
<!-- :pagination="pagination" -->
|
|
31
31
|
<NormalColumnContent
|
|
32
32
|
:ref="column.prop"
|
|
33
33
|
:is-sql="isSql"
|
|
@@ -63,7 +63,13 @@
|
|
|
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 {
|
|
66
|
+
import {
|
|
67
|
+
getColumnValues,
|
|
68
|
+
isRequiredEdit,
|
|
69
|
+
getContentAlign,
|
|
70
|
+
getHeaderAlign,
|
|
71
|
+
getHeaderLable
|
|
72
|
+
} from './utils'
|
|
67
73
|
import DynamicInput from './dynamic-input.vue'
|
|
68
74
|
import store from './store'
|
|
69
75
|
import customFormatter from './custom-formatter'
|
|
@@ -278,7 +284,7 @@ export default {
|
|
|
278
284
|
}
|
|
279
285
|
const align = getContentAlign(this.column, gridParams)
|
|
280
286
|
if (align) {
|
|
281
|
-
this.align = align
|
|
287
|
+
this.align = gridParams.options.align
|
|
282
288
|
}
|
|
283
289
|
const headerAlign = getHeaderAlign(this.column, gridParams)
|
|
284
290
|
if (headerAlign) {
|
|
@@ -296,8 +302,10 @@ export default {
|
|
|
296
302
|
gridParams.options &&
|
|
297
303
|
gridParams.options.showOperationButton
|
|
298
304
|
},
|
|
299
|
-
mounted() {
|
|
300
|
-
|
|
305
|
+
mounted() {
|
|
306
|
+
},
|
|
307
|
+
unmounted() {
|
|
308
|
+
},
|
|
301
309
|
methods: {
|
|
302
310
|
...customFormatter,
|
|
303
311
|
...apis,
|
|
@@ -315,7 +323,7 @@ export default {
|
|
|
315
323
|
$emit(this, 'refresPortData', port, value, index)
|
|
316
324
|
},
|
|
317
325
|
refresPortsData(map, index) {
|
|
318
|
-
|
|
326
|
+
$emit(this, 'refresPortsData', map, index)
|
|
319
327
|
},
|
|
320
328
|
refresMainTableFields(map) {
|
|
321
329
|
$emit(this, 'refresMainTableFields', map)
|
|
@@ -354,7 +362,7 @@ export default {
|
|
|
354
362
|
this.$emit('open-page', openPageParams)
|
|
355
363
|
}
|
|
356
364
|
},
|
|
357
|
-
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
365
|
+
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit',]
|
|
358
366
|
}
|
|
359
367
|
</script>
|
|
360
368
|
|
|
@@ -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 (
|
|
806
|
+
if (typeof gridParams.options.align !== 'undefined') {
|
|
807
807
|
align = gridParams.options.align
|
|
808
808
|
} else if (column.contAlign && column.contAlign !== '') {
|
|
809
809
|
align = column.contAlign
|
|
@@ -811,16 +811,20 @@ 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 (
|
|
816
|
+
if (typeof gridParams.options.headerAlign !== 'undefined') {
|
|
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'
|
|
820
823
|
}
|
|
821
824
|
return headerAlign
|
|
822
825
|
}
|
|
823
826
|
|
|
827
|
+
|
|
824
828
|
export function getHeaderLable(column) {
|
|
825
829
|
let label = column.label
|
|
826
830
|
if (!column.titleValueSet) {
|
|
@@ -836,4 +840,4 @@ export function getHeaderLable(column) {
|
|
|
836
840
|
|
|
837
841
|
function formatHeader(column) {
|
|
838
842
|
return doFormatWithValueSet(column.titleValueSetValue, column.label)
|
|
839
|
-
}
|
|
843
|
+
}
|