cloud-web-corejs 1.0.54-dev.200 → 1.0.54-dev.202

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.
@@ -1,28 +1,35 @@
1
1
  <template>
2
2
  <div>
3
- <el-form-item v-if="optionModel.formulaEnabled" :label="i18nt('designer.setting.formula')">
4
- <el-tooltip effect="light" :content="formulaForView" placement="top">
3
+ <el-form-item
4
+ :label="i18nt('designer.setting.formula')"
5
+ v-if="optionModel.formulaEnabled">
6
+ </el-form-item>
7
+ <el-form-item label-width="0" v-if="optionModel.formulaEnabled">
8
+ <el-tooltip
9
+ :content="formulaForView"
10
+ effect="light"
11
+ placement="top">
5
12
  <el-input v-model="formulaForView" readonly>
6
- <template slot="append">
7
- <el-button icon="el-icon-edit" @click="editFormula"></el-button>
13
+ <template #append>
14
+ <el-button
15
+ @click="editFormula"
16
+ icon="el-icon-edit"></el-button>
8
17
  </template>
9
18
  </el-input>
10
19
  </el-tooltip>
11
20
  </el-form-item>
12
21
  <el-dialog
22
+ v-if="formulaDialogVisible"
13
23
  :visible.sync="formulaDialogVisible"
14
24
  :title="i18nt('designer.hint.formulaSetting')"
25
+ custom-class="dialog-style list-dialog"
15
26
  :close-on-click-modal="false"
16
27
  :close-on-press-escape="false"
17
28
  :destroy-on-close="true"
18
29
  :append-to-body="true"
19
- top="0px"
20
30
  width="70%"
21
- ref="colFormulaDialog"
22
- custom-class="dialog-style list-dialog dialog-checkbox pd_0"
23
- v-el-drag-dialog
24
- v-el-dialog-center
25
- >
31
+ top="0px"
32
+ ref="colFormulaDialog">
26
33
  <div class="cont">
27
34
  <el-row>
28
35
  <el-col :span="24">
@@ -30,98 +37,64 @@
30
37
  <div class="editor-top">
31
38
  <el-row>
32
39
  <el-col :span="22">
33
- <div style="font-weight: bold;"> {{ optionModel.label }} =</div>
40
+ <div style="font-weight: bold">
41
+ {{ this.optionModel.label }} =
42
+ </div>
34
43
  </el-col>
44
+ <!-- el-tag 模式 按钮 end -->
35
45
  <el-col :span="2">
36
- <el-button size="small" @click="clearFormula" type="danger"
37
- plain=""> 清除
46
+ <el-button
47
+ size="small"
48
+ @click="clearFormula"
49
+ type="danger"
50
+ plain>
51
+ {{ i18nt("designer.hint.formulaClear") }}
38
52
  </el-button>
39
53
  </el-col>
40
54
  </el-row>
41
- <!-- <div class="el-row">
42
- <div class="el-col el-col-22">
43
- <div style="font-weight: bold;"> 年龄 =</div>
44
- </div>
45
- <div class="el-col el-col-2">
46
- <button type="button"
47
- class="el-button el-button&#45;&#45;danger el-button&#45;&#45;small is-plain">&lt;!&ndash;&ndash;&gt;&lt;!&ndash;&ndash;&gt;<span> 清除 </span>
48
- </button>
49
- </div>
50
- </div>-->
51
- <div ref="cmRef" style="height: 110px; width: 100%;">
52
- <editor-content :editor="codeMirror" />
53
- </div>
54
- <!-- <div style="height: 110px; width: 100%;">
55
- <codemirror
56
- ref="codeEditor"
57
- v-model="formulaStr"
58
- :options="cmOptions"
59
- @input="codeMirrorChange"
60
- ></codemirror>
61
- </div>-->
55
+ <div ref="cmRef" style="height:83px;width:100%"></div>
62
56
  </div>
57
+ <!-- -->
63
58
  <div class="editor-bottom">
64
- <template v-for="(item,index) in operate">
65
- <el-button :key="index" size="default" @click="insertSymbol(item)">{{ item }}</el-button>
66
- </template>
67
- <!-- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
68
- &lt;!&ndash;&ndash;&gt;<span> + </span></button>
69
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
70
- &lt;!&ndash;&ndash;&gt;<span> - </span></button>
71
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
72
- &lt;!&ndash;&ndash;&gt;<span> * </span></button>
73
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
74
- &lt;!&ndash;&ndash;&gt;<span> / </span></button>
75
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
76
- &lt;!&ndash;&ndash;&gt;<span> != </span></button>
77
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
78
- &lt;!&ndash;&ndash;&gt;<span> == </span></button>
79
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
80
- &lt;!&ndash;&ndash;&gt;<span> &lt; </span></button>
81
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
82
- &lt;!&ndash;&ndash;&gt;<span> &gt; </span></button>
83
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
84
- &lt;!&ndash;&ndash;&gt;<span> &lt;= </span></button>
85
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
86
- &lt;!&ndash;&ndash;&gt;<span> &gt;= </span></button>
87
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
88
- &lt;!&ndash;&ndash;&gt;<span> ( </span></button>
89
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
90
- &lt;!&ndash;&ndash;&gt;<span> ) </span></button>
91
- <button type="button" class="el-button el-button&#45;&#45;default el-button&#45;&#45;default">&lt;!&ndash;&ndash;&gt;
92
- &lt;!&ndash;&ndash;&gt;<span> , </span></button>-->
59
+ <el-button
60
+ v-on:click="insertSymbol(item)"
61
+ size="default"
62
+ v-for="(item, idx) in operate"
63
+ :key="idx">
64
+ {{ item }}
65
+ </el-button>
93
66
  </div>
67
+ <!-- -->
94
68
  </div>
95
69
  </el-col>
96
70
  </el-row>
97
- <el-row style="margin: 10px;">
71
+ <el-row style="margin: 10px">
98
72
  <el-col :span="6">
99
73
  <div class="group-item-left">
100
- <div class="item-header"> 组件列表</div>
101
- <el-input v-model="filterText" :placeholder="i18nt('designer.hint.formulaSearch')" clearable></el-input>
74
+ <div class="item-header">
75
+ {{ i18nt("designer.hint.formulaWidgetList") }}
76
+ </div>
77
+ <el-input
78
+ :placeholder="i18nt('designer.hint.formulaSearch')"
79
+ v-model="filterText"
80
+ clearable></el-input>
102
81
  <div class="item-body-left">
103
82
  <el-tree
104
83
  ref="fieldTree"
105
84
  :data="fieldTreeData"
106
85
  :filter-node-method="filterNode"
107
- @node-click="insertField"
108
- >
109
- <span class="custom-tree-node" slot-scope="{ node }">
110
- <el-tooltip effect="dark" :content="node.label" placement="right">
111
- <span>{{ node.label }}</span>
112
- </el-tooltip>
113
- </span>
86
+ @node-click="insertField">
87
+ <template #default="{ node, data }">
88
+ <span class="custom-tree-node">
89
+ <el-tooltip
90
+ effect="dark"
91
+ :content="node.label"
92
+ placement="right">
93
+ <span>{{ node.label }}</span>
94
+ </el-tooltip>
95
+ </span>
96
+ </template>
114
97
  </el-tree>
115
- <!-- <div role="tree" class="el-tree">
116
- <div role="treeitem" tabindex="0" draggable="false" class="el-tree-node is-focusable">
117
- <div class="el-tree-node__content" style="padding-left: 0px;"><span
118
- class="is-leaf el-tree-node__expand-icon el-icon-caret-right"></span>&lt;!&ndash;&ndash;&gt;&lt;!&ndash;&ndash;&gt;
119
- <span
120
- class="custom-tree-node"><span class="el-tooltip"
121
- aria-describedby="el-tooltip-4169" tabindex="0">number</span></span>
122
- </div>&lt;!&ndash;&ndash;&gt;</div>&lt;!&ndash;&ndash;&gt;
123
- <div class="el-tree__drop-indicator" style="display: none;"></div>
124
- </div>-->
125
98
  </div>
126
99
  </div>
127
100
  </el-col>
@@ -129,77 +102,36 @@
129
102
  <el-row>
130
103
  <el-col :span="24">
131
104
  <div class="group-item-right-top">
132
- <div class="item-header"> 函数列表</div>
105
+ <div class="item-header">
106
+ {{
107
+ i18nt(
108
+ "designer.hint.formulaFunctionList"
109
+ )
110
+ }}
111
+ </div>
133
112
  <div class="function-list">
134
113
  <el-collapse v-model="funcActiveCollapseNames">
135
- <el-collapse-item v-for="(item,index) in funcList" :key="index" :name="index"
136
- :title="i18nt(item.fClass)">
137
- <div v-for="(item2,index2) in item.flist" :key="index2" class="field-item"
138
- @click="insertFunction(item2.fName +'(')"
139
- @mouseenter="showIntro(i18nt(item2.fName),i18nt(item.fClass),i18nt(item2.fIntro))"
140
- @mouseleave="resetIntro">
141
- <span>{{ item2.fName }}</span><span
142
- class="el-tag el-tag--light">{{ i18nt(item2.fType) }} </span></div>
143
- <!-- <div class="field-item"><span>SUM</span><span
144
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
145
- <div class="field-item"><span>AVERAGE</span><span
146
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
147
- <div class="field-item"><span>MAX</span><span
148
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
149
- <div class="field-item"><span>MIN</span><span
150
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
151
- <div class="field-item"><span>ABS</span><span
152
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
153
- <div class="field-item"><span>ROUND</span><span
154
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
155
- <div class="field-item"><span>CEILING</span><span
156
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
157
- <div class="field-item"><span>LOG</span><span
158
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
159
- <div class="field-item"><span>MOD</span><span
160
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
161
- <div class="field-item"><span>POWER</span><span
162
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>-->
114
+ <el-collapse-item
115
+ v-for="(item, index) in funcList"
116
+ :key="index"
117
+ :title="i18nt(item.fClass)"
118
+ :name="index">
119
+ <div
120
+ v-for="(info, i) in item.flist"
121
+ :key="i"
122
+ class="field-item"
123
+ @click="insertFunction(info.fName + '(')"
124
+ @mouseenter="showIntro(i18nt(info.fName), i18nt(item.fClass), i18nt(info.fIntro))"
125
+ v-on:mouseleave="resetIntro">
126
+ <span>{{ info.fName }}</span>
127
+ <el-tag
128
+ :type="getClass(info.fType)"
129
+ >{{ i18nt(info.fType) }}
130
+ </el-tag
131
+ >
132
+ </div>
163
133
  </el-collapse-item>
164
134
  </el-collapse>
165
- <!-- <div role="tablist" aria-multiselectable="true" class="el-collapse">
166
- <div class="el-collapse-item is-active">
167
- <div role="tab" aria-expanded="true" aria-controls="el-collapse-content-7683"
168
- aria-describedby="el-collapse-content-7683">
169
- <div role="button" id="el-collapse-head-7683" tabindex="0"
170
- class="el-collapse-item__header is-active">数学函数<i
171
- class="el-collapse-item__arrow el-icon-arrow-right is-active"></i></div>
172
- </div>
173
- <div role="tabpanel" aria-labelledby="el-collapse-head-7683" id="el-collapse-content-7683"
174
- class="el-collapse-item__wrap">
175
- <div class="el-collapse-item__content">
176
- <div class="field-item"><span>INT</span><span
177
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
178
- <div class="field-item"><span>SUM</span><span
179
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
180
- <div class="field-item"><span>AVERAGE</span><span
181
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
182
- <div class="field-item"><span>MAX</span><span
183
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
184
- <div class="field-item"><span>MIN</span><span
185
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
186
- <div class="field-item"><span>ABS</span><span
187
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
188
- <div class="field-item"><span>ROUND</span><span
189
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
190
- <div class="field-item"><span>CEILING</span><span
191
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
192
- <div class="field-item"><span>LOG</span><span
193
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
194
- <div class="field-item"><span>MOD</span><span
195
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
196
- <div class="field-item"><span>POWER</span><span
197
- class="el-tag el-tag&#45;&#45;light">数字 </span></div>
198
- </div>
199
- </div>
200
- </div>
201
- </div>-->
202
-
203
135
  </div>
204
136
  </div>
205
137
  </el-col>
@@ -210,12 +142,15 @@
210
142
  <div class="item-header">{{ introTitle }}</div>
211
143
  <div class="item-body-right-bottom">
212
144
  <ul>
213
- <li v-if="!!introduction.title" style="font-size: 16px; color: rgb(10, 93, 124);"> {{
214
- introduction.title
215
- }}
145
+ <li
146
+ v-if="introduction.title !== ''"
147
+ style="font-size: 16px; color: #0a5d7c">
148
+ {{ introduction.title }}
216
149
  </li>
217
150
  <li>
218
- <div class="intro-content" v-html="introduction.content"></div>
151
+ <div
152
+ class="intro-content"
153
+ v-html="introduction.content"></div>
219
154
  </li>
220
155
  </ul>
221
156
  </div>
@@ -223,37 +158,41 @@
223
158
  </el-col>
224
159
  </el-row>
225
160
  </div>
226
- <span slot="footer" class="dialog-footer">
227
- <el-button @click="formulaDialogVisible = false">{{ $t2('取 消', 'system.button.cancel2') }}</el-button>
228
- <el-button type="primary" @click="saveFormula">{{ $t2('确 定', 'system.button.confirm2') }}</el-button>
229
- </span>
161
+ <div class="dialog-footer" slot="footer">
162
+ <el-button @click="formulaDialogVisible = false" class="button-sty" icon="el-icon-close">
163
+ {{ i18nt("designer.hint.cancel") }}
164
+ </el-button>
165
+ <el-button
166
+ type="primary"
167
+ @click="saveFormula"
168
+ class="button-sty"
169
+ icon="el-icon-check"
170
+ >
171
+ {{ i18nt("designer.hint.confirm") }}
172
+ </el-button>
173
+ </div>
230
174
  </el-dialog>
231
175
  </div>
232
176
  </template>
233
177
 
234
178
  <script>
235
- import i18n from "../../../../../components/xform/utils/i18n"
236
-
237
- /*import { Editor, EditorContent } from '@tiptap/vue-2'
238
- import StarterKit from '@tiptap/starter-kit'
239
- import {Schema, DOMParser} from "prosemirror-model"*/
240
-
241
- import {
242
- formulas,
243
- FORMULA_REG_EXP,
244
- } from "../../../../../components/xform/utils/formula";
179
+ import {basicSetup, EditorView} from "codemirror"
180
+ import {javascript} from "@codemirror/lang-javascript"
181
+ import {EditorState} from "@codemirror/state";
182
+ import i18n from "@base/components/xform/utils/i18n";
245
183
  import {
246
184
  deepClone,
247
- getAllFieldWidgets,
248
185
  getAllContainerWidgets,
249
- traverseFieldWidgetsOfContainer, getFieldWidgetById
250
- } from "../../../../../components/xform/utils/util";
251
-
186
+ getAllFieldWidgets,
187
+ getFieldWidgetById,
188
+ traverseFieldWidgetsOfContainer
189
+ } from "@base/components/xform/utils/util";
190
+ import {placeholders, baseTheme, formulas, FORMULA_REG_EXP} from "@base/components/xform/utils/formula-util";
252
191
 
253
192
  export default {
254
193
  name: "formula-editor",
255
194
  mixins: [i18n],
256
- components: {/*EditorContent*/},
195
+ components: {},
257
196
  props: {
258
197
  designer: Object,
259
198
  selectedWidget: Object,
@@ -261,46 +200,33 @@ export default {
261
200
  },
262
201
  computed: {
263
202
  formulaForView() {
264
- const o = this.optionModel.formula.match(FORMULA_REG_EXP);
265
- if (!o) return this.optionModel.formula;
266
- let e = this.optionModel.formula;
267
- return (
268
- o.forEach((n) => {
269
- const l = n.split(".")[1];
270
- e = e.replaceAll(n, l);
271
- }),
272
- e
273
- );
203
+ const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP)
204
+ if (!matchResult) {
205
+ return this.optionModel.formula
206
+ }
207
+
208
+ let resultFormula = this.optionModel.formula
209
+ matchResult.forEach(mi => {
210
+ const secondPart = mi.split('.')[1]
211
+ resultFormula = resultFormula.replaceAll(mi, secondPart)
212
+ })
213
+
214
+ return resultFormula
274
215
  },
275
216
  },
276
217
  watch: {
277
- filterText(o) {
278
- this.$refs.fieldTree.filter(o);
218
+ filterText(val) {
219
+ this.$refs.fieldTree.filter(val);
279
220
  },
280
221
  },
281
222
  data() {
282
223
  return {
283
- cmOptions: {
284
- // 语言及语法模式
285
- mode: 'text/javascript',
286
- // 主题
287
- theme: "idea",
288
- // 显示函数
289
- line: true,
290
- lineNumbers: false,
291
- // 软换行
292
- lineWrapping: true,
293
- // tab宽度
294
- tabSize: 4,
295
- },
296
- formulaStr:"",
297
-
298
224
  codeMirror: null,
299
225
  formula: "",
300
- tags: [],
301
- fieldTreeData: [],
226
+ tags: [], // 公式页签集合
227
+ fieldTreeData: [], // 设计器字段树
302
228
  filterText: "",
303
- formulaDialogVisible: !1,
229
+ formulaDialogVisible: false,
304
230
  operate: [
305
231
  "+",
306
232
  "-",
@@ -325,9 +251,7 @@ export default {
325
251
  value: "large",
326
252
  },
327
253
  {
328
- label: this.i18nt(
329
- "designer.hint.formulaSizeMedium"
330
- ),
254
+ label: this.i18nt("designer.hint.formulaSizeMedium"),
331
255
  value: "default",
332
256
  },
333
257
  {
@@ -339,19 +263,17 @@ export default {
339
263
  value: "small",
340
264
  },
341
265
  ],
342
- introTitle: this.i18nt(
343
- "designer.hint.formulaFunctionExplain"
344
- ),
266
+ introTitle: this.i18nt("designer.hint.formulaFunctionExplain"),
345
267
  introduction: {
346
268
  title: this.i18nt("designer.hint.formulaPleaseSelect"),
347
269
  content:
348
- '<span class="cg">'
349
- + this.i18nt("designer.hint.formulaSample")
350
- + ':</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">'
351
- + this.i18nt("designer.hint.formulaPara")
352
- + '1</span><span class="cg">,</span><span class="cs">'
353
- + this.i18nt("designer.hint.formulaPara")
354
- + '2</span><span class="cg">)</span>',
270
+ '<span class="cg">' +
271
+ this.i18nt("designer.hint.formulaSample") +
272
+ ':</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">' +
273
+ this.i18nt("designer.hint.formulaPara") +
274
+ '1</span><span class="cg">,</span><span class="cs">' +
275
+ this.i18nt("designer.hint.formulaPara") +
276
+ '2</span><span class="cg">)</span>',
355
277
  },
356
278
  funcList: formulas,
357
279
  funcActiveCollapseNames: [0],
@@ -360,332 +282,476 @@ export default {
360
282
  mounted() {
361
283
  },
362
284
  methods: {
363
- clearFormula(o) {
364
- (this.formula = ""),
365
- (this.tags = []),
366
- this.codeMirror.view.dispatch({
367
- changes: {
368
- from: 0,
369
- to: this.codeMirror.view.state.doc.length,
370
- insert: "",
371
- },
372
- });
285
+ clearFormula(event) {
286
+ this.formula = ""; //CodeMirror 模式
287
+ this.tags = []; //el-tag模式
288
+ this.codeMirror.dispatch({changes: {from: 0, to: this.codeMirror.state.doc.length, insert: ""}})
373
289
  },
374
- deleteChar(o, e, n) {
375
- let l = -1;
376
- return o.replace(/a/g, (s) => (l++, l === n ? "" : s));
290
+
291
+ /** 删除字符串str中的第n个subStr
292
+ * @param {Object} str
293
+ * @param {Object} subStr
294
+ * @param {Object} n
295
+ */
296
+ deleteChar(str, subStr, n) {
297
+ let num = -1;
298
+ return str.replace(/a/g, (item) => {
299
+ num++;
300
+ return num === n ? "" : item;
301
+ });
377
302
  },
378
- filterNode(o, e) {
379
- return o ? e.label.indexOf(o) !== -1 : !0;
303
+
304
+ filterNode(value, data) {
305
+ if (!value) return true;
306
+ return data.label.indexOf(value) !== -1;
380
307
  },
308
+
381
309
  loadFieldListToTree() {
382
- this.fieldTreeData.length = 0;
383
- const o = getAllFieldWidgets(this.designer.widgetList),
384
- e = getAllContainerWidgets(this.designer.widgetList),
385
- n = [];
386
- let l = [];
387
- const s = {};
388
- e.forEach((c) => {
389
- if (
390
- c.type === "sub-form"
391
- || c.type === "grid-sub-form"
392
- ) {
393
- n.push(c.container);
394
- const u = [],
395
- $ = (g) => {
396
- !!g.formItemFlag
397
- && g.type === "number"
398
- && u.push(g);
399
- };
400
- traverseFieldWidgetsOfContainer(c.container, $),
401
- (s[c.container.options.name] = u),
402
- (l = l.concat(u));
310
+ this.fieldTreeData.length = 0 //先清空
311
+
312
+ const allFields = getAllFieldWidgets(this.designer.widgetList);
313
+ const allContainers = getAllContainerWidgets(this.designer.widgetList)
314
+
315
+ const subFormArray = []
316
+ let sfFieldArray = []
317
+ const subFormFieldMap = {}
318
+
319
+ //获取子表单容器内部的字段
320
+ allContainers.forEach(con => {
321
+ if ((con.type === 'sub-form') || (con.type === 'grid-sub-form')) {
322
+ subFormArray.push(con.container)
323
+
324
+ const tmpFieldArray = []
325
+ const fwHandler = (fw) => {
326
+ if (!!fw.formItemFlag && (fw.type === 'number')) {
327
+ tmpFieldArray.push(fw)
328
+ }
329
+ }
330
+ traverseFieldWidgetsOfContainer(con.container, fwHandler)
331
+ subFormFieldMap[con.container.options.name] = tmpFieldArray
332
+ sfFieldArray = sfFieldArray.concat(tmpFieldArray)
403
333
  }
404
- }),
405
- o.forEach((c) => {
406
- if (!l.find((u) => u.id === c.field.id)) {
407
- const u = {
408
- id: c.field.id,
409
- name: c.field.options.name,
410
- label: c.field.options.label,
411
- type: c.field.type,
412
- formItemFlag: !0,
413
- };
414
- u.name !== this.optionModel.name
415
- && u.type === "number"
416
- && this.fieldTreeData.push(u);
334
+ })
335
+
336
+ //加载到树形组件数据对象
337
+ allFields.forEach(fld => {
338
+ if (!sfFieldArray.find(item => item.id === fld.field.id)) { //排除子表单字段
339
+ const fieldNode = {
340
+ id: fld.field.id,
341
+ name: fld.field.options.name,
342
+ label: fld.field.options.label,
343
+ type: fld.field.type,
344
+ formItemFlag: true
417
345
  }
418
- }),
419
- n.forEach((c) => {
420
- const u = {
421
- id: c.id,
422
- name: c.options.name,
423
- label: c.options.label || c.options.name,
424
- type: c.type,
425
- formItemFlag: !1,
426
- children: [],
427
- };
428
- s[c.options.name].forEach(($) => {
429
- const g = {
430
- id: $.id,
431
- name: $.options.name,
432
- label: $.options.label,
433
- type: $.type,
434
- formItemFlag: !0,
435
- };
436
- g.name !== this.optionModel.name
437
- && u.children.push(g);
438
- }),
439
- this.fieldTreeData.push(u);
440
- });
346
+
347
+ if ((fieldNode.name !== this.optionModel.name) && (fieldNode.type === 'number')) { //排除当前设置公式字段
348
+ this.fieldTreeData.push(fieldNode)
349
+ }
350
+ }
351
+ })
352
+
353
+ subFormArray.forEach(sf => {
354
+ const subFormNode = {
355
+ id: sf.id,
356
+ name: sf.options.name,
357
+ label: sf.options.label || sf.options.name,
358
+ type: sf.type,
359
+ formItemFlag: false,
360
+ children: []
361
+ }
362
+
363
+ subFormFieldMap[sf.options.name].forEach(fld => {
364
+ const fieldNode = {
365
+ id: fld.id,
366
+ name: fld.options.name,
367
+ label: fld.options.label,
368
+ type: fld.type,
369
+ formItemFlag: true
370
+ }
371
+
372
+ if (fieldNode.name !== this.optionModel.name) { //排除当前设置公式字段
373
+ subFormNode.children.push(fieldNode)
374
+ }
375
+ })
376
+
377
+ this.fieldTreeData.push(subFormNode)
378
+ })
441
379
  },
442
- insertField(o, e, n) {
443
- if (o.formItemFlag) {
444
- let l = o.id,
445
- s = "[" + o.label + "]";
446
- this.updateCodeMirror(l, s, "field");
380
+
381
+ // 插入字段
382
+ insertField(obj, node, self) {
383
+ if (!!obj.formItemFlag) {
384
+ let fieldId = obj.id
385
+ let fieldLabel = '[' + obj.label + ']'
386
+ this.updateCodeMirror(fieldId, fieldLabel, "field");
447
387
  }
448
388
  },
449
- insertSymbol(o) {
450
- this.updateCodeMirror(o, o, null);
389
+
390
+ // 插入符号
391
+ insertSymbol(opt) {
392
+ this.updateCodeMirror(opt, opt, null);
451
393
  },
452
- insertFunction(o) {
453
- const e = o.substring(0, o.length - 1);
454
- this.updateCodeMirror(e, e, "func");
394
+
395
+ // 插入函数
396
+ insertFunction(opt) {
397
+ const val = opt.substring(0, opt.length - 1);
398
+ this.updateCodeMirror(val, val, "func");
455
399
  },
456
- updateCodeMirror(o, e, n = null) {
457
- if (n) {
458
- let l = {field: o, text: e, type: n},
459
- s = l.field.length + l.text.length + l.type.length,
460
- c = `{{${l.field}.${l.text}.${l.type}}}`;
461
- n === "func" ? ((c += "()"), (s = s + 7)) : (s = s + 6),
462
- c
463
- && this.codeMirror.view.dispatch({
464
- changes: {
465
- from: this.codeMirror.view.state.selection.head,
466
- to: this.codeMirror.view.state.selection
467
- .head,
468
- insert: c,
469
- },
470
- selection: {
471
- anchor:
472
- this.codeMirror.view.state.selection
473
- .head + s,
474
- },
475
- });
476
- } else
477
- this.codeMirror.view.dispatch({
400
+
401
+ updateCodeMirror(field, text, type = null) {
402
+ if (type) {
403
+ let obj = {
404
+ field: field,
405
+ text: text,
406
+ type: type
407
+ }
408
+ let selectionLet = obj.field.length + obj.text.length + obj.type.length;//光标位置;
409
+ let code = `{{${obj.field}.${obj.text}.${obj.type}}}`;
410
+ if (type === "func") {
411
+ code += "()";
412
+ selectionLet = selectionLet + 7
413
+ } else {
414
+ selectionLet = selectionLet + 6;
415
+ }
416
+
417
+ if (code) {
418
+ this.codeMirror.dispatch({
419
+ changes: {
420
+ from: this.codeMirror.state.selection.main.head,
421
+ to: this.codeMirror.state.selection.main.head,
422
+ insert: code
423
+ },
424
+ selection: {anchor: this.codeMirror.state.selection.main.head + selectionLet},
425
+ });
426
+ }
427
+ } else {
428
+ this.codeMirror.dispatch({
478
429
  changes: {
479
- from: this.codeMirror.view.state.selection.head,
480
- to: this.codeMirror.view.state.selection.head,
481
- insert: e,
482
- },
483
- selection: {
484
- anchor:
485
- this.codeMirror.view.state.selection.head
486
- + e.length,
430
+ from: this.codeMirror.state.selection.main.head, to: this.codeMirror.state.selection.main.head, insert: text
487
431
  },
432
+ selection: {anchor: this.codeMirror.state.selection.main.head + text.length}
488
433
  });
434
+
435
+ }
489
436
  },
490
- removeStr(o) {
491
- let e = o.indexOf("[");
492
- if (e === -1) return o;
493
- let n = o.indexOf("]", e) + 1,
494
- l = o.substring(e, n),
495
- s = o.split(l),
496
- c = "";
497
- for (let u = 0; u < s.length; u++) c += s[u];
498
- return this.removeStr(c);
437
+
438
+ // 在字符串中查找[开始]结尾的字符串,并删除
439
+ removeStr(str) {
440
+ let a = str.indexOf("[");
441
+ if (a === -1) {
442
+ return str;
443
+ }
444
+ let b = str.indexOf("]", a) + 1;
445
+ let c = str.substring(a, b);
446
+ let strArr = str.split(c);
447
+ let newStr = "";
448
+ for (let i = 0; i < strArr.length; i++) {
449
+ newStr += strArr[i];
450
+ }
451
+ return this.removeStr(newStr);
499
452
  },
453
+
454
+ /**
455
+ * 字段label可能在公式保存后再次被修改,当编辑公式时需要再次刷新公式中的字段label(不刷新也不会影响公式计算结果)
456
+ */
500
457
  refreshFormula() {
501
- const o = this.optionModel.formula.match(FORMULA_REG_EXP);
502
- if (!o) return this.optionModel.formula;
503
- o.forEach((e) => {
504
- const n = e.split(".")[0],
505
- l = e.split(".")[2];
506
- if (l.substring(0, l.length - 2) === "func") return;
507
- const c = n.substring(2, n.length),
508
- u = getFieldWidgetById(
509
- this.designer.widgetList,
510
- c,
511
- !1
512
- ),
513
- $ = u.options.label || u.options.name;
514
- this.optionModel.formula
515
- = this.optionModel.formula.replace(
516
- e,
517
- n + ".[" + $ + "]." + l
518
- );
519
- });
458
+ const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP)
459
+ if (!matchResult) {
460
+ return this.optionModel.formula
461
+ }
462
+
463
+ matchResult.forEach(mi => {
464
+ const firstPart = mi.split('.')[0]
465
+ const secondPart = mi.split('.')[1]
466
+ const thirdPart = mi.split('.')[2]
467
+ const nodeType = thirdPart.substring(0, thirdPart.length - 2)
468
+ if (nodeType === 'func') {
469
+ return
470
+ }
471
+
472
+ const fieldId = firstPart.substring(2, firstPart.length)
473
+ const fieldSchema = getFieldWidgetById(this.designer.widgetList, fieldId, false)
474
+ if (!!fieldSchema) {
475
+ const newLabel = fieldSchema.options.label || fieldSchema.options.name
476
+ this.optionModel.formula = this.optionModel.formula.replace(mi,
477
+ firstPart + '.[' + newLabel + '].' + thirdPart)
478
+ } else {
479
+ this.$message.error(this.i18nt("designer.hint.deletedFieldInFormula") + secondPart)
480
+ }
481
+ })
520
482
  },
483
+
484
+ // 打开编辑公式弹窗
521
485
  editFormula() {
522
- (this.fieldTreeData.length = 0),
523
- this.designer.widgetList.forEach((e) => {
524
- this.optionModel.name !== e.id
525
- && this.loadFieldListToTree();
526
- }),
527
- console.log(
528
- "设计器字段===>",
529
- this.fieldTreeData
530
- ),
531
- (this.tags = deepClone(this.optionModel.formulaTags)),
532
- this.refreshFormula();
533
- const o = this.optionModel.formula || "";
534
- (this.formulaDialogVisible = !0),
535
- this.$nextTick(() => {
536
-
537
- this.codeMirror = new Editor({
538
- content: o,
539
- extensions: [
540
- StarterKit,
541
- ],
542
- })
543
-
544
- /*(this.codeMirror = new EditorView({
545
- state: EditorState.create({
546
- doc: o,
547
- /!*extensions: [
548
- basicSetup,
549
- javascript(),
550
- [baseTheme, [], placeholders],
551
- ],*!/
552
- }),
553
- parent: this.$refs.cmRef,
554
- })),
555
- console.log(
556
- "编辑器实例==>",
557
- this.codeMirror
558
- );*/
486
+ this.fieldTreeData.length = 0
487
+ // 初始化字段树
488
+ this.designer.widgetList.forEach((wItem) => {
489
+ if (this.optionModel.name !== wItem.id) {
490
+ //this.buildTreeNodeOfWidget(wItem, this.fieldTreeData);
491
+ this.loadFieldListToTree()
492
+ }
493
+ })
494
+
495
+ console.log("设计器字段===>", this.fieldTreeData)
496
+
497
+ // 加载当前字段计算公式tags
498
+ this.tags = deepClone(this.optionModel.formulaTags)
499
+ // this.formula = deepClone(this.optionModel.formula);
500
+
501
+ //const code = this.optionModel.formulaShow;
502
+ this.refreshFormula()
503
+ const code = this.optionModel.formula
504
+ this.formulaDialogVisible = true
505
+
506
+ //==== codeMirror 挂载视图 ====
507
+ this.$nextTick(() => {
508
+ this.codeMirror = new EditorView({
509
+ state: EditorState.create({
510
+ doc: code,
511
+ extensions: [basicSetup, javascript(),
512
+ [baseTheme, [], placeholders]],
513
+ }),
514
+ parent: this.$refs.cmRef
559
515
  });
516
+ console.log("编辑器实例==>", this.codeMirror)
517
+ })
560
518
  },
519
+
520
+ // 保存计算公式
561
521
  saveFormula() {
562
- (this.optionModel.formula
563
- = this.codeMirror.view.state.doc.text.join("")),
564
- (this.formulaDialogVisible = !1);
522
+ this.optionModel.formula = this.codeMirror.state.doc.text.join('')
523
+ this.formulaDialogVisible = false;
565
524
  },
566
- analysisFormula(o) {
567
- let e = o.indexOf("[");
568
- if (e === -1) return o;
569
- let n = o.indexOf("]", e) + 1,
570
- l = o.substring(e, n),
571
- s = this.findTreeNodeByCnName(l);
572
- return s
573
- ? ((o = o.replace(l, "{" + s + "}")),
574
- this.analysisFormula(o))
575
- : (this.$message.error(
576
- l + " 字段无法识别"
577
- ),
578
- !1);
525
+
526
+ // 解析计算公式 STEP1:将公式中的字段转换为【英文表名.英文字段名】
527
+ analysisFormula(formula) {
528
+ let a = formula.indexOf("[");
529
+ if (a === -1) {
530
+ return formula;
531
+ }
532
+ let b = formula.indexOf("]", a) + 1;
533
+ let cnField = formula.substring(a, b);
534
+ let enFieldName = this.findTreeNodeByCnName(cnField);
535
+ if (!!enFieldName) {
536
+ formula = formula.replace(cnField, "{" + enFieldName + "}");
537
+ return this.analysisFormula(formula);
538
+ } else {
539
+ this.$message.error(cnField + " 字段无法识别");
540
+ return false;
541
+ }
579
542
  },
580
- findTreeNodeByCnName(o) {
581
- let e = "",
582
- n = "",
583
- l = o.split("[")[1].split("]")[0],
584
- s = l.split("-")[0],
585
- c = l.split("-")[1],
586
- u = this.fieldTreeData;
587
- for (let $ = 0; $ < u.length; $++) {
588
- let g = u[$].children;
589
- for (let y = 0; y < g.length; y++)
590
- if (g[y].cnTitle === s) {
591
- e = g[y].enTitle;
592
- let f = g[y].children;
593
- for (let v = 0; v < f.length; v++)
594
- if (f[v].cnTitle === c)
595
- return (n = f[v].enTitle), e + "-" + n;
543
+
544
+ // 根据树节点中文名查找树节点
545
+ findTreeNodeByCnName(nodeCnName) {
546
+ let enTableName = "",
547
+ enFieldName = "";
548
+ let tableFieldName = nodeCnName.split("[")[1].split("]")[0];
549
+ let tableName = tableFieldName.split("-")[0];
550
+ let fieldName = tableFieldName.split("-")[1];
551
+ let moduleList = this.fieldTreeData;
552
+ for (let i = 0; i < moduleList.length; i++) {
553
+ let tableList = moduleList[i].children;
554
+ for (let j = 0; j < tableList.length; j++) {
555
+ if (tableList[j].cnTitle === tableName) {
556
+ enTableName = tableList[j].enTitle;
557
+ let fieldList = tableList[j].children;
558
+ for (let k = 0; k < fieldList.length; k++) {
559
+ if (fieldList[k].cnTitle === fieldName) {
560
+ enFieldName = fieldList[k].enTitle;
561
+ return enTableName + "-" + enFieldName;
562
+ }
563
+ }
596
564
  }
565
+ }
597
566
  }
567
+ // 没找到节点返回NULL
598
568
  return null;
599
569
  },
600
- getClass(o) {
601
- if (o === this.i18nt("designer.hint.formulaNumber"))
570
+
571
+ getClass(type) {
572
+ if (type === this.i18nt("designer.hint.formulaNumber")) {
602
573
  return "warning";
603
- if (o === this.i18nt("designer.hint.formulaChar"))
574
+ }
575
+ if (type === this.i18nt("designer.hint.formulaChar")) {
604
576
  return "";
605
- if (o === this.i18nt("designer.hint.formulaObject"))
577
+ }
578
+ if (type === this.i18nt("designer.hint.formulaObject")) {
606
579
  return "danger";
580
+ }
607
581
  },
582
+
608
583
  resetIntro() {
609
- (this.introTitle = this.i18nt(
584
+ this.introTitle = this.i18nt(
610
585
  "designer.hint.formulaFunctionExplain"
611
- )),
612
- (this.introduction = {
613
- title: this.i18nt(
614
- "designer.hint.formulaPleaseSelect"
615
- ),
616
- content:
617
- '<span class="cg">'
618
- + this.i18nt("designer.hint.formulaSample")
619
- + ':</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">参数1</span><span class="cg">,</span><span class="cs">参数2</span><span class="cg">)</span>',
620
- });
586
+ );
587
+ this.introduction = {
588
+ title: this.i18nt("designer.hint.formulaPleaseSelect"),
589
+ content:
590
+ '<span class="cg">' +
591
+ this.i18nt("designer.hint.formulaSample") +
592
+ ':</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">参数1</span><span class="cg">,</span><span class="cs">参数2</span><span class="cg">)</span>',
593
+ };
621
594
  },
622
- showIntro(o, e, n) {
623
- (n = '<span class="cg">' + n + "</span>"),
624
- (this.introduction = {title: e, content: n}),
625
- (this.introTitle = o);
595
+
596
+ showIntro(name, title, content) {
597
+ content = '<span class="cg">' + content + "</span>";
598
+ this.introduction = {
599
+ title: title,
600
+ content: content,
601
+ };
602
+ this.introTitle = name;
626
603
  },
627
- isValid(o) {
628
- let e = [],
629
- n = o.length,
630
- l = 0,
631
- s = 1,
632
- c;
633
- for (let u = 0; u < n && s; u++)
634
- switch (o[u]) {
604
+
605
+ /**
606
+ * 校验计算公式是否正确
607
+ * @param s
608
+ * @returns {boolean}
609
+ */
610
+ isValid(s) {
611
+ let a = []; //存储左括号出现的地方
612
+ let l = s.length;
613
+ let k = 0;
614
+ let flag = 1;
615
+ let j;
616
+ for (let i = 0; i < l && flag; i++) {
617
+ switch (s[i]) {
635
618
  case "(":
636
- (e[l] = u), l++;
619
+ a[k] = i;
620
+ k++;
637
621
  break;
638
622
  case ")":
639
- (c = e[l - 1]),
640
- o[c] === "(" ? ((e[l] = 0), l--) : (s = 0);
623
+ j = a[k - 1];
624
+ if (s[j] === "(") {
625
+ a[k] = 0;
626
+ k--;
627
+ } else {
628
+ flag = 0;
629
+ }
641
630
  break;
642
631
  case "{":
643
- (e[l] = u), l++;
632
+ a[k] = i;
633
+ k++;
644
634
  break;
645
635
  case "}":
646
- (c = e[l - 1]),
647
- o[c] === "{" ? ((e[l] = 0), l--) : (s = 0);
636
+ j = a[k - 1];
637
+ if (s[j] === "{") {
638
+ a[k] = 0;
639
+ k--;
640
+ } else {
641
+ flag = 0;
642
+ }
648
643
  break;
649
644
  case "[":
650
- (e[l] = u), l++;
645
+ a[k] = i;
646
+ k++;
651
647
  break;
652
648
  case "]":
653
- (c = e[l - 1]),
654
- o[c] === "[" ? ((e[l] = 0), l--) : (s = 0);
649
+ j = a[k - 1];
650
+ if (s[j] === "[") {
651
+ a[k] = 0;
652
+ k--;
653
+ } else {
654
+ flag = 0;
655
+ }
655
656
  break;
656
657
  }
657
- return l !== 0 && (s = 0), s !== 0;
658
+ }
659
+ if (k !== 0) {
660
+ flag = 0;
661
+ }
662
+ return flag !== 0;
658
663
  },
659
664
  },
660
- }
665
+ };
661
666
  </script>
662
667
 
663
- <style scoped>
668
+ <style lang="scss" scoped>
669
+ :deep(.cm-editor) {
670
+ height: 100%;
671
+ }
672
+
673
+ li {
674
+ list-style: none;
675
+ }
676
+
677
+ /*去掉li前面的点*/
678
+ .el-input-group {
679
+ cursor: pointer;
680
+ }
681
+
682
+ .header {
683
+ width: 97%;
684
+ border: 1px solid #ccc;
685
+ border-top-left-radius: 10px;
686
+ border-top-right-radius: 10px;
687
+ height: 31px;
688
+ line-height: 31px;
689
+ padding-left: 15px;
690
+ }
691
+
692
+ .editor {
693
+ margin-left: 10px;
694
+ margin-right: 10px;
695
+ height: 200px;
696
+ border: 1px solid #ccc;
697
+ border-radius: 6px;
698
+ }
699
+
700
+ .editor-top {
701
+ //margin-left: 10px;
702
+ height: 130px;
703
+ width: 100%;
704
+ padding: 8px;
705
+ position: relative;
706
+ overflow-x: hidden;
707
+ overflow-y: scroll;
708
+ }
709
+
710
+ .editor-bottom {
711
+ border-left: 1px solid #ccc;
712
+ display: flex;
713
+ flex-wrap: wrap;
714
+ padding: 5px;
715
+ align-content: flex-start;
716
+ }
717
+
718
+ .body-right-button {
719
+ width: 60px;
720
+ height: 40px;
721
+ }
722
+
723
+ .group-form {
724
+ margin-top: 15px;
725
+ display: flex;
726
+ justify-content: space-between;
727
+ height: 350px;
728
+ }
729
+
664
730
  .group-item-left {
665
- height: 400px;
731
+ height: 350px;
666
732
  border: 1px solid #ccc;
667
733
  border-top-left-radius: 6px;
668
734
  border-bottom-left-radius: 6px;
669
735
  margin-bottom: 5px;
670
736
  padding: 0;
671
- width: 100%
737
+ width: 100%;
672
738
  }
673
739
 
674
740
  .group-item-right-top {
675
- height: 400px;
741
+ height: 350px;
676
742
  border: 1px solid #ccc;
677
743
  border-radius: 0;
678
744
  margin-bottom: 5px;
679
- width: 100%
745
+ width: 100%;
680
746
  }
681
747
 
682
748
  .group-item-right-bottom {
683
- height: 400px;
749
+ height: 350px;
684
750
  border: 1px solid #ccc;
685
751
  border-top-right-radius: 6px;
686
752
  border-bottom-right-radius: 6px;
687
753
  margin-bottom: 5px;
688
- width: 100%
754
+ width: 100%;
689
755
  }
690
756
 
691
757
  .item-header {
@@ -693,25 +759,111 @@ export default {
693
759
  height: 29px;
694
760
  line-height: 29px;
695
761
  padding-left: 15px;
696
- font-weight: 700
762
+ font-weight: bold;
697
763
  }
698
764
 
699
765
  .item-body-left {
700
766
  height: 320px;
701
- overflow-y: auto
767
+ overflow-y: auto;
702
768
  }
703
769
 
704
770
  .function-list {
705
- height: 360px;
706
- overflow-y: auto
707
- }
771
+ height: 320px;
772
+ overflow-y: auto;
708
773
 
709
- .function-list .el-collapse-item__header {
710
- font-weight: 400 !important
774
+ :deep(.el-collapse-item__header) {
775
+ font-weight: normal !important;
776
+ }
711
777
  }
712
778
 
713
779
  .item-body-right-bottom {
714
780
  height: 152px;
715
- overflow-y: auto
781
+ overflow-y: auto;
782
+ }
783
+
784
+ .el-collapse {
785
+ border: none;
786
+ }
787
+
788
+ :deep(.el-dialog) {
789
+ margin-top: 10px !important;
790
+ }
791
+
792
+ :deep(.el-collapse-item__header) {
793
+ padding-left: 10px;
794
+ border: none;
795
+ }
796
+
797
+ :deep(.el-collapse-item__wrap) {
798
+ border: none;
799
+ }
800
+
801
+ :deep(.el-collapse-item__arrow) {
802
+ margin-left: 8px;
803
+ }
804
+
805
+ .field-item {
806
+ display: flex;
807
+ justify-content: space-between;
808
+ align-items: center;
809
+ height: 32px;
810
+ padding-left: 30px;
811
+ padding-right: 15px;
812
+ cursor: pointer;
813
+ }
814
+
815
+ .field-item:hover {
816
+ background-color: #f8f8f8;
817
+ }
818
+
819
+ p::before {
820
+ content: "● ";
821
+ color: #0a5d7c;
822
+ }
823
+
824
+ p {
825
+ height: 24px;
826
+ line-height: 24px;
827
+ padding: 0 15px;
828
+ font-size: 16px;
829
+ color: #0a5d7c;
830
+ }
831
+
832
+ .intro-content {
833
+ padding-left: 30px;
834
+ }
835
+
836
+ .cg {
837
+ color: #0a5d7c;
838
+ }
839
+
840
+ .fname {
841
+ display: inline-block;
842
+ border-radius: 2px;
843
+ padding: 0 5px;
844
+ margin: 1px;
845
+ font-size: 12px;
846
+ line-height: 20px;
847
+ color: #708;
848
+ background: #fff;
849
+ }
850
+
851
+ .cs {
852
+ display: inline-block;
853
+ border-radius: 2px;
854
+ padding: 0 5px;
855
+ margin: 1px;
856
+ color: #fff;
857
+ font-size: 12px;
858
+ line-height: 20px;
859
+ background: #178cdf;
860
+ }
861
+
862
+ :deep(.el-dialog__body) {
863
+ padding: 0;
864
+ }
865
+
866
+ .small-padding-dialog {
867
+ /* margin-top: 0px; */
716
868
  }
717
869
  </style>