tianheng-ui 0.0.42 → 0.0.45
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/03250ed25fc1b305e9980cf7cf0dfb09.js +1 -0
- package/lib/c755e7fc08446566ee8dd3a8aa8fe43f.js +1715 -0
- package/lib/index.js +1 -1
- package/lib/tianheng-ui.js +25 -20
- package/lib/tianheng-ui.js.map +1 -1
- package/package.json +65 -58
- package/packages/formMaking/Container.vue +57 -48
- package/packages/formMaking/CusDialog.vue +2 -2
- package/packages/formMaking/FormConfig.vue +18 -9
- package/packages/formMaking/GenerateForm.vue +1 -1
- package/packages/formMaking/GenerateFormItem.vue +516 -266
- package/packages/formMaking/Upload/index.vue +298 -177
- package/packages/formMaking/WidgetConfig.vue +1361 -498
- package/packages/formMaking/WidgetForm.vue +167 -116
- package/packages/formMaking/WidgetFormItem.vue +466 -284
- package/packages/formMaking/componentsConfig.js +402 -313
- package/packages/formMaking/index.js +25 -27
package/package.json
CHANGED
@@ -1,58 +1,65 @@
|
|
1
|
-
{
|
2
|
-
"name": "tianheng-ui",
|
3
|
-
"description": "A Vue.js project",
|
4
|
-
"version": "0.0.
|
5
|
-
"author": "shu lang <403732931@qq.com>",
|
6
|
-
"license": "MIT",
|
7
|
-
"private": false,
|
8
|
-
"main": "./lib/tianheng-ui.js",
|
9
|
-
"scripts": {
|
10
|
-
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
|
11
|
-
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
12
|
-
},
|
13
|
-
"dependencies": {
|
14
|
-
"ace-builds": "^1.4.13",
|
15
|
-
"axios": "^0.27.2",
|
16
|
-
"clipboard": "^2.0.11",
|
17
|
-
"element-ui": "^2.15.6",
|
18
|
-
"normalize.css": "^8.0.1",
|
19
|
-
"nprogress": "^0.2.0",
|
20
|
-
"viewerjs": "^1.10.5",
|
21
|
-
"vue": "^2.5.11",
|
22
|
-
"vue-i18n": "^5.0.3",
|
23
|
-
"vue-router": "^3.5.3",
|
24
|
-
"
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
"
|
29
|
-
"
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
"babel
|
34
|
-
"babel-
|
35
|
-
"babel-
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
|
48
|
-
|
49
|
-
"
|
50
|
-
"
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
1
|
+
{
|
2
|
+
"name": "tianheng-ui",
|
3
|
+
"description": "A Vue.js project",
|
4
|
+
"version": "0.0.45",
|
5
|
+
"author": "shu lang <403732931@qq.com>",
|
6
|
+
"license": "MIT",
|
7
|
+
"private": false,
|
8
|
+
"main": "./lib/tianheng-ui.js",
|
9
|
+
"scripts": {
|
10
|
+
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
|
11
|
+
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
12
|
+
},
|
13
|
+
"dependencies": {
|
14
|
+
"ace-builds": "^1.4.13",
|
15
|
+
"axios": "^0.27.2",
|
16
|
+
"clipboard": "^2.0.11",
|
17
|
+
"element-ui": "^2.15.6",
|
18
|
+
"normalize.css": "^8.0.1",
|
19
|
+
"nprogress": "^0.2.0",
|
20
|
+
"viewerjs": "^1.10.5",
|
21
|
+
"vue": "^2.5.11",
|
22
|
+
"vue-i18n": "^5.0.3",
|
23
|
+
"vue-router": "^3.5.3",
|
24
|
+
"vue2-editor": "^2.10.3",
|
25
|
+
"vuedraggable": "^2.24.3"
|
26
|
+
},
|
27
|
+
"browserslist": [
|
28
|
+
"> 1%",
|
29
|
+
"last 2 versions",
|
30
|
+
"not ie <= 8"
|
31
|
+
],
|
32
|
+
"devDependencies": {
|
33
|
+
"@babel/core": "^7.0.0",
|
34
|
+
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
35
|
+
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
36
|
+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
37
|
+
"@babel/plugin-syntax-import-meta": "^7.0.0",
|
38
|
+
"@babel/preset-env": "^7.0.0",
|
39
|
+
"@types/ace": "0.0.42",
|
40
|
+
"babel-loader": "^8.2.5",
|
41
|
+
"cross-env": "^5.0.5",
|
42
|
+
"css-loader": "^0.28.7",
|
43
|
+
"file-loader": "^1.1.4",
|
44
|
+
"less": "^3.9.0",
|
45
|
+
"less-loader": "^4.1.0",
|
46
|
+
"sass": "^1.26.5",
|
47
|
+
"sass-loader": "^7.3.1",
|
48
|
+
"uglifyjs-webpack-plugin": "^2.2.0",
|
49
|
+
"vue-loader": "^14.2.4",
|
50
|
+
"vue-template-compiler": "^2.4.4",
|
51
|
+
"webpack": "^4.46.0",
|
52
|
+
"webpack-cli": "^3.3.12",
|
53
|
+
"webpack-dev-server": "^3.11.3"
|
54
|
+
},
|
55
|
+
"files": [
|
56
|
+
"lib",
|
57
|
+
"packages"
|
58
|
+
],
|
59
|
+
"homepage": "",
|
60
|
+
"keywords": [
|
61
|
+
"tianheng",
|
62
|
+
"tianheng-ui"
|
63
|
+
],
|
64
|
+
"style": "lib/theme-chalk/index.css"
|
65
|
+
}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<div class="components-list">
|
8
8
|
<template v-if="basicFields.length">
|
9
9
|
<div class="widget-cate">
|
10
|
-
|
10
|
+
基础字段
|
11
11
|
</div>
|
12
12
|
<draggable
|
13
13
|
tag="ul"
|
@@ -38,7 +38,7 @@
|
|
38
38
|
</template>
|
39
39
|
<template v-if="advanceFields.length">
|
40
40
|
<div class="widget-cate">
|
41
|
-
|
41
|
+
高级字段
|
42
42
|
</div>
|
43
43
|
<draggable
|
44
44
|
tag="ul"
|
@@ -70,7 +70,7 @@
|
|
70
70
|
|
71
71
|
<template v-if="layoutFields.length">
|
72
72
|
<div class="widget-cate">
|
73
|
-
|
73
|
+
布局字段
|
74
74
|
</div>
|
75
75
|
<draggable
|
76
76
|
tag="ul"
|
@@ -109,7 +109,7 @@
|
|
109
109
|
size="medium"
|
110
110
|
icon="el-icon-upload2"
|
111
111
|
@click="handleUpload"
|
112
|
-
|
112
|
+
>导入JSON</el-button
|
113
113
|
>
|
114
114
|
<el-button
|
115
115
|
v-if="clearable"
|
@@ -117,7 +117,7 @@
|
|
117
117
|
size="medium"
|
118
118
|
icon="el-icon-delete"
|
119
119
|
@click="handleClear"
|
120
|
-
|
120
|
+
>清空</el-button
|
121
121
|
>
|
122
122
|
<el-button
|
123
123
|
v-if="preview"
|
@@ -125,7 +125,7 @@
|
|
125
125
|
size="medium"
|
126
126
|
icon="el-icon-view"
|
127
127
|
@click="handlePreview"
|
128
|
-
|
128
|
+
>预览</el-button
|
129
129
|
>
|
130
130
|
<el-button
|
131
131
|
v-if="generateJson"
|
@@ -133,7 +133,7 @@
|
|
133
133
|
size="medium"
|
134
134
|
icon="el-icon-tickets"
|
135
135
|
@click="handleGenerateJson"
|
136
|
-
|
136
|
+
>生成JSON</el-button
|
137
137
|
>
|
138
138
|
<el-button
|
139
139
|
v-if="generateCode"
|
@@ -141,7 +141,7 @@
|
|
141
141
|
size="medium"
|
142
142
|
icon="el-icon-document"
|
143
143
|
@click="handleGenerateCode"
|
144
|
-
|
144
|
+
>生成代码</el-button
|
145
145
|
>
|
146
146
|
</el-header>
|
147
147
|
<el-main :class="{ 'widget-empty': widgetForm.list.length == 0 }">
|
@@ -162,20 +162,21 @@
|
|
162
162
|
:class="{ active: configTab == 'widget' }"
|
163
163
|
@click="handleConfigSelect('widget')"
|
164
164
|
>
|
165
|
-
|
165
|
+
字段属性
|
166
166
|
</div>
|
167
167
|
<div
|
168
168
|
class="config-tab"
|
169
169
|
:class="{ active: configTab == 'form' }"
|
170
170
|
@click="handleConfigSelect('form')"
|
171
171
|
>
|
172
|
-
|
172
|
+
表单属性
|
173
173
|
</div>
|
174
174
|
</el-header>
|
175
175
|
<el-main class="config-content">
|
176
176
|
<widget-config
|
177
177
|
v-show="configTab == 'widget'"
|
178
178
|
:data="widgetFormSelect"
|
179
|
+
:remoteApis="remoteApis"
|
179
180
|
></widget-config>
|
180
181
|
<form-config
|
181
182
|
v-show="configTab == 'form'"
|
@@ -216,12 +217,8 @@
|
|
216
217
|
</generate-form>
|
217
218
|
|
218
219
|
<template slot="action">
|
219
|
-
<el-button type="primary" @click="handleTest">
|
220
|
-
|
221
|
-
}}</el-button>
|
222
|
-
<el-button @click="handleReset">{{
|
223
|
-
$t("fm.actions.reset")
|
224
|
-
}}</el-button>
|
220
|
+
<el-button type="primary" @click="handleTest">获取数据</el-button>
|
221
|
+
<el-button @click="handleReset">重置</el-button>
|
225
222
|
</template>
|
226
223
|
</cus-dialog>
|
227
224
|
|
@@ -235,7 +232,7 @@
|
|
235
232
|
>
|
236
233
|
<el-alert
|
237
234
|
type="info"
|
238
|
-
|
235
|
+
title="JSON格式如下,直接复制生成的json覆盖此处代码点击确定即可"
|
239
236
|
></el-alert>
|
240
237
|
<div id="uploadeditor" style="height: 400px;width: 100%;">
|
241
238
|
{{ jsonEg }}
|
@@ -258,7 +255,7 @@
|
|
258
255
|
type="primary"
|
259
256
|
class="json-btn"
|
260
257
|
:data-clipboard-text="jsonCopyValue"
|
261
|
-
|
258
|
+
>复制数据</el-button
|
262
259
|
>
|
263
260
|
</template>
|
264
261
|
</cus-dialog>
|
@@ -302,6 +299,14 @@
|
|
302
299
|
</template>
|
303
300
|
|
304
301
|
<script>
|
302
|
+
import ace from "ace-builds";
|
303
|
+
import "ace-builds/src-min-noconflict/mode-json";
|
304
|
+
import "ace-builds/src-min-noconflict/mode-html";
|
305
|
+
import htmlWorkerUrl from "file-loader!ace-builds/src-min-noconflict/worker-html";
|
306
|
+
ace.config.setModuleUrl("ace/mode/html_worker", htmlWorkerUrl);
|
307
|
+
import jsonWorkerUrl from "file-loader!ace-builds/src-noconflict/worker-json";
|
308
|
+
ace.config.setModuleUrl("ace/mode/json_worker", jsonWorkerUrl);
|
309
|
+
|
305
310
|
import Draggable from "vuedraggable";
|
306
311
|
import Clipboard from "clipboard";
|
307
312
|
import WidgetConfig from "./WidgetConfig";
|
@@ -374,6 +379,10 @@ export default {
|
|
374
379
|
layoutFields: {
|
375
380
|
type: Array,
|
376
381
|
default: () => ["grid"]
|
382
|
+
},
|
383
|
+
remoteApis: {
|
384
|
+
type: Array,
|
385
|
+
default: () => []
|
377
386
|
}
|
378
387
|
},
|
379
388
|
data() {
|
@@ -427,7 +436,8 @@ export default {
|
|
427
436
|
uploadEditor: null,
|
428
437
|
jsonCopyValue: "",
|
429
438
|
jsonClipboard: null,
|
430
|
-
jsonEg: `
|
439
|
+
jsonEg: `
|
440
|
+
{
|
431
441
|
"list": [],
|
432
442
|
"config": {
|
433
443
|
"labelWidth": 100,
|
@@ -439,29 +449,29 @@ export default {
|
|
439
449
|
};
|
440
450
|
},
|
441
451
|
mounted() {
|
442
|
-
this._loadComponents();
|
452
|
+
// this._loadComponents();
|
443
453
|
},
|
444
454
|
methods: {
|
445
|
-
_loadComponents() {
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
},
|
455
|
+
// _loadComponents() {
|
456
|
+
// this.basicComponents = this.basicComponents.map(item => {
|
457
|
+
// return {
|
458
|
+
// ...item,
|
459
|
+
// name: this.$t(`fm.components.fields.${item.type}`)
|
460
|
+
// };
|
461
|
+
// });
|
462
|
+
// this.advanceComponents = this.advanceComponents.map(item => {
|
463
|
+
// return {
|
464
|
+
// ...item,
|
465
|
+
// name: this.$t(`fm.components.fields.${item.type}`)
|
466
|
+
// };
|
467
|
+
// });
|
468
|
+
// this.layoutComponents = this.layoutComponents.map(item => {
|
469
|
+
// return {
|
470
|
+
// ...item,
|
471
|
+
// name: this.$t(`fm.components.fields.${item.type}`)
|
472
|
+
// };
|
473
|
+
// });
|
474
|
+
// },
|
465
475
|
handleGoGithub() {
|
466
476
|
window.location.href = "https://github.com/GavinZhuLei/vue-form-making";
|
467
477
|
},
|
@@ -469,16 +479,16 @@ export default {
|
|
469
479
|
this.configTab = value;
|
470
480
|
},
|
471
481
|
handleMoveEnd(evt) {
|
472
|
-
console.log("end", evt);
|
482
|
+
// console.log("end", evt);
|
473
483
|
},
|
474
484
|
handleMoveStart({ oldIndex }) {
|
475
|
-
console.log("start", oldIndex, this.basicComponents);
|
485
|
+
// console.log("start", oldIndex, this.basicComponents);
|
476
486
|
},
|
477
487
|
handleMove() {
|
478
488
|
return true;
|
479
489
|
},
|
480
490
|
handlePreview() {
|
481
|
-
console.log(this.widgetForm);
|
491
|
+
// console.log(this.widgetForm);
|
482
492
|
this.previewVisible = true;
|
483
493
|
},
|
484
494
|
handleTest() {
|
@@ -498,7 +508,6 @@ export default {
|
|
498
508
|
handleGenerateJson() {
|
499
509
|
this.jsonVisible = true;
|
500
510
|
this.jsonTemplate = this.widgetForm;
|
501
|
-
console.log(JSON.stringify(this.widgetForm));
|
502
511
|
this.$nextTick(() => {
|
503
512
|
const editor = ace.edit("jsoneditor");
|
504
513
|
editor.session.setMode("ace/mode/json");
|
@@ -506,7 +515,7 @@ export default {
|
|
506
515
|
if (!this.jsonClipboard) {
|
507
516
|
this.jsonClipboard = new Clipboard(".json-btn");
|
508
517
|
this.jsonClipboard.on("success", e => {
|
509
|
-
this.$message.success(
|
518
|
+
this.$message.success("复制成功");
|
510
519
|
});
|
511
520
|
}
|
512
521
|
this.jsonCopyValue = JSON.stringify(this.widgetForm);
|
@@ -570,18 +579,18 @@ export default {
|
|
570
579
|
}
|
571
580
|
},
|
572
581
|
handleInput(val) {
|
573
|
-
console.log(val);
|
582
|
+
// console.log(val);
|
574
583
|
this.blank = val;
|
575
584
|
},
|
576
585
|
handleDataChange(field, value, data) {
|
577
|
-
console.log(field, value, data);
|
586
|
+
// console.log(field, value, data);
|
578
587
|
}
|
579
588
|
},
|
580
589
|
watch: {
|
581
590
|
widgetForm: {
|
582
591
|
deep: true,
|
583
592
|
handler: function(val) {
|
584
|
-
console.log(this.$refs.widgetForm);
|
593
|
+
// console.log(this.$refs.widgetForm);
|
585
594
|
}
|
586
595
|
},
|
587
596
|
$lang: function(val) {
|
@@ -17,8 +17,8 @@
|
|
17
17
|
<span v-if="action" slot="footer" class="dialog-footer" v-loading="loading"
|
18
18
|
:element-loading-text="loadingText">
|
19
19
|
<slot name="action">
|
20
|
-
<el-button @click="close"
|
21
|
-
<el-button type="primary" @click="submit"
|
20
|
+
<el-button @click="close">取 消</el-button>
|
21
|
+
<el-button type="primary" @click="submit" >确 定</el-button>
|
22
22
|
</slot>
|
23
23
|
</span>
|
24
24
|
</el-dialog>
|
@@ -1,19 +1,28 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="form-config-container">
|
3
3
|
<el-form label-position="top">
|
4
|
-
<el-form-item
|
4
|
+
<el-form-item label="表单标题">
|
5
|
+
<el-input v-model="data.title"></el-input>
|
6
|
+
</el-form-item>
|
7
|
+
|
8
|
+
<el-form-item label="标签对齐方式">
|
5
9
|
<el-radio-group v-model="data.labelPosition">
|
6
|
-
<el-radio-button label="left"
|
7
|
-
<el-radio-button label="right"
|
8
|
-
<el-radio-button label="top"
|
10
|
+
<el-radio-button label="left">左对齐</el-radio-button>
|
11
|
+
<el-radio-button label="right">右对齐</el-radio-button>
|
12
|
+
<el-radio-button label="top">顶部对齐</el-radio-button>
|
9
13
|
</el-radio-group>
|
10
14
|
</el-form-item>
|
11
15
|
|
12
|
-
<el-form-item
|
13
|
-
<el-input-number
|
16
|
+
<el-form-item label="表单标签宽度">
|
17
|
+
<el-input-number
|
18
|
+
v-model="data.labelWidth"
|
19
|
+
:min="0"
|
20
|
+
:max="200"
|
21
|
+
:step="10"
|
22
|
+
></el-input-number>
|
14
23
|
</el-form-item>
|
15
24
|
|
16
|
-
<el-form-item
|
25
|
+
<el-form-item label="组件尺寸">
|
17
26
|
<el-radio-group v-model="data.size">
|
18
27
|
<el-radio-button label="medium">medium</el-radio-button>
|
19
28
|
<el-radio-button label="small">small</el-radio-button>
|
@@ -26,6 +35,6 @@
|
|
26
35
|
|
27
36
|
<script>
|
28
37
|
export default {
|
29
|
-
props: [
|
30
|
-
}
|
38
|
+
props: ["data"]
|
39
|
+
};
|
31
40
|
</script>
|