tianheng-ui 0.1.81 → 0.1.84

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.
Files changed (32) hide show
  1. package/README.md +72 -15
  2. package/lib/theme-chalk/fonts/formMaking-iconfont.svg +155 -155
  3. package/lib/theme-chalk/fonts/th-iconfont.css +2402 -2402
  4. package/lib/theme-chalk/js/axios.js +87 -87
  5. package/lib/tianheng-ui.js +13 -13
  6. package/package.json +87 -86
  7. package/packages/CodeEditor/index.vue +3 -2
  8. package/packages/FormMaking/GenerateForm.vue +392 -392
  9. package/packages/FormMaking/Upload/index.vue +571 -571
  10. package/packages/FormMaking/WidgetFooter.vue +16 -0
  11. package/packages/FormMaking/WidgetForm.vue +145 -146
  12. package/packages/FormMaking/WidgetTools.vue +21 -16
  13. package/packages/FormMaking/custom/config.js +120 -2
  14. package/packages/FormMaking/custom/configs/number.vue +0 -5
  15. package/packages/FormMaking/custom/configs/page-table.vue +146 -0
  16. package/packages/FormMaking/custom/index.js +1 -1
  17. package/packages/FormMaking/custom/items/page-table.vue +250 -0
  18. package/packages/FormMaking/custom/register.js +43 -43
  19. package/packages/FormMaking/iconfont/demo.css +539 -539
  20. package/packages/FormMaking/iconfont/demo_index.html +1159 -1159
  21. package/packages/FormMaking/iconfont/formMaking-iconfont.css +189 -189
  22. package/packages/FormMaking/iconfont/formMaking-iconfont.svg +155 -155
  23. package/packages/FormMaking/index.js +33 -33
  24. package/packages/FormMaking/index.vue +6 -1
  25. package/packages/FormMaking/lang/en-US.js +187 -187
  26. package/packages/FormMaking/lang/zh-CN.js +187 -187
  27. package/packages/FormMaking/network/axios.js +88 -88
  28. package/packages/FormMaking/styles/index.scss +216 -216
  29. package/packages/FormMaking/util/generateCode.js +427 -157
  30. package/packages/FormMaking/util/index.js +98 -98
  31. package/packages/TableMaking/network/axios.js +88 -88
  32. package/packages/TableMaking/widgetConfig.vue +1 -1
@@ -1,87 +1,87 @@
1
- import axios from "axios";
2
- import Log from "./Log";
3
- import { Notification } from "element-ui";
4
-
5
- export const init = baseConfig => {
6
- // 创建axios实例
7
- const Axios = axios.create({
8
- baseURL: baseConfig.baseUrl,
9
- timeout: 60000 // 请求超时时间
10
- // withCredentials: true, //允许携带cookie
11
- });
12
-
13
- // 添加请求拦截器
14
- Axios.interceptors.request.use(
15
- config => {
16
- const info = sessionStorage.getItem("_TH_OauthConfig");
17
- if (info) {
18
- const oauthInfo = JSON.parse(info)
19
- config.baseURL = oauthInfo.baseUrl
20
- config.headers["Authorization"] = oauthInfo.token;
21
- }
22
- if (baseConfig.headers) {
23
- config.headers = Object.assign(config.headers, baseConfig.headers);
24
- }
25
- return config;
26
- },
27
- error => {
28
- Promise.reject(error);
29
- }
30
- );
31
-
32
- // 添加响应拦截器
33
- Axios.interceptors.response.use(
34
- response => {
35
- const code = response.status;
36
- if (code < 200 || code > 300) {
37
- Notification.error({
38
- title: response.message
39
- });
40
- return Promise.reject("error");
41
- }
42
-
43
- const dataCode = response.data.code;
44
- if (dataCode && dataCode !== 200) {
45
- Notification.error({
46
- title: response.data.message
47
- });
48
- return Promise.reject("error");
49
- }
50
-
51
- if (baseConfig.debug) {
52
- Log.prettyPrimary("Request Url:", response.request.responseURL);
53
- Log.prettySuccess("Request Res:", response);
54
- }
55
-
56
- return response.data;
57
- },
58
- error => {
59
- let code = 0;
60
- try {
61
- code = error.response.data.status;
62
- } catch (e) {
63
- if (error.toString().indexOf("Error: timeout") !== -1) {
64
- Notification.error({
65
- title: "网络请求超时",
66
- duration: 5000
67
- });
68
- return Promise.reject(error);
69
- }
70
- }
71
- if (code) {
72
- const errorMsg = error.response.data.message;
73
- Notification.error({
74
- title: errorMsg || "未知错误",
75
- duration: 5000
76
- });
77
- } else {
78
- Notification.error({
79
- title: "接口请求失败",
80
- duration: 5000
81
- });
82
- }
83
- return Promise.reject(error);
84
- }
85
- );
86
- return Axios;
87
- };
1
+ import axios from "axios";
2
+ import Log from "./Log";
3
+ import { Notification } from "element-ui";
4
+
5
+ export const init = baseConfig => {
6
+ // 创建axios实例
7
+ const Axios = axios.create({
8
+ baseURL: baseConfig.baseUrl,
9
+ timeout: 60000 // 请求超时时间
10
+ // withCredentials: true, //允许携带cookie
11
+ });
12
+
13
+ // 添加请求拦截器
14
+ Axios.interceptors.request.use(
15
+ config => {
16
+ const info = sessionStorage.getItem("_TH_OauthConfig");
17
+ if (info) {
18
+ const oauthInfo = JSON.parse(info)
19
+ config.baseURL = oauthInfo.baseUrl
20
+ config.headers["Authorization"] = oauthInfo.token;
21
+ }
22
+ if (baseConfig.headers) {
23
+ config.headers = Object.assign(config.headers, baseConfig.headers);
24
+ }
25
+ return config;
26
+ },
27
+ error => {
28
+ Promise.reject(error);
29
+ }
30
+ );
31
+
32
+ // 添加响应拦截器
33
+ Axios.interceptors.response.use(
34
+ response => {
35
+ const code = response.status;
36
+ if (code < 200 || code > 300) {
37
+ Notification.error({
38
+ title: response.message
39
+ });
40
+ return Promise.reject("error");
41
+ }
42
+
43
+ const dataCode = response.data.code;
44
+ if (dataCode && dataCode !== 200) {
45
+ Notification.error({
46
+ title: response.data.message
47
+ });
48
+ return Promise.reject("error");
49
+ }
50
+
51
+ if (baseConfig.debug) {
52
+ Log.prettyPrimary("Request Url:", response.request.responseURL);
53
+ Log.prettySuccess("Request Res:", response);
54
+ }
55
+
56
+ return response.data;
57
+ },
58
+ error => {
59
+ let code = 0;
60
+ try {
61
+ code = error.response.data.status;
62
+ } catch (e) {
63
+ if (error.toString().indexOf("Error: timeout") !== -1) {
64
+ Notification.error({
65
+ title: "网络请求超时",
66
+ duration: 5000
67
+ });
68
+ return Promise.reject(error);
69
+ }
70
+ }
71
+ if (code) {
72
+ const errorMsg = error.response.data.message;
73
+ Notification.error({
74
+ title: errorMsg || "未知错误",
75
+ duration: 5000
76
+ });
77
+ } else {
78
+ Notification.error({
79
+ title: "接口请求失败",
80
+ duration: 5000
81
+ });
82
+ }
83
+ return Promise.reject(error);
84
+ }
85
+ );
86
+ return Axios;
87
+ };