tianheng-ui 0.1.68 → 0.1.70
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/theme-chalk/js/axios.js +1 -1
- package/lib/theme-chalk/styles/dialog.scss +56 -40
- package/lib/theme-chalk/styles/feature.scss +7 -0
- package/lib/theme-chalk/styles/icon.css +8 -2
- package/lib/tianheng-ui.js +13 -13
- package/package.json +1 -1
- package/packages/Dialog/index.vue +18 -9
- package/packages/FormMaking/GenerateForm.vue +40 -49
- package/packages/FormMaking/GenerateFormItem.vue +10 -26
- package/packages/FormMaking/WidgetFormItem.vue +9 -7
- package/packages/FormMaking/WidgetGuide.vue +86 -0
- package/packages/FormMaking/WidgetSelect.vue +2 -2
- package/packages/FormMaking/WidgetTools.vue +10 -7
- package/packages/FormMaking/config/index.js +2 -0
- package/packages/FormMaking/custom/config.js +7 -36
- package/packages/FormMaking/custom/configs/grid.vue +17 -9
- package/packages/FormMaking/custom/configs/list.vue +89 -8
- package/packages/FormMaking/custom/configs/radio.vue +2 -5
- package/packages/FormMaking/custom/configs/table.vue +12 -9
- package/packages/FormMaking/custom/configs/tabs.vue +69 -55
- package/packages/FormMaking/custom/index.js +1 -1
- package/packages/FormMaking/custom/items/grid_dev.vue +5 -8
- package/packages/FormMaking/custom/items/list_dev.vue +19 -23
- package/packages/FormMaking/custom/items/list_pro.vue +109 -6
- package/packages/FormMaking/custom/items/table_dev.vue +13 -12
- package/packages/FormMaking/custom/items/table_pro.vue +5 -5
- package/packages/FormMaking/custom/items/tabs_dev.vue +4 -7
- package/packages/FormMaking/custom/items/tabs_pro.vue +7 -9
- package/packages/FormMaking/custom/items/upload.vue +3 -1
- package/packages/FormMaking/index.vue +72 -78
- package/packages/FormMaking/lang/zh-CN.js +2 -2
- package/packages/FormMaking/network/axios.js +88 -0
- package/packages/FormMaking/styles/index.scss +3 -3
- package/packages/FormMaking/util/Log.js +99 -0
- package/packages/FormMaking/util/generateCode.js +2 -2
- package/packages/TableMaking/config/index.js +8 -0
- package/packages/TableMaking/generateTable.vue +10 -3
- package/packages/TableMaking/index.vue +18 -3
- package/packages/TableMaking/network/axios.js +88 -0
- package/packages/TableMaking/util/Log.js +99 -0
- package/packages/TableMaking/widgetGuide.vue +122 -58
- package/packages/FormMaking/custom/configs/tableH5.vue +0 -98
- package/packages/FormMaking/custom/items/tableH5_dev.vue +0 -112
- package/packages/FormMaking/custom/items/tableH5_pro.vue +0 -119
- package/packages/FormMaking/util/request.js +0 -25
@@ -27,11 +27,7 @@
|
|
27
27
|
:widget="element"
|
28
28
|
:model.sync="dataModel[scope.$index][element.model]"
|
29
29
|
:models="models"
|
30
|
-
:pModel="
|
31
|
-
pModel
|
32
|
-
? `${pModel}.${scope.$index}`
|
33
|
-
: `${widget.model}.${scope.$index}`
|
34
|
-
"
|
30
|
+
:pModel="getPModel(scope.$index)"
|
35
31
|
:config="config"
|
36
32
|
:slotKeys="slotKeys"
|
37
33
|
:componentsData="componentsData"
|
@@ -110,6 +106,10 @@ export default {
|
|
110
106
|
},
|
111
107
|
handleTableDelete(index) {
|
112
108
|
this.dataModel.splice(index, 1);
|
109
|
+
},
|
110
|
+
getPModel(val) {
|
111
|
+
if (this.pModel) return `${this.pModel}.${this.widget.model}.${val}`;
|
112
|
+
else return `${this.widget.model}.${val}`;
|
113
113
|
}
|
114
114
|
}
|
115
115
|
};
|
@@ -13,13 +13,13 @@
|
|
13
13
|
>
|
14
14
|
<draggable
|
15
15
|
v-model="column.list"
|
16
|
-
:no-transition-on-drag="true"
|
17
16
|
v-bind="{
|
18
17
|
group: 'people',
|
19
18
|
ghostClass: 'draggable-ghost',
|
20
19
|
animation: 200,
|
21
20
|
handle: '.drag-widget'
|
22
21
|
}"
|
22
|
+
:no-transition-on-drag="true"
|
23
23
|
@add="handleWidgetAdd($event, widget, columnIndex)"
|
24
24
|
>
|
25
25
|
<transition-group name="fade" tag="div" class="draggable-list">
|
@@ -49,18 +49,15 @@ export default {
|
|
49
49
|
mixins: [itemsComponent, eventMixin],
|
50
50
|
data() {
|
51
51
|
return {
|
52
|
-
selectWidget:
|
52
|
+
selectWidget: this.select
|
53
53
|
};
|
54
54
|
},
|
55
55
|
watch: {
|
56
56
|
select(val) {
|
57
57
|
this.selectWidget = val;
|
58
58
|
},
|
59
|
-
selectWidget
|
60
|
-
|
61
|
-
this.$emit("update:select", val);
|
62
|
-
},
|
63
|
-
deep: true
|
59
|
+
selectWidget(val) {
|
60
|
+
this.$emit("update:select", val);
|
64
61
|
}
|
65
62
|
},
|
66
63
|
methods: {
|
@@ -20,11 +20,7 @@
|
|
20
20
|
: dataModel[column.value][element.model]
|
21
21
|
"
|
22
22
|
:models="models"
|
23
|
-
:pModel="
|
24
|
-
pModel
|
25
|
-
? `${pModel}.${scope.$index}`
|
26
|
-
: `${widget.model}.${column.value}`
|
27
|
-
"
|
23
|
+
:pModel="getPModel(column.value)"
|
28
24
|
:config="config"
|
29
25
|
:slotKeys="slotKeys"
|
30
26
|
:componentsData="componentsData"
|
@@ -44,10 +40,12 @@ export default {
|
|
44
40
|
components: { GenerateFormItem },
|
45
41
|
mixins: [itemsComponent, eventMixin],
|
46
42
|
props: ["slotKeys", "componentsData"],
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
methods: {
|
44
|
+
getPModel(val) {
|
45
|
+
if (this.pModel) return `${this.pModel}.${this.widget.model}.${val}`;
|
46
|
+
else return `${this.widget.model}.${val}`;
|
47
|
+
}
|
48
|
+
}
|
51
49
|
};
|
52
50
|
</script>
|
53
51
|
|
@@ -54,6 +54,8 @@
|
|
54
54
|
|
55
55
|
<script>
|
56
56
|
import { itemsComponent, eventMixin } from "../mixins/index";
|
57
|
+
import appConfig from "../../config/index";
|
58
|
+
|
57
59
|
export default {
|
58
60
|
mixins: [itemsComponent, eventMixin],
|
59
61
|
data() {
|
@@ -65,7 +67,7 @@ export default {
|
|
65
67
|
computed: {
|
66
68
|
uploadUrl() {
|
67
69
|
if (this.widget.options.remote.open) {
|
68
|
-
const info = sessionStorage.getItem(
|
70
|
+
const info = sessionStorage.getItem(appConfig.storageKeys.oauthConfig);
|
69
71
|
let baseUrl = "";
|
70
72
|
if (info) baseUrl = JSON.parse(info).baseUrl;
|
71
73
|
const func = this.config.network[this.widget.options.remote.api];
|
@@ -13,24 +13,20 @@
|
|
13
13
|
name="group-basic"
|
14
14
|
>
|
15
15
|
<draggable
|
16
|
-
tag="ul"
|
17
16
|
:list="getBasicComponents"
|
18
17
|
v-bind="{
|
19
18
|
group: { name: 'people', pull: 'clone', put: false },
|
20
19
|
sort: false
|
21
20
|
}"
|
22
21
|
>
|
23
|
-
<
|
22
|
+
<div
|
24
23
|
v-for="(item, index) in getBasicComponents"
|
25
|
-
class="fields-label"
|
26
|
-
:class="[[item.type]]"
|
24
|
+
:class="`fields-label ${item.type}`"
|
27
25
|
:key="index"
|
28
26
|
>
|
29
|
-
<
|
30
|
-
|
31
|
-
|
32
|
-
</a>
|
33
|
-
</li>
|
27
|
+
<i class="iconfont" :class="item.icon"></i>
|
28
|
+
<span>{{ item.name }}</span>
|
29
|
+
</div>
|
34
30
|
</draggable>
|
35
31
|
</el-collapse-item>
|
36
32
|
<el-collapse-item
|
@@ -39,24 +35,20 @@
|
|
39
35
|
name="group-advance"
|
40
36
|
>
|
41
37
|
<draggable
|
42
|
-
tag="ul"
|
43
38
|
:list="getAdvanceComponents"
|
44
39
|
v-bind="{
|
45
40
|
group: { name: 'people', pull: 'clone', put: false },
|
46
41
|
sort: false
|
47
42
|
}"
|
48
43
|
>
|
49
|
-
<
|
44
|
+
<div
|
50
45
|
v-for="(item, index) in getAdvanceComponents"
|
51
|
-
class="fields-label no-put"
|
52
|
-
:class="[[item.type]]"
|
46
|
+
:class="`fields-label ${item.type} no-put`"
|
53
47
|
:key="index"
|
54
48
|
>
|
55
|
-
<
|
56
|
-
|
57
|
-
|
58
|
-
</a>
|
59
|
-
</li>
|
49
|
+
<i class="iconfont" :class="item.icon"></i>
|
50
|
+
<span>{{ item.name }}</span>
|
51
|
+
</div>
|
60
52
|
</draggable>
|
61
53
|
</el-collapse-item>
|
62
54
|
<el-collapse-item
|
@@ -65,27 +57,23 @@
|
|
65
57
|
name="group-layout"
|
66
58
|
>
|
67
59
|
<draggable
|
68
|
-
tag="ul"
|
69
60
|
:list="getLayoutComponents"
|
70
61
|
v-bind="{
|
71
62
|
group: { name: 'people', pull: 'clone', put: false },
|
72
63
|
sort: false
|
73
64
|
}"
|
74
65
|
>
|
75
|
-
<
|
66
|
+
<div
|
76
67
|
v-for="(item, index) in getLayoutComponents"
|
77
|
-
class="
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
}"
|
68
|
+
:class="
|
69
|
+
`fields-label ${item.type}
|
70
|
+
${['alliance'].includes(item.type) ? 'no-put' : ''}`
|
71
|
+
"
|
82
72
|
:key="index"
|
83
73
|
>
|
84
|
-
<
|
85
|
-
|
86
|
-
|
87
|
-
</a>
|
88
|
-
</li>
|
74
|
+
<i class="iconfont" :class="item.icon"></i>
|
75
|
+
<span>{{ item.name }}</span>
|
76
|
+
</div>
|
89
77
|
</draggable>
|
90
78
|
</el-collapse-item>
|
91
79
|
<el-collapse-item
|
@@ -94,31 +82,27 @@
|
|
94
82
|
name="group-business"
|
95
83
|
>
|
96
84
|
<draggable
|
97
|
-
tag="ul"
|
98
85
|
:list="getBusinessComponents"
|
99
86
|
v-bind="{
|
100
87
|
group: { name: 'people', pull: 'clone', put: false },
|
101
88
|
sort: false
|
102
89
|
}"
|
103
90
|
>
|
104
|
-
<
|
91
|
+
<div
|
105
92
|
v-for="(item, index) in getBusinessComponents"
|
106
|
-
class="fields-label"
|
107
|
-
:class="[[item.type]]"
|
93
|
+
:class="`fields-label ${item.type}`"
|
108
94
|
:key="index"
|
109
95
|
>
|
110
|
-
<
|
111
|
-
|
112
|
-
|
113
|
-
</a>
|
114
|
-
</li>
|
96
|
+
<i class="iconfont" :class="item.icon"></i>
|
97
|
+
<span>{{ item.name }}</span>
|
98
|
+
</div>
|
115
99
|
</draggable>
|
116
100
|
</el-collapse-item>
|
117
101
|
</el-collapse>
|
118
102
|
</div>
|
119
103
|
|
120
104
|
<!-- 中间视图区 -->
|
121
|
-
<div class="
|
105
|
+
<div class="th-fiex_content">
|
122
106
|
<!-- 操作区 -->
|
123
107
|
<widget-tools
|
124
108
|
:baseConfig="baseConfig"
|
@@ -154,6 +138,10 @@
|
|
154
138
|
>
|
155
139
|
</widget-config>
|
156
140
|
</div>
|
141
|
+
|
142
|
+
<!-- <th-dialog v-model="showGuide" title="配置" :showFooter="false">
|
143
|
+
<widget-guide></widget-guide>
|
144
|
+
</th-dialog> -->
|
157
145
|
</div>
|
158
146
|
</template>
|
159
147
|
|
@@ -163,6 +151,7 @@ import WidgetConfig from "./WidgetConfig";
|
|
163
151
|
import WidgetTools from "./WidgetTools";
|
164
152
|
import WidgetForm from "./WidgetForm";
|
165
153
|
import GenerateForm from "./GenerateForm";
|
154
|
+
import WidgetGuide from "./WidgetGuide.vue";
|
166
155
|
import {
|
167
156
|
basicComponents,
|
168
157
|
advanceComponents,
|
@@ -171,6 +160,7 @@ import {
|
|
171
160
|
baseConfig
|
172
161
|
} from "./custom/config";
|
173
162
|
import generateCode from "./util/generateCode.js";
|
163
|
+
import appConfig from "./config/index";
|
174
164
|
import { deepClone } from "./util/index";
|
175
165
|
|
176
166
|
export default {
|
@@ -180,7 +170,8 @@ export default {
|
|
180
170
|
WidgetConfig,
|
181
171
|
WidgetTools,
|
182
172
|
WidgetForm,
|
183
|
-
GenerateForm
|
173
|
+
GenerateForm,
|
174
|
+
WidgetGuide
|
184
175
|
},
|
185
176
|
props: {
|
186
177
|
config: Object,
|
@@ -228,7 +219,7 @@ export default {
|
|
228
219
|
},
|
229
220
|
advanceFields: {
|
230
221
|
type: Array,
|
231
|
-
default: () => ["table", "
|
222
|
+
default: () => ["table", "list", "tabs"]
|
232
223
|
},
|
233
224
|
layoutFields: {
|
234
225
|
type: Array,
|
@@ -237,7 +228,8 @@ export default {
|
|
237
228
|
businessFields: {
|
238
229
|
type: Array,
|
239
230
|
default: () => ["blank", "descriptions", "workflow"]
|
240
|
-
}
|
231
|
+
},
|
232
|
+
guide: Boolean
|
241
233
|
},
|
242
234
|
data() {
|
243
235
|
this.basicComponents = basicComponents;
|
@@ -255,7 +247,8 @@ export default {
|
|
255
247
|
"group-advance",
|
256
248
|
"group-layout",
|
257
249
|
"group-business"
|
258
|
-
]
|
250
|
+
],
|
251
|
+
showGuide: this.guide
|
259
252
|
};
|
260
253
|
},
|
261
254
|
computed: {
|
@@ -291,6 +284,12 @@ export default {
|
|
291
284
|
},
|
292
285
|
apiOptions(val) {
|
293
286
|
this.handleNetworkConfig(true);
|
287
|
+
},
|
288
|
+
guide(val) {
|
289
|
+
this.showGuide = val;
|
290
|
+
},
|
291
|
+
showGuide(val) {
|
292
|
+
this.$emit("update:guide", val);
|
294
293
|
}
|
295
294
|
},
|
296
295
|
created() {
|
@@ -314,7 +313,10 @@ export default {
|
|
314
313
|
token: this.oauthConfig.token,
|
315
314
|
baseUrl: this.oauthConfig.baseUrl
|
316
315
|
};
|
317
|
-
sessionStorage.setItem(
|
316
|
+
sessionStorage.setItem(
|
317
|
+
appConfig.storageKeys.oauthConfig,
|
318
|
+
JSON.stringify(oauthInfo)
|
319
|
+
);
|
318
320
|
} else if (this.oauthConfig.oauth) {
|
319
321
|
// 模拟授权认证流程
|
320
322
|
this.axios({
|
@@ -327,7 +329,10 @@ export default {
|
|
327
329
|
token: res.data,
|
328
330
|
baseUrl: this.oauthConfig.baseUrl
|
329
331
|
};
|
330
|
-
sessionStorage.setItem(
|
332
|
+
sessionStorage.setItem(
|
333
|
+
appConfig.storageKeys.oauthConfig,
|
334
|
+
JSON.stringify(oauthInfo)
|
335
|
+
);
|
331
336
|
});
|
332
337
|
}
|
333
338
|
},
|
@@ -346,7 +351,7 @@ export default {
|
|
346
351
|
item.options.columns.forEach(e => {
|
347
352
|
initList(e.list);
|
348
353
|
});
|
349
|
-
} else if (item.type === "table" || item.type === "
|
354
|
+
} else if (item.type === "table" || item.type === "list") {
|
350
355
|
initList(item.options.columns);
|
351
356
|
} else if (item.type === "workflow") {
|
352
357
|
initList(item.options.buttons);
|
@@ -488,15 +493,10 @@ export default {
|
|
488
493
|
align-items: center;
|
489
494
|
height: 45px;
|
490
495
|
padding: 0 15px;
|
491
|
-
|
492
|
-
ul {
|
493
|
-
position: relative;
|
494
|
-
overflow: hidden;
|
495
|
-
padding: 5px;
|
496
|
-
margin: 0;
|
496
|
+
z-index: 99;
|
497
497
|
}
|
498
498
|
.fields-label {
|
499
|
-
margin:
|
499
|
+
margin: 2px 3px;
|
500
500
|
width: calc(50% - 6px);
|
501
501
|
line-height: 26px;
|
502
502
|
font-size: 12px;
|
@@ -505,9 +505,23 @@ export default {
|
|
505
505
|
overflow: hidden;
|
506
506
|
text-overflow: ellipsis;
|
507
507
|
white-space: nowrap;
|
508
|
+
background: #f4f6fc;
|
508
509
|
border: 1px solid #f4f6fc;
|
509
510
|
box-sizing: border-box;
|
510
511
|
transition: 0.25s;
|
512
|
+
cursor: move;
|
513
|
+
|
514
|
+
i {
|
515
|
+
margin-right: 6px;
|
516
|
+
margin-left: 8px;
|
517
|
+
font-size: 14px;
|
518
|
+
display: inline-block;
|
519
|
+
vertical-align: middle;
|
520
|
+
}
|
521
|
+
span {
|
522
|
+
display: inline-block;
|
523
|
+
vertical-align: middle;
|
524
|
+
}
|
511
525
|
|
512
526
|
&:hover {
|
513
527
|
color: $color-parimary-active !important;
|
@@ -517,32 +531,8 @@ export default {
|
|
517
531
|
color: $color-parimary-active !important;
|
518
532
|
}
|
519
533
|
}
|
520
|
-
|
521
|
-
& > a {
|
522
|
-
color: #333;
|
523
|
-
display: block;
|
524
|
-
cursor: move;
|
525
|
-
background: #f4f6fc;
|
526
|
-
border: 1px solid #f4f6fc;
|
527
|
-
transition: 0.25s;
|
528
|
-
|
529
|
-
.icon {
|
530
|
-
margin-right: 6px;
|
531
|
-
margin-left: 8px;
|
532
|
-
font-size: 14px;
|
533
|
-
display: inline-block;
|
534
|
-
vertical-align: middle;
|
535
|
-
}
|
536
|
-
|
537
|
-
span {
|
538
|
-
display: inline-block;
|
539
|
-
vertical-align: middle;
|
540
|
-
}
|
541
|
-
}
|
542
534
|
}
|
543
535
|
}
|
544
|
-
.formMaking-drawing {
|
545
|
-
}
|
546
536
|
}
|
547
537
|
</style>
|
548
538
|
|
@@ -554,5 +544,9 @@ export default {
|
|
554
544
|
line-height: 40px;
|
555
545
|
background-color: #f5f7f9;
|
556
546
|
}
|
547
|
+
.el-collapse-item__content {
|
548
|
+
padding: 2px 3px;
|
549
|
+
line-height: normal;
|
550
|
+
}
|
557
551
|
}
|
558
552
|
</style>
|
@@ -11,7 +11,7 @@ export default {
|
|
11
11
|
date: '日期选择器',
|
12
12
|
rate: '评分',
|
13
13
|
color: '颜色选择器',
|
14
|
-
select: '
|
14
|
+
select: '下拉选择器',
|
15
15
|
switch: '开关',
|
16
16
|
slider: '滑块',
|
17
17
|
text: '文字',
|
@@ -20,7 +20,7 @@ export default {
|
|
20
20
|
upload: '图片',
|
21
21
|
editor: '编辑器',
|
22
22
|
cascader: '级联选择器',
|
23
|
-
table: '
|
23
|
+
table: '子表格',
|
24
24
|
grid: '栅格布局',
|
25
25
|
tabs: '标签页',
|
26
26
|
divider: '分割线'
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import axios from "axios";
|
2
|
+
import Log from "../util/Log";
|
3
|
+
import appConfig from "../config/index";
|
4
|
+
import { Notification } from "element-ui";
|
5
|
+
|
6
|
+
export const init = baseConfig => {
|
7
|
+
// 创建axios实例
|
8
|
+
const Axios = axios.create({
|
9
|
+
baseURL: baseConfig.baseUrl,
|
10
|
+
timeout: 60000 // 请求超时时间
|
11
|
+
// withCredentials: true, //允许携带cookie
|
12
|
+
});
|
13
|
+
|
14
|
+
// 添加请求拦截器
|
15
|
+
Axios.interceptors.request.use(
|
16
|
+
config => {
|
17
|
+
const info = sessionStorage.getItem(appConfig.storageKeys.oauthConfig);
|
18
|
+
if (info) {
|
19
|
+
const oauthInfo = JSON.parse(info);
|
20
|
+
config.baseURL = oauthInfo.baseUrl;
|
21
|
+
config.headers["Authorization"] = oauthInfo.token;
|
22
|
+
}
|
23
|
+
if (baseConfig.headers) {
|
24
|
+
config.headers = Object.assign(config.headers, baseConfig.headers);
|
25
|
+
}
|
26
|
+
return config;
|
27
|
+
},
|
28
|
+
error => {
|
29
|
+
Promise.reject(error);
|
30
|
+
}
|
31
|
+
);
|
32
|
+
|
33
|
+
// 添加响应拦截器
|
34
|
+
Axios.interceptors.response.use(
|
35
|
+
response => {
|
36
|
+
const code = response.status;
|
37
|
+
if (code < 200 || code > 300) {
|
38
|
+
Notification.error({
|
39
|
+
title: response.message
|
40
|
+
});
|
41
|
+
return Promise.reject("error");
|
42
|
+
}
|
43
|
+
|
44
|
+
const dataCode = response.data.code;
|
45
|
+
if (dataCode && dataCode !== 200) {
|
46
|
+
Notification.error({
|
47
|
+
title: response.data.message
|
48
|
+
});
|
49
|
+
return Promise.reject("error");
|
50
|
+
}
|
51
|
+
|
52
|
+
if (baseConfig.debug) {
|
53
|
+
Log.prettyPrimary("Request Url:", response.request.responseURL);
|
54
|
+
Log.prettySuccess("Request Res:", response);
|
55
|
+
}
|
56
|
+
|
57
|
+
return response.data;
|
58
|
+
},
|
59
|
+
error => {
|
60
|
+
let code = 0;
|
61
|
+
try {
|
62
|
+
code = error.response.data.status;
|
63
|
+
} catch (e) {
|
64
|
+
if (error.toString().indexOf("Error: timeout") !== -1) {
|
65
|
+
Notification.error({
|
66
|
+
title: "网络请求超时",
|
67
|
+
duration: 5000
|
68
|
+
});
|
69
|
+
return Promise.reject(error);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
if (code) {
|
73
|
+
const errorMsg = error.response.data.message;
|
74
|
+
Notification.error({
|
75
|
+
title: errorMsg || "未知错误",
|
76
|
+
duration: 5000
|
77
|
+
});
|
78
|
+
} else {
|
79
|
+
Notification.error({
|
80
|
+
title: "接口请求失败",
|
81
|
+
duration: 5000
|
82
|
+
});
|
83
|
+
}
|
84
|
+
return Promise.reject(error);
|
85
|
+
}
|
86
|
+
);
|
87
|
+
return Axios;
|
88
|
+
};
|
@@ -66,7 +66,7 @@
|
|
66
66
|
overflow: hidden;
|
67
67
|
content: "";
|
68
68
|
// 隐藏内容
|
69
|
-
|
69
|
+
i {
|
70
70
|
display: none;
|
71
71
|
}
|
72
72
|
}
|
@@ -75,7 +75,7 @@
|
|
75
75
|
.draggable-list {
|
76
76
|
min-height: 52px;
|
77
77
|
background-color: #fff;
|
78
|
-
|
78
|
+
border: 1px dashed rgba(170, 170, 170, 0.7);
|
79
79
|
}
|
80
80
|
|
81
81
|
.widgetForm {
|
@@ -150,7 +150,7 @@
|
|
150
150
|
}
|
151
151
|
|
152
152
|
.value {
|
153
|
-
color:
|
153
|
+
color: $color-parimary;
|
154
154
|
cursor: pointer;
|
155
155
|
}
|
156
156
|
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
function Log() {}
|
2
|
+
|
3
|
+
Log.prototype.type = ["primary", "success", "warn", "error", "info"];
|
4
|
+
|
5
|
+
Log.prototype.typeColor = function(type) {
|
6
|
+
let color = "";
|
7
|
+
switch (type) {
|
8
|
+
case "primary":
|
9
|
+
color = "#2d8cf0";
|
10
|
+
break;
|
11
|
+
case "success":
|
12
|
+
color = "#19be6b";
|
13
|
+
break;
|
14
|
+
case "info":
|
15
|
+
color = "#909399";
|
16
|
+
break;
|
17
|
+
case "warn":
|
18
|
+
color = "#ff9900";
|
19
|
+
break;
|
20
|
+
case "error":
|
21
|
+
color = "#f03f14";
|
22
|
+
break;
|
23
|
+
default:
|
24
|
+
color = "#35495E";
|
25
|
+
break;
|
26
|
+
}
|
27
|
+
return color;
|
28
|
+
};
|
29
|
+
|
30
|
+
Log.prototype.isArray = function(obj) {
|
31
|
+
return Object.prototype.toString.call(obj) === "[object Array]";
|
32
|
+
};
|
33
|
+
|
34
|
+
Log.prototype.print = function(text, type = "default", back = false) {
|
35
|
+
if (typeof text === "object") {
|
36
|
+
// 如果是對象則調用打印對象方式
|
37
|
+
this.isArray(text) ? console.table(text) : console.dir(text);
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
if (back) {
|
41
|
+
// 如果是打印帶背景圖的
|
42
|
+
console.log(`%c ${text} `, `background:${this.typeColor(type)}; padding: 2px; border-radius: 4px; color: #fff;`);
|
43
|
+
} else {
|
44
|
+
console.log(
|
45
|
+
`%c ${text} `,
|
46
|
+
`border: 1px solid ${this.typeColor(type)};
|
47
|
+
padding: 2px; border-radius: 4px;
|
48
|
+
color: ${this.typeColor(type)};`
|
49
|
+
);
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
Log.prototype.printBack = function(type = "primary", title) {
|
54
|
+
this.print(type, title, true);
|
55
|
+
};
|
56
|
+
|
57
|
+
Log.prototype.pretty = function(type = "primary", title, text) {
|
58
|
+
if (typeof text === "object") {
|
59
|
+
// console.group("Console Group", title);
|
60
|
+
console.log(
|
61
|
+
`%c ${title}`,
|
62
|
+
`background:${this.typeColor(type)};border:1px solid ${this.typeColor(type)};
|
63
|
+
padding: 1px; border-radius: 4px; color: #fff;`
|
64
|
+
);
|
65
|
+
this.isArray(text) ? console.table(text) : console.dir(text);
|
66
|
+
console.groupEnd();
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
console.log(
|
70
|
+
`%c ${title} %c ${text} %c`,
|
71
|
+
`background:${this.typeColor(type)};border:1px solid ${this.typeColor(type)};
|
72
|
+
padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`,
|
73
|
+
`border:1px solid ${this.typeColor(type)};
|
74
|
+
padding: 1px; border-radius: 0 4px 4px 0; color: ${this.typeColor(type)};`,
|
75
|
+
"background:transparent"
|
76
|
+
);
|
77
|
+
};
|
78
|
+
|
79
|
+
Log.prototype.prettyPrimary = function(title, ...text) {
|
80
|
+
text.forEach(t => this.pretty("primary", title, t));
|
81
|
+
};
|
82
|
+
|
83
|
+
Log.prototype.prettySuccess = function(title, ...text) {
|
84
|
+
text.forEach(t => this.pretty("success", title, t));
|
85
|
+
};
|
86
|
+
|
87
|
+
Log.prototype.prettyWarn = function(title, ...text) {
|
88
|
+
text.forEach(t => this.pretty("warn", title, t));
|
89
|
+
};
|
90
|
+
|
91
|
+
Log.prototype.prettyError = function(title, ...text) {
|
92
|
+
text.forEach(t => this.pretty("error", title, t));
|
93
|
+
};
|
94
|
+
|
95
|
+
Log.prototype.prettyInfo = function(title, ...text) {
|
96
|
+
text.forEach(t => this.pretty("info", title, t));
|
97
|
+
};
|
98
|
+
|
99
|
+
export default new Log();
|
@@ -112,7 +112,7 @@ export default function(config, type = "making") {
|
|
112
112
|
},
|
113
113
|
methods: {
|
114
114
|
handleSubmit () {
|
115
|
-
this.$refs.makingForm.
|
115
|
+
this.$refs.makingForm.getData().then(res => {
|
116
116
|
console.log(res);
|
117
117
|
});
|
118
118
|
}
|
@@ -146,7 +146,7 @@ export default function(config, type = "making") {
|
|
146
146
|
console.log(val);
|
147
147
|
},
|
148
148
|
handleSubmit () {
|
149
|
-
this.$refs.generateForm.
|
149
|
+
this.$refs.generateForm.getData().then(res => {
|
150
150
|
console.log(res);
|
151
151
|
});
|
152
152
|
}
|