agilebuilder-ui 1.0.90-tmp1 → 1.0.90-tmp11

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agilebuilder-ui",
3
- "version": "1.0.90-tmp1",
3
+ "version": "1.0.90-tmp11",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -1453,14 +1453,15 @@ const apis = {
1453
1453
  }
1454
1454
  ]
1455
1455
  */
1456
- dynamicControlTableEdit(pageContext, customRules){
1457
- console.log('dynamicControlTableEdit----customRules-----', customRules)
1456
+ dynamicControlTableEdit(pageContext, customRules, listCode){
1457
+ const gridParams = store.get(listCode)
1458
+ // console.log('dynamicControlTableEdit----customRules-----', customRules, gridParams.options.customRules)
1458
1459
  if(!customRules){
1459
1460
  return
1460
1461
  }
1461
1462
  let gridCustomRules = {}
1462
- if(this.options.customRules){
1463
- gridCustomRules = JSON.parse(JSON.stringify(this.options.customRules))
1463
+ if(gridParams.options.customRules){
1464
+ gridCustomRules = JSON.parse(JSON.stringify(gridParams.options.customRules))
1464
1465
  }
1465
1466
  customRules.forEach(item=>{
1466
1467
  const copyItem = JSON.parse(JSON.stringify(item))
@@ -1469,10 +1470,11 @@ const apis = {
1469
1470
  let columnRules
1470
1471
  if(!gridCustomRules[prop]){
1471
1472
  gridCustomRules[prop] = {}
1472
- } else {
1473
- // 获得当前列已有的自定义规则集合
1474
- columnRules = gridCustomRules[prop].rules
1475
1473
  }
1474
+ // console.log('dynamicControlTableEdit----gridCustomRules111-----', gridCustomRules)
1475
+ // 获得当前列已有的自定义规则集合
1476
+ columnRules = gridCustomRules[prop].rules
1477
+
1476
1478
  if(copyItem.rules){
1477
1479
  if(!columnRules){
1478
1480
  columnRules = []
@@ -1482,9 +1484,14 @@ const apis = {
1482
1484
  }
1483
1485
  // 当前列总的自定义规则更新
1484
1486
  copyItem.rules = columnRules
1485
- this.options.customRules[prop] = copyItem
1487
+ // this.options.customRules[prop] = copyItem
1488
+ if(!gridParams.options.customRules){
1489
+ gridParams.options.customRules = {}
1490
+ }
1491
+ // console.log('dynamicControlTableEdit----gridParams.options.customRules222-----', gridParams.options.customRules)
1492
+ gridParams.options.customRules[prop] = copyItem
1486
1493
  })
1487
- console.log('dynamicControlTableEdit----this.options-----', this.options)
1494
+ // console.log('dynamicControlTableEdit----gridParams.options.customRules333-----', gridParams.options.customRules)
1488
1495
  }
1489
1496
  }
1490
1497
  export default apis
@@ -441,8 +441,6 @@ 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'
445
-
446
444
  export default {
447
445
  name: 'DynamicInput',
448
446
  components: {
@@ -745,17 +743,17 @@ export default {
745
743
  if(!this.gridOptions.customRules){
746
744
  this.gridOptions.customRules = {}
747
745
  }
748
- this.watch('gridOptions.customRules.'+this.column.prop,
746
+ this.$watch('gridOptions.customRules.'+this.column.prop,
749
747
  (newVal, oldVal)=> {
750
- this.packageCustomRules()
748
+ this.packageCustomRules(newVal)
751
749
  },
752
750
  {
753
751
  immediate: true,
754
752
  deep: true,
755
753
  })
756
- this.watch('gridOptions.customRules._all_fields',
754
+ this.$watch('gridOptions.customRules._all_fields',
757
755
  (newVal, oldVal)=> {
758
- this.packageCustomRules()
756
+ this.packageCustomRules(newVal)
759
757
  },
760
758
  {
761
759
  immediate: true,
@@ -1817,21 +1815,16 @@ export default {
1817
1815
  this.innerValue = value
1818
1816
  this.blurEvent()
1819
1817
  },
1820
- packageCustomRules() {
1821
- if(!this.options.customRules){
1818
+ packageCustomRules(columnRule) {
1819
+ console.log('packageCustomRules---columnRule=', columnRule)
1820
+ if(!columnRule){
1822
1821
  return
1823
1822
  }
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
- }
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)
1835
1828
  }
1836
1829
  }
1837
1830
  }
@@ -457,16 +457,12 @@ export default {
457
457
  isShowForm: {
458
458
  type: Boolean,
459
459
  default: false
460
- },
461
- // 列表配置信息
462
- options: {
463
- type: Object,
464
- default: null
465
460
  }
466
461
  },
467
462
  data() {
468
463
  let parentFormData
469
464
  const gridParams = store.get(this.listCode)
465
+ const options = gridParams.options
470
466
  if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
471
467
  parentFormData = gridParams.options.extraParam.entityMap
472
468
  }
@@ -481,7 +477,10 @@ export default {
481
477
  scanEnable = true
482
478
  }
483
479
  const componentId = this.listCode + '_' + this.column.prop
484
- const requiredClass = this.isRequired(this.row.$editing) ? 'm-requried' : ''
480
+ let lineEdit
481
+ if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
482
+ lineEdit = gridParams.lineEdit
483
+ }
485
484
  return {
486
485
  selectRow: null,
487
486
  that: this,
@@ -511,21 +510,27 @@ export default {
511
510
  componentId,
512
511
  controlConfig,
513
512
  rowLinkConfigMapping: {},
514
- requiredClass
513
+ myRequiredClass: '',
514
+ lineEdit,
515
+ options
515
516
  }
516
517
  },
517
518
  computed: {
518
- lineEdit() {
519
- let isLineEdit = false
520
- if (this.listCode) {
521
- const gridParams = store.get(this.listCode)
522
- if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
523
- isLineEdit = gridParams.lineEdit
524
- } else {
525
- isLineEdit = false
526
- }
527
- }
528
- return isLineEdit
519
+ // lineEdit() {
520
+ // let isLineEdit = false
521
+ // if (this.listCode) {
522
+ // const gridParams = store.get(this.listCode)
523
+ // if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
524
+ // isLineEdit = gridParams.lineEdit
525
+ // } else {
526
+ // isLineEdit = false
527
+ // }
528
+ // }
529
+ // return isLineEdit
530
+ // },
531
+ requiredClass(){
532
+ console.log('computed------requiredClass=', myRequiredClass)
533
+ return this.myRequiredClass
529
534
  },
530
535
 
531
536
  ...mapGetters(['preventReclick'])
@@ -612,6 +617,7 @@ export default {
612
617
  }
613
618
  }
614
619
  this.setScanRuleSets()
620
+ this.myRequiredClass = this.isRequired(this.row.$editing) ? 'm-requried' : ''
615
621
  },
616
622
  mounted() {
617
623
  // 监听保存时点击按钮事件线触发
@@ -971,7 +977,8 @@ export default {
971
977
  }
972
978
  },
973
979
  isRequired(editing) {
974
- if (!this.isFormSubTable && this.lineEdit.editable && this.isEditable && editing && this.column.validations) {
980
+ console.log('isRequired---this.lineEdit=', this.lineEdit)
981
+ if (!this.isFormSubTable && this.lineEdit && this.lineEdit.editable && this.isEditable && editing && this.column.validations) {
975
982
  if (this.column.validations.indexOf('"required":true') > 0) {
976
983
  return true
977
984
  }
@@ -1025,7 +1032,9 @@ export default {
1025
1032
  }
1026
1033
  },
1027
1034
  changeRequired(required) {
1028
- this.requiredClass = required? 'm-requried' : ''
1035
+ console.log('changeRequired------required=', required)
1036
+ this.myRequiredClass = required? 'm-requried' : ''
1037
+ console.log('changeRequired------myRequiredClass=', myRequiredClass)
1029
1038
  }
1030
1039
  },
1031
1040
  emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
@@ -146,16 +146,12 @@ export default {
146
146
  listToolbarFormData: {
147
147
  type: Object,
148
148
  default: null
149
- },
150
- // 列表配置信息
151
- options: {
152
- type: Object,
153
- default: null
154
149
  }
155
150
  },
156
151
  data() {
157
152
  let parentFormData
158
153
  const gridParams = store.get(this.listCode)
154
+ const options = gridParams.options
159
155
  if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
160
156
  parentFormData = gridParams.options.extraParam.entityMap
161
157
  }
@@ -169,7 +165,8 @@ export default {
169
165
  subTableCanAdd: true, // 表单子表时是否有新增权限
170
166
  isShowAdd: false, // 是否显示表头的新增按钮
171
167
  cellWidth: null,
172
- parentFormData
168
+ parentFormData,
169
+ options
173
170
  }
174
171
  },
175
172
  computed: {