tianheng-ui 0.1.11 → 0.1.12
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/lib/tianheng-ui.js +13 -14
- package/package.json +1 -1
- package/packages/FormMaking/GenerateForm.vue +6 -1
- package/packages/FormMaking/GenerateFormItem.vue +7 -3
- package/packages/FormMaking/GenerateFormItemH5.vue +1 -1
- package/packages/FormMaking/WidgetConfig.vue +35 -48
- package/packages/FormMaking/WidgetTools.vue +538 -0
- package/packages/FormMaking/config/index.js +6 -0
- package/packages/FormMaking/custom/config.js +21 -24
- package/packages/FormMaking/custom/configs/button.vue +24 -25
- package/packages/FormMaking/custom/configs/cascader.vue +7 -7
- package/packages/FormMaking/custom/configs/checkbox.vue +23 -22
- package/packages/FormMaking/custom/configs/color.vue +3 -3
- package/packages/FormMaking/custom/configs/date.vue +3 -3
- package/packages/FormMaking/custom/configs/input.vue +3 -3
- package/packages/FormMaking/custom/configs/number.vue +3 -3
- package/packages/FormMaking/custom/configs/radio.vue +23 -19
- package/packages/FormMaking/custom/configs/rate.vue +3 -3
- package/packages/FormMaking/custom/configs/select.vue +25 -20
- package/packages/FormMaking/custom/configs/slider.vue +3 -3
- package/packages/FormMaking/custom/configs/switch.vue +3 -3
- package/packages/FormMaking/custom/configs/tabs.vue +12 -17
- package/packages/FormMaking/custom/configs/textarea.vue +3 -3
- package/packages/FormMaking/custom/configs/time.vue +3 -3
- package/packages/FormMaking/custom/configs/upload.vue +5 -5
- package/packages/FormMaking/custom/items/button.vue +35 -1
- package/packages/FormMaking/custom/items/checkbox.vue +1 -1
- package/packages/FormMaking/custom/mixins/index.js +12 -12
- package/packages/FormMaking/index.vue +91 -468
- package/packages/FormMaking/styles/index.scss +0 -21
- package/packages/FormMaking/util/request.js +9 -12
@@ -0,0 +1,538 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="widgetTools">
|
3
|
+
<div class="left">
|
4
|
+
<el-button
|
5
|
+
v-if="permissions.includes('monitor')"
|
6
|
+
:class="{ active: client === 'monitor' }"
|
7
|
+
type="text"
|
8
|
+
size="medium"
|
9
|
+
icon="el-icon-monitor"
|
10
|
+
@click="handleClick('monitor')"
|
11
|
+
>
|
12
|
+
</el-button>
|
13
|
+
<el-button
|
14
|
+
v-if="permissions.includes('mobile')"
|
15
|
+
:class="{ active: client === 'mobile' }"
|
16
|
+
type="text"
|
17
|
+
size="medium"
|
18
|
+
icon="el-icon-mobile"
|
19
|
+
@click="handleClick('mobile')"
|
20
|
+
>
|
21
|
+
</el-button>
|
22
|
+
</div>
|
23
|
+
<div class="right">
|
24
|
+
<slot> </slot>
|
25
|
+
|
26
|
+
<el-button
|
27
|
+
v-if="permissions.includes('clearable')"
|
28
|
+
style="margin-left:10px;"
|
29
|
+
type="text"
|
30
|
+
size="medium"
|
31
|
+
icon="el-icon-delete"
|
32
|
+
@click="handleClick('clear')"
|
33
|
+
>清空
|
34
|
+
</el-button>
|
35
|
+
<el-button
|
36
|
+
v-if="permissions.includes('preview')"
|
37
|
+
type="text"
|
38
|
+
size="medium"
|
39
|
+
icon="el-icon-view"
|
40
|
+
@click="dialog.preview.visible = true"
|
41
|
+
>预览
|
42
|
+
</el-button>
|
43
|
+
<el-popover style="margin-left:10px;" placement="bottom" trigger="hover">
|
44
|
+
<el-button
|
45
|
+
v-if="permissions.includes('upload')"
|
46
|
+
type="text"
|
47
|
+
size="medium"
|
48
|
+
icon="el-icon-upload2"
|
49
|
+
slot="reference"
|
50
|
+
>导入</el-button
|
51
|
+
>
|
52
|
+
<div>
|
53
|
+
<div>
|
54
|
+
<el-button
|
55
|
+
type="text"
|
56
|
+
size="medium"
|
57
|
+
@click="dialog.import.visible = true"
|
58
|
+
>导入JSON
|
59
|
+
</el-button>
|
60
|
+
</div>
|
61
|
+
<div>
|
62
|
+
<el-upload
|
63
|
+
action
|
64
|
+
accept=".xlsx, .xls"
|
65
|
+
:auto-upload="false"
|
66
|
+
:show-file-list="false"
|
67
|
+
:on-change="onExcelFileChange"
|
68
|
+
>
|
69
|
+
<el-button type="text" size="medium">导入EXCEL</el-button>
|
70
|
+
</el-upload>
|
71
|
+
</div>
|
72
|
+
<div>
|
73
|
+
<el-button
|
74
|
+
type="text"
|
75
|
+
size="medium"
|
76
|
+
@click="dialog.template.visible = true"
|
77
|
+
>导入模板
|
78
|
+
</el-button>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
</el-popover>
|
82
|
+
<el-popover style="margin-left:10px;" placement="bottom" trigger="hover">
|
83
|
+
<el-button
|
84
|
+
v-if="
|
85
|
+
permissions.includes('generateJson') ||
|
86
|
+
permissions.includes('generateCode')
|
87
|
+
"
|
88
|
+
type="text"
|
89
|
+
size="medium"
|
90
|
+
icon="el-icon-document"
|
91
|
+
slot="reference"
|
92
|
+
>生成</el-button
|
93
|
+
>
|
94
|
+
<div>
|
95
|
+
<div>
|
96
|
+
<el-button
|
97
|
+
v-if="permissions.includes('generateJson')"
|
98
|
+
type="text"
|
99
|
+
size="medium"
|
100
|
+
@click="handleGenerateJson"
|
101
|
+
>
|
102
|
+
生成JSON
|
103
|
+
</el-button>
|
104
|
+
</div>
|
105
|
+
<div>
|
106
|
+
<el-button
|
107
|
+
v-if="permissions.includes('generateCode')"
|
108
|
+
type="text"
|
109
|
+
size="medium"
|
110
|
+
@click="handleGenerateCode"
|
111
|
+
>
|
112
|
+
生成代码
|
113
|
+
</el-button>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
</el-popover>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
<!-- 导入JSON -->
|
120
|
+
<th-dialog
|
121
|
+
title="导入JSON"
|
122
|
+
:visible="dialog.import.visible"
|
123
|
+
:modal-append-to-body="false"
|
124
|
+
@on-close="dialog.import.visible = false"
|
125
|
+
@on-affirm="handleImportJson"
|
126
|
+
@on-fullscreen="$refs.valueCodeEditor.resize()"
|
127
|
+
>
|
128
|
+
<el-alert
|
129
|
+
type="info"
|
130
|
+
title="JSON格式如下,直接复制生成的json覆盖此处代码点击确定即可"
|
131
|
+
></el-alert>
|
132
|
+
<th-code-editor
|
133
|
+
v-model="dialog.import.value"
|
134
|
+
ref="valueCodeEditor"
|
135
|
+
></th-code-editor>
|
136
|
+
</th-dialog>
|
137
|
+
|
138
|
+
<!-- 导入模板 -->
|
139
|
+
<th-dialog
|
140
|
+
title="导入模板"
|
141
|
+
:visible="dialog.template.visible"
|
142
|
+
:modal-append-to-body="false"
|
143
|
+
@on-close="dialog.template.visible = false"
|
144
|
+
@on-affirm="handleImportTemplate"
|
145
|
+
>
|
146
|
+
|
147
|
+
</th-dialog>
|
148
|
+
|
149
|
+
<!-- 预览 -->
|
150
|
+
<th-dialog
|
151
|
+
title="预览"
|
152
|
+
v-model="dialog.preview.visible"
|
153
|
+
:modal-append-to-body="false"
|
154
|
+
@on-close="dialog.preview.visible = false"
|
155
|
+
>
|
156
|
+
<generate-form
|
157
|
+
v-if="dialog.preview.visible"
|
158
|
+
:data="formData"
|
159
|
+
:value="formValue"
|
160
|
+
:oauthConfig="oauthConfig"
|
161
|
+
:remote="remoteData"
|
162
|
+
:slotKeys="slotKeys"
|
163
|
+
:client="client"
|
164
|
+
insite="true"
|
165
|
+
@on-change="handleDataChange"
|
166
|
+
@button-submit="handleButtonSubmit"
|
167
|
+
ref="generateForm"
|
168
|
+
>
|
169
|
+
<template v-for="name in slotKeys" :slot="name">
|
170
|
+
<slot :name="name" />
|
171
|
+
</template>
|
172
|
+
</generate-form>
|
173
|
+
|
174
|
+
<template slot="footer">
|
175
|
+
<el-button type="primary" @click="handleGetData">获取数据</el-button>
|
176
|
+
<el-button @click="handleReset">重置</el-button>
|
177
|
+
</template>
|
178
|
+
</th-dialog>
|
179
|
+
|
180
|
+
<!-- 获取数据 -->
|
181
|
+
<th-dialog
|
182
|
+
title="获取数据"
|
183
|
+
:visible="dialog.data.visible"
|
184
|
+
:modal-append-to-body="false"
|
185
|
+
@on-close="dialog.data.visible = false"
|
186
|
+
@on-fullscreen="$refs.dataCodeEditor.resize()"
|
187
|
+
>
|
188
|
+
<th-code-editor
|
189
|
+
v-model="dialog.data.value"
|
190
|
+
ref="dataCodeEditor"
|
191
|
+
></th-code-editor>
|
192
|
+
|
193
|
+
<template slot="footer">
|
194
|
+
<el-button
|
195
|
+
type="primary"
|
196
|
+
class="json-btn"
|
197
|
+
:data-clipboard-text="dialog.data.valueCopy"
|
198
|
+
>复制数据</el-button
|
199
|
+
>
|
200
|
+
</template>
|
201
|
+
</th-dialog>
|
202
|
+
|
203
|
+
<!-- 生成json -->
|
204
|
+
<th-dialog
|
205
|
+
title="生成JSON"
|
206
|
+
:visible="dialog.config.visible"
|
207
|
+
:modal-append-to-body="false"
|
208
|
+
@on-close="dialog.config.visible = false"
|
209
|
+
@on-fullscreen="$refs.jsonCodeEditor.resize()"
|
210
|
+
>
|
211
|
+
<th-code-editor
|
212
|
+
v-model="dialog.config.value"
|
213
|
+
ref="jsonCodeEditor"
|
214
|
+
></th-code-editor>
|
215
|
+
|
216
|
+
<template slot="footer">
|
217
|
+
<el-button
|
218
|
+
type="primary"
|
219
|
+
class="json-btn"
|
220
|
+
:data-clipboard-text="dialog.config.valueCopy"
|
221
|
+
>复制数据</el-button
|
222
|
+
>
|
223
|
+
</template>
|
224
|
+
</th-dialog>
|
225
|
+
|
226
|
+
<!-- 生成代码 -->
|
227
|
+
<th-dialog
|
228
|
+
class="codeDialog"
|
229
|
+
title="生成代码"
|
230
|
+
:visible="dialog.code.visible"
|
231
|
+
:showFooter="false"
|
232
|
+
:modal-append-to-body="false"
|
233
|
+
@on-close="dialog.code.visible = false"
|
234
|
+
@on-fullscreen="handleDialogFullscreen"
|
235
|
+
>
|
236
|
+
<el-tabs
|
237
|
+
type="border-card"
|
238
|
+
style="box-shadow: none;"
|
239
|
+
v-model="dialog.code.type"
|
240
|
+
>
|
241
|
+
<el-tab-pane label="Vue Component" name="vue">
|
242
|
+
<th-code-editor
|
243
|
+
v-model="dialog.code.valueVue"
|
244
|
+
language="html"
|
245
|
+
readonly
|
246
|
+
ref="vueCodeEditor"
|
247
|
+
></th-code-editor>
|
248
|
+
</el-tab-pane>
|
249
|
+
<el-tab-pane label="HTML" name="html">
|
250
|
+
<th-code-editor
|
251
|
+
v-model="dialog.code.valueHtml"
|
252
|
+
language="html"
|
253
|
+
readonly
|
254
|
+
ref="htmlCodeEditor"
|
255
|
+
></th-code-editor>
|
256
|
+
</el-tab-pane>
|
257
|
+
</el-tabs>
|
258
|
+
</th-dialog>
|
259
|
+
</div>
|
260
|
+
</template>
|
261
|
+
|
262
|
+
<script>
|
263
|
+
import * as XLSX from "xlsx/xlsx.mjs";
|
264
|
+
import request from "./util/request";
|
265
|
+
import Clipboard from "clipboard";
|
266
|
+
import generateCode from "./util/generateCode.js";
|
267
|
+
import GenerateForm from "./GenerateForm";
|
268
|
+
export default {
|
269
|
+
props: {
|
270
|
+
baseConfig: Object,
|
271
|
+
permissions: Array,
|
272
|
+
client: String,
|
273
|
+
basicComponents: Array,
|
274
|
+
layoutComponents: Array,
|
275
|
+
formData: Object,
|
276
|
+
formValue: Object,
|
277
|
+
oauthConfig: Object,
|
278
|
+
slotKeys: Array
|
279
|
+
},
|
280
|
+
components: { GenerateForm },
|
281
|
+
data() {
|
282
|
+
return {
|
283
|
+
dialog: {
|
284
|
+
import: { visible: false, value: "" },
|
285
|
+
template: { visible: false, value: "" },
|
286
|
+
preview: { visible: false, value: "" },
|
287
|
+
data: { visible: false, value: "", valueCopy: "" },
|
288
|
+
config: { visible: false, value: "", valueCopy: "" },
|
289
|
+
code: { visible: false, valueHtml: "", valueVue: "", type: "vue" }
|
290
|
+
},
|
291
|
+
remoteData: {
|
292
|
+
func_test(resolve) {
|
293
|
+
setTimeout(() => {
|
294
|
+
const options = [
|
295
|
+
{ id: "1", name: "1111" },
|
296
|
+
{ id: "2", name: "2222" },
|
297
|
+
{ id: "3", name: "3333" }
|
298
|
+
];
|
299
|
+
|
300
|
+
resolve(options);
|
301
|
+
}, 2000);
|
302
|
+
},
|
303
|
+
funcGetToken(resolve) {
|
304
|
+
request
|
305
|
+
.get("http://tools-server.making.link/api/uptoken")
|
306
|
+
.then(res => {
|
307
|
+
resolve(res.uptoken);
|
308
|
+
});
|
309
|
+
},
|
310
|
+
upload_callback(response, file, fileList) {
|
311
|
+
console.log("callback", response, file, fileList);
|
312
|
+
}
|
313
|
+
},
|
314
|
+
jsonClipboard: null
|
315
|
+
};
|
316
|
+
},
|
317
|
+
created() {},
|
318
|
+
mounted() {},
|
319
|
+
methods: {
|
320
|
+
handleClick(val, data) {
|
321
|
+
this.$emit("click", val, data);
|
322
|
+
},
|
323
|
+
// excel 文件上传 改变监听
|
324
|
+
async onExcelFileChange(ev) {
|
325
|
+
let file = ev.raw;
|
326
|
+
if (!file) {
|
327
|
+
console.log("文件打开失败");
|
328
|
+
return;
|
329
|
+
} else {
|
330
|
+
let data = await this.readExcelFile(file);
|
331
|
+
//XLSX 文档 https://www.npmjs.com/package/xlsx
|
332
|
+
let workbook = XLSX.read(data, { type: "binary" }); //解析二进制格式数据
|
333
|
+
let worksheet = workbook.Sheets[workbook.SheetNames[0]]; //获取第一个Sheet
|
334
|
+
|
335
|
+
// console.log("XLSX.read => \n", workbook);
|
336
|
+
// console.log("sheet_to_json => \n", XLSX.utils.sheet_to_json(worksheet));
|
337
|
+
// console.log("sheet_to_csv => \n", XLSX.utils.sheet_to_csv(worksheet));
|
338
|
+
// console.log("sheet_to_txt => \n", XLSX.utils.sheet_to_txt(worksheet));
|
339
|
+
const xlsxDom = this.parseDom(XLSX.utils.sheet_to_html(worksheet));
|
340
|
+
// console.log("sheet_to_html => \n", xlsxDom);
|
341
|
+
const rowsDom = xlsxDom.getElementsByTagName("tr");
|
342
|
+
let rowSpan = 0;
|
343
|
+
for (let i = 0; i < rowsDom[0].childNodes.length; i++) {
|
344
|
+
const col = rowsDom[0].childNodes[i];
|
345
|
+
rowSpan += col.colSpan || 1;
|
346
|
+
}
|
347
|
+
const colSpan = 24 / rowSpan;
|
348
|
+
|
349
|
+
let config = {
|
350
|
+
list: [],
|
351
|
+
config: this.baseConfig
|
352
|
+
};
|
353
|
+
|
354
|
+
for (const row of rowsDom) {
|
355
|
+
const key =
|
356
|
+
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
357
|
+
let grid = this.getComponentsConfig("grid");
|
358
|
+
grid.options.columns = [];
|
359
|
+
grid.key = key;
|
360
|
+
grid.model = "grid_" + key;
|
361
|
+
|
362
|
+
const colsDom = row.childNodes;
|
363
|
+
let span = 0;
|
364
|
+
for (let i = 0; i < colsDom.length; i++) {
|
365
|
+
if (i % 2 === 0) span = 0;
|
366
|
+
else continue;
|
367
|
+
|
368
|
+
const colKey =
|
369
|
+
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
370
|
+
const titleDom = colsDom[i];
|
371
|
+
const valueDom = colsDom[i + 1];
|
372
|
+
if (!titleDom.innerText && !valueDom.innerText) continue;
|
373
|
+
|
374
|
+
if (valueDom) {
|
375
|
+
span =
|
376
|
+
((titleDom.colSpan || 1) + (valueDom.colSpan || 1)) * colSpan;
|
377
|
+
|
378
|
+
const data = this.getComponentsConfig("input");
|
379
|
+
let name = titleDom.innerText;
|
380
|
+
if (name.charAt(0) === "*") {
|
381
|
+
name = name.slice(1);
|
382
|
+
data.options.required = true;
|
383
|
+
data.rules = data.rules || [];
|
384
|
+
data.rules.push({
|
385
|
+
required: true,
|
386
|
+
message: "单行文本必须填写"
|
387
|
+
});
|
388
|
+
}
|
389
|
+
data.name = name;
|
390
|
+
data.options.defaultValue = valueDom.innerText;
|
391
|
+
data.key = colKey;
|
392
|
+
data.model = "input_" + colKey;
|
393
|
+
grid.options.columns.push({ span: span, list: [data] });
|
394
|
+
} else {
|
395
|
+
span = titleDom.colSpan * colSpan;
|
396
|
+
|
397
|
+
const data = this.getComponentsConfig("text");
|
398
|
+
data.name = titleDom.innerText;
|
399
|
+
data.options.defaultValue = titleDom.innerText;
|
400
|
+
data.options.hideLabel = true;
|
401
|
+
data.key = colKey;
|
402
|
+
data.model = "text_" + colKey;
|
403
|
+
grid.options.columns.push({ span: span, list: [data] });
|
404
|
+
}
|
405
|
+
}
|
406
|
+
if (grid.options.columns.length) {
|
407
|
+
config.list.push(grid);
|
408
|
+
} else {
|
409
|
+
const data = this.getComponentsConfig("filler");
|
410
|
+
data.name = "";
|
411
|
+
data.key = key;
|
412
|
+
data.model = "filler_" + key;
|
413
|
+
config.list.push(data);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
this.handleClick("import-excel", config);
|
417
|
+
}
|
418
|
+
},
|
419
|
+
// 读取excel file
|
420
|
+
readExcelFile(file) {
|
421
|
+
//文件读取
|
422
|
+
return new Promise(resolve => {
|
423
|
+
let reader = new FileReader();
|
424
|
+
reader.readAsBinaryString(file); //以二进制的方式读取
|
425
|
+
reader.onload = ev => {
|
426
|
+
resolve(ev.target.result);
|
427
|
+
};
|
428
|
+
});
|
429
|
+
},
|
430
|
+
parseDom(arg) {
|
431
|
+
var objE = document.createElement("div");
|
432
|
+
objE.innerHTML = arg;
|
433
|
+
return objE.childNodes[2];
|
434
|
+
},
|
435
|
+
getComponentsConfig(type) {
|
436
|
+
let data = null;
|
437
|
+
for (const item of this.basicComponents) {
|
438
|
+
if (type === item.type) {
|
439
|
+
data = JSON.parse(JSON.stringify(item));
|
440
|
+
return data;
|
441
|
+
}
|
442
|
+
}
|
443
|
+
for (const item of this.layoutComponents) {
|
444
|
+
if (type === item.type) {
|
445
|
+
data = JSON.parse(JSON.stringify(item));
|
446
|
+
return data;
|
447
|
+
}
|
448
|
+
}
|
449
|
+
return data;
|
450
|
+
},
|
451
|
+
handleImportJson() {
|
452
|
+
this.dialog.import.visible = false;
|
453
|
+
this.handleClick("import-json", JSON.parse(this.dialog.import.value));
|
454
|
+
},
|
455
|
+
handleImportTemplate() {
|
456
|
+
this.dialog.template.visible = false;
|
457
|
+
},
|
458
|
+
handleDataChange(field, value, data) {
|
459
|
+
// console.log('handleDataChange =>',field, value, data);
|
460
|
+
},
|
461
|
+
handleButtonSubmit(val) {
|
462
|
+
// console.log("handleButtonSubmit =>", val);
|
463
|
+
},
|
464
|
+
handleGetData() {
|
465
|
+
this.$refs.generateForm.getData().then(data => {
|
466
|
+
this.dialog.data = {
|
467
|
+
visible: true,
|
468
|
+
value: JSON.stringify(data, null, 2),
|
469
|
+
valueCopy: JSON.stringify(data, null, 2)
|
470
|
+
};
|
471
|
+
this.$nextTick(() => {
|
472
|
+
this.initClipboard();
|
473
|
+
});
|
474
|
+
});
|
475
|
+
},
|
476
|
+
handleReset() {
|
477
|
+
this.$refs.generateForm.reset();
|
478
|
+
},
|
479
|
+
handleGenerateJson() {
|
480
|
+
this.dialog.config = {
|
481
|
+
visible: true,
|
482
|
+
value: JSON.stringify(this.formData, null, 2),
|
483
|
+
valueCopy: JSON.stringify(this.formData, null, 2)
|
484
|
+
};
|
485
|
+
this.$nextTick(() => {
|
486
|
+
this.initClipboard();
|
487
|
+
});
|
488
|
+
},
|
489
|
+
initClipboard() {
|
490
|
+
if (!this.jsonClipboard) {
|
491
|
+
this.jsonClipboard = new Clipboard(".json-btn");
|
492
|
+
this.jsonClipboard.on("success", e => {
|
493
|
+
this.$message.success("复制成功");
|
494
|
+
});
|
495
|
+
}
|
496
|
+
},
|
497
|
+
handleGenerateCode() {
|
498
|
+
this.dialog.code = {
|
499
|
+
visible: true,
|
500
|
+
valueHtml: generateCode(JSON.stringify(this.formData), "html"),
|
501
|
+
valueVue: generateCode(JSON.stringify(this.formData), "vue"),
|
502
|
+
type: "vue"
|
503
|
+
};
|
504
|
+
},
|
505
|
+
handleDialogFullscreen() {
|
506
|
+
this.$refs.vueCodeEditor.resize();
|
507
|
+
this.$refs.htmlCodeEditor.resize();
|
508
|
+
}
|
509
|
+
}
|
510
|
+
};
|
511
|
+
</script>
|
512
|
+
|
513
|
+
<style lang="scss" scoped>
|
514
|
+
.widgetTools {
|
515
|
+
display: flex;
|
516
|
+
align-items: center;
|
517
|
+
width: 100%;
|
518
|
+
height: 45px;
|
519
|
+
padding: 0 15px;
|
520
|
+
border-bottom: solid 2px #e4e7ed;
|
521
|
+
|
522
|
+
.left {
|
523
|
+
min-width: 60px;
|
524
|
+
.el-button {
|
525
|
+
color: #333;
|
526
|
+
}
|
527
|
+
.active {
|
528
|
+
color: #409eff;
|
529
|
+
}
|
530
|
+
}
|
531
|
+
.right {
|
532
|
+
flex: 1;
|
533
|
+
display: flex;
|
534
|
+
align-items: center;
|
535
|
+
justify-content: right;
|
536
|
+
}
|
537
|
+
}
|
538
|
+
</style>
|
@@ -113,16 +113,16 @@ export const basicComponents = [
|
|
113
113
|
showLabel: false,
|
114
114
|
options: [
|
115
115
|
{
|
116
|
-
value: "
|
117
|
-
label: "
|
116
|
+
value: "选值 1",
|
117
|
+
label: "选项 1"
|
118
118
|
},
|
119
119
|
{
|
120
|
-
value: "
|
121
|
-
label: "
|
120
|
+
value: "选值 2",
|
121
|
+
label: "选项 2"
|
122
122
|
},
|
123
123
|
{
|
124
|
-
value: "
|
125
|
-
label: "
|
124
|
+
value: "选值 3",
|
125
|
+
label: "选项 3"
|
126
126
|
}
|
127
127
|
],
|
128
128
|
required: false,
|
@@ -156,13 +156,16 @@ export const basicComponents = [
|
|
156
156
|
showLabel: false,
|
157
157
|
options: [
|
158
158
|
{
|
159
|
-
value: "
|
159
|
+
value: "选值 1",
|
160
|
+
label: "选项 1"
|
160
161
|
},
|
161
162
|
{
|
162
|
-
value: "
|
163
|
+
value: "选值 2",
|
164
|
+
label: "选项 2"
|
163
165
|
},
|
164
166
|
{
|
165
|
-
value: "
|
167
|
+
value: "选值 3",
|
168
|
+
label: "选项 3"
|
166
169
|
}
|
167
170
|
],
|
168
171
|
required: false,
|
@@ -264,15 +267,9 @@ export const basicComponents = [
|
|
264
267
|
collapseTags: false,
|
265
268
|
allowCreate: false,
|
266
269
|
options: [
|
267
|
-
{
|
268
|
-
|
269
|
-
}
|
270
|
-
{
|
271
|
-
value: "Option 2"
|
272
|
-
},
|
273
|
-
{
|
274
|
-
value: "Option 3"
|
275
|
-
}
|
270
|
+
{ value: "选值 1", label: "选项 1" },
|
271
|
+
{ value: "选值 2", label: "选项 2" },
|
272
|
+
{ value: "选值 3", label: "选项 3" }
|
276
273
|
],
|
277
274
|
filterable: false,
|
278
275
|
props: {
|
@@ -784,14 +781,14 @@ export const baseConfig = {
|
|
784
781
|
hideLabel: false,
|
785
782
|
eventScript: [
|
786
783
|
{
|
787
|
-
|
788
|
-
|
789
|
-
|
784
|
+
id: "mounted",
|
785
|
+
label: "mounted",
|
786
|
+
value: ""
|
790
787
|
},
|
791
788
|
{
|
792
|
-
|
793
|
-
|
794
|
-
|
789
|
+
id: "refresh",
|
790
|
+
label: "refresh",
|
791
|
+
value: ""
|
795
792
|
}
|
796
793
|
]
|
797
794
|
};
|
@@ -82,12 +82,7 @@
|
|
82
82
|
</el-checkbox>
|
83
83
|
</el-form-item>
|
84
84
|
|
85
|
-
<el-form-item>
|
86
|
-
<div class="config-header" slot="label">
|
87
|
-
<span class="title">动作设置</span>
|
88
|
-
<span class="value" @click="handleEventsShow">配置</span>
|
89
|
-
</div>
|
90
|
-
|
85
|
+
<el-form-item label="提交接口">
|
91
86
|
<!-- <el-radio-group
|
92
87
|
style="margin-bottom:10px;"
|
93
88
|
v-model="widget.options.remote"
|
@@ -96,23 +91,27 @@
|
|
96
91
|
<el-radio-button :label="false">自定义事件</el-radio-button>
|
97
92
|
<el-radio-button :label="true">绑定接口</el-radio-button>
|
98
93
|
</el-radio-group> -->
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
94
|
+
<el-select
|
95
|
+
style="width:100%"
|
96
|
+
v-model="widget.options.remoteFunc"
|
97
|
+
value-key="id"
|
98
|
+
placeholder="请选择提交方法"
|
99
|
+
clearable
|
100
|
+
>
|
101
|
+
<el-option
|
102
|
+
v-for="item in config.remoteFuncs"
|
103
|
+
:key="item.id"
|
104
|
+
:label="item.label"
|
105
|
+
:value="item"
|
107
106
|
>
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
107
|
+
</el-option>
|
108
|
+
</el-select>
|
109
|
+
</el-form-item>
|
110
|
+
|
111
|
+
<el-form-item>
|
112
|
+
<div class="config-header" slot="label">
|
113
|
+
<span class="title">动作设置</span>
|
114
|
+
<span class="value" @click="handleEventsShow">配置</span>
|
116
115
|
</div>
|
117
116
|
|
118
117
|
<el-collapse v-show="!widget.options.remote" class="eventsCollapse">
|
@@ -131,9 +130,9 @@
|
|
131
130
|
>
|
132
131
|
<el-option
|
133
132
|
v-for="item in config.eventScript"
|
134
|
-
:key="item.
|
135
|
-
:label="item.
|
136
|
-
:value="item.
|
133
|
+
:key="item.id"
|
134
|
+
:label="item.label"
|
135
|
+
:value="item.id"
|
137
136
|
>
|
138
137
|
</el-option>
|
139
138
|
</el-select>
|