cloud-web-corejs 1.0.54-dev.497 → 1.0.54-dev.499
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 +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1626 -1
- package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +9 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +99 -50
- package/src/views/user/form/vform/designer.vue +2 -1
package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue
CHANGED
|
@@ -85,6 +85,15 @@ export default {
|
|
|
85
85
|
let hasWf = this.getHasWf() || false;
|
|
86
86
|
result = result && !hasWf;
|
|
87
87
|
}*/
|
|
88
|
+
if(!this.designState){
|
|
89
|
+
let authCode = this.$parent.getAuthCode ? this.$parent.getAuthCode() : null
|
|
90
|
+
if(authCode){
|
|
91
|
+
let dispermissions = this.$store.getters.dispermissions;
|
|
92
|
+
if (dispermissions.includes(authCode)) {
|
|
93
|
+
result = false
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
88
97
|
return result;
|
|
89
98
|
}
|
|
90
99
|
|
|
@@ -1,26 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<el-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<el-form-item prop="name" :rules="nameRequiredRule">
|
|
4
|
+
<span slot="label"
|
|
5
|
+
>{{ i18nt("designer.setting.uniqueName") }}
|
|
6
|
+
<el-tooltip effect="light" :content="i18nt('designer.setting.editNameHelp')">
|
|
7
|
+
<i class="el-icon-info"></i
|
|
8
|
+
></el-tooltip>
|
|
9
|
+
</span>
|
|
10
|
+
<template
|
|
11
|
+
v-if="
|
|
12
|
+
(!!selectedWidget.category && selectedWidget.type !== 'sub-form') || noFieldList
|
|
13
|
+
"
|
|
14
|
+
>
|
|
15
|
+
<el-input
|
|
16
|
+
type="text"
|
|
17
|
+
v-model="optionModel.name"
|
|
18
|
+
:readonly="widgetNameReadonly"
|
|
19
|
+
@change="updateWidgetNameAndRef"
|
|
20
|
+
></el-input>
|
|
21
|
+
</template>
|
|
22
|
+
<template v-else>
|
|
23
|
+
<el-select
|
|
24
|
+
v-model="optionModel.name"
|
|
25
|
+
allow-create
|
|
26
|
+
filterable
|
|
27
|
+
:disabled="true"
|
|
28
|
+
@change="updateWidgetNameAndRef"
|
|
29
|
+
:title="i18nt('designer.setting.editNameHelp')"
|
|
30
|
+
>
|
|
31
|
+
<el-option
|
|
32
|
+
v-for="(sf, sfIdx) in serverFieldList"
|
|
33
|
+
:key="sfIdx"
|
|
34
|
+
:label="sf.label"
|
|
35
|
+
:value="sf.name"
|
|
36
|
+
></el-option>
|
|
37
|
+
</el-select>
|
|
38
|
+
</template>
|
|
39
|
+
</el-form-item>
|
|
40
|
+
<el-form-item label="菜单按钮权限编码" v-show="showAuthCode">
|
|
41
|
+
<div style="word-break: break-all">{{ authCode }}</div>
|
|
42
|
+
</el-form-item>
|
|
43
|
+
</div>
|
|
19
44
|
</template>
|
|
20
45
|
|
|
21
46
|
<script>
|
|
22
|
-
import i18n from "../../../../../components/xform/utils/i18n"
|
|
23
|
-
import {isEmptyStr} from "../../../../../components/xform/utils/util"
|
|
47
|
+
import i18n from "../../../../../components/xform/utils/i18n";
|
|
48
|
+
import { isEmptyStr } from "../../../../../components/xform/utils/util";
|
|
24
49
|
|
|
25
50
|
export default {
|
|
26
51
|
name: "name-editor",
|
|
@@ -31,53 +56,80 @@ export default {
|
|
|
31
56
|
optionModel: Object,
|
|
32
57
|
parentList: Array,
|
|
33
58
|
},
|
|
34
|
-
inject: [
|
|
59
|
+
inject: ["serverFieldList", "getDesignerConfig", "isDataTableChildWidget"],
|
|
35
60
|
data() {
|
|
36
61
|
return {
|
|
37
|
-
nameRequiredRule: [{required: true, message:
|
|
38
|
-
}
|
|
62
|
+
nameRequiredRule: [{ required: true, message: "name required" }],
|
|
63
|
+
};
|
|
39
64
|
},
|
|
40
65
|
computed: {
|
|
41
66
|
noFieldList() {
|
|
42
|
-
return !this.serverFieldList ||
|
|
67
|
+
return !this.serverFieldList || this.serverFieldList.length <= 0;
|
|
43
68
|
},
|
|
44
69
|
|
|
45
70
|
widgetNameReadonly() {
|
|
46
|
-
return !!this.getDesignerConfig().widgetNameReadonly
|
|
71
|
+
return !!this.getDesignerConfig().widgetNameReadonly;
|
|
72
|
+
},
|
|
73
|
+
showAuthCode() {
|
|
74
|
+
// return this.selectedWidget.category !== "container";
|
|
75
|
+
return [
|
|
76
|
+
"button",
|
|
77
|
+
"a-text",
|
|
78
|
+
"a-link",
|
|
79
|
+
"a-link2",
|
|
80
|
+
"search_button",
|
|
81
|
+
"save_button",
|
|
82
|
+
"reset_button",
|
|
83
|
+
"table-export-button",
|
|
84
|
+
"select-export-button",
|
|
85
|
+
"add_button",
|
|
86
|
+
"import-button",
|
|
87
|
+
"import2-button",
|
|
88
|
+
"print-button",
|
|
89
|
+
"print-detail-button",
|
|
90
|
+
"download-button",
|
|
91
|
+
"copy_button",
|
|
92
|
+
"tempStorage",
|
|
93
|
+
].includes(this.selectedWidget.type);
|
|
94
|
+
},
|
|
95
|
+
authCode() {
|
|
96
|
+
return (
|
|
97
|
+
this.designer.vueInstance?.reportTemplate?.formCode + ":" + this.optionModel.name
|
|
98
|
+
);
|
|
47
99
|
},
|
|
48
|
-
|
|
49
100
|
},
|
|
50
101
|
methods: {
|
|
51
102
|
updateWidgetNameAndRef(newName) {
|
|
52
|
-
let oldName = this.designer.selectedWidgetName
|
|
103
|
+
let oldName = this.designer.selectedWidgetName;
|
|
53
104
|
if (isEmptyStr(newName)) {
|
|
54
|
-
this.selectedWidget.options.name = oldName
|
|
55
|
-
this.$message.info(this.i18nt(
|
|
56
|
-
return
|
|
105
|
+
this.selectedWidget.options.name = oldName;
|
|
106
|
+
this.$message.info(this.i18nt("designer.hint.nameRequired"));
|
|
107
|
+
return;
|
|
57
108
|
}
|
|
58
109
|
|
|
59
110
|
if (!!this.designer.formWidget) {
|
|
60
|
-
let foundRef = this.designer.formWidget.getWidgetRef(newName) // 检查newName是否已存在!!
|
|
111
|
+
let foundRef = this.designer.formWidget.getWidgetRef(newName); // 检查newName是否已存在!!
|
|
61
112
|
|
|
62
113
|
if (!!foundRef) {
|
|
63
114
|
if (this.isDataTableChildWidget()) {
|
|
64
115
|
let parentList = this.parentList;
|
|
65
|
-
for (let i;i<parentList.length;i++){
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.selectedWidget.options.name = oldName
|
|
71
|
-
this.$message.info(this.i18nt('designer.hint.duplicateName') + newName)
|
|
72
|
-
return
|
|
116
|
+
for (let i; i < parentList.length; i++) {}
|
|
117
|
+
} else {
|
|
118
|
+
this.selectedWidget.options.name = oldName;
|
|
119
|
+
this.$message.info(this.i18nt("designer.hint.duplicateName") + newName);
|
|
120
|
+
return;
|
|
73
121
|
}
|
|
74
122
|
}
|
|
75
123
|
|
|
76
|
-
let widgetInDesign = this.designer.formWidget.getWidgetRef(oldName)
|
|
124
|
+
let widgetInDesign = this.designer.formWidget.getWidgetRef(oldName);
|
|
77
125
|
if (!!widgetInDesign && !!widgetInDesign.registerToRefList) {
|
|
78
|
-
widgetInDesign.registerToRefList(oldName)
|
|
79
|
-
let newLabel = this.getLabelByFieldName(newName)
|
|
80
|
-
this.designer.updateSelectedWidgetNameAndLabel(
|
|
126
|
+
widgetInDesign.registerToRefList(oldName); //注册组件新的ref名称并删除老的ref!!
|
|
127
|
+
let newLabel = this.getLabelByFieldName(newName);
|
|
128
|
+
this.designer.updateSelectedWidgetNameAndLabel(
|
|
129
|
+
this.selectedWidget,
|
|
130
|
+
newName,
|
|
131
|
+
newLabel
|
|
132
|
+
);
|
|
81
133
|
}
|
|
82
134
|
}
|
|
83
135
|
},
|
|
@@ -85,17 +137,14 @@ export default {
|
|
|
85
137
|
getLabelByFieldName(fieldName) {
|
|
86
138
|
for (let i = 0; i < this.serverFieldList.length; i++) {
|
|
87
139
|
if (this.serverFieldList[i].name === fieldName) {
|
|
88
|
-
return this.serverFieldList[i].label
|
|
140
|
+
return this.serverFieldList[i].label;
|
|
89
141
|
}
|
|
90
142
|
}
|
|
91
143
|
|
|
92
|
-
return null
|
|
144
|
+
return null;
|
|
93
145
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
146
|
+
},
|
|
147
|
+
};
|
|
97
148
|
</script>
|
|
98
149
|
|
|
99
|
-
<style lang="scss" scoped>
|
|
100
|
-
|
|
101
|
-
</style>
|
|
150
|
+
<style lang="scss" scoped></style>
|
|
@@ -104,7 +104,8 @@ export default {
|
|
|
104
104
|
this.showDesinger = true;
|
|
105
105
|
this.$nextTick(() => {
|
|
106
106
|
let formJson = this.$baseLodash.cloneDeep({
|
|
107
|
-
widgetList: this.widgetList
|
|
107
|
+
widgetList: this.widgetList,
|
|
108
|
+
formConfig:{}
|
|
108
109
|
});
|
|
109
110
|
this.$refs.designer.setFormJson(formJson);
|
|
110
111
|
})
|