cloud-web-corejs 1.0.54-dev.647 → 1.0.54-dev.649
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/setting-panel/index.vue +41 -36
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1 -161
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/edit-tree-button-group-config-dialog.vue +281 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +37 -17
- package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/widgetPropertyDialogMixin.js +173 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +0 -4
- package/src/components/xform/form-render/container-item/data-table-mixin.js +22 -21
package/package.json
CHANGED
|
@@ -140,78 +140,82 @@
|
|
|
140
140
|
</el-dialog>
|
|
141
141
|
|
|
142
142
|
<el-dialog
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
:
|
|
143
|
+
v-for="dlg in widgetPropertyDialogs"
|
|
144
|
+
:key="dlg.id"
|
|
145
|
+
:title="dlg.title || i18nt('配置编辑')"
|
|
146
|
+
:visible.sync="dlg.visible"
|
|
146
147
|
:modal="false"
|
|
147
148
|
:show-close="!0"
|
|
148
149
|
custom-class="dialog-style list-dialog"
|
|
149
150
|
:close-on-click-modal="!1"
|
|
150
151
|
:close-on-press-escape="!1"
|
|
151
152
|
:destroy-on-close="!0"
|
|
153
|
+
append-to-body
|
|
152
154
|
v-el-drag-dialog
|
|
153
155
|
v-el-dialog-center
|
|
156
|
+
:before-close="(done) => handleWidgetPropertyDialogBeforeClose(dlg, done)"
|
|
157
|
+
@mousedown.native="setActivePropertyDialog(dlg.id)"
|
|
154
158
|
>
|
|
155
159
|
<div class="cont" style="height: auto;max-height: 500px;">
|
|
156
160
|
<el-scrollbar class="setting-scrollbar">
|
|
157
|
-
<el-form :model="columnSelectedWidget.options" size="mini" label-position="left" label-width="120px" class="setting-form"
|
|
161
|
+
<el-form :model="dlg.columnSelectedWidget.options" size="mini" label-position="left" label-width="120px" class="setting-form"
|
|
158
162
|
@submit.native.prevent>
|
|
159
|
-
<el-collapse v-model="widgetActiveCollapseName1s" class="setting-collapse">
|
|
160
|
-
<el-collapse-item name="1" v-if="
|
|
163
|
+
<el-collapse v-model="dlg.widgetActiveCollapseName1s" class="setting-collapse">
|
|
164
|
+
<el-collapse-item name="1" v-if="showCollapseForDialog(dlg, commonProps)"
|
|
161
165
|
:title="i18nt('designer.setting.commonSetting')">
|
|
162
166
|
<template v-for="(editorName, propName) in commonProps">
|
|
163
167
|
<component
|
|
164
|
-
v-if="
|
|
165
|
-
:is="
|
|
168
|
+
v-if="hasPropEditorForDialog(dlg, propName, editorName)"
|
|
169
|
+
:is="getPropEditorForDialog(dlg, propName, editorName)"
|
|
166
170
|
:designer="designer"
|
|
167
|
-
:selected-widget="columnSelectedWidget"
|
|
168
|
-
:option-model="columnSelectedWidget.options"
|
|
169
|
-
:tableColumns="tableColumns"
|
|
170
|
-
:key="propName"
|
|
171
|
+
:selected-widget="dlg.columnSelectedWidget"
|
|
172
|
+
:option-model="dlg.columnSelectedWidget.options"
|
|
173
|
+
:tableColumns="dlg.tableColumns"
|
|
174
|
+
:key="dlg.id + '-common-' + propName"
|
|
171
175
|
></component>
|
|
172
176
|
</template>
|
|
173
177
|
</el-collapse-item>
|
|
174
178
|
|
|
175
|
-
<el-collapse-item name="2" v-if="
|
|
179
|
+
<el-collapse-item name="2" v-if="showCollapseForDialog(dlg, advProps)"
|
|
176
180
|
:title="i18nt('designer.setting.advancedSetting')">
|
|
177
181
|
<template v-for="(editorName, propName) in advProps">
|
|
178
182
|
<component
|
|
179
|
-
v-if="
|
|
180
|
-
:is="
|
|
183
|
+
v-if="hasPropEditorForDialog(dlg, propName, editorName)"
|
|
184
|
+
:is="getPropEditorForDialog(dlg, propName, editorName)"
|
|
181
185
|
:designer="designer"
|
|
182
|
-
:selected-widget="columnSelectedWidget"
|
|
183
|
-
:option-model="columnSelectedWidget.options"
|
|
184
|
-
:tableColumns="tableColumns"
|
|
185
|
-
:key="propName"
|
|
186
|
+
:selected-widget="dlg.columnSelectedWidget"
|
|
187
|
+
:option-model="dlg.columnSelectedWidget.options"
|
|
188
|
+
:tableColumns="dlg.tableColumns"
|
|
189
|
+
:key="dlg.id + '-adv-' + propName"
|
|
186
190
|
></component>
|
|
187
191
|
</template>
|
|
188
192
|
</el-collapse-item>
|
|
189
|
-
<el-collapse-item name="4" v-if="
|
|
193
|
+
<el-collapse-item name="4" v-if="showCollapseForDialog(dlg, wfProps)"
|
|
190
194
|
:title="i18nt('流程属性')">
|
|
191
195
|
<template v-for="(editorName, propName) in wfProps">
|
|
192
196
|
<component
|
|
193
|
-
v-if="
|
|
194
|
-
:is="
|
|
197
|
+
v-if="hasPropEditorForDialog(dlg, propName, editorName)"
|
|
198
|
+
:is="getPropEditorForDialog(dlg, propName, editorName)"
|
|
195
199
|
:designer="designer"
|
|
196
|
-
:selected-widget="columnSelectedWidget"
|
|
197
|
-
:option-model="columnSelectedWidget.options"
|
|
198
|
-
:tableColumns="tableColumns"
|
|
199
|
-
:key="propName"
|
|
200
|
+
:selected-widget="dlg.columnSelectedWidget"
|
|
201
|
+
:option-model="dlg.columnSelectedWidget.options"
|
|
202
|
+
:tableColumns="dlg.tableColumns"
|
|
203
|
+
:key="dlg.id + '-wf-' + propName"
|
|
200
204
|
></component>
|
|
201
205
|
</template>
|
|
202
206
|
</el-collapse-item>
|
|
203
207
|
|
|
204
|
-
<el-collapse-item name="3" v-if="showEventCollapse1() &&
|
|
208
|
+
<el-collapse-item name="3" v-if="showEventCollapse1() && showCollapseForDialog(dlg, eventProps)"
|
|
205
209
|
:title="i18nt('designer.setting.eventSetting')">
|
|
206
210
|
<template v-for="(editorName, propName) in eventProps">
|
|
207
211
|
<component
|
|
208
|
-
v-if="
|
|
209
|
-
:is="
|
|
212
|
+
v-if="hasPropEditorForDialog(dlg, propName, editorName)"
|
|
213
|
+
:is="getPropEditorForDialog(dlg, propName, editorName)"
|
|
210
214
|
:designer="designer"
|
|
211
|
-
:selected-widget="columnSelectedWidget"
|
|
212
|
-
:option-model="columnSelectedWidget.options"
|
|
213
|
-
:tableColumns="tableColumns"
|
|
214
|
-
:key="propName"
|
|
215
|
+
:selected-widget="dlg.columnSelectedWidget"
|
|
216
|
+
:option-model="dlg.columnSelectedWidget.options"
|
|
217
|
+
:tableColumns="dlg.tableColumns"
|
|
218
|
+
:key="dlg.id + '-event-' + propName"
|
|
215
219
|
></component>
|
|
216
220
|
</template>
|
|
217
221
|
</el-collapse-item>
|
|
@@ -220,10 +224,10 @@
|
|
|
220
224
|
</el-scrollbar>
|
|
221
225
|
</div>
|
|
222
226
|
<div class="dialog-footer" slot="footer">
|
|
223
|
-
<el-button @click="
|
|
227
|
+
<el-button @click="closeWidgetPropertyDialog(dlg.id)" class="button-sty" icon="el-icon-close">
|
|
224
228
|
{{ i18nt('designer.hint.cancel') }}
|
|
225
229
|
</el-button>
|
|
226
|
-
<el-button type="primary" class="button-sty" @click="confirmWidgetPropertyDialog">
|
|
230
|
+
<el-button type="primary" class="button-sty" @click="confirmWidgetPropertyDialog(dlg)">
|
|
227
231
|
{{ i18nt('designer.hint.confirm') }}
|
|
228
232
|
</el-button>
|
|
229
233
|
</div>
|
|
@@ -236,6 +240,7 @@ import PropertyEditors from './property-editor/index';
|
|
|
236
240
|
import FormSetting from './form-setting';
|
|
237
241
|
import dataSourceSetting from './dataSource-setting';
|
|
238
242
|
import indexMixin from './indexMixin';
|
|
243
|
+
import widgetPropertyDialogMixin from './widgetPropertyDialogMixin';
|
|
239
244
|
|
|
240
245
|
export default {
|
|
241
246
|
name: 'SettingPanel',
|
|
@@ -244,7 +249,7 @@ export default {
|
|
|
244
249
|
dataSourceSetting,
|
|
245
250
|
...PropertyEditors
|
|
246
251
|
},
|
|
247
|
-
mixins: [indexMixin],
|
|
252
|
+
mixins: [indexMixin, widgetPropertyDialogMixin],
|
|
248
253
|
};
|
|
249
254
|
</script>
|
|
250
255
|
|
|
@@ -136,10 +136,7 @@
|
|
|
136
136
|
<el-divider class="custom-divider-margin-top">编辑表格设置</el-divider>
|
|
137
137
|
</el-form-item>
|
|
138
138
|
<el-form-item :label="i18nt('编辑表格')">
|
|
139
|
-
<el-switch
|
|
140
|
-
v-model="optionModel.isEditTable"
|
|
141
|
-
@change="onIsEditTableChange"
|
|
142
|
-
></el-switch>
|
|
139
|
+
<el-switch v-model="optionModel.isEditTable"></el-switch>
|
|
143
140
|
</el-form-item>
|
|
144
141
|
<el-form-item :label="i18nt('树表格')">
|
|
145
142
|
<el-switch v-model="optionModel.isTreeTable"></el-switch>
|
|
@@ -150,88 +147,6 @@
|
|
|
150
147
|
<el-form-item :label="i18nt('排序脚本编码')" v-if="optionModel.isEditTable">
|
|
151
148
|
<el-input v-model="optionModel.sortScriptCode"></el-input>
|
|
152
149
|
</el-form-item>
|
|
153
|
-
<template v-if="optionModel.isEditTable">
|
|
154
|
-
<el-form-item
|
|
155
|
-
label-width="0"
|
|
156
|
-
v-if="!optionModel.rowAddAuthName || !optionModel.rowEditAuthName"
|
|
157
|
-
>
|
|
158
|
-
<el-button
|
|
159
|
-
type="text"
|
|
160
|
-
icon="el-icon-refresh-right"
|
|
161
|
-
class="add-option"
|
|
162
|
-
@click="createRandomRowAuthNames"
|
|
163
|
-
>
|
|
164
|
-
随机生成权限名称
|
|
165
|
-
</el-button>
|
|
166
|
-
</el-form-item>
|
|
167
|
-
<el-form-item label="行新增权限名称">
|
|
168
|
-
<el-input
|
|
169
|
-
v-model="optionModel.rowAddAuthName"
|
|
170
|
-
placeholder="留空则不校验权限"
|
|
171
|
-
clearable
|
|
172
|
-
></el-input>
|
|
173
|
-
</el-form-item>
|
|
174
|
-
<el-form-item label="行新增权限编码" v-if="rowAddAuthCode">
|
|
175
|
-
<div style="word-break: break-all">
|
|
176
|
-
<el-tooltip effect="light" content="复制">
|
|
177
|
-
<a
|
|
178
|
-
class="a-link"
|
|
179
|
-
style="color: unset"
|
|
180
|
-
@click="copyAuthCode(rowAddAuthCode, $event)"
|
|
181
|
-
>
|
|
182
|
-
<span
|
|
183
|
-
><i class="el-icon-copy-document" style="margin-right: 2px"></i
|
|
184
|
-
>{{ rowAddAuthCode }}</span
|
|
185
|
-
>
|
|
186
|
-
</a>
|
|
187
|
-
</el-tooltip>
|
|
188
|
-
</div>
|
|
189
|
-
</el-form-item>
|
|
190
|
-
<el-form-item label="行编辑权限名称">
|
|
191
|
-
<el-input
|
|
192
|
-
v-model="optionModel.rowEditAuthName"
|
|
193
|
-
placeholder="留空则不校验权限"
|
|
194
|
-
clearable
|
|
195
|
-
></el-input>
|
|
196
|
-
</el-form-item>
|
|
197
|
-
<el-form-item label="行编辑权限编码" v-if="rowEditAuthCode">
|
|
198
|
-
<div style="word-break: break-all">
|
|
199
|
-
<el-tooltip effect="light" content="复制">
|
|
200
|
-
<a
|
|
201
|
-
class="a-link"
|
|
202
|
-
style="color: unset"
|
|
203
|
-
@click="copyAuthCode(rowEditAuthCode, $event)"
|
|
204
|
-
>
|
|
205
|
-
<span
|
|
206
|
-
><i class="el-icon-copy-document" style="margin-right: 2px"></i
|
|
207
|
-
>{{ rowEditAuthCode }}</span
|
|
208
|
-
>
|
|
209
|
-
</a>
|
|
210
|
-
</el-tooltip>
|
|
211
|
-
</div>
|
|
212
|
-
</el-form-item>
|
|
213
|
-
<el-form-item label="行新增显示条件" label-width="150px">
|
|
214
|
-
<a
|
|
215
|
-
href="javascript:void(0);"
|
|
216
|
-
class="a-link link-oneLind"
|
|
217
|
-
@click="editEventHandler('rowAddShow', rowShowParams)"
|
|
218
|
-
>
|
|
219
|
-
<span>{{ optionModel.rowAddShow ? "已维护" : "" }}</span>
|
|
220
|
-
<i class="el-icon-edit"></i>
|
|
221
|
-
</a>
|
|
222
|
-
</el-form-item>
|
|
223
|
-
<el-form-item label="行编辑显示条件" label-width="150px">
|
|
224
|
-
<a
|
|
225
|
-
href="javascript:void(0);"
|
|
226
|
-
class="a-link link-oneLind"
|
|
227
|
-
@click="editEventHandler('rowEditShow', rowShowParams)"
|
|
228
|
-
>
|
|
229
|
-
<span>{{ optionModel.rowEditShow ? "已维护" : "" }}</span>
|
|
230
|
-
<i class="el-icon-edit"></i>
|
|
231
|
-
</a>
|
|
232
|
-
</el-form-item>
|
|
233
|
-
</template>
|
|
234
|
-
|
|
235
150
|
<el-form-item label-width="0">
|
|
236
151
|
<el-divider class="custom-divider-margin-top">明细导出设置</el-divider>
|
|
237
152
|
</el-form-item>
|
|
@@ -428,7 +343,6 @@ import eventMixin from "../../../../../../components/xform/form-designer/setting
|
|
|
428
343
|
import setttingConfig from "@/settings";
|
|
429
344
|
|
|
430
345
|
import exportItemColumnsDialog from "./exportItemColumns-dialog.vue";
|
|
431
|
-
import Clipboard from "clipboard";
|
|
432
346
|
|
|
433
347
|
export default {
|
|
434
348
|
name: "data-table-editor",
|
|
@@ -638,7 +552,6 @@ export default {
|
|
|
638
552
|
},
|
|
639
553
|
defaultCheckedKeys: [],
|
|
640
554
|
tableConfigParams: ["dataId", "formCode"],
|
|
641
|
-
rowShowParams: ["dataId", "formCode", "tableParam"],
|
|
642
555
|
showExportItemColumnsDialog: false,
|
|
643
556
|
};
|
|
644
557
|
},
|
|
@@ -667,12 +580,6 @@ export default {
|
|
|
667
580
|
this.optionModel.isNotShowQueryButton = !val;
|
|
668
581
|
},
|
|
669
582
|
},
|
|
670
|
-
rowAddAuthCode() {
|
|
671
|
-
return this.getRowAuthCode(this.getRowAddAuthName());
|
|
672
|
-
},
|
|
673
|
-
rowEditAuthCode() {
|
|
674
|
-
return this.getRowAuthCode(this.getRowEditAuthName());
|
|
675
|
-
},
|
|
676
583
|
},
|
|
677
584
|
created: function () {
|
|
678
585
|
// this.reportTemplate = this.getReportTemplate();
|
|
@@ -1073,73 +980,6 @@ export default {
|
|
|
1073
980
|
openExportItemColumnsDialog() {
|
|
1074
981
|
this.showExportItemColumnsDialog = true;
|
|
1075
982
|
},
|
|
1076
|
-
getRowAddAuthName() {
|
|
1077
|
-
return this.optionModel.rowAddAuthName ?? this.optionModel.treeRowAddName;
|
|
1078
|
-
},
|
|
1079
|
-
getRowEditAuthName() {
|
|
1080
|
-
return (
|
|
1081
|
-
this.optionModel.rowEditAuthName ?? this.optionModel.treeRowEditName
|
|
1082
|
-
);
|
|
1083
|
-
},
|
|
1084
|
-
getRowAuthCode(authName) {
|
|
1085
|
-
if (!authName || !this.reportTemplate?.formCode) {
|
|
1086
|
-
return "";
|
|
1087
|
-
}
|
|
1088
|
-
return this.reportTemplate.formCode + ":" + authName;
|
|
1089
|
-
},
|
|
1090
|
-
createRowAuthName(type) {
|
|
1091
|
-
return `row${type}` + generateId();
|
|
1092
|
-
},
|
|
1093
|
-
onIsEditTableChange(enabled) {
|
|
1094
|
-
if (!enabled) {
|
|
1095
|
-
return;
|
|
1096
|
-
}
|
|
1097
|
-
if (!this.getRowAddAuthName()) {
|
|
1098
|
-
this.createRandomRowAddAuthName();
|
|
1099
|
-
}
|
|
1100
|
-
if (!this.getRowEditAuthName()) {
|
|
1101
|
-
this.createRandomRowEditAuthName();
|
|
1102
|
-
}
|
|
1103
|
-
},
|
|
1104
|
-
createRandomRowAddAuthName() {
|
|
1105
|
-
this.$set(
|
|
1106
|
-
this.optionModel,
|
|
1107
|
-
"rowAddAuthName",
|
|
1108
|
-
this.createRowAuthName("Add")
|
|
1109
|
-
);
|
|
1110
|
-
},
|
|
1111
|
-
createRandomRowEditAuthName() {
|
|
1112
|
-
this.$set(
|
|
1113
|
-
this.optionModel,
|
|
1114
|
-
"rowEditAuthName",
|
|
1115
|
-
this.createRowAuthName("Edit")
|
|
1116
|
-
);
|
|
1117
|
-
},
|
|
1118
|
-
createRandomRowAuthNames() {
|
|
1119
|
-
// this.createRandomRowAddAuthName();
|
|
1120
|
-
// this.createRandomRowEditAuthName();
|
|
1121
|
-
if (!this.getRowAddAuthName()) {
|
|
1122
|
-
this.createRandomRowAddAuthName();
|
|
1123
|
-
}
|
|
1124
|
-
if (!this.getRowEditAuthName()) {
|
|
1125
|
-
this.createRandomRowEditAuthName();
|
|
1126
|
-
}
|
|
1127
|
-
this.$message.success("生成成功");
|
|
1128
|
-
},
|
|
1129
|
-
copyAuthCode(content, clickEvent) {
|
|
1130
|
-
const clipboard = new Clipboard(clickEvent.target, {
|
|
1131
|
-
text: () => content,
|
|
1132
|
-
});
|
|
1133
|
-
clipboard.on("success", () => {
|
|
1134
|
-
this.$message.success("复制成功");
|
|
1135
|
-
clipboard.destroy();
|
|
1136
|
-
});
|
|
1137
|
-
clipboard.on("error", () => {
|
|
1138
|
-
this.$message.error("复制失败");
|
|
1139
|
-
clipboard.destroy();
|
|
1140
|
-
});
|
|
1141
|
-
clipboard.onClick(clickEvent);
|
|
1142
|
-
},
|
|
1143
983
|
},
|
|
1144
984
|
};
|
|
1145
985
|
</script>
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
title="编辑行按钮组配置"
|
|
4
|
+
:visible.sync="dialogVisible"
|
|
5
|
+
custom-class="dialog-style list-dialog"
|
|
6
|
+
:show-close="true"
|
|
7
|
+
append-to-body
|
|
8
|
+
:close-on-click-modal="false"
|
|
9
|
+
:close-on-press-escape="false"
|
|
10
|
+
:destroy-on-close="true"
|
|
11
|
+
width="520px"
|
|
12
|
+
v-dialog-drag
|
|
13
|
+
@close="handleClose"
|
|
14
|
+
>
|
|
15
|
+
<div class="cont">
|
|
16
|
+
<el-form label-width="150px" class="edit-tree-button-group-form">
|
|
17
|
+
<el-form-item label="新增按钮唯一名称">
|
|
18
|
+
<el-input
|
|
19
|
+
v-model="row.rowAddAuthName"
|
|
20
|
+
class="all-width"
|
|
21
|
+
placeholder="留空则不校验权限"
|
|
22
|
+
clearable
|
|
23
|
+
>
|
|
24
|
+
<el-tooltip
|
|
25
|
+
slot="suffix"
|
|
26
|
+
:enterable="false"
|
|
27
|
+
effect="dark"
|
|
28
|
+
content="随机生成"
|
|
29
|
+
placement="top"
|
|
30
|
+
>
|
|
31
|
+
<i
|
|
32
|
+
class="el-input__icon el-icon-refresh-right"
|
|
33
|
+
@click="createRandomRowAddAuthName"
|
|
34
|
+
></i>
|
|
35
|
+
</el-tooltip>
|
|
36
|
+
</el-input>
|
|
37
|
+
</el-form-item>
|
|
38
|
+
<el-form-item label="新增按钮编码" v-if="rowAddAuthCode">
|
|
39
|
+
<div class="auth-code-text">
|
|
40
|
+
<el-tooltip effect="light" content="复制">
|
|
41
|
+
<a
|
|
42
|
+
class="a-link"
|
|
43
|
+
style="color: unset"
|
|
44
|
+
@click="copyAuthCode(rowAddAuthCode, $event)"
|
|
45
|
+
>
|
|
46
|
+
<span
|
|
47
|
+
><i
|
|
48
|
+
class="el-icon-copy-document"
|
|
49
|
+
style="margin-right: 2px"
|
|
50
|
+
></i
|
|
51
|
+
>{{ rowAddAuthCode }}</span
|
|
52
|
+
>
|
|
53
|
+
</a>
|
|
54
|
+
</el-tooltip>
|
|
55
|
+
</div>
|
|
56
|
+
</el-form-item>
|
|
57
|
+
<el-form-item label="新增按钮唯一名称">
|
|
58
|
+
<el-input
|
|
59
|
+
v-model="row.rowEditAuthName"
|
|
60
|
+
class="all-width"
|
|
61
|
+
placeholder="留空则不校验权限"
|
|
62
|
+
clearable
|
|
63
|
+
>
|
|
64
|
+
<el-tooltip
|
|
65
|
+
slot="suffix"
|
|
66
|
+
:enterable="false"
|
|
67
|
+
effect="dark"
|
|
68
|
+
content="随机生成"
|
|
69
|
+
placement="top"
|
|
70
|
+
>
|
|
71
|
+
<i
|
|
72
|
+
class="el-input__icon el-icon-refresh-right"
|
|
73
|
+
@click="createRandomRowEditAuthName"
|
|
74
|
+
></i>
|
|
75
|
+
</el-tooltip>
|
|
76
|
+
</el-input>
|
|
77
|
+
</el-form-item>
|
|
78
|
+
<el-form-item label="编辑按钮编码" v-if="rowEditAuthCode">
|
|
79
|
+
<div class="auth-code-text">
|
|
80
|
+
<el-tooltip effect="light" content="复制">
|
|
81
|
+
<a
|
|
82
|
+
class="a-link"
|
|
83
|
+
style="color: unset"
|
|
84
|
+
@click="copyAuthCode(rowEditAuthCode, $event)"
|
|
85
|
+
>
|
|
86
|
+
<span
|
|
87
|
+
><i
|
|
88
|
+
class="el-icon-copy-document"
|
|
89
|
+
style="margin-right: 2px"
|
|
90
|
+
></i
|
|
91
|
+
>{{ rowEditAuthCode }}</span
|
|
92
|
+
>
|
|
93
|
+
</a>
|
|
94
|
+
</el-tooltip>
|
|
95
|
+
</div>
|
|
96
|
+
</el-form-item>
|
|
97
|
+
<el-form-item label="新增按钮显隐条件定义">
|
|
98
|
+
<a
|
|
99
|
+
href="javascript:void(0);"
|
|
100
|
+
class="a-link link-oneLind"
|
|
101
|
+
@click="editRowShowScript('rowAddShow')"
|
|
102
|
+
>
|
|
103
|
+
<span>{{ row.rowAddShow }}</span>
|
|
104
|
+
<i class="el-icon-edit"></i>
|
|
105
|
+
</a>
|
|
106
|
+
</el-form-item>
|
|
107
|
+
<el-form-item label="编辑按钮显隐条件定义">
|
|
108
|
+
<a
|
|
109
|
+
href="javascript:void(0);"
|
|
110
|
+
class="a-link link-oneLind"
|
|
111
|
+
@click="editRowShowScript('rowEditShow')"
|
|
112
|
+
>
|
|
113
|
+
<span>{{ row.rowEditShow }}</span>
|
|
114
|
+
<i class="el-icon-edit"></i>
|
|
115
|
+
</a>
|
|
116
|
+
</el-form-item>
|
|
117
|
+
</el-form>
|
|
118
|
+
</div>
|
|
119
|
+
<div slot="footer" class="dialog-footer">
|
|
120
|
+
<el-button class="button-sty" icon="el-icon-close" @click="handleClose">
|
|
121
|
+
{{ i18nt("designer.hint.cancel") }}
|
|
122
|
+
</el-button>
|
|
123
|
+
<el-button
|
|
124
|
+
type="primary"
|
|
125
|
+
class="button-sty"
|
|
126
|
+
icon="el-icon-check"
|
|
127
|
+
@click="handleConfirm"
|
|
128
|
+
>
|
|
129
|
+
{{ i18nt("designer.hint.confirm") }}
|
|
130
|
+
</el-button>
|
|
131
|
+
</div>
|
|
132
|
+
</el-dialog>
|
|
133
|
+
</template>
|
|
134
|
+
|
|
135
|
+
<script>
|
|
136
|
+
import i18n from "../../../../../../components/xform/utils/i18n";
|
|
137
|
+
import eventMixin from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
|
138
|
+
import { generateId } from "../../../../../../components/xform/utils/util";
|
|
139
|
+
import Clipboard from "clipboard";
|
|
140
|
+
|
|
141
|
+
export default {
|
|
142
|
+
name: "edit-tree-button-group-config-dialog",
|
|
143
|
+
mixins: [i18n, eventMixin],
|
|
144
|
+
props: {
|
|
145
|
+
visible: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: false,
|
|
148
|
+
},
|
|
149
|
+
row: {
|
|
150
|
+
type: Object,
|
|
151
|
+
required: true,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
inject: ["getReportTemplate"],
|
|
155
|
+
data() {
|
|
156
|
+
return {
|
|
157
|
+
rowShowParams: ["dataId", "formCode", "tableParam"],
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
computed: {
|
|
161
|
+
dialogVisible: {
|
|
162
|
+
get() {
|
|
163
|
+
return this.visible;
|
|
164
|
+
},
|
|
165
|
+
set(val) {
|
|
166
|
+
this.$emit("update:visible", val);
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
reportTemplate() {
|
|
170
|
+
return this.getReportTemplate();
|
|
171
|
+
},
|
|
172
|
+
rowAddAuthName() {
|
|
173
|
+
return this.getRowAddAuthName();
|
|
174
|
+
},
|
|
175
|
+
rowEditAuthName() {
|
|
176
|
+
return this.getRowEditAuthName();
|
|
177
|
+
},
|
|
178
|
+
rowAddAuthCode() {
|
|
179
|
+
return this.getRowAuthCode(this.rowAddAuthName);
|
|
180
|
+
},
|
|
181
|
+
rowEditAuthCode() {
|
|
182
|
+
return this.getRowAuthCode(this.rowEditAuthName);
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
watch: {
|
|
186
|
+
visible(val) {
|
|
187
|
+
if (val) {
|
|
188
|
+
this.ensureRowAuthNames();
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
methods: {
|
|
193
|
+
getRowAddAuthName() {
|
|
194
|
+
return this.row.rowAddAuthName ?? this.row.treeRowAddName;
|
|
195
|
+
},
|
|
196
|
+
getRowEditAuthName() {
|
|
197
|
+
return this.row.rowEditAuthName ?? this.row.treeRowEditName;
|
|
198
|
+
},
|
|
199
|
+
getRowAuthCode(authName) {
|
|
200
|
+
if (!authName || !this.reportTemplate?.formCode) {
|
|
201
|
+
return "";
|
|
202
|
+
}
|
|
203
|
+
return this.reportTemplate.formCode + ":" + authName;
|
|
204
|
+
},
|
|
205
|
+
createRowAuthName(type) {
|
|
206
|
+
return `row${type}` + generateId();
|
|
207
|
+
},
|
|
208
|
+
ensureRowAuthNames() {
|
|
209
|
+
if (!this.getRowAddAuthName()) {
|
|
210
|
+
this.$set(this.row, "rowAddAuthName", this.createRowAuthName("Add"));
|
|
211
|
+
}
|
|
212
|
+
if (!this.getRowEditAuthName()) {
|
|
213
|
+
this.$set(this.row, "rowEditAuthName", this.createRowAuthName("Edit"));
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
createRandomRowAddAuthName() {
|
|
217
|
+
this.$set(this.row, "rowAddAuthName", this.createRowAuthName("Add"));
|
|
218
|
+
this.$message.success("生成成功");
|
|
219
|
+
},
|
|
220
|
+
createRandomRowEditAuthName() {
|
|
221
|
+
this.$set(this.row, "rowEditAuthName", this.createRowAuthName("Edit"));
|
|
222
|
+
this.$message.success("生成成功");
|
|
223
|
+
},
|
|
224
|
+
editRowShowScript(eventName) {
|
|
225
|
+
this.editEventHandler(eventName, this.rowShowParams, {
|
|
226
|
+
customCode: () => this.row[eventName] || "",
|
|
227
|
+
callback: (code) => {
|
|
228
|
+
this.$set(this.row, eventName, code);
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
copyAuthCode(content, clickEvent) {
|
|
233
|
+
const clipboard = new Clipboard(clickEvent.target, {
|
|
234
|
+
text: () => content,
|
|
235
|
+
});
|
|
236
|
+
clipboard.on("success", () => {
|
|
237
|
+
this.$message.success("复制成功");
|
|
238
|
+
clipboard.destroy();
|
|
239
|
+
});
|
|
240
|
+
clipboard.on("error", () => {
|
|
241
|
+
this.$message.error("复制失败");
|
|
242
|
+
clipboard.destroy();
|
|
243
|
+
});
|
|
244
|
+
clipboard.onClick(clickEvent);
|
|
245
|
+
},
|
|
246
|
+
handleClose() {
|
|
247
|
+
this.dialogVisible = false;
|
|
248
|
+
},
|
|
249
|
+
handleConfirm() {
|
|
250
|
+
this.$emit("confirm", this.getRowConfigSnapshot());
|
|
251
|
+
this.dialogVisible = false;
|
|
252
|
+
},
|
|
253
|
+
getRowConfigSnapshot() {
|
|
254
|
+
return {
|
|
255
|
+
rowAddAuthName: this.row.rowAddAuthName,
|
|
256
|
+
rowEditAuthName: this.row.rowEditAuthName,
|
|
257
|
+
rowAddShow: this.row.rowAddShow,
|
|
258
|
+
rowEditShow: this.row.rowEditShow,
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
</script>
|
|
264
|
+
|
|
265
|
+
<style scoped lang="scss">
|
|
266
|
+
.edit-tree-button-group-form {
|
|
267
|
+
::v-deep .el-form-item {
|
|
268
|
+
margin-bottom: 12px;
|
|
269
|
+
}
|
|
270
|
+
::v-deep .el-form-item__label {
|
|
271
|
+
line-height: 28px;
|
|
272
|
+
}
|
|
273
|
+
::v-deep .el-form-item__content {
|
|
274
|
+
line-height: 28px;
|
|
275
|
+
}
|
|
276
|
+
.auth-code-text {
|
|
277
|
+
word-break: break-all;
|
|
278
|
+
line-height: 1.5;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
</style>
|
|
@@ -130,7 +130,8 @@
|
|
|
130
130
|
@click="openFormatConfigDialog(scope.row, scope.$index)"
|
|
131
131
|
:disabled="
|
|
132
132
|
!columnFormatMap[scope.row.formatS] &&
|
|
133
|
-
'widgetRender' !== scope.row.formatS
|
|
133
|
+
'widgetRender' !== scope.row.formatS &&
|
|
134
|
+
'editTreeButtonGroup' !== scope.row.formatS
|
|
134
135
|
"
|
|
135
136
|
></el-button>
|
|
136
137
|
</template>
|
|
@@ -265,6 +266,12 @@
|
|
|
265
266
|
:visiable.sync="showColumnRenderDialog"
|
|
266
267
|
@confirm="confirmWidgetRenderDialog"
|
|
267
268
|
></columnRenderDialog>
|
|
269
|
+
<editTreeButtonGroupConfigDialog
|
|
270
|
+
v-if="showEditTreeButtonGroupConfigDialog && editTreeButtonGroupRowData"
|
|
271
|
+
:visible.sync="showEditTreeButtonGroupConfigDialog"
|
|
272
|
+
:row="editTreeButtonGroupRowData"
|
|
273
|
+
@confirm="confirmEditTreeButtonGroupConfig"
|
|
274
|
+
/>
|
|
268
275
|
</div>
|
|
269
276
|
<div class="dialog-footer" slot="footer">
|
|
270
277
|
<el-button @click="closeHandle" class="button-sty" icon="el-icon-close">
|
|
@@ -490,7 +497,8 @@
|
|
|
490
497
|
@click="openFormatConfigDialog(rowData, rowDataIndex)"
|
|
491
498
|
:disabled="
|
|
492
499
|
!columnFormatMap[rowData.formatS] &&
|
|
493
|
-
'widgetRender' !== rowData.formatS
|
|
500
|
+
'widgetRender' !== rowData.formatS &&
|
|
501
|
+
'editTreeButtonGroup' !== rowData.formatS
|
|
494
502
|
"
|
|
495
503
|
></el-button>
|
|
496
504
|
</el-form-item>
|
|
@@ -620,6 +628,7 @@ import {
|
|
|
620
628
|
columnFormatMap,
|
|
621
629
|
} from "../../../../../../components/xform/utils/util";
|
|
622
630
|
import columnRenderDialog from "./columnRenderDialog.vue";
|
|
631
|
+
import editTreeButtonGroupConfigDialog from "./edit-tree-button-group-config-dialog.vue";
|
|
623
632
|
|
|
624
633
|
let businessOptions = [
|
|
625
634
|
{
|
|
@@ -648,7 +657,7 @@ export default {
|
|
|
648
657
|
selectedWidget: Object,
|
|
649
658
|
optionModel: Object,
|
|
650
659
|
},
|
|
651
|
-
components: { columnRenderDialog },
|
|
660
|
+
components: { columnRenderDialog, editTreeButtonGroupConfigDialog },
|
|
652
661
|
inject: ["openWidgetPropertyDialog"],
|
|
653
662
|
data() {
|
|
654
663
|
return {
|
|
@@ -659,6 +668,9 @@ export default {
|
|
|
659
668
|
tableColumnConfigCode: null,
|
|
660
669
|
showDialog: true,
|
|
661
670
|
dialogVisible: true,
|
|
671
|
+
showEditTreeButtonGroupConfigDialog: false,
|
|
672
|
+
currentEditTreeButtonGroupRow: null,
|
|
673
|
+
editTreeButtonGroupRowData: null,
|
|
662
674
|
alignOptions: [
|
|
663
675
|
{
|
|
664
676
|
value: "left",
|
|
@@ -1059,6 +1071,9 @@ export default {
|
|
|
1059
1071
|
getUuid() {
|
|
1060
1072
|
return new Date().getTime();
|
|
1061
1073
|
},
|
|
1074
|
+
createRowAuthName(type) {
|
|
1075
|
+
return `row${type}` + generateId();
|
|
1076
|
+
},
|
|
1062
1077
|
/**
|
|
1063
1078
|
* 生成一行数据
|
|
1064
1079
|
*/
|
|
@@ -1082,6 +1097,10 @@ export default {
|
|
|
1082
1097
|
footerMethodConfg: null,
|
|
1083
1098
|
widgetList: [],
|
|
1084
1099
|
labelColor: null,
|
|
1100
|
+
rowAddAuthName: this.createRowAuthName("Add"),
|
|
1101
|
+
rowEditAuthName: this.createRowAuthName("Edit"),
|
|
1102
|
+
rowAddShow: null,
|
|
1103
|
+
rowEditShow: null,
|
|
1085
1104
|
// treeNode: false,
|
|
1086
1105
|
};
|
|
1087
1106
|
return row;
|
|
@@ -1314,6 +1333,8 @@ export default {
|
|
|
1314
1333
|
row.label = null;
|
|
1315
1334
|
row.sortable = false;
|
|
1316
1335
|
row.width = 150;
|
|
1336
|
+
row.columnOption = {};
|
|
1337
|
+
row.widget = null;
|
|
1317
1338
|
} else if (isButtontCell) {
|
|
1318
1339
|
if (row.formatS == "dropdown") {
|
|
1319
1340
|
row.width = 100;
|
|
@@ -1494,7 +1515,20 @@ export default {
|
|
|
1494
1515
|
}
|
|
1495
1516
|
return widget;
|
|
1496
1517
|
},
|
|
1518
|
+
confirmEditTreeButtonGroupConfig(rowConfig) {
|
|
1519
|
+
if (this.currentEditTreeButtonGroupRow) {
|
|
1520
|
+
Object.assign(this.currentEditTreeButtonGroupRow, rowConfig);
|
|
1521
|
+
}
|
|
1522
|
+
this.currentEditTreeButtonGroupRow = null;
|
|
1523
|
+
this.editTreeButtonGroupRowData = null;
|
|
1524
|
+
},
|
|
1497
1525
|
openFormatConfigDialog(row, index) {
|
|
1526
|
+
if (row.formatS === "editTreeButtonGroup") {
|
|
1527
|
+
this.currentEditTreeButtonGroupRow = row;
|
|
1528
|
+
this.editTreeButtonGroupRowData = this.$baseLodash.cloneDeep(row);
|
|
1529
|
+
this.showEditTreeButtonGroupConfigDialog = true;
|
|
1530
|
+
return;
|
|
1531
|
+
}
|
|
1498
1532
|
if (row.formatS == "widgetRender") {
|
|
1499
1533
|
let formWidgetList = deepClone(this.designer.widgetList);
|
|
1500
1534
|
let tableData = deepClone(this.tableData);
|
|
@@ -1527,20 +1561,6 @@ export default {
|
|
|
1527
1561
|
return;
|
|
1528
1562
|
}
|
|
1529
1563
|
|
|
1530
|
-
/*let option = row.columnOption;
|
|
1531
|
-
let selectedWidget;
|
|
1532
|
-
let columnWidgetConfig = this.getColumnWidgetConfig(row);
|
|
1533
|
-
let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
|
|
1534
|
-
if (columnSelectedWidget) {
|
|
1535
|
-
option = columnSelectedWidget.options;
|
|
1536
|
-
selectedWidget = columnSelectedWidget;
|
|
1537
|
-
} else {
|
|
1538
|
-
option = {};
|
|
1539
|
-
selectedWidget = {};
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
let columnOption = this.$baseLodash.cloneDeep(option);
|
|
1543
|
-
row.columnOption = columnOption;*/
|
|
1544
1564
|
let selectedWidget = row.widget;
|
|
1545
1565
|
this.operateIndex = index;
|
|
1546
1566
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</el-select>
|
|
38
38
|
</template>
|
|
39
39
|
</el-form-item>
|
|
40
|
-
<el-form-item label="
|
|
40
|
+
<el-form-item label="按钮编码" v-show="showAuthCode">
|
|
41
41
|
<div style="word-break: break-all">
|
|
42
42
|
<el-tooltip effect="light" content="复制">
|
|
43
43
|
<a class="a-link" style="color: unset;" @click="copyAuthCode"><span><i class="el-icon-copy-document" style="margin-right:2px"></i>{{ authCode }}</span></a>
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { propertyRegistered } from './propertyRegister';
|
|
2
|
+
|
|
3
|
+
let propertyDialogSeed = 0;
|
|
4
|
+
|
|
5
|
+
function nextPropertyDialogId() {
|
|
6
|
+
propertyDialogSeed += 1;
|
|
7
|
+
return `widget-property-dialog-${Date.now()}-${propertyDialogSeed}`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
data() {
|
|
12
|
+
return {
|
|
13
|
+
widgetPropertyDialogs: [],
|
|
14
|
+
activePropertyDialogId: null,
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
getActivePropertyDialog() {
|
|
19
|
+
if (!this.widgetPropertyDialogs.length) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (this.activePropertyDialogId) {
|
|
23
|
+
const active = this.widgetPropertyDialogs.find(
|
|
24
|
+
(dlg) => dlg.id === this.activePropertyDialogId
|
|
25
|
+
);
|
|
26
|
+
if (active) {
|
|
27
|
+
return active;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return this.widgetPropertyDialogs[this.widgetPropertyDialogs.length - 1];
|
|
31
|
+
},
|
|
32
|
+
setActivePropertyDialog(id) {
|
|
33
|
+
this.activePropertyDialogId = id;
|
|
34
|
+
this.syncLegacyPropertyDialogState();
|
|
35
|
+
},
|
|
36
|
+
syncLegacyPropertyDialogState() {
|
|
37
|
+
const active = this.getActivePropertyDialog();
|
|
38
|
+
this.showDateConfigDialog = !!active;
|
|
39
|
+
this.columnSelectedWidget = active ? active.columnSelectedWidget : {};
|
|
40
|
+
this.columnEditFields = active ? active.columnEditFields : [];
|
|
41
|
+
this.formatConfig = active ? active.formatConfig : {};
|
|
42
|
+
this.tableColumns = active ? active.tableColumns : null;
|
|
43
|
+
},
|
|
44
|
+
openWidgetPropertyDialog(config) {
|
|
45
|
+
const id = nextPropertyDialogId();
|
|
46
|
+
const dialog = {
|
|
47
|
+
id,
|
|
48
|
+
visible: true,
|
|
49
|
+
title: config.title,
|
|
50
|
+
columnSelectedWidget: config.columnSelectedWidget || {},
|
|
51
|
+
columnEditFields: config.columnEditFields || null,
|
|
52
|
+
tableColumns: config.tableColumns,
|
|
53
|
+
formatConfig: config,
|
|
54
|
+
widgetActiveCollapseName1s: ['1', '3'],
|
|
55
|
+
};
|
|
56
|
+
this.widgetPropertyDialogs.push(dialog);
|
|
57
|
+
this.setActivePropertyDialog(id);
|
|
58
|
+
},
|
|
59
|
+
closeWidgetPropertyDialog(id, invokeCallback = false) {
|
|
60
|
+
const index = this.widgetPropertyDialogs.findIndex((dlg) => dlg.id === id);
|
|
61
|
+
if (index === -1) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const dialog = this.widgetPropertyDialogs[index];
|
|
65
|
+
if (invokeCallback && dialog.formatConfig && dialog.formatConfig.callback) {
|
|
66
|
+
const columnOption = this.$baseLodash.cloneDeep(
|
|
67
|
+
dialog.columnSelectedWidget.options
|
|
68
|
+
);
|
|
69
|
+
dialog.formatConfig.callback(columnOption);
|
|
70
|
+
}
|
|
71
|
+
this.widgetPropertyDialogs.splice(index, 1);
|
|
72
|
+
if (this.activePropertyDialogId === id) {
|
|
73
|
+
const last = this.widgetPropertyDialogs[this.widgetPropertyDialogs.length - 1];
|
|
74
|
+
this.activePropertyDialogId = last ? last.id : null;
|
|
75
|
+
}
|
|
76
|
+
this.syncLegacyPropertyDialogState();
|
|
77
|
+
},
|
|
78
|
+
handleWidgetPropertyDialogBeforeClose(dialog, done) {
|
|
79
|
+
this.closeWidgetPropertyDialog(dialog.id);
|
|
80
|
+
done();
|
|
81
|
+
},
|
|
82
|
+
confirmWidgetPropertyDialog(dialog) {
|
|
83
|
+
this.closeWidgetPropertyDialog(dialog.id, true);
|
|
84
|
+
},
|
|
85
|
+
hasPropEditorForDialog(dialog, propName, editorName) {
|
|
86
|
+
if (!editorName) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (dialog.columnEditFields && !dialog.columnEditFields.includes(propName)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const widget = dialog.columnSelectedWidget;
|
|
93
|
+
if (propName.indexOf('-') <= -1) {
|
|
94
|
+
const originalPropName = `${widget.type}-${propName}`;
|
|
95
|
+
if (propertyRegistered(originalPropName)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const propKey = propName.replace(`${widget.type}-`, '');
|
|
100
|
+
return this.designer.hasConfig(widget, propKey);
|
|
101
|
+
},
|
|
102
|
+
getPropEditorForDialog(dialog, propName, editorName) {
|
|
103
|
+
const widget = dialog.columnSelectedWidget;
|
|
104
|
+
const propKey = propName.replace(`${widget.type}-`, '');
|
|
105
|
+
const uniquePropName = `${widget.type}-${propKey}-editor`;
|
|
106
|
+
if (this.$options.components[uniquePropName]) {
|
|
107
|
+
return uniquePropName;
|
|
108
|
+
}
|
|
109
|
+
if (this.$root.$options.components[uniquePropName]) {
|
|
110
|
+
return uniquePropName;
|
|
111
|
+
}
|
|
112
|
+
return editorName;
|
|
113
|
+
},
|
|
114
|
+
showCollapseForDialog(dialog, props) {
|
|
115
|
+
for (const propName in props) {
|
|
116
|
+
if (!props.hasOwnProperty(propName)) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (this.hasPropEditorForDialog(dialog, propName, props[propName])) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
},
|
|
125
|
+
editEventHandler(eventName, eventParams, eventOptions) {
|
|
126
|
+
eventOptions = eventOptions || {};
|
|
127
|
+
const activeDialog = this.getActivePropertyDialog();
|
|
128
|
+
const eventWidget = activeDialog
|
|
129
|
+
? activeDialog.columnSelectedWidget
|
|
130
|
+
: this.selectedWidget;
|
|
131
|
+
this.curEventName = eventName;
|
|
132
|
+
this.eventHeader = `${this.optionModel.name}.${eventName}(${eventParams.join(', ')}) {`;
|
|
133
|
+
if (eventOptions.customCode) {
|
|
134
|
+
this.eventHandlerCode = eventOptions.customCode() || '';
|
|
135
|
+
} else {
|
|
136
|
+
this.eventHandlerCode = (eventWidget && eventWidget.options[eventName]) || '';
|
|
137
|
+
}
|
|
138
|
+
this.eventOption = eventOptions;
|
|
139
|
+
if (eventName === 'onCreated' && !this.optionModel.onCreated) {
|
|
140
|
+
this.eventHandlerCode = ' //组件创建生命周期\n console.log(\'test onCreated()\')\n';
|
|
141
|
+
}
|
|
142
|
+
this.showWidgetEventDialogFlag = true;
|
|
143
|
+
},
|
|
144
|
+
saveEventHandler() {
|
|
145
|
+
const editorAnnotations = this.$refs.ecEditor.getEditorAnnotations();
|
|
146
|
+
let hasError = false;
|
|
147
|
+
if (editorAnnotations && editorAnnotations.length > 0) {
|
|
148
|
+
editorAnnotations.forEach((item) => {
|
|
149
|
+
if (item.type === 'error') {
|
|
150
|
+
hasError = true;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
if (hasError) {
|
|
154
|
+
this.$message.error(this.i18nt('designer.hint.syntaxCheckWarning'));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const eventOptions = this.eventOption || {};
|
|
159
|
+
if (!eventOptions.callback) {
|
|
160
|
+
const activeDialog = this.getActivePropertyDialog();
|
|
161
|
+
const eventWidget = activeDialog
|
|
162
|
+
? activeDialog.columnSelectedWidget
|
|
163
|
+
: this.selectedWidget;
|
|
164
|
+
if (eventWidget) {
|
|
165
|
+
eventWidget.options[this.curEventName] = this.eventHandlerCode;
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
eventOptions.callback(this.eventHandlerCode);
|
|
169
|
+
}
|
|
170
|
+
this.showWidgetEventDialogFlag = false;
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
@@ -259,10 +259,6 @@ export const containers = [
|
|
|
259
259
|
tableConfig: null,
|
|
260
260
|
isEditTable: false,
|
|
261
261
|
isTreeTable: false,
|
|
262
|
-
rowAddAuthName: null,
|
|
263
|
-
rowEditAuthName: null,
|
|
264
|
-
rowAddShow: null,
|
|
265
|
-
rowEditShow: null,
|
|
266
262
|
wbsEnabled: false,
|
|
267
263
|
sortScriptCode: null,
|
|
268
264
|
importTemplateFile: null,
|
|
@@ -2731,26 +2731,27 @@ modules = {
|
|
|
2731
2731
|
let dispermissions = this.$store.getters.dispermissions;
|
|
2732
2732
|
return !dispermissions.includes(authCode);
|
|
2733
2733
|
},
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2734
|
+
getEditTreeButtonGroupConfig(obj) {
|
|
2735
|
+
let columnConfig = obj?.column?.params?.columnConfig || {};
|
|
2736
|
+
let tableOptions = this.widget.options || {};
|
|
2737
|
+
return {
|
|
2738
|
+
rowAddAuthName: columnConfig.rowAddAuthName,
|
|
2739
|
+
rowEditAuthName: columnConfig.rowEditAuthName,
|
|
2740
|
+
rowAddShow: columnConfig.rowAddShow,
|
|
2741
|
+
rowEditShow: columnConfig.rowEditShow,
|
|
2742
|
+
};
|
|
2738
2743
|
},
|
|
2739
|
-
|
|
2740
|
-
return (
|
|
2741
|
-
this.widget.options.rowEditAuthName ??
|
|
2742
|
-
this.widget.options.treeRowEditName
|
|
2743
|
-
);
|
|
2744
|
+
getRowAddAuthName(obj) {
|
|
2745
|
+
return this.getEditTreeButtonGroupConfig(obj).rowAddAuthName;
|
|
2744
2746
|
},
|
|
2745
|
-
|
|
2746
|
-
return (
|
|
2747
|
-
this.widget.options.rowAddShow ?? this.widget.options.treeRowAddShow
|
|
2748
|
-
);
|
|
2747
|
+
getRowEditAuthName(obj) {
|
|
2748
|
+
return this.getEditTreeButtonGroupConfig(obj).rowEditAuthName;
|
|
2749
2749
|
},
|
|
2750
|
-
|
|
2751
|
-
return (
|
|
2752
|
-
|
|
2753
|
-
|
|
2750
|
+
getRowAddShow(obj) {
|
|
2751
|
+
return this.getEditTreeButtonGroupConfig(obj).rowAddShow;
|
|
2752
|
+
},
|
|
2753
|
+
getRowEditShow(obj) {
|
|
2754
|
+
return this.getEditTreeButtonGroupConfig(obj).rowEditShow;
|
|
2754
2755
|
},
|
|
2755
2756
|
isRowButtonShow(script, obj) {
|
|
2756
2757
|
if (!script) {
|
|
@@ -2761,16 +2762,16 @@ modules = {
|
|
|
2761
2762
|
},
|
|
2762
2763
|
canShowRowAdd(obj) {
|
|
2763
2764
|
return (
|
|
2764
|
-
this.hasTableRowPermission(this.getRowAddAuthName()) &&
|
|
2765
|
-
this.isRowButtonShow(this.getRowAddShow(), obj)
|
|
2765
|
+
this.hasTableRowPermission(this.getRowAddAuthName(obj)) &&
|
|
2766
|
+
this.isRowButtonShow(this.getRowAddShow(obj), obj)
|
|
2766
2767
|
);
|
|
2767
2768
|
},
|
|
2768
2769
|
canShowRowEdit(obj) {
|
|
2769
2770
|
let isAddRow = !this.hasSaveRow(obj?.row);
|
|
2770
2771
|
if (isAddRow) return true;
|
|
2771
2772
|
return (
|
|
2772
|
-
this.hasTableRowPermission(this.getRowEditAuthName()) &&
|
|
2773
|
-
this.isRowButtonShow(this.getRowEditShow(), obj)
|
|
2773
|
+
this.hasTableRowPermission(this.getRowEditAuthName(obj)) &&
|
|
2774
|
+
this.isRowButtonShow(this.getRowEditShow(obj), obj)
|
|
2774
2775
|
);
|
|
2775
2776
|
},
|
|
2776
2777
|
editRowEvent(obj) {
|