cloud-web-corejs 1.0.54-dev.202 → 1.0.54-dev.204
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/excelExport/mixins.js +1 -1
- package/src/components/xform/form-designer/designer.js +0 -1
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +245 -1
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +30 -36
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/index.vue +4 -0
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +2 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +23 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +214 -129
- package/src/components/xform/form-designer/setting-panel/property-editor/multiple-editor.vue +8 -3
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +2 -0
- package/src/components/xform/form-render/container-item/data-table-item.vue +7 -4
- package/src/components/xform/form-render/container-item/data-table-mixin.js +225 -34
- package/src/components/xform/form-render/container-item/data-table-mixin2.js +2169 -0
- package/src/components/xform/form-render/indexMixin.js +65 -16
- package/src/components/xform/utils/formula-util.js +33 -12
- package/src/components/xform/utils/util.js +762 -999
- package/src/views/bd/setting/form_script/edit1.vue +8 -1
@@ -2,18 +2,14 @@
|
|
2
2
|
<div>
|
3
3
|
<el-form-item
|
4
4
|
:label="i18nt('designer.setting.formula')"
|
5
|
-
v-if="optionModel.formulaEnabled"
|
5
|
+
v-if="optionModel.formulaEnabled"
|
6
|
+
>
|
6
7
|
</el-form-item>
|
7
8
|
<el-form-item label-width="0" v-if="optionModel.formulaEnabled">
|
8
|
-
<el-tooltip
|
9
|
-
:content="formulaForView"
|
10
|
-
effect="light"
|
11
|
-
placement="top">
|
9
|
+
<el-tooltip :content="formulaForView" effect="light" placement="top">
|
12
10
|
<el-input v-model="formulaForView" readonly>
|
13
11
|
<template #append>
|
14
|
-
<el-button
|
15
|
-
@click="editFormula"
|
16
|
-
icon="el-icon-edit"></el-button>
|
12
|
+
<el-button @click="editFormula" icon="el-icon-edit"></el-button>
|
17
13
|
</template>
|
18
14
|
</el-input>
|
19
15
|
</el-tooltip>
|
@@ -29,7 +25,8 @@
|
|
29
25
|
:append-to-body="true"
|
30
26
|
width="70%"
|
31
27
|
top="0px"
|
32
|
-
ref="colFormulaDialog"
|
28
|
+
ref="colFormulaDialog"
|
29
|
+
>
|
33
30
|
<div class="cont">
|
34
31
|
<el-row>
|
35
32
|
<el-col :span="24">
|
@@ -47,12 +44,13 @@
|
|
47
44
|
size="small"
|
48
45
|
@click="clearFormula"
|
49
46
|
type="danger"
|
50
|
-
plain
|
47
|
+
plain
|
48
|
+
>
|
51
49
|
{{ i18nt("designer.hint.formulaClear") }}
|
52
50
|
</el-button>
|
53
51
|
</el-col>
|
54
52
|
</el-row>
|
55
|
-
<div ref="cmRef" style="height:83px;width:100%"></div>
|
53
|
+
<div ref="cmRef" style="height: 83px; width: 100%"></div>
|
56
54
|
</div>
|
57
55
|
<!-- -->
|
58
56
|
<div class="editor-bottom">
|
@@ -60,7 +58,8 @@
|
|
60
58
|
v-on:click="insertSymbol(item)"
|
61
59
|
size="default"
|
62
60
|
v-for="(item, idx) in operate"
|
63
|
-
:key="idx"
|
61
|
+
:key="idx"
|
62
|
+
>
|
64
63
|
{{ item }}
|
65
64
|
</el-button>
|
66
65
|
</div>
|
@@ -77,22 +76,25 @@
|
|
77
76
|
<el-input
|
78
77
|
:placeholder="i18nt('designer.hint.formulaSearch')"
|
79
78
|
v-model="filterText"
|
80
|
-
clearable
|
79
|
+
clearable
|
80
|
+
></el-input>
|
81
81
|
<div class="item-body-left">
|
82
82
|
<el-tree
|
83
83
|
ref="fieldTree"
|
84
84
|
:data="fieldTreeData"
|
85
85
|
:filter-node-method="filterNode"
|
86
|
-
@node-click="insertField"
|
86
|
+
@node-click="insertField"
|
87
|
+
>
|
87
88
|
<template #default="{ node, data }">
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
89
|
+
<span class="custom-tree-node">
|
90
|
+
<el-tooltip
|
91
|
+
effect="dark"
|
92
|
+
:content="node.label"
|
93
|
+
placement="right"
|
94
|
+
>
|
95
|
+
<span>{{ node.label }}</span>
|
96
|
+
</el-tooltip>
|
97
|
+
</span>
|
96
98
|
</template>
|
97
99
|
</el-tree>
|
98
100
|
</div>
|
@@ -103,11 +105,7 @@
|
|
103
105
|
<el-col :span="24">
|
104
106
|
<div class="group-item-right-top">
|
105
107
|
<div class="item-header">
|
106
|
-
{{
|
107
|
-
i18nt(
|
108
|
-
"designer.hint.formulaFunctionList"
|
109
|
-
)
|
110
|
-
}}
|
108
|
+
{{ i18nt("designer.hint.formulaFunctionList") }}
|
111
109
|
</div>
|
112
110
|
<div class="function-list">
|
113
111
|
<el-collapse v-model="funcActiveCollapseNames">
|
@@ -115,20 +113,26 @@
|
|
115
113
|
v-for="(item, index) in funcList"
|
116
114
|
:key="index"
|
117
115
|
:title="i18nt(item.fClass)"
|
118
|
-
:name="index"
|
116
|
+
:name="index"
|
117
|
+
>
|
119
118
|
<div
|
120
119
|
v-for="(info, i) in item.flist"
|
121
120
|
:key="i"
|
122
121
|
class="field-item"
|
123
122
|
@click="insertFunction(info.fName + '(')"
|
124
|
-
@mouseenter="
|
125
|
-
|
123
|
+
@mouseenter="
|
124
|
+
showIntro(
|
125
|
+
i18nt(info.fName),
|
126
|
+
i18nt(item.fClass),
|
127
|
+
i18nt(info.fIntro)
|
128
|
+
)
|
129
|
+
"
|
130
|
+
v-on:mouseleave="resetIntro"
|
131
|
+
>
|
126
132
|
<span>{{ info.fName }}</span>
|
127
|
-
<el-tag
|
128
|
-
:type="getClass(info.fType)"
|
133
|
+
<el-tag :type="getClass(info.fType)"
|
129
134
|
>{{ i18nt(info.fType) }}
|
130
|
-
</el-tag
|
131
|
-
>
|
135
|
+
</el-tag>
|
132
136
|
</div>
|
133
137
|
</el-collapse-item>
|
134
138
|
</el-collapse>
|
@@ -144,13 +148,15 @@
|
|
144
148
|
<ul>
|
145
149
|
<li
|
146
150
|
v-if="introduction.title !== ''"
|
147
|
-
style="font-size: 16px; color: #0a5d7c"
|
151
|
+
style="font-size: 16px; color: #0a5d7c"
|
152
|
+
>
|
148
153
|
{{ introduction.title }}
|
149
154
|
</li>
|
150
155
|
<li>
|
151
156
|
<div
|
152
157
|
class="intro-content"
|
153
|
-
v-html="introduction.content"
|
158
|
+
v-html="introduction.content"
|
159
|
+
></div>
|
154
160
|
</li>
|
155
161
|
</ul>
|
156
162
|
</div>
|
@@ -159,7 +165,11 @@
|
|
159
165
|
</el-row>
|
160
166
|
</div>
|
161
167
|
<div class="dialog-footer" slot="footer">
|
162
|
-
<el-button
|
168
|
+
<el-button
|
169
|
+
@click="formulaDialogVisible = false"
|
170
|
+
class="button-sty"
|
171
|
+
icon="el-icon-close"
|
172
|
+
>
|
163
173
|
{{ i18nt("designer.hint.cancel") }}
|
164
174
|
</el-button>
|
165
175
|
<el-button
|
@@ -176,8 +186,8 @@
|
|
176
186
|
</template>
|
177
187
|
|
178
188
|
<script>
|
179
|
-
import {basicSetup, EditorView} from "codemirror"
|
180
|
-
import {javascript} from "@codemirror/lang-javascript"
|
189
|
+
import {basicSetup, EditorView} from "codemirror";
|
190
|
+
import {javascript} from "@codemirror/lang-javascript";
|
181
191
|
import {EditorState} from "@codemirror/state";
|
182
192
|
import i18n from "@base/components/xform/utils/i18n";
|
183
193
|
import {
|
@@ -185,9 +195,15 @@ import {
|
|
185
195
|
getAllContainerWidgets,
|
186
196
|
getAllFieldWidgets,
|
187
197
|
getFieldWidgetById,
|
188
|
-
traverseFieldWidgetsOfContainer
|
198
|
+
traverseFieldWidgetsOfContainer,
|
199
|
+
loopHandleWidget
|
189
200
|
} from "@base/components/xform/utils/util";
|
190
|
-
import {
|
201
|
+
import {
|
202
|
+
placeholders,
|
203
|
+
baseTheme,
|
204
|
+
formulas,
|
205
|
+
FORMULA_REG_EXP,
|
206
|
+
} from "@base/components/xform/utils/formula-util";
|
191
207
|
|
192
208
|
export default {
|
193
209
|
name: "formula-editor",
|
@@ -197,21 +213,22 @@ export default {
|
|
197
213
|
designer: Object,
|
198
214
|
selectedWidget: Object,
|
199
215
|
optionModel: Object,
|
216
|
+
tableColumns: Array
|
200
217
|
},
|
201
218
|
computed: {
|
202
219
|
formulaForView() {
|
203
|
-
const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP)
|
220
|
+
const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP);
|
204
221
|
if (!matchResult) {
|
205
|
-
return this.optionModel.formula
|
222
|
+
return this.optionModel.formula;
|
206
223
|
}
|
207
224
|
|
208
|
-
let resultFormula = this.optionModel.formula
|
209
|
-
matchResult.forEach(mi => {
|
210
|
-
const secondPart = mi.split(
|
211
|
-
resultFormula = resultFormula.replaceAll(mi, secondPart)
|
212
|
-
})
|
225
|
+
let resultFormula = this.optionModel.formula;
|
226
|
+
matchResult.forEach((mi) => {
|
227
|
+
const secondPart = mi.split(".")[1];
|
228
|
+
resultFormula = resultFormula.replaceAll(mi, secondPart);
|
229
|
+
});
|
213
230
|
|
214
|
-
return resultFormula
|
231
|
+
return resultFormula;
|
215
232
|
},
|
216
233
|
},
|
217
234
|
watch: {
|
@@ -285,7 +302,9 @@ export default {
|
|
285
302
|
clearFormula(event) {
|
286
303
|
this.formula = ""; //CodeMirror 模式
|
287
304
|
this.tags = []; //el-tag模式
|
288
|
-
this.codeMirror.dispatch({
|
305
|
+
this.codeMirror.dispatch({
|
306
|
+
changes: {from: 0, to: this.codeMirror.state.doc.length, insert: ""},
|
307
|
+
});
|
289
308
|
},
|
290
309
|
|
291
310
|
/** 删除字符串str中的第n个subStr
|
@@ -306,83 +325,134 @@ export default {
|
|
306
325
|
return data.label.indexOf(value) !== -1;
|
307
326
|
},
|
308
327
|
|
328
|
+
traverseFieldWidgetsOfTableDataWidget(widget, callback) {
|
329
|
+
if (widget.type == "data-table") {
|
330
|
+
debugger
|
331
|
+
let loopDo = (t) => {
|
332
|
+
if (t.children && t.children.length) {
|
333
|
+
t.children.forEach((item) => {
|
334
|
+
loopDo(item);
|
335
|
+
});
|
336
|
+
} else {
|
337
|
+
if (t.widget) {
|
338
|
+
if (t.formatS == "editNumber") {
|
339
|
+
t.widget.options.label = t.label;
|
340
|
+
this.handleTableConfigData(t.widget, callback);
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
};
|
345
|
+
|
346
|
+
let tableColumns = this.tableColumns;
|
347
|
+
let columns = tableColumns ? tableColumns : widget.options.tableColumns
|
348
|
+
columns.forEach((item) => {
|
349
|
+
loopDo(item);
|
350
|
+
loopHandleWidget(item.widgetList, (item1) => {
|
351
|
+
if (item1.type == "number") {
|
352
|
+
this.handleTableConfigData(item1, callback);
|
353
|
+
}
|
354
|
+
});
|
355
|
+
});
|
356
|
+
}
|
357
|
+
},
|
358
|
+
handleTableConfigData(widget, callback) {
|
359
|
+
callback(widget);
|
360
|
+
},
|
309
361
|
loadFieldListToTree() {
|
310
|
-
this.fieldTreeData.length = 0 //先清空
|
362
|
+
this.fieldTreeData.length = 0; //先清空
|
311
363
|
|
312
364
|
const allFields = getAllFieldWidgets(this.designer.widgetList);
|
313
|
-
const allContainers = getAllContainerWidgets(this.designer.widgetList)
|
365
|
+
const allContainers = getAllContainerWidgets(this.designer.widgetList);
|
314
366
|
|
315
|
-
const subFormArray = []
|
316
|
-
let sfFieldArray = []
|
317
|
-
const subFormFieldMap = {}
|
367
|
+
const subFormArray = [];
|
368
|
+
let sfFieldArray = [];
|
369
|
+
const subFormFieldMap = {};
|
318
370
|
|
319
371
|
//获取子表单容器内部的字段
|
320
|
-
allContainers.forEach(con => {
|
321
|
-
if (
|
322
|
-
subFormArray.push(con.container)
|
372
|
+
allContainers.forEach((con) => {
|
373
|
+
if (con.type === "sub-form" || con.type === "grid-sub-form") {
|
374
|
+
subFormArray.push(con.container);
|
323
375
|
|
324
|
-
const tmpFieldArray = []
|
376
|
+
const tmpFieldArray = [];
|
325
377
|
const fwHandler = (fw) => {
|
326
|
-
if (!!fw.formItemFlag &&
|
327
|
-
tmpFieldArray.push(fw)
|
378
|
+
if (!!fw.formItemFlag && fw.type === "number") {
|
379
|
+
tmpFieldArray.push(fw);
|
328
380
|
}
|
329
|
-
}
|
330
|
-
traverseFieldWidgetsOfContainer(con.container, fwHandler)
|
331
|
-
subFormFieldMap[con.container.options.name] = tmpFieldArray
|
332
|
-
sfFieldArray = sfFieldArray.concat(tmpFieldArray)
|
381
|
+
};
|
382
|
+
traverseFieldWidgetsOfContainer(con.container, fwHandler);
|
383
|
+
subFormFieldMap[con.container.options.name] = tmpFieldArray;
|
384
|
+
sfFieldArray = sfFieldArray.concat(tmpFieldArray);
|
385
|
+
} else if (con.type === "data-table") {
|
386
|
+
subFormArray.push(con.container);
|
387
|
+
|
388
|
+
const tmpFieldArray = [];
|
389
|
+
const fwHandler = (fw) => {
|
390
|
+
if (!!fw.formItemFlag && fw.type === "number") {
|
391
|
+
tmpFieldArray.push(fw);
|
392
|
+
}
|
393
|
+
};
|
394
|
+
this.traverseFieldWidgetsOfTableDataWidget(con.container, fwHandler);
|
395
|
+
subFormFieldMap[con.container.options.name] = tmpFieldArray;
|
396
|
+
sfFieldArray = sfFieldArray.concat(tmpFieldArray);
|
333
397
|
}
|
334
|
-
})
|
398
|
+
});
|
335
399
|
|
336
400
|
//加载到树形组件数据对象
|
337
|
-
allFields.forEach(fld => {
|
338
|
-
if (!sfFieldArray.find(item => item.id === fld.field.id)) {
|
401
|
+
allFields.forEach((fld) => {
|
402
|
+
if (!sfFieldArray.find((item) => item.id === fld.field.id)) {
|
403
|
+
//排除子表单字段
|
339
404
|
const fieldNode = {
|
340
405
|
id: fld.field.id,
|
341
406
|
name: fld.field.options.name,
|
342
407
|
label: fld.field.options.label,
|
343
408
|
type: fld.field.type,
|
344
|
-
formItemFlag: true
|
345
|
-
}
|
346
|
-
|
347
|
-
if (
|
348
|
-
this.
|
409
|
+
formItemFlag: true,
|
410
|
+
};
|
411
|
+
|
412
|
+
if (
|
413
|
+
fieldNode.name !== this.optionModel.name &&
|
414
|
+
fieldNode.type === "number"
|
415
|
+
) {
|
416
|
+
//排除当前设置公式字段
|
417
|
+
this.fieldTreeData.push(fieldNode);
|
349
418
|
}
|
350
419
|
}
|
351
|
-
})
|
420
|
+
});
|
352
421
|
|
353
|
-
subFormArray.forEach(sf => {
|
422
|
+
subFormArray.forEach((sf) => {
|
354
423
|
const subFormNode = {
|
355
424
|
id: sf.id,
|
356
425
|
name: sf.options.name,
|
357
426
|
label: sf.options.label || sf.options.name,
|
358
427
|
type: sf.type,
|
359
428
|
formItemFlag: false,
|
360
|
-
children: []
|
361
|
-
}
|
429
|
+
children: [],
|
430
|
+
};
|
362
431
|
|
363
|
-
subFormFieldMap[sf.options.name].forEach(fld => {
|
432
|
+
subFormFieldMap[sf.options.name].forEach((fld) => {
|
364
433
|
const fieldNode = {
|
365
434
|
id: fld.id,
|
366
435
|
name: fld.options.name,
|
367
436
|
label: fld.options.label,
|
368
437
|
type: fld.type,
|
369
|
-
formItemFlag: true
|
370
|
-
}
|
438
|
+
formItemFlag: true,
|
439
|
+
};
|
371
440
|
|
372
|
-
if (fieldNode.name !== this.optionModel.name) {
|
373
|
-
|
441
|
+
if (fieldNode.name !== this.optionModel.name) {
|
442
|
+
//排除当前设置公式字段
|
443
|
+
subFormNode.children.push(fieldNode);
|
374
444
|
}
|
375
|
-
})
|
445
|
+
});
|
376
446
|
|
377
|
-
this.fieldTreeData.push(subFormNode)
|
378
|
-
})
|
447
|
+
this.fieldTreeData.push(subFormNode);
|
448
|
+
});
|
379
449
|
},
|
380
450
|
|
381
451
|
// 插入字段
|
382
452
|
insertField(obj, node, self) {
|
383
453
|
if (!!obj.formItemFlag) {
|
384
|
-
let fieldId = obj.id
|
385
|
-
let fieldLabel =
|
454
|
+
let fieldId = obj.id + "";
|
455
|
+
let fieldLabel = "[" + obj.label + "]";
|
386
456
|
this.updateCodeMirror(fieldId, fieldLabel, "field");
|
387
457
|
}
|
388
458
|
},
|
@@ -403,13 +473,13 @@ export default {
|
|
403
473
|
let obj = {
|
404
474
|
field: field,
|
405
475
|
text: text,
|
406
|
-
type: type
|
407
|
-
}
|
408
|
-
let selectionLet = obj.field.length + obj.text.length + obj.type.length
|
476
|
+
type: type,
|
477
|
+
};
|
478
|
+
let selectionLet = obj.field.length + obj.text.length + obj.type.length; //光标位置;
|
409
479
|
let code = `{{${obj.field}.${obj.text}.${obj.type}}}`;
|
410
480
|
if (type === "func") {
|
411
481
|
code += "()";
|
412
|
-
selectionLet = selectionLet + 7
|
482
|
+
selectionLet = selectionLet + 7;
|
413
483
|
} else {
|
414
484
|
selectionLet = selectionLet + 6;
|
415
485
|
}
|
@@ -419,19 +489,24 @@ export default {
|
|
419
489
|
changes: {
|
420
490
|
from: this.codeMirror.state.selection.main.head,
|
421
491
|
to: this.codeMirror.state.selection.main.head,
|
422
|
-
insert: code
|
492
|
+
insert: code,
|
493
|
+
},
|
494
|
+
selection: {
|
495
|
+
anchor: this.codeMirror.state.selection.main.head + selectionLet,
|
423
496
|
},
|
424
|
-
selection: {anchor: this.codeMirror.state.selection.main.head + selectionLet},
|
425
497
|
});
|
426
498
|
}
|
427
499
|
} else {
|
428
500
|
this.codeMirror.dispatch({
|
429
501
|
changes: {
|
430
|
-
from: this.codeMirror.state.selection.main.head,
|
502
|
+
from: this.codeMirror.state.selection.main.head,
|
503
|
+
to: this.codeMirror.state.selection.main.head,
|
504
|
+
insert: text,
|
505
|
+
},
|
506
|
+
selection: {
|
507
|
+
anchor: this.codeMirror.state.selection.main.head + text.length,
|
431
508
|
},
|
432
|
-
selection: {anchor: this.codeMirror.state.selection.main.head + text.length}
|
433
509
|
});
|
434
|
-
|
435
510
|
}
|
436
511
|
},
|
437
512
|
|
@@ -455,71 +530,83 @@ export default {
|
|
455
530
|
* 字段label可能在公式保存后再次被修改,当编辑公式时需要再次刷新公式中的字段label(不刷新也不会影响公式计算结果)
|
456
531
|
*/
|
457
532
|
refreshFormula() {
|
458
|
-
const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP)
|
533
|
+
const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP);
|
459
534
|
if (!matchResult) {
|
460
|
-
return this.optionModel.formula
|
535
|
+
return this.optionModel.formula;
|
461
536
|
}
|
462
537
|
|
463
|
-
matchResult.forEach(mi => {
|
464
|
-
const firstPart = mi.split(
|
465
|
-
const secondPart = mi.split(
|
466
|
-
const thirdPart = mi.split(
|
467
|
-
const nodeType = thirdPart.substring(0, thirdPart.length - 2)
|
468
|
-
if (nodeType ===
|
469
|
-
return
|
538
|
+
matchResult.forEach((mi) => {
|
539
|
+
const firstPart = mi.split(".")[0];
|
540
|
+
const secondPart = mi.split(".")[1];
|
541
|
+
const thirdPart = mi.split(".")[2];
|
542
|
+
const nodeType = thirdPart.substring(0, thirdPart.length - 2);
|
543
|
+
if (nodeType === "func") {
|
544
|
+
return;
|
470
545
|
}
|
471
546
|
|
472
|
-
const fieldId = firstPart.substring(2, firstPart.length)
|
473
|
-
const fieldSchema = getFieldWidgetById(
|
547
|
+
const fieldId = firstPart.substring(2, firstPart.length);
|
548
|
+
const fieldSchema = getFieldWidgetById(
|
549
|
+
this.designer.widgetList,
|
550
|
+
fieldId,
|
551
|
+
false
|
552
|
+
);
|
474
553
|
if (!!fieldSchema) {
|
475
|
-
const newLabel =
|
476
|
-
|
477
|
-
|
554
|
+
const newLabel =
|
555
|
+
fieldSchema.options.label || fieldSchema.options.name;
|
556
|
+
this.optionModel.formula = this.optionModel.formula.replace(
|
557
|
+
mi,
|
558
|
+
firstPart + ".[" + newLabel + "]." + thirdPart
|
559
|
+
);
|
478
560
|
} else {
|
479
|
-
this.$message.error(
|
561
|
+
this.$message.error(
|
562
|
+
this.i18nt("designer.hint.deletedFieldInFormula") + secondPart
|
563
|
+
);
|
480
564
|
}
|
481
|
-
})
|
565
|
+
});
|
482
566
|
},
|
483
567
|
|
484
568
|
// 打开编辑公式弹窗
|
485
569
|
editFormula() {
|
486
|
-
this.fieldTreeData.length = 0
|
570
|
+
this.fieldTreeData.length = 0;
|
487
571
|
// 初始化字段树
|
488
572
|
this.designer.widgetList.forEach((wItem) => {
|
489
573
|
if (this.optionModel.name !== wItem.id) {
|
490
574
|
//this.buildTreeNodeOfWidget(wItem, this.fieldTreeData);
|
491
|
-
this.loadFieldListToTree()
|
575
|
+
this.loadFieldListToTree();
|
492
576
|
}
|
493
|
-
})
|
577
|
+
});
|
494
578
|
|
495
|
-
console.log("设计器字段===>", this.fieldTreeData)
|
579
|
+
console.log("设计器字段===>", this.fieldTreeData);
|
496
580
|
|
497
581
|
// 加载当前字段计算公式tags
|
498
|
-
this.tags = deepClone(this.optionModel.formulaTags)
|
582
|
+
this.tags = deepClone(this.optionModel.formulaTags);
|
499
583
|
// this.formula = deepClone(this.optionModel.formula);
|
500
584
|
|
501
585
|
//const code = this.optionModel.formulaShow;
|
502
|
-
this.refreshFormula()
|
503
|
-
const code = this.optionModel.formula
|
504
|
-
this.formulaDialogVisible = true
|
586
|
+
this.refreshFormula();
|
587
|
+
const code = this.optionModel.formula;
|
588
|
+
this.formulaDialogVisible = true;
|
505
589
|
|
506
590
|
//==== codeMirror 挂载视图 ====
|
507
591
|
this.$nextTick(() => {
|
508
592
|
this.codeMirror = new EditorView({
|
509
593
|
state: EditorState.create({
|
510
594
|
doc: code,
|
511
|
-
extensions: [
|
512
|
-
|
595
|
+
extensions: [
|
596
|
+
basicSetup,
|
597
|
+
javascript(),
|
598
|
+
[baseTheme, [], placeholders],
|
599
|
+
],
|
513
600
|
}),
|
514
|
-
parent: this.$refs.cmRef
|
601
|
+
parent: this.$refs.cmRef,
|
515
602
|
});
|
516
|
-
console.log("编辑器实例==>", this.codeMirror)
|
517
|
-
})
|
603
|
+
console.log("编辑器实例==>", this.codeMirror);
|
604
|
+
});
|
518
605
|
},
|
519
606
|
|
520
607
|
// 保存计算公式
|
521
608
|
saveFormula() {
|
522
|
-
this.optionModel.formula = this.codeMirror.state.doc.text.join(
|
609
|
+
this.optionModel.formula = this.codeMirror.state.doc.text.join("");
|
523
610
|
this.formulaDialogVisible = false;
|
524
611
|
},
|
525
612
|
|
@@ -581,9 +668,7 @@ export default {
|
|
581
668
|
},
|
582
669
|
|
583
670
|
resetIntro() {
|
584
|
-
this.introTitle = this.i18nt(
|
585
|
-
"designer.hint.formulaFunctionExplain"
|
586
|
-
);
|
671
|
+
this.introTitle = this.i18nt("designer.hint.formulaFunctionExplain");
|
587
672
|
this.introduction = {
|
588
673
|
title: this.i18nt("designer.hint.formulaPleaseSelect"),
|
589
674
|
content:
|
package/src/components/xform/form-designer/setting-panel/property-editor/multiple-editor.vue
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<el-
|
4
|
-
|
2
|
+
<div>
|
3
|
+
<el-form-item :label="i18nt('designer.setting.multiple')">
|
4
|
+
<el-switch v-model="optionModel.multiple" @change="onMultipleSelected"></el-switch>
|
5
|
+
</el-form-item>
|
6
|
+
<el-form-item :label="i18nt('平铺选项')">
|
7
|
+
<el-switch v-model="optionModel.flatCollapseTags"></el-switch>
|
8
|
+
</el-form-item>
|
9
|
+
</div>
|
5
10
|
</template>
|
6
11
|
|
7
12
|
<script>
|
@@ -207,14 +207,15 @@
|
|
207
207
|
<template #widget="obj">
|
208
208
|
<component
|
209
209
|
:is="getColumnWidgetName(obj.column.params.widget)"
|
210
|
-
:field="
|
210
|
+
:field="fieldSchemaMap[obj.row._X_ROW_KEY][obj.column.params.widget.id]"
|
211
211
|
:form-model="globalModel.formModel"
|
212
212
|
:designer="null"
|
213
|
-
:key="
|
213
|
+
:key="fieldSchemaMap[obj.row._X_ROW_KEY][obj.column.params.widget.id].id"
|
214
214
|
:parent-widget="widget"
|
215
215
|
:columnConfig="obj.column.params.columnConfig"
|
216
216
|
:subFormRowIndex="obj.rowIndex"
|
217
217
|
:formItemProp="getColumnProp(widget,obj)"
|
218
|
+
:subFormRowId="obj.row._X_ROW_KEY"
|
218
219
|
:tableParam="obj"
|
219
220
|
>
|
220
221
|
<template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
|
@@ -234,6 +235,7 @@
|
|
234
235
|
:parent-widget="widget"
|
235
236
|
:columnConfig="obj.column.params.columnConfig"
|
236
237
|
:subFormRowIndex="obj.rowIndex"
|
238
|
+
:subFormRowId="obj.row._X_ROW_KEY"
|
237
239
|
formItemProp="false"
|
238
240
|
:tableParam="obj"
|
239
241
|
>
|
@@ -246,13 +248,14 @@
|
|
246
248
|
<template #editWidget="obj">
|
247
249
|
<component
|
248
250
|
:is="getColumnWidgetName(obj.column.params.editWidget)"
|
249
|
-
:field="
|
251
|
+
:field="fieldSchemaMap[obj.row._X_ROW_KEY][obj.column.params.editWidget.id]"
|
250
252
|
:form-model="globalModel.formModel"
|
251
253
|
:designer="null"
|
252
|
-
:key="
|
254
|
+
:key="fieldSchemaMap[obj.row._X_ROW_KEY][obj.column.params.editWidget.id].id"
|
253
255
|
:parent-widget="widget"
|
254
256
|
:columnConfig="obj.column.params.columnConfig"
|
255
257
|
:subFormRowIndex="obj.rowIndex"
|
258
|
+
:subFormRowId="obj.row._X_ROW_KEY"
|
256
259
|
:formItemProp="getColumnProp(widget, obj,true)"
|
257
260
|
:tableParam="obj"
|
258
261
|
>
|