agilebuilder-ui 1.0.90-tmp18 → 1.0.90-tmp182
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 +48544 -46849
- package/lib/super-ui.umd.cjs +94 -97
- package/package.json +1 -1
- package/packages/fs-upload-list/src/fs-upload-list.vue +2 -2
- package/packages/super-grid/src/apis.js +244 -469
- package/packages/super-grid/src/dynamic-input.vue +21 -50
- package/packages/super-grid/src/formValidatorUtil.js +15 -76
- package/packages/super-grid/src/normal-column-content.vue +88 -46
- package/packages/super-grid/src/normal-column.vue +24 -20
- package/packages/super-grid/src/super-grid.vue +4 -12
- package/packages/super-grid/src/utils.js +5 -18
- package/src/i18n/langs/cn.js +1 -2
- package/src/i18n/langs/en.js +1 -2
|
@@ -441,6 +441,7 @@ import { $emit } from '../../utils/gogocodeTransfer'
|
|
|
441
441
|
import eventBus from './eventBus'
|
|
442
442
|
import { isMobileBrowser } from '../../../src/utils/common-util'
|
|
443
443
|
import { analysisScanValue, setScanAnalysisValue } from './scan-util.ts'
|
|
444
|
+
|
|
444
445
|
export default {
|
|
445
446
|
name: 'DynamicInput',
|
|
446
447
|
components: {
|
|
@@ -464,7 +465,6 @@ export default {
|
|
|
464
465
|
type: Object,
|
|
465
466
|
default: null
|
|
466
467
|
},
|
|
467
|
-
// 下拉选选项集合
|
|
468
468
|
options: {
|
|
469
469
|
type: Array,
|
|
470
470
|
default: null
|
|
@@ -498,11 +498,6 @@ export default {
|
|
|
498
498
|
disabled: {
|
|
499
499
|
type: Boolean,
|
|
500
500
|
default: false
|
|
501
|
-
},
|
|
502
|
-
// 列表配置信息
|
|
503
|
-
gridOptions: {
|
|
504
|
-
type: Object,
|
|
505
|
-
default: null
|
|
506
501
|
}
|
|
507
502
|
},
|
|
508
503
|
data() {
|
|
@@ -712,18 +707,20 @@ export default {
|
|
|
712
707
|
this.setInputNumberConfig()
|
|
713
708
|
}
|
|
714
709
|
// 如果是多选文件类型,需要解析(需要设置临时字段,判断文件还是图片,图片需要预览)
|
|
715
|
-
if (this.column.valueSetOptions
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
710
|
+
if (this.column.valueSetOptions) {
|
|
711
|
+
if (this.column.componentType === 'switch') {
|
|
712
|
+
const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
|
|
713
|
+
if (valueSetOptionsObj) {
|
|
714
|
+
this.valueSetOptions = valueSetOptionsObj
|
|
715
|
+
}
|
|
716
|
+
} else if (this.column.componentType !== 'inputNumber') {
|
|
717
|
+
const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
|
|
718
|
+
if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
|
|
719
|
+
this.valueSetOptions = valueSetOptionsObj.valueSetOptions
|
|
720
|
+
}
|
|
721
|
+
if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
|
|
722
|
+
this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
|
|
723
|
+
}
|
|
727
724
|
}
|
|
728
725
|
}
|
|
729
726
|
if (this.column.orgTreeSet) {
|
|
@@ -740,25 +737,6 @@ export default {
|
|
|
740
737
|
}
|
|
741
738
|
}
|
|
742
739
|
this.getDateAllowTime()
|
|
743
|
-
if(!this.gridOptions.customRules){
|
|
744
|
-
this.gridOptions.customRules = {}
|
|
745
|
-
}
|
|
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
|
-
})
|
|
762
740
|
},
|
|
763
741
|
mounted() {
|
|
764
742
|
// 去掉该监听,否则导致焦点总是跳到第一个编辑框
|
|
@@ -1762,7 +1740,12 @@ export default {
|
|
|
1762
1740
|
},
|
|
1763
1741
|
getSwitchConfig(switchProp) {
|
|
1764
1742
|
if (this.valueSetOptions && this.valueSetOptions[switchProp]) {
|
|
1765
|
-
|
|
1743
|
+
const value = this.valueSetOptions[switchProp]
|
|
1744
|
+
if ('true' === value || 'false' === value) {
|
|
1745
|
+
return 'true' === value
|
|
1746
|
+
} else {
|
|
1747
|
+
return this.valueSetOptions[switchProp]
|
|
1748
|
+
}
|
|
1766
1749
|
} else {
|
|
1767
1750
|
if (switchProp === 'activeValue') {
|
|
1768
1751
|
if (this.dataSourceType === 'mysql') {
|
|
@@ -1814,18 +1797,6 @@ export default {
|
|
|
1814
1797
|
this.isShowBrowserScan = false
|
|
1815
1798
|
this.innerValue = value
|
|
1816
1799
|
this.blurEvent()
|
|
1817
|
-
},
|
|
1818
|
-
packageCustomRules(columnRule) {
|
|
1819
|
-
console.log('packageCustomRules---columnRule=', columnRule)
|
|
1820
|
-
if(!columnRule){
|
|
1821
|
-
return
|
|
1822
|
-
}
|
|
1823
|
-
if(columnRule.disabled !== undefined){
|
|
1824
|
-
this.$emit('change-disabled', columnRule.disabled)
|
|
1825
|
-
}
|
|
1826
|
-
if(columnRule.required !== undefined){
|
|
1827
|
-
this.$emit('change-required', columnRule.required)
|
|
1828
|
-
}
|
|
1829
1800
|
}
|
|
1830
1801
|
}
|
|
1831
1802
|
}
|
|
@@ -87,102 +87,41 @@ function getValidator(listCode) {
|
|
|
87
87
|
}
|
|
88
88
|
const gridParams = store.get(listCode)
|
|
89
89
|
const editFieldInfos = gridParams.columns
|
|
90
|
-
const customRules = gridParams.options.customRules
|
|
91
90
|
const rules = {}
|
|
92
91
|
if (editFieldInfos) {
|
|
93
92
|
editFieldInfos.forEach((editField) => {
|
|
94
|
-
setRules(rules, editField, listCode
|
|
93
|
+
setRules(rules, editField, listCode)
|
|
95
94
|
})
|
|
96
95
|
}
|
|
97
96
|
// console.log('rules', rules)
|
|
98
97
|
return rules
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
function setRules(rules, editField, listCode
|
|
100
|
+
function setRules(rules, editField, listCode) {
|
|
102
101
|
const prop = editField.prop
|
|
103
102
|
if (editField.groupHeader && editField.children && editField.children.length > 0) {
|
|
104
103
|
// 组合表头时或者动态列,递归设置规则,
|
|
105
104
|
editField.children.forEach((child) => {
|
|
106
|
-
setRules(rules, child, listCode
|
|
105
|
+
setRules(rules, child, listCode)
|
|
107
106
|
})
|
|
108
107
|
} else {
|
|
109
|
-
if(prop) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
validations.forEach((item) => {
|
|
116
|
-
if (item.pattern) {
|
|
117
|
-
// 后台传递的是正则字符串,不能直接使用
|
|
118
|
-
item.pattern = new RegExp(item.pattern)
|
|
119
|
-
}
|
|
120
|
-
})
|
|
121
|
-
validations = validations.concat(columnCustomRules)
|
|
122
|
-
console.log('setRules---prop=', prop, 'validations====', validations)
|
|
123
|
-
if (prop.indexOf('.') > 0) {
|
|
124
|
-
setObjectPropRule(editField, rules, validations)
|
|
125
|
-
} else {
|
|
126
|
-
if (validations && validations.length > 0) {
|
|
127
|
-
rules[prop] = [...validations]
|
|
128
|
-
}
|
|
108
|
+
if (prop && editField.validations && !isDisableEdit(prop, listCode)) {
|
|
109
|
+
const validations = JSON.parse(editField.validations)
|
|
110
|
+
validations.forEach((item) => {
|
|
111
|
+
if (item.pattern) {
|
|
112
|
+
// 后台传递的是正则字符串,不能直接使用
|
|
113
|
+
item.pattern = new RegExp(item.pattern)
|
|
129
114
|
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* 获得当前列的自定义校验规则
|
|
136
|
-
* @param {*} editField
|
|
137
|
-
* @param {*} customRules
|
|
138
|
-
* @returns
|
|
139
|
-
*/
|
|
140
|
-
function getColumnCustomRules(editField, customRules) {
|
|
141
|
-
const prop = editField.prop
|
|
142
|
-
let columnCustomRules = []
|
|
143
|
-
let requiredRule
|
|
144
|
-
const allFieldsName = '_all_fields'
|
|
145
|
-
let columnRule
|
|
146
|
-
if(customRules){
|
|
147
|
-
columnRule = customRules[prop]? customRules[prop]: customRules[allFieldsName]
|
|
148
|
-
}
|
|
149
|
-
if(columnRule && (columnRule.required || columnRule.rules)) {
|
|
150
|
-
// 表示配置的必填或其它验证规则时
|
|
151
|
-
const mustFillMsg = getI18n().t('imatrixUIMessage.mustFill', {
|
|
152
|
-
label: editField.label
|
|
153
|
-
})
|
|
154
|
-
columnCustomRules = columnRule.rules? JSON.parse(JSON.stringify(columnRule.rules)): null
|
|
155
|
-
if(columnCustomRules && columnCustomRules.length > 0){
|
|
156
|
-
// 获得必填验证规则
|
|
157
|
-
const requiredRules = columnCustomRules.filter(item=>item.required)
|
|
158
|
-
if(requiredRules && requiredRules.length > 0){
|
|
159
|
-
requiredRule = requiredRules[0]
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if(columnRule.name === allFieldsName && columnCustomRules){
|
|
163
|
-
// 所有字段_all_fields的验证的message更新,补充“label”
|
|
164
|
-
columnCustomRules.forEach(item=>{
|
|
165
|
-
item.message = editField.label + item.message
|
|
166
115
|
})
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
requiredRule = {
|
|
174
|
-
required: true,
|
|
175
|
-
message: mustFillMsg,
|
|
176
|
-
trigger: 'blur'
|
|
116
|
+
if (prop.indexOf('.') > 0) {
|
|
117
|
+
setObjectPropRule(editField, rules, validations)
|
|
118
|
+
} else {
|
|
119
|
+
if (validations && validations.length > 0) {
|
|
120
|
+
rules[prop] = [...validations]
|
|
121
|
+
}
|
|
177
122
|
}
|
|
178
|
-
columnCustomRules.push(requiredRule)
|
|
179
|
-
}
|
|
180
|
-
if(requiredRule && !requiredRule.message) {
|
|
181
|
-
// 如果必填验证规则中message为空时,封装默认的必填验证规则,'_all_fields'可能会为空
|
|
182
|
-
requiredRule.message = mustFillMsg
|
|
183
123
|
}
|
|
184
124
|
}
|
|
185
|
-
return columnCustomRules
|
|
186
125
|
}
|
|
187
126
|
/**
|
|
188
127
|
* 验证实体
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
<dynamic-input
|
|
5
5
|
v-if="(lineEdit.editable && isEditable && row.$editing) || isShowForm"
|
|
6
6
|
v-model:value="row[column.prop]"
|
|
7
|
-
:class="
|
|
7
|
+
:class="isRequired(row.$editing) ? 'm-requried' : ''"
|
|
8
8
|
:column="column"
|
|
9
9
|
:is-sql="isSql"
|
|
10
10
|
:line-edit="lineEdit"
|
|
11
11
|
:list-code="listCode"
|
|
12
12
|
:list-toolbar-form-data="listToolbarFormData"
|
|
13
13
|
:options="column.valueSet"
|
|
14
|
-
:grid-options="options"
|
|
15
14
|
:position="{
|
|
16
15
|
row: rowIndex,
|
|
17
16
|
prop: column.prop
|
|
@@ -29,7 +28,6 @@
|
|
|
29
28
|
@refresPortData="refresPortData"
|
|
30
29
|
@refresPortsData="refresPortsData"
|
|
31
30
|
@change-disabled="changeDisabled"
|
|
32
|
-
@change-required="changeRequired"
|
|
33
31
|
/>
|
|
34
32
|
<span v-else>
|
|
35
33
|
<span v-if="column.operations" class="grid-operation-buttons">
|
|
@@ -72,20 +70,20 @@
|
|
|
72
70
|
</template>
|
|
73
71
|
</el-dropdown>
|
|
74
72
|
<component
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
:is="operation.props.customControl"
|
|
74
|
+
v-else-if="operation.props.customControl"
|
|
75
|
+
v-permission="operation.props.permission"
|
|
76
|
+
:key="column.prop + '_' + rowIndex + '_' + currentPage"
|
|
77
|
+
:disabled="true"
|
|
78
|
+
:row="pageGridData[rowIndex]"
|
|
79
|
+
:entity="pageGridData[rowIndex]"
|
|
80
|
+
:prop="column.prop"
|
|
81
|
+
:parent="parentFormData"
|
|
82
|
+
:row-index="rowIndex"
|
|
83
|
+
:grid-data="gridData"
|
|
84
|
+
:page-grid-data="pageGridData"
|
|
85
|
+
:current-page="currentPage"
|
|
86
|
+
@refresh-list="refreshList"
|
|
89
87
|
/>
|
|
90
88
|
<row-operation
|
|
91
89
|
v-else
|
|
@@ -462,7 +460,6 @@ export default {
|
|
|
462
460
|
data() {
|
|
463
461
|
let parentFormData
|
|
464
462
|
const gridParams = store.get(this.listCode)
|
|
465
|
-
const options = gridParams.options
|
|
466
463
|
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
467
464
|
parentFormData = gridParams.options.extraParam.entityMap
|
|
468
465
|
}
|
|
@@ -477,10 +474,6 @@ export default {
|
|
|
477
474
|
scanEnable = true
|
|
478
475
|
}
|
|
479
476
|
const componentId = this.listCode + '_' + this.column.prop
|
|
480
|
-
let lineEdit
|
|
481
|
-
if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
|
|
482
|
-
lineEdit = gridParams.lineEdit
|
|
483
|
-
}
|
|
484
477
|
return {
|
|
485
478
|
selectRow: null,
|
|
486
479
|
that: this,
|
|
@@ -509,25 +502,80 @@ export default {
|
|
|
509
502
|
scanEnable,
|
|
510
503
|
componentId,
|
|
511
504
|
controlConfig,
|
|
512
|
-
rowLinkConfigMapping: {}
|
|
513
|
-
requiredClass: '',
|
|
514
|
-
lineEdit,
|
|
515
|
-
options
|
|
505
|
+
rowLinkConfigMapping: {}
|
|
516
506
|
}
|
|
517
507
|
},
|
|
518
508
|
computed: {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
509
|
+
filters() {
|
|
510
|
+
if (this.column.filterable) {
|
|
511
|
+
const gridParams = store.get(this.listCode)
|
|
512
|
+
const values = getColumnValues(gridParams.gridData, this.column.prop)
|
|
513
|
+
const filters = []
|
|
514
|
+
for (const value of values) {
|
|
515
|
+
filters.push({
|
|
516
|
+
text: value,
|
|
517
|
+
value
|
|
518
|
+
})
|
|
519
|
+
}
|
|
520
|
+
return filters
|
|
521
|
+
} else {
|
|
522
|
+
return null
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
filterMethod() {
|
|
526
|
+
if (this.column.filterable) {
|
|
527
|
+
return this.filterHandler
|
|
528
|
+
} else {
|
|
529
|
+
return null
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
fixed() {
|
|
533
|
+
if (
|
|
534
|
+
(this.column.fixed && this.column.fixed === 'false') ||
|
|
535
|
+
this.column.fixed === undefined ||
|
|
536
|
+
this.column.fixed === ''
|
|
537
|
+
) {
|
|
538
|
+
return false
|
|
539
|
+
}
|
|
540
|
+
if (this.column.prop === 'operation' && this.column.fixed && this.column.fixed === 'left') {
|
|
541
|
+
// 操作列居右固定
|
|
542
|
+
return 'right'
|
|
543
|
+
}
|
|
544
|
+
return this.column.fixed
|
|
545
|
+
},
|
|
546
|
+
sortable() {
|
|
547
|
+
const gridParams = store.get(this.listCode)
|
|
548
|
+
if (
|
|
549
|
+
gridParams &&
|
|
550
|
+
gridParams.options &&
|
|
551
|
+
gridParams.options.isFormSubTable &&
|
|
552
|
+
gridParams.options.showOperationButton
|
|
553
|
+
) {
|
|
554
|
+
return false
|
|
555
|
+
}
|
|
556
|
+
if (this.column.sortable === 'false' || this.column.sortable === false || this.column.sortable === '') {
|
|
557
|
+
return false
|
|
558
|
+
} else if (this.column.sortable === 'true' || this.column.sortable === true) {
|
|
559
|
+
return 'custom'
|
|
560
|
+
}
|
|
561
|
+
if (this.column.sortable) {
|
|
562
|
+
return 'custom'
|
|
563
|
+
} else {
|
|
564
|
+
return false
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
lineEdit() {
|
|
568
|
+
let isLineEdit = false
|
|
569
|
+
if (this.listCode) {
|
|
570
|
+
const gridParams = store.get(this.listCode)
|
|
571
|
+
if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
|
|
572
|
+
isLineEdit = gridParams.lineEdit
|
|
573
|
+
} else {
|
|
574
|
+
isLineEdit = false
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return isLineEdit
|
|
578
|
+
},
|
|
531
579
|
|
|
532
580
|
...mapGetters(['preventReclick'])
|
|
533
581
|
},
|
|
@@ -613,7 +661,6 @@ export default {
|
|
|
613
661
|
}
|
|
614
662
|
}
|
|
615
663
|
this.setScanRuleSets()
|
|
616
|
-
this.requiredClass = this.isRequired(this.row.$editing) ? 'm-requried' : ''
|
|
617
664
|
},
|
|
618
665
|
mounted() {
|
|
619
666
|
// 监听保存时点击按钮事件线触发
|
|
@@ -879,7 +926,6 @@ export default {
|
|
|
879
926
|
tableName,
|
|
880
927
|
this.listCode
|
|
881
928
|
)
|
|
882
|
-
debugger
|
|
883
929
|
if (hyperLinkResult.jumpPageSetting && rowIndex !== undefined) {
|
|
884
930
|
this.rowLinkConfigMapping[rowIndex] = hyperLinkResult.jumpPageSetting
|
|
885
931
|
}
|
|
@@ -973,8 +1019,7 @@ export default {
|
|
|
973
1019
|
}
|
|
974
1020
|
},
|
|
975
1021
|
isRequired(editing) {
|
|
976
|
-
|
|
977
|
-
if (!this.isFormSubTable && this.lineEdit && this.lineEdit.editable && this.isEditable && editing && this.column.validations) {
|
|
1022
|
+
if (!this.isFormSubTable && this.lineEdit.editable && this.isEditable && editing && this.column.validations) {
|
|
978
1023
|
if (this.column.validations.indexOf('"required":true') > 0) {
|
|
979
1024
|
return true
|
|
980
1025
|
}
|
|
@@ -1026,9 +1071,6 @@ export default {
|
|
|
1026
1071
|
this.column._scanRuleSets = res
|
|
1027
1072
|
})
|
|
1028
1073
|
}
|
|
1029
|
-
},
|
|
1030
|
-
changeRequired(required) {
|
|
1031
|
-
this.requiredClass = required? 'm-requried' : ''
|
|
1032
1074
|
}
|
|
1033
1075
|
},
|
|
1034
1076
|
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
@@ -1045,7 +1087,7 @@ export default {
|
|
|
1045
1087
|
.m-requried {
|
|
1046
1088
|
float: left;
|
|
1047
1089
|
white-space: nowrap;
|
|
1048
|
-
width:
|
|
1090
|
+
width: 100%;
|
|
1049
1091
|
}
|
|
1050
1092
|
|
|
1051
1093
|
.m-requried::after {
|
|
@@ -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)
|
|
@@ -344,10 +336,6 @@ export default {
|
|
|
344
336
|
return this.column.width ? this.column.width + '' : '130'
|
|
345
337
|
},
|
|
346
338
|
// 设置字段禁止编辑
|
|
347
|
-
fnProhibitToEdit(isEditable) {
|
|
348
|
-
this.$refs[this.column.prop].fnProhibitToEdit(isEditable)
|
|
349
|
-
},
|
|
350
|
-
// 设置字段禁止编辑
|
|
351
339
|
prohibitToEdit(entity) {
|
|
352
340
|
$emit(this, 'prohibitToEdit', entity)
|
|
353
341
|
},
|
|
@@ -362,9 +350,25 @@ export default {
|
|
|
362
350
|
this.$emit('open-page', openPageParams)
|
|
363
351
|
}
|
|
364
352
|
},
|
|
365
|
-
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit'
|
|
353
|
+
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
366
354
|
}
|
|
367
355
|
</script>
|
|
368
356
|
|
|
369
357
|
<style lang="scss" scoped>
|
|
358
|
+
.annex-cell {
|
|
359
|
+
padding-right: 5px;
|
|
360
|
+
cursor: pointer;
|
|
361
|
+
color: #409eff;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.m-requried {
|
|
365
|
+
float: left;
|
|
366
|
+
white-space: nowrap;
|
|
367
|
+
width: 100%;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.m-requried::after {
|
|
371
|
+
content: '*';
|
|
372
|
+
color: #f56c6c;
|
|
373
|
+
}
|
|
370
374
|
</style>
|
|
@@ -3156,10 +3156,7 @@ export default {
|
|
|
3156
3156
|
openFold(isOpen) {
|
|
3157
3157
|
this.resizeTableHeight()
|
|
3158
3158
|
},
|
|
3159
|
-
|
|
3160
|
-
* 设置字段禁止编辑。只能控制禁止编辑。不能控制必填
|
|
3161
|
-
* @param entity 格式如:{'NAME':false,"DYM_COLUMN":true}。表示NAME字段不可编辑,DYM_COLUMN可以被编辑
|
|
3162
|
-
*/
|
|
3159
|
+
// 设置字段禁止编辑
|
|
3163
3160
|
fnProhibitToEdit(entity) {
|
|
3164
3161
|
if (entity) {
|
|
3165
3162
|
if (entity.isForceUpdate) {
|
|
@@ -3177,10 +3174,7 @@ export default {
|
|
|
3177
3174
|
}
|
|
3178
3175
|
}
|
|
3179
3176
|
},
|
|
3180
|
-
|
|
3181
|
-
* 设置字段禁止编辑。只能控制禁止编辑。不能控制必填
|
|
3182
|
-
* @param entity 格式如:{'NAME':false,"DYM_COLUMN":true}。表示NAME字段不可编辑,DYM_COLUMN可以被编辑
|
|
3183
|
-
*/
|
|
3177
|
+
// 设置字段禁止编辑
|
|
3184
3178
|
prohibitToEdit(entity) {
|
|
3185
3179
|
this.fnProhibitToEdit(entity)
|
|
3186
3180
|
},
|
|
@@ -3333,9 +3327,6 @@ export default {
|
|
|
3333
3327
|
},
|
|
3334
3328
|
closeRowForm () {
|
|
3335
3329
|
this.showRowForm = false
|
|
3336
|
-
},
|
|
3337
|
-
testFunc(params){
|
|
3338
|
-
console.log('testFunc-----------------params=', params)
|
|
3339
3330
|
}
|
|
3340
3331
|
},
|
|
3341
3332
|
emits: [
|
|
@@ -3349,7 +3340,8 @@ export default {
|
|
|
3349
3340
|
'un-edit',
|
|
3350
3341
|
'refresMainTableFields',
|
|
3351
3342
|
'refresh',
|
|
3352
|
-
'cancel-search'
|
|
3343
|
+
'cancel-search',
|
|
3344
|
+
,
|
|
3353
3345
|
],
|
|
3354
3346
|
}
|
|
3355
3347
|
</script>
|
|
@@ -262,15 +262,6 @@ export function isDisableEdit(prop, listCode, row) {
|
|
|
262
262
|
isDiabled = true
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
if (isDiabled === false) {
|
|
266
|
-
// 表示不是禁止编辑的,继续校验自定义规则中是否是禁止编辑的
|
|
267
|
-
if(gridParams.options.customRules && (gridParams.options.customRules[prop] || gridParams.options.customRules['_all_fields'])){
|
|
268
|
-
const columnRules = gridParams.options.customRules[prop]? gridParams.options.customRules[prop]: gridParams.options.customRules['_all_fields']
|
|
269
|
-
if(columnRules && columnRules.disabled){
|
|
270
|
-
isDiabled = true
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
265
|
}
|
|
275
266
|
return isDiabled
|
|
276
267
|
}
|
|
@@ -801,9 +792,9 @@ export function getControlConfig(column) {
|
|
|
801
792
|
return controlConfig
|
|
802
793
|
}
|
|
803
794
|
|
|
804
|
-
export function getContentAlign(column, gridParams){
|
|
795
|
+
export function getContentAlign(column, gridParams) {
|
|
805
796
|
let align
|
|
806
|
-
if (
|
|
797
|
+
if (gridParams.options?.align && gridParams.options.align !== '') {
|
|
807
798
|
align = gridParams.options.align
|
|
808
799
|
} else if (column.contAlign && column.contAlign !== '') {
|
|
809
800
|
align = column.contAlign
|
|
@@ -811,20 +802,16 @@ export function getContentAlign(column, gridParams){
|
|
|
811
802
|
return align
|
|
812
803
|
}
|
|
813
804
|
|
|
814
|
-
export function getHeaderAlign(column, gridParams){
|
|
805
|
+
export function getHeaderAlign(column, gridParams) {
|
|
815
806
|
let headerAlign
|
|
816
|
-
if (
|
|
807
|
+
if (gridParams.options?.headerAlign && gridParams.options.headerAlign !== '') {
|
|
817
808
|
headerAlign = gridParams.options.headerAlign
|
|
818
809
|
} else if (column.titleAlign && column.titleAlign !== '') {
|
|
819
810
|
headerAlign = column.titleAlign
|
|
820
|
-
} else {
|
|
821
|
-
// 如果没有配置表头对齐方式,默认使用内容对齐方式
|
|
822
|
-
headerAlign = 'left'
|
|
823
811
|
}
|
|
824
812
|
return headerAlign
|
|
825
813
|
}
|
|
826
814
|
|
|
827
|
-
|
|
828
815
|
export function getHeaderLable(column) {
|
|
829
816
|
let label = column.label
|
|
830
817
|
if (!column.titleValueSet) {
|
|
@@ -840,4 +827,4 @@ export function getHeaderLable(column) {
|
|
|
840
827
|
|
|
841
828
|
function formatHeader(column) {
|
|
842
829
|
return doFormatWithValueSet(column.titleValueSetValue, column.label)
|
|
843
|
-
}
|
|
830
|
+
}
|
package/src/i18n/langs/cn.js
CHANGED
|
@@ -83,8 +83,7 @@ const cn = {
|
|
|
83
83
|
forbiddenExceptionLinkUrl: '请点击进行权限申请',
|
|
84
84
|
forbiddenExceptionLinkUser: '如有疑问请联系',
|
|
85
85
|
uploadFileTip: '上传的文件不超过{fileSize}M',
|
|
86
|
-
asyncExportJumpMsg: '或点击我跳转到下载页面'
|
|
87
|
-
mustFill: '{label} 必须填写'
|
|
86
|
+
asyncExportJumpMsg: '或点击我跳转到下载页面'
|
|
88
87
|
},
|
|
89
88
|
// 列表组件
|
|
90
89
|
superGrid: {
|
package/src/i18n/langs/en.js
CHANGED
|
@@ -85,8 +85,7 @@ const en = {
|
|
|
85
85
|
forbiddenExceptionLinkUrl: 'please click to apply',
|
|
86
86
|
forbiddenExceptionLinkUser: 'if you have any questions,please contact',
|
|
87
87
|
uploadFileTip: 'The file size should lower {fileSize}M',
|
|
88
|
-
asyncExportJumpMsg: 'Or click me to jump to download page.'
|
|
89
|
-
mustFill: '{label} must fill'
|
|
88
|
+
asyncExportJumpMsg: 'Or click me to jump to download page.'
|
|
90
89
|
},
|
|
91
90
|
superGrid: {
|
|
92
91
|
columnConfig: 'Column Config',
|