vue2-client 1.15.54 → 1.15.57
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
@@ -878,7 +878,7 @@ export default {
|
|
878
878
|
}
|
879
879
|
},
|
880
880
|
computed: {
|
881
|
-
...mapState('account', { currUser: 'user' }),
|
881
|
+
...mapState('account', { currUser: 'user', curRoles: 'roles', curPermissions: 'permissions' }),
|
882
882
|
queryParamsName () {
|
883
883
|
if (this.attr.keyName.startsWith('function')) {
|
884
884
|
// 调用异步函数获取内容
|
@@ -1087,14 +1087,21 @@ export default {
|
|
1087
1087
|
},
|
1088
1088
|
async showFormItemFunc () {
|
1089
1089
|
if (this.attr.showFormItemFunc) {
|
1090
|
-
const obj = executeStrFunctionByContext(this, this.attr.showFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode, this.
|
1090
|
+
const obj = executeStrFunctionByContext(this, this.attr.showFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode, this.curPermissions, this.curRoles])
|
1091
1091
|
// 判断是 bool 还是 obj 兼容
|
1092
1092
|
if (typeof obj === 'boolean') {
|
1093
1093
|
this.show = obj
|
1094
1094
|
} else if (obj && typeof obj === 'object') {
|
1095
1095
|
// obj 是一个对象,并且不是数组
|
1096
|
-
|
1097
|
-
|
1096
|
+
if (obj.hasOwnProperty('show')) {
|
1097
|
+
this.show = obj?.show
|
1098
|
+
}
|
1099
|
+
if (obj.hasOwnProperty('readOnly')) {
|
1100
|
+
this.readOnly = obj?.readOnly
|
1101
|
+
}
|
1102
|
+
if (obj.hasOwnProperty('disabled')) {
|
1103
|
+
this.disabled = obj?.disabled
|
1104
|
+
}
|
1098
1105
|
}
|
1099
1106
|
} else {
|
1100
1107
|
this.show = true
|
@@ -1102,14 +1109,21 @@ export default {
|
|
1102
1109
|
},
|
1103
1110
|
async showQueryFormItemFunc () {
|
1104
1111
|
if (this.attr.showQueryFormItemFunc) {
|
1105
|
-
const obj = executeStrFunctionByContext(this, this.attr.showQueryFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode, this.
|
1112
|
+
const obj = executeStrFunctionByContext(this, this.attr.showQueryFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode, this.curPermissions, this.curRoles])
|
1106
1113
|
// 判断是 bool 还是 obj 兼容
|
1107
1114
|
if (typeof obj === 'boolean') {
|
1108
1115
|
this.show = obj
|
1109
1116
|
} else if (obj && typeof obj === 'object') {
|
1110
1117
|
// obj 是一个对象,并且不是数组
|
1111
|
-
|
1112
|
-
|
1118
|
+
if (obj.hasOwnProperty('show')) {
|
1119
|
+
this.show = obj?.show
|
1120
|
+
}
|
1121
|
+
if (obj.hasOwnProperty('readOnly')) {
|
1122
|
+
this.readOnly = obj?.readOnly
|
1123
|
+
}
|
1124
|
+
if (obj.hasOwnProperty('disabled')) {
|
1125
|
+
this.disabled = obj?.disabled
|
1126
|
+
}
|
1113
1127
|
}
|
1114
1128
|
} else {
|
1115
1129
|
this.show = true
|