agilebuilder-ui 1.0.90-tmp18 → 1.0.90-tmp1811
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 +48482 -46682
- package/lib/super-ui.umd.cjs +94 -97
- package/package.json +1 -1
- package/packages/super-grid/src/apis.js +244 -390
- package/packages/super-grid/src/dynamic-input.vue +45 -33
- package/packages/super-grid/src/formValidatorUtil.js +0 -2
- package/packages/super-grid/src/normal-column-content.vue +2 -0
- package/packages/super-grid/src/normal-column.vue +8 -16
- package/packages/super-grid/src/super-grid.vue +0 -3
- package/packages/super-grid/src/utils.js +5 -9
- package/src/utils/util.js +716 -767
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
:additional-param-map="additionalParamMap"
|
|
21
21
|
:listCode="listCode"
|
|
22
22
|
:component-id="componentId"
|
|
23
|
+
:page-context="pageContext"
|
|
23
24
|
@change="cellEvent('change', $event)"
|
|
24
25
|
@input="cellEvent('input', $event)"
|
|
25
26
|
/>
|
|
@@ -712,18 +713,20 @@ export default {
|
|
|
712
713
|
this.setInputNumberConfig()
|
|
713
714
|
}
|
|
714
715
|
// 如果是多选文件类型,需要解析(需要设置临时字段,判断文件还是图片,图片需要预览)
|
|
715
|
-
if (this.column.valueSetOptions
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
716
|
+
if (this.column.valueSetOptions) {
|
|
717
|
+
if (this.column.componentType === 'switch') {
|
|
718
|
+
const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
|
|
719
|
+
if (valueSetOptionsObj) {
|
|
720
|
+
this.valueSetOptions = valueSetOptionsObj
|
|
721
|
+
}
|
|
722
|
+
} else if (this.column.componentType !== 'inputNumber') {
|
|
723
|
+
const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
|
|
724
|
+
if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
|
|
725
|
+
this.valueSetOptions = valueSetOptionsObj.valueSetOptions
|
|
726
|
+
}
|
|
727
|
+
if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
|
|
728
|
+
this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
|
|
729
|
+
}
|
|
727
730
|
}
|
|
728
731
|
}
|
|
729
732
|
if (this.column.orgTreeSet) {
|
|
@@ -740,25 +743,29 @@ export default {
|
|
|
740
743
|
}
|
|
741
744
|
}
|
|
742
745
|
this.getDateAllowTime()
|
|
743
|
-
if(!this.gridOptions.customRules){
|
|
746
|
+
if (!this.gridOptions.customRules) {
|
|
744
747
|
this.gridOptions.customRules = {}
|
|
745
748
|
}
|
|
746
|
-
this.$watch(
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
749
|
+
this.$watch(
|
|
750
|
+
'gridOptions.customRules.' + this.column.prop,
|
|
751
|
+
(newVal, oldVal) => {
|
|
752
|
+
this.packageCustomRules(newVal)
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
immediate: true,
|
|
756
|
+
deep: true
|
|
757
|
+
}
|
|
758
|
+
)
|
|
759
|
+
this.$watch(
|
|
760
|
+
'gridOptions.customRules._all_fields',
|
|
761
|
+
(newVal, oldVal) => {
|
|
762
|
+
this.packageCustomRules(newVal)
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
immediate: true,
|
|
766
|
+
deep: true
|
|
767
|
+
}
|
|
768
|
+
)
|
|
762
769
|
},
|
|
763
770
|
mounted() {
|
|
764
771
|
// 去掉该监听,否则导致焦点总是跳到第一个编辑框
|
|
@@ -1762,7 +1769,12 @@ export default {
|
|
|
1762
1769
|
},
|
|
1763
1770
|
getSwitchConfig(switchProp) {
|
|
1764
1771
|
if (this.valueSetOptions && this.valueSetOptions[switchProp]) {
|
|
1765
|
-
|
|
1772
|
+
const value = this.valueSetOptions[switchProp]
|
|
1773
|
+
if ('true' === value || 'false' === value) {
|
|
1774
|
+
return 'true' === value
|
|
1775
|
+
} else {
|
|
1776
|
+
return this.valueSetOptions[switchProp]
|
|
1777
|
+
}
|
|
1766
1778
|
} else {
|
|
1767
1779
|
if (switchProp === 'activeValue') {
|
|
1768
1780
|
if (this.dataSourceType === 'mysql') {
|
|
@@ -1817,13 +1829,13 @@ export default {
|
|
|
1817
1829
|
},
|
|
1818
1830
|
packageCustomRules(columnRule) {
|
|
1819
1831
|
console.log('packageCustomRules---columnRule=', columnRule)
|
|
1820
|
-
if(!columnRule){
|
|
1832
|
+
if (!columnRule) {
|
|
1821
1833
|
return
|
|
1822
1834
|
}
|
|
1823
|
-
if(columnRule.disabled !== undefined){
|
|
1835
|
+
if (columnRule.disabled !== undefined) {
|
|
1824
1836
|
this.$emit('change-disabled', columnRule.disabled)
|
|
1825
1837
|
}
|
|
1826
|
-
if(columnRule.required !== undefined){
|
|
1838
|
+
if (columnRule.required !== undefined) {
|
|
1827
1839
|
this.$emit('change-required', columnRule.required)
|
|
1828
1840
|
}
|
|
1829
1841
|
}
|
|
@@ -109,7 +109,6 @@ function setRules(rules, editField, listCode, customRules) {
|
|
|
109
109
|
if(prop) {
|
|
110
110
|
// 获得当前列的自定义校验规则
|
|
111
111
|
const columnCustomRules = getColumnCustomRules(editField, customRules)
|
|
112
|
-
console.log('setRules---prop=', prop, 'columnCustomRules====', columnCustomRules)
|
|
113
112
|
if ((columnCustomRules || editField.validations) && !isDisableEdit(prop, listCode)) {
|
|
114
113
|
let validations = editField.validations? JSON.parse(editField.validations): []
|
|
115
114
|
validations.forEach((item) => {
|
|
@@ -119,7 +118,6 @@ function setRules(rules, editField, listCode, customRules) {
|
|
|
119
118
|
}
|
|
120
119
|
})
|
|
121
120
|
validations = validations.concat(columnCustomRules)
|
|
122
|
-
console.log('setRules---prop=', prop, 'validations====', validations)
|
|
123
121
|
if (prop.indexOf('.') > 0) {
|
|
124
122
|
setObjectPropRule(editField, rules, validations)
|
|
125
123
|
} else {
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
:value="getCellValue(row)"
|
|
120
120
|
:additional-param-map="additionalParamMap"
|
|
121
121
|
:additional-settings="additionalSettings"
|
|
122
|
+
:page-context="options?.pageContext"
|
|
122
123
|
/>
|
|
123
124
|
</span>
|
|
124
125
|
<!-- 自定义格式的时候 -->
|
|
@@ -155,6 +156,7 @@
|
|
|
155
156
|
:listCode="listCode"
|
|
156
157
|
:component-id="componentId"
|
|
157
158
|
:additional-settings="additionalSettings"
|
|
159
|
+
:page-context="options?.pageContext"
|
|
158
160
|
@prohibitToEdit="prohibitToEdit"
|
|
159
161
|
@refresh-list="refreshList"
|
|
160
162
|
/></span>
|
|
@@ -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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
|
|
@@ -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 (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 (
|
|
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
|
+
}
|