doway-coms 2.11.80 → 2.11.85

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": "doway-coms",
3
- "version": "2.11.80",
3
+ "version": "2.11.85",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -274,6 +274,7 @@
274
274
  col.controlType === 'pulldown' &&
275
275
  (col.isButtonShow == false || col.isButtonShow == undefined)
276
276
  "
277
+ :ref="'pulldown_' + col.field"
277
278
  :formRow="formRow"
278
279
  :isOld="isOld"
279
280
  :edit="col.edit"
@@ -798,6 +799,16 @@ export default {
798
799
  // })
799
800
  // }
800
801
  this.$emit('selectRows', selectRows)
802
+ },
803
+ reloadPulldownColumn(field) {
804
+ const pulldownRef = this.$refs['pulldown_' + field]
805
+ if (pulldownRef) {
806
+ // 处理 ref 可能是数组的情况(v-for 中的 ref)
807
+ const component = Array.isArray(pulldownRef) ? pulldownRef[0] : pulldownRef
808
+ if (component && component.reloadColumn) {
809
+ component.reloadColumn()
810
+ }
811
+ }
801
812
  }
802
813
  },
803
814
  }
@@ -1333,7 +1333,11 @@ export default {
1333
1333
  //拖动后输入框有错位问题,暂时不启用
1334
1334
  // this.initColumnDrop()
1335
1335
  for (let i = 0; i < this.columns.length; i++) {
1336
- this.internalColumns.push(this.initColumns(this.columns[i]))
1336
+ let tempCol = this.initColumns(this.columns[i])
1337
+ if(tempCol===null){
1338
+ continue
1339
+ }
1340
+ this.internalColumns.push(tempCol)
1337
1341
  if (
1338
1342
  this.columns[i].visible !== false &&
1339
1343
  this.columns[i].controlType !== 'operation'
@@ -1539,7 +1543,11 @@ export default {
1539
1543
  })
1540
1544
  }
1541
1545
  for (let i = 0; i < this.columns.length; i++) {
1542
- this.internalColumns.push(this.initColumns(this.columns[i]))
1546
+ let tempCol = this.initColumns(this.columns[i])
1547
+ if(tempCol===null){
1548
+ continue
1549
+ }
1550
+ this.internalColumns.push(tempCol)
1543
1551
  if (
1544
1552
  this.columns[i].visible !== false &&
1545
1553
  this.columns[i].controlType !== 'operation'
@@ -2051,7 +2059,6 @@ export default {
2051
2059
  initColumns(originCol) {
2052
2060
  let vm = this
2053
2061
  let colParams = {}
2054
-
2055
2062
  let colInfo = {
2056
2063
  field: originCol.field,
2057
2064
  title: originCol.title,
@@ -2139,6 +2146,9 @@ export default {
2139
2146
  if(originCol.headerCellStyle){
2140
2147
  colParams['headerCellStyle'] =originCol.headerCellStyle
2141
2148
  }
2149
+ if(originCol.permissionField){
2150
+ colParams['permissionField'] = originCol.permissionField
2151
+ }
2142
2152
 
2143
2153
  if (originCol.footerSum === true) {
2144
2154
  this.showFooter = true
@@ -2191,8 +2201,8 @@ export default {
2191
2201
  // if (XEUtils.isNumber(originCol.max)) {
2192
2202
  // colParams['max'] = originCol.max
2193
2203
  // }
2194
- colParams['max'] =XEUtils.isNumber(originCol.max)?originCol.max:'Infinity'
2195
- colParams['min'] =XEUtils.isNumber(originCol.min)?originCol.min:'-Infinity'
2204
+ colParams['max'] =XEUtils.isNumber(originCol.max)?originCol.max:Infinity
2205
+ colParams['min'] =XEUtils.isNumber(originCol.min)?originCol.min:-Infinity
2196
2206
  if (originCol.precision) {
2197
2207
  colParams['precision'] = originCol.precision
2198
2208
  //加入验证逻辑
@@ -2401,7 +2411,11 @@ export default {
2401
2411
  if (originCol.children) {
2402
2412
  colInfo['children'] = []
2403
2413
  for (let x = 0; x < originCol.children.length; x++) {
2404
- colInfo['children'].push(this.initColumns(originCol.children[x]))
2414
+ let tempCol = this.initColumns(originCol.children[x])
2415
+ if(tempCol===null){
2416
+ continue
2417
+ }
2418
+ colInfo['children'].push(tempCol)
2405
2419
  }
2406
2420
  }
2407
2421
  //防止报错 有slots值就走前面 没有slots这个键key就走后面
@@ -2896,6 +2910,7 @@ export default {
2896
2910
  if (this.pager.buttons) {
2897
2911
  for (let i = 0; i < this.pager.buttons.length; i++) {
2898
2912
  let editVisible = this.getColumnEdit(
2913
+ null,
2899
2914
  this.pager.buttons[i].edit,
2900
2915
  currentState,
2901
2916
  currentStatus,
@@ -2949,6 +2964,7 @@ export default {
2949
2964
  this.internalColumns[i].params.columns[j].edit = false
2950
2965
  //设置工具栏可编辑状态
2951
2966
  let editVisible = this.getColumnEdit(
2967
+ this.internalColumns[i].params.columns[j].permissionField,
2952
2968
  this.internalColumns[i].params.columns[j].edit,
2953
2969
  currentState,
2954
2970
  currentStatus,
@@ -2973,6 +2989,7 @@ export default {
2973
2989
  //设置网格列编辑状态
2974
2990
  if (this.gridEdit === true) {
2975
2991
  let editVisible = this.getColumnEdit(
2992
+ this.internalColumns[i].params.permissionField,
2976
2993
  this.internalColumns[i].params.edit,
2977
2994
  currentState,
2978
2995
  currentStatus,
@@ -2989,6 +3006,7 @@ export default {
2989
3006
  }
2990
3007
  },
2991
3008
  getColumnEdit(
3009
+ permissionField,
2992
3010
  originEdit,
2993
3011
  currentState,
2994
3012
  currentStatus,
@@ -3018,6 +3036,23 @@ export default {
3018
3036
  if (currentStatus && editStatuss) {
3019
3037
  originEdit = editStatuss.indexOf(currentStatus) > -1
3020
3038
  }
3039
+ //是否存在字段编辑权限控制
3040
+ //首先判断是否满足触发权限字段逻辑,包括单据状态是否满足,编辑状态是否满足
3041
+ if(permissionField && originEdit===true){
3042
+ let usePermissionEdit = false
3043
+ if(currentState && permissionField.editStates){
3044
+ usePermissionEdit = permissionField.editStates.indexOf(currentState) > -1
3045
+ }
3046
+ if(currentStatus && permissionField.editStatuss){
3047
+ usePermissionEdit = permissionField.editStatuss.indexOf(currentStatus) > -1
3048
+ }
3049
+ if(usePermissionEdit===true){
3050
+ //满足条件触发权限字段控制
3051
+ originEdit = permissionField.edit===true
3052
+ }
3053
+ }
3054
+ //---------------------------------------------------------------------
3055
+
3021
3056
  return { visible: fieldVisible, edit: originEdit }
3022
3057
  },
3023
3058
  pulldownSelectChanged(scope,selectedRowInfo){
@@ -3281,7 +3316,11 @@ export default {
3281
3316
  this.internalColumns = []
3282
3317
 
3283
3318
  columns.forEach((column) => {
3284
- this.internalColumns.push(this.initColumns(column))
3319
+ let tempCol = this.initColumns(column)
3320
+ if(tempCol===null){
3321
+ return
3322
+ }
3323
+ this.internalColumns.push(tempCol)
3285
3324
  })
3286
3325
  //注意,不能移到上面添加,会出现布局问题,暂时不知道什么原因????
3287
3326
  if (this.showCheckBox) {
@@ -617,7 +617,11 @@ export default {
617
617
  this.filterCols.push(this.columns[i])
618
618
  }
619
619
  }
620
- this.$refs.pupupGridView.refreshColumn()
620
+ this.$nextTick(() => {
621
+ if (this.$refs.pupupGridView) {
622
+ this.$refs.pupupGridView.refreshColumn()
623
+ }
624
+ })
621
625
  },
622
626
  gridRowStyle(scope) {
623
627
  if (scope.row.sysRepeat === true) {
@@ -61,7 +61,8 @@ export const sysRowState = {
61
61
  y_axis: 'y_axis',
62
62
  series: 'series',
63
63
  treeSelect: 'treeSelect',
64
- multiSelect: 'multiSelect'
64
+ multiSelect: 'multiSelect',
65
+ permission:'permission'//权限控制字段
65
66
  }
66
67
  export const dataType = {
67
68
  frame: 'frame',
@@ -83,6 +83,30 @@ export default new Vuex.Store({
83
83
  }
84
84
  let operationFields = []
85
85
  XEUtils.arrayEach(loopData.fields, loopField => {
86
+
87
+ if(loopField.controlType===controlType.permission){
88
+ //权限字段,无需处理
89
+ return
90
+ }
91
+
92
+ let extraInfo = loopField.extraInfo
93
+ ? JSON.parse(loopField.extraInfo)
94
+ : {}
95
+ let userExtraInfo = loopField.userExtraInfo
96
+ ? JSON.parse(loopField.userExtraInfo)
97
+ : {}
98
+ extraInfo = {...extraInfo, ...userExtraInfo}
99
+
100
+ if(extraInfo.permissionField){
101
+ //存在权限控制字段
102
+ let tempPermissionFieldInfo = XEUtils.find(loopData.fields,p=>p.code===extraInfo.permissionField)
103
+ if(tempPermissionFieldInfo){
104
+ //存在权限控制字段
105
+ extraInfo.permissionField = tempPermissionFieldInfo
106
+ }
107
+ }
108
+
109
+
86
110
  let tempField = {
87
111
  field:loopField.code, // loopField.boundField,
88
112
  title: loopField.name,
@@ -108,13 +132,7 @@ export default new Vuex.Store({
108
132
  tempField['editStatuss'] = loopField.editStatuss.split(',')
109
133
  tempField['visibleStatuss'] = loopField.editStatuss.split(',')
110
134
  }
111
- let extraInfo = loopField.extraInfo
112
- ? JSON.parse(loopField.extraInfo)
113
- : {}
114
- let userExtraInfo = loopField.userExtraInfo
115
- ? JSON.parse(loopField.userExtraInfo)
116
- : {}
117
- extraInfo = {...extraInfo, ...userExtraInfo}
135
+
118
136
  //存在额外参数,就赋值
119
137
  if (Object.keys(extraInfo).length) {
120
138
  if (Object.hasOwn(extraInfo, 'api')) {