cloud-web-corejs 1.0.287 → 1.0.288
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
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:sub-form-row-id="subFormRowId"
|
|
13
13
|
>
|
|
14
14
|
<el-dropdown
|
|
15
|
+
v-if="hasDropdownPermission(field) && hasVisibleDropdownItem"
|
|
15
16
|
:trigger="field.options.dropdownTrigger"
|
|
16
17
|
:disabled="field.options.disabled"
|
|
17
18
|
>
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
<el-dropdown-menu slot="dropdown">
|
|
40
41
|
<template v-for="(subWidget, index) in field.widgetList">
|
|
41
42
|
<el-dropdown-item
|
|
42
|
-
v-show="
|
|
43
|
+
v-show="isDropdownItemVisible(subWidget)"
|
|
43
44
|
:key="index"
|
|
44
45
|
:icon="subWidget.options.icon"
|
|
45
46
|
@click.native="(e) => handleSubButtonWidgetClick(e, index)"
|
|
@@ -105,7 +106,14 @@ export default {
|
|
|
105
106
|
StaticContentWrapper,
|
|
106
107
|
dropdownItemWidget,
|
|
107
108
|
},
|
|
108
|
-
computed: {
|
|
109
|
+
computed: {
|
|
110
|
+
hasVisibleDropdownItem() {
|
|
111
|
+
if (this.designState) return true;
|
|
112
|
+
return this.field.widgetList.some((item) =>
|
|
113
|
+
this.isDropdownItemVisible(item)
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
},
|
|
109
117
|
beforeCreate() {
|
|
110
118
|
/* 这里不能访问方法和属性!! */
|
|
111
119
|
},
|
|
@@ -146,7 +154,30 @@ export default {
|
|
|
146
154
|
}
|
|
147
155
|
},
|
|
148
156
|
handleSubButtonWidgetClick(e, index) {
|
|
149
|
-
this
|
|
157
|
+
let subWidget = this.field.widgetList[index];
|
|
158
|
+
if (!this.isDropdownItemVisible(subWidget)) return;
|
|
159
|
+
let itemRef = this.$refs["item" + index];
|
|
160
|
+
if (itemRef && itemRef[0]) {
|
|
161
|
+
itemRef[0].handleButtonWidgetClick(e);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
getDropdownAuthCode(widget) {
|
|
165
|
+
let formRef = this.getFormRef();
|
|
166
|
+
let formCode = formRef?.reportTemplate?.formCode;
|
|
167
|
+
let authName = widget?.options?.name;
|
|
168
|
+
return formCode && authName ? formCode + ":" + authName : null;
|
|
169
|
+
},
|
|
170
|
+
hasDropdownPermission(widget) {
|
|
171
|
+
if (this.designState) return true;
|
|
172
|
+
let authCode = this.getDropdownAuthCode(widget);
|
|
173
|
+
if (!authCode) return true;
|
|
174
|
+
let dispermissions = this.$store.getters.dispermissions || [];
|
|
175
|
+
return !dispermissions.includes(authCode);
|
|
176
|
+
},
|
|
177
|
+
isDropdownItemVisible(widget) {
|
|
178
|
+
return (
|
|
179
|
+
!!widget && !widget.options.hidden && this.hasDropdownPermission(widget)
|
|
180
|
+
);
|
|
150
181
|
},
|
|
151
182
|
handleHidden() {
|
|
152
183
|
let isShow = this.field.widgetList.some((item) => !item.options.hidden);
|