agilebuilder-ui 1.0.90-temp5 → 1.0.90-tmp1
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 +46681 -48462
- package/lib/super-ui.umd.cjs +97 -94
- package/package.json +1 -1
- package/packages/super-grid/src/apis.js +72 -0
- package/packages/super-grid/src/dynamic-input.vue +56 -25
- package/packages/super-grid/src/normal-column-content.vue +14 -60
- package/packages/super-grid/src/normal-column.vue +26 -11
- package/packages/super-grid/src/super-grid.vue +12 -4
- package/packages/super-grid/src/utils.js +18 -5
package/package.json
CHANGED
|
@@ -1413,6 +1413,78 @@ const apis = {
|
|
|
1413
1413
|
const gridParams = store.get(listCode)
|
|
1414
1414
|
gridParams.options['subTableData'] = null
|
|
1415
1415
|
this.fetchListData()
|
|
1416
|
+
},
|
|
1417
|
+
/**
|
|
1418
|
+
* v10 行编辑时动态控制字段的编辑权限
|
|
1419
|
+
* @param pageContext 页面解析的上下文对象
|
|
1420
|
+
* @param customRules 格式如下:
|
|
1421
|
+
* [
|
|
1422
|
+
{
|
|
1423
|
+
name: '_all_fields', // _all_fields 表示所有字段
|
|
1424
|
+
disabled: true,
|
|
1425
|
+
required: true,
|
|
1426
|
+
rules: [
|
|
1427
|
+
{
|
|
1428
|
+
required: true,
|
|
1429
|
+
trigger: 'blur'
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
type: 'email',
|
|
1433
|
+
trigger: ['blur', 'change']
|
|
1434
|
+
}
|
|
1435
|
+
]
|
|
1436
|
+
},
|
|
1437
|
+
{
|
|
1438
|
+
name: 'xxxx',
|
|
1439
|
+
disabled: true,
|
|
1440
|
+
required: true,
|
|
1441
|
+
rules: [
|
|
1442
|
+
{
|
|
1443
|
+
required: true,
|
|
1444
|
+
message: 'Please input email address',
|
|
1445
|
+
trigger: 'blur'
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
type: 'email',
|
|
1449
|
+
message: 'Please input correct email address',
|
|
1450
|
+
trigger: ['blur', 'change']
|
|
1451
|
+
}
|
|
1452
|
+
]
|
|
1453
|
+
}
|
|
1454
|
+
]
|
|
1455
|
+
*/
|
|
1456
|
+
dynamicControlTableEdit(pageContext, customRules){
|
|
1457
|
+
console.log('dynamicControlTableEdit----customRules-----', customRules)
|
|
1458
|
+
if(!customRules){
|
|
1459
|
+
return
|
|
1460
|
+
}
|
|
1461
|
+
let gridCustomRules = {}
|
|
1462
|
+
if(this.options.customRules){
|
|
1463
|
+
gridCustomRules = JSON.parse(JSON.stringify(this.options.customRules))
|
|
1464
|
+
}
|
|
1465
|
+
customRules.forEach(item=>{
|
|
1466
|
+
const copyItem = JSON.parse(JSON.stringify(item))
|
|
1467
|
+
const prop = item.name
|
|
1468
|
+
// 当前列新的自定义规则集合
|
|
1469
|
+
let columnRules
|
|
1470
|
+
if(!gridCustomRules[prop]){
|
|
1471
|
+
gridCustomRules[prop] = {}
|
|
1472
|
+
} else {
|
|
1473
|
+
// 获得当前列已有的自定义规则集合
|
|
1474
|
+
columnRules = gridCustomRules[prop].rules
|
|
1475
|
+
}
|
|
1476
|
+
if(copyItem.rules){
|
|
1477
|
+
if(!columnRules){
|
|
1478
|
+
columnRules = []
|
|
1479
|
+
}
|
|
1480
|
+
// 将当前列自定义规则集合拼接到已有的自定义规则集合中
|
|
1481
|
+
columnRules = columnRules.concat(copyItem.rules)
|
|
1482
|
+
}
|
|
1483
|
+
// 当前列总的自定义规则更新
|
|
1484
|
+
copyItem.rules = columnRules
|
|
1485
|
+
this.options.customRules[prop] = copyItem
|
|
1486
|
+
})
|
|
1487
|
+
console.log('dynamicControlTableEdit----this.options-----', this.options)
|
|
1416
1488
|
}
|
|
1417
1489
|
}
|
|
1418
1490
|
export default apis
|
|
@@ -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
|
+
import restfulInterfaceVue from '../../../../agilebuilder-private-lib/packages/restful-interface/src/restful-interface.vue'
|
|
444
445
|
|
|
445
446
|
export default {
|
|
446
447
|
name: 'DynamicInput',
|
|
@@ -465,6 +466,7 @@ export default {
|
|
|
465
466
|
type: Object,
|
|
466
467
|
default: null
|
|
467
468
|
},
|
|
469
|
+
// 下拉选选项集合
|
|
468
470
|
options: {
|
|
469
471
|
type: Array,
|
|
470
472
|
default: null
|
|
@@ -498,6 +500,11 @@ export default {
|
|
|
498
500
|
disabled: {
|
|
499
501
|
type: Boolean,
|
|
500
502
|
default: false
|
|
503
|
+
},
|
|
504
|
+
// 列表配置信息
|
|
505
|
+
gridOptions: {
|
|
506
|
+
type: Object,
|
|
507
|
+
default: null
|
|
501
508
|
}
|
|
502
509
|
},
|
|
503
510
|
data() {
|
|
@@ -707,20 +714,18 @@ export default {
|
|
|
707
714
|
this.setInputNumberConfig()
|
|
708
715
|
}
|
|
709
716
|
// 如果是多选文件类型,需要解析(需要设置临时字段,判断文件还是图片,图片需要预览)
|
|
710
|
-
if (this.column.valueSetOptions) {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
|
|
723
|
-
}
|
|
717
|
+
if (this.column.valueSetOptions && this.column.componentType !== 'inputNumber') {
|
|
718
|
+
const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
|
|
719
|
+
if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
|
|
720
|
+
this.valueSetOptions = valueSetOptionsObj.valueSetOptions
|
|
721
|
+
}
|
|
722
|
+
if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
|
|
723
|
+
this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
|
|
724
|
+
}
|
|
725
|
+
} else if (this.column.componentType === 'switch' && this.column.valueSetOptions) {
|
|
726
|
+
const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
|
|
727
|
+
if (valueSetOptionsObj) {
|
|
728
|
+
this.valueSetOptions = valueSetOptionsObj
|
|
724
729
|
}
|
|
725
730
|
}
|
|
726
731
|
if (this.column.orgTreeSet) {
|
|
@@ -737,6 +742,25 @@ export default {
|
|
|
737
742
|
}
|
|
738
743
|
}
|
|
739
744
|
this.getDateAllowTime()
|
|
745
|
+
if(!this.gridOptions.customRules){
|
|
746
|
+
this.gridOptions.customRules = {}
|
|
747
|
+
}
|
|
748
|
+
this.watch('gridOptions.customRules.'+this.column.prop,
|
|
749
|
+
(newVal, oldVal)=> {
|
|
750
|
+
this.packageCustomRules()
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
immediate: true,
|
|
754
|
+
deep: true,
|
|
755
|
+
})
|
|
756
|
+
this.watch('gridOptions.customRules._all_fields',
|
|
757
|
+
(newVal, oldVal)=> {
|
|
758
|
+
this.packageCustomRules()
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
immediate: true,
|
|
762
|
+
deep: true,
|
|
763
|
+
})
|
|
740
764
|
},
|
|
741
765
|
mounted() {
|
|
742
766
|
// 去掉该监听,否则导致焦点总是跳到第一个编辑框
|
|
@@ -1659,11 +1683,6 @@ export default {
|
|
|
1659
1683
|
setEntityFieldValue(this.row, this.column.prop, numberValue)
|
|
1660
1684
|
return numberValue
|
|
1661
1685
|
}
|
|
1662
|
-
if (this.column.dataType === 'BOOLEAN') {
|
|
1663
|
-
if ('true' === val || 'false' === val) {
|
|
1664
|
-
return 'true' === val
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
1686
|
}
|
|
1668
1687
|
return val
|
|
1669
1688
|
},
|
|
@@ -1745,12 +1764,7 @@ export default {
|
|
|
1745
1764
|
},
|
|
1746
1765
|
getSwitchConfig(switchProp) {
|
|
1747
1766
|
if (this.valueSetOptions && this.valueSetOptions[switchProp]) {
|
|
1748
|
-
|
|
1749
|
-
if ('true' === value || 'false' === value) {
|
|
1750
|
-
return 'true' === value
|
|
1751
|
-
} else {
|
|
1752
|
-
return this.valueSetOptions[switchProp]
|
|
1753
|
-
}
|
|
1767
|
+
return this.valueSetOptions[switchProp]
|
|
1754
1768
|
} else {
|
|
1755
1769
|
if (switchProp === 'activeValue') {
|
|
1756
1770
|
if (this.dataSourceType === 'mysql') {
|
|
@@ -1802,6 +1816,23 @@ export default {
|
|
|
1802
1816
|
this.isShowBrowserScan = false
|
|
1803
1817
|
this.innerValue = value
|
|
1804
1818
|
this.blurEvent()
|
|
1819
|
+
},
|
|
1820
|
+
packageCustomRules() {
|
|
1821
|
+
if(!this.options.customRules){
|
|
1822
|
+
return
|
|
1823
|
+
}
|
|
1824
|
+
const columnRules = this.options.customRules.filter(item=>item.name===this.column.prop || item.name === '_all_fields')
|
|
1825
|
+
if(columnRules && columnRules.length > 0) {
|
|
1826
|
+
for(let i = 0; i< columnRules.length; i++) {
|
|
1827
|
+
const columnRule = columnRules[i]
|
|
1828
|
+
if(columnRule.disabled !== undefined){
|
|
1829
|
+
this.$emit('change-disabled', columnRule.disabled)
|
|
1830
|
+
}
|
|
1831
|
+
if(columnRule.required !== undefined){
|
|
1832
|
+
this.$emit('change-required', columnRule.required)
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1805
1836
|
}
|
|
1806
1837
|
}
|
|
1807
1838
|
}
|
|
@@ -4,13 +4,14 @@
|
|
|
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="requiredClass"
|
|
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"
|
|
14
15
|
:position="{
|
|
15
16
|
row: rowIndex,
|
|
16
17
|
prop: column.prop
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
@refresPortData="refresPortData"
|
|
29
30
|
@refresPortsData="refresPortsData"
|
|
30
31
|
@change-disabled="changeDisabled"
|
|
32
|
+
@change-required="changeRequired"
|
|
31
33
|
/>
|
|
32
34
|
<span v-else>
|
|
33
35
|
<span v-if="column.operations" class="grid-operation-buttons">
|
|
@@ -455,6 +457,11 @@ export default {
|
|
|
455
457
|
isShowForm: {
|
|
456
458
|
type: Boolean,
|
|
457
459
|
default: false
|
|
460
|
+
},
|
|
461
|
+
// 列表配置信息
|
|
462
|
+
options: {
|
|
463
|
+
type: Object,
|
|
464
|
+
default: null
|
|
458
465
|
}
|
|
459
466
|
},
|
|
460
467
|
data() {
|
|
@@ -474,6 +481,7 @@ export default {
|
|
|
474
481
|
scanEnable = true
|
|
475
482
|
}
|
|
476
483
|
const componentId = this.listCode + '_' + this.column.prop
|
|
484
|
+
const requiredClass = this.isRequired(this.row.$editing) ? 'm-requried' : ''
|
|
477
485
|
return {
|
|
478
486
|
selectRow: null,
|
|
479
487
|
that: this,
|
|
@@ -502,68 +510,11 @@ export default {
|
|
|
502
510
|
scanEnable,
|
|
503
511
|
componentId,
|
|
504
512
|
controlConfig,
|
|
505
|
-
rowLinkConfigMapping: {}
|
|
513
|
+
rowLinkConfigMapping: {},
|
|
514
|
+
requiredClass
|
|
506
515
|
}
|
|
507
516
|
},
|
|
508
517
|
computed: {
|
|
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
518
|
lineEdit() {
|
|
568
519
|
let isLineEdit = false
|
|
569
520
|
if (this.listCode) {
|
|
@@ -1072,6 +1023,9 @@ export default {
|
|
|
1072
1023
|
this.column._scanRuleSets = res
|
|
1073
1024
|
})
|
|
1074
1025
|
}
|
|
1026
|
+
},
|
|
1027
|
+
changeRequired(required) {
|
|
1028
|
+
this.requiredClass = required? 'm-requried' : ''
|
|
1075
1029
|
}
|
|
1076
1030
|
},
|
|
1077
1031
|
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'
|
|
@@ -140,12 +146,16 @@ export default {
|
|
|
140
146
|
listToolbarFormData: {
|
|
141
147
|
type: Object,
|
|
142
148
|
default: null
|
|
149
|
+
},
|
|
150
|
+
// 列表配置信息
|
|
151
|
+
options: {
|
|
152
|
+
type: Object,
|
|
153
|
+
default: null
|
|
143
154
|
}
|
|
144
155
|
},
|
|
145
156
|
data() {
|
|
146
157
|
let parentFormData
|
|
147
158
|
const gridParams = store.get(this.listCode)
|
|
148
|
-
const options = gridParams.options
|
|
149
159
|
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
150
160
|
parentFormData = gridParams.options.extraParam.entityMap
|
|
151
161
|
}
|
|
@@ -159,8 +169,7 @@ export default {
|
|
|
159
169
|
subTableCanAdd: true, // 表单子表时是否有新增权限
|
|
160
170
|
isShowAdd: false, // 是否显示表头的新增按钮
|
|
161
171
|
cellWidth: null,
|
|
162
|
-
parentFormData
|
|
163
|
-
options
|
|
172
|
+
parentFormData
|
|
164
173
|
}
|
|
165
174
|
},
|
|
166
175
|
computed: {
|
|
@@ -278,7 +287,7 @@ export default {
|
|
|
278
287
|
}
|
|
279
288
|
const align = getContentAlign(this.column, gridParams)
|
|
280
289
|
if (align) {
|
|
281
|
-
this.align = align
|
|
290
|
+
this.align = gridParams.options.align
|
|
282
291
|
}
|
|
283
292
|
const headerAlign = getHeaderAlign(this.column, gridParams)
|
|
284
293
|
if (headerAlign) {
|
|
@@ -296,8 +305,10 @@ export default {
|
|
|
296
305
|
gridParams.options &&
|
|
297
306
|
gridParams.options.showOperationButton
|
|
298
307
|
},
|
|
299
|
-
mounted() {
|
|
300
|
-
|
|
308
|
+
mounted() {
|
|
309
|
+
},
|
|
310
|
+
unmounted() {
|
|
311
|
+
},
|
|
301
312
|
methods: {
|
|
302
313
|
...customFormatter,
|
|
303
314
|
...apis,
|
|
@@ -315,7 +326,7 @@ export default {
|
|
|
315
326
|
$emit(this, 'refresPortData', port, value, index)
|
|
316
327
|
},
|
|
317
328
|
refresPortsData(map, index) {
|
|
318
|
-
|
|
329
|
+
$emit(this, 'refresPortsData', map, index)
|
|
319
330
|
},
|
|
320
331
|
refresMainTableFields(map) {
|
|
321
332
|
$emit(this, 'refresMainTableFields', map)
|
|
@@ -336,6 +347,10 @@ export default {
|
|
|
336
347
|
return this.column.width ? this.column.width + '' : '130'
|
|
337
348
|
},
|
|
338
349
|
// 设置字段禁止编辑
|
|
350
|
+
fnProhibitToEdit(isEditable) {
|
|
351
|
+
this.$refs[this.column.prop].fnProhibitToEdit(isEditable)
|
|
352
|
+
},
|
|
353
|
+
// 设置字段禁止编辑
|
|
339
354
|
prohibitToEdit(entity) {
|
|
340
355
|
$emit(this, 'prohibitToEdit', entity)
|
|
341
356
|
},
|
|
@@ -350,7 +365,7 @@ export default {
|
|
|
350
365
|
this.$emit('open-page', openPageParams)
|
|
351
366
|
}
|
|
352
367
|
},
|
|
353
|
-
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
368
|
+
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit',]
|
|
354
369
|
}
|
|
355
370
|
</script>
|
|
356
371
|
|
|
@@ -3156,7 +3156,10 @@ export default {
|
|
|
3156
3156
|
openFold(isOpen) {
|
|
3157
3157
|
this.resizeTableHeight()
|
|
3158
3158
|
},
|
|
3159
|
-
|
|
3159
|
+
/**
|
|
3160
|
+
* 设置字段禁止编辑。只能控制禁止编辑。不能控制必填
|
|
3161
|
+
* @param entity 格式如:{'NAME':false,"DYM_COLUMN":true}。表示NAME字段不可编辑,DYM_COLUMN可以被编辑
|
|
3162
|
+
*/
|
|
3160
3163
|
fnProhibitToEdit(entity) {
|
|
3161
3164
|
if (entity) {
|
|
3162
3165
|
if (entity.isForceUpdate) {
|
|
@@ -3174,7 +3177,10 @@ export default {
|
|
|
3174
3177
|
}
|
|
3175
3178
|
}
|
|
3176
3179
|
},
|
|
3177
|
-
|
|
3180
|
+
/**
|
|
3181
|
+
* 设置字段禁止编辑。只能控制禁止编辑。不能控制必填
|
|
3182
|
+
* @param entity 格式如:{'NAME':false,"DYM_COLUMN":true}。表示NAME字段不可编辑,DYM_COLUMN可以被编辑
|
|
3183
|
+
*/
|
|
3178
3184
|
prohibitToEdit(entity) {
|
|
3179
3185
|
this.fnProhibitToEdit(entity)
|
|
3180
3186
|
},
|
|
@@ -3327,6 +3333,9 @@ export default {
|
|
|
3327
3333
|
},
|
|
3328
3334
|
closeRowForm () {
|
|
3329
3335
|
this.showRowForm = false
|
|
3336
|
+
},
|
|
3337
|
+
testFunc(params){
|
|
3338
|
+
console.log('testFunc-----------------params=', params)
|
|
3330
3339
|
}
|
|
3331
3340
|
},
|
|
3332
3341
|
emits: [
|
|
@@ -3340,8 +3349,7 @@ export default {
|
|
|
3340
3349
|
'un-edit',
|
|
3341
3350
|
'refresMainTableFields',
|
|
3342
3351
|
'refresh',
|
|
3343
|
-
'cancel-search'
|
|
3344
|
-
,
|
|
3352
|
+
'cancel-search'
|
|
3345
3353
|
],
|
|
3346
3354
|
}
|
|
3347
3355
|
</script>
|
|
@@ -262,6 +262,15 @@ 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]){
|
|
268
|
+
const columnRules = gridParams.options.customRules[prop]
|
|
269
|
+
if(columnRules && columnRules.disabled){
|
|
270
|
+
isDiabled = true
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
265
274
|
}
|
|
266
275
|
return isDiabled
|
|
267
276
|
}
|
|
@@ -792,9 +801,9 @@ export function getControlConfig(column) {
|
|
|
792
801
|
return controlConfig
|
|
793
802
|
}
|
|
794
803
|
|
|
795
|
-
export function getContentAlign(column, gridParams)
|
|
804
|
+
export function getContentAlign(column, gridParams){
|
|
796
805
|
let align
|
|
797
|
-
if (
|
|
806
|
+
if (typeof gridParams.options.align !== 'undefined') {
|
|
798
807
|
align = gridParams.options.align
|
|
799
808
|
} else if (column.contAlign && column.contAlign !== '') {
|
|
800
809
|
align = column.contAlign
|
|
@@ -802,16 +811,20 @@ export function getContentAlign(column, gridParams) {
|
|
|
802
811
|
return align
|
|
803
812
|
}
|
|
804
813
|
|
|
805
|
-
export function getHeaderAlign(column, gridParams)
|
|
814
|
+
export function getHeaderAlign(column, gridParams){
|
|
806
815
|
let headerAlign
|
|
807
|
-
if (
|
|
816
|
+
if (typeof gridParams.options.headerAlign !== 'undefined') {
|
|
808
817
|
headerAlign = gridParams.options.headerAlign
|
|
809
818
|
} else if (column.titleAlign && column.titleAlign !== '') {
|
|
810
819
|
headerAlign = column.titleAlign
|
|
820
|
+
} else {
|
|
821
|
+
// 如果没有配置表头对齐方式,默认使用内容对齐方式
|
|
822
|
+
headerAlign = 'left'
|
|
811
823
|
}
|
|
812
824
|
return headerAlign
|
|
813
825
|
}
|
|
814
826
|
|
|
827
|
+
|
|
815
828
|
export function getHeaderLable(column) {
|
|
816
829
|
let label = column.label
|
|
817
830
|
if (!column.titleValueSet) {
|
|
@@ -827,4 +840,4 @@ export function getHeaderLable(column) {
|
|
|
827
840
|
|
|
828
841
|
function formatHeader(column) {
|
|
829
842
|
return doFormatWithValueSet(column.titleValueSetValue, column.label)
|
|
830
|
-
}
|
|
843
|
+
}
|