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.
- package/README.md +72 -15
- package/lib/theme-chalk/fonts/formMaking-iconfont.svg +155 -155
- package/lib/theme-chalk/fonts/th-iconfont.css +2402 -2402
- package/lib/theme-chalk/js/axios.js +87 -87
- package/lib/tianheng-ui.js +13 -13
- package/package.json +87 -86
- package/packages/CodeEditor/index.vue +3 -2
- package/packages/FormMaking/GenerateForm.vue +392 -392
- package/packages/FormMaking/Upload/index.vue +571 -571
- package/packages/FormMaking/WidgetFooter.vue +16 -0
- package/packages/FormMaking/WidgetForm.vue +145 -146
- package/packages/FormMaking/WidgetTools.vue +21 -16
- package/packages/FormMaking/custom/config.js +120 -2
- package/packages/FormMaking/custom/configs/number.vue +0 -5
- package/packages/FormMaking/custom/configs/page-table.vue +146 -0
- package/packages/FormMaking/custom/index.js +1 -1
- package/packages/FormMaking/custom/items/page-table.vue +250 -0
- package/packages/FormMaking/custom/register.js +43 -43
- package/packages/FormMaking/iconfont/demo.css +539 -539
- package/packages/FormMaking/iconfont/demo_index.html +1159 -1159
- package/packages/FormMaking/iconfont/formMaking-iconfont.css +189 -189
- package/packages/FormMaking/iconfont/formMaking-iconfont.svg +155 -155
- package/packages/FormMaking/index.js +33 -33
- package/packages/FormMaking/index.vue +6 -1
- package/packages/FormMaking/lang/en-US.js +187 -187
- package/packages/FormMaking/lang/zh-CN.js +187 -187
- package/packages/FormMaking/network/axios.js +88 -88
- package/packages/FormMaking/styles/index.scss +216 -216
- package/packages/FormMaking/util/generateCode.js +427 -157
- package/packages/FormMaking/util/index.js +98 -98
- package/packages/TableMaking/network/axios.js +88 -88
- package/packages/TableMaking/widgetConfig.vue +1 -1
@@ -1,98 +1,98 @@
|
|
1
|
-
export const loadJs = url => {
|
2
|
-
return new Promise((resolve, reject) => {
|
3
|
-
const script = document.createElement("script");
|
4
|
-
script.src = url;
|
5
|
-
script.type = "text/javascript";
|
6
|
-
document.body.appendChild(script);
|
7
|
-
script.onload = () => {
|
8
|
-
resolve();
|
9
|
-
};
|
10
|
-
});
|
11
|
-
};
|
12
|
-
|
13
|
-
export const loadCss = url => {
|
14
|
-
return new Promise((resolve, reject) => {
|
15
|
-
const link = document.createElement("link");
|
16
|
-
link.rel = "stylesheet";
|
17
|
-
link.href = url;
|
18
|
-
document.head.appendChild(link);
|
19
|
-
link.onload = () => {
|
20
|
-
resolve();
|
21
|
-
};
|
22
|
-
});
|
23
|
-
};
|
24
|
-
|
25
|
-
export const generateUUID = () => {
|
26
|
-
var d = new Date().getTime();
|
27
|
-
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
28
|
-
c
|
29
|
-
) {
|
30
|
-
var r = (d + Math.random() * 16) % 16 | 0;
|
31
|
-
d = Math.floor(d / 16);
|
32
|
-
return (c == "x" ? r : (r & 0x7) | 0x8).toString(16);
|
33
|
-
});
|
34
|
-
return uuid;
|
35
|
-
};
|
36
|
-
|
37
|
-
export const inputTypeDict = val => {
|
38
|
-
const dict = {
|
39
|
-
email: "email",
|
40
|
-
url: "url"
|
41
|
-
};
|
42
|
-
return dict[val] || "text";
|
43
|
-
};
|
44
|
-
|
45
|
-
export const deepClone = (obj, clone) => {
|
46
|
-
//判断拷贝的要进行深拷贝的是数组还是对象,是数组的话进行数组拷贝,对象的话进行对象拷贝
|
47
|
-
const toString = Object.prototype.toString;
|
48
|
-
toString.call(obj) === "[object Array]"
|
49
|
-
? (clone = clone || [])
|
50
|
-
: (clone = clone || {});
|
51
|
-
for (const i in obj) {
|
52
|
-
if (typeof obj[i] === "object" && obj[i] !== null) {
|
53
|
-
// 要考虑深复制问题了
|
54
|
-
if (Array.isArray(obj[i])) {
|
55
|
-
// 这是数组
|
56
|
-
clone[i] = [];
|
57
|
-
} else {
|
58
|
-
// 这是对象
|
59
|
-
clone[i] = {};
|
60
|
-
}
|
61
|
-
deepClone(obj[i], clone[i]);
|
62
|
-
} else {
|
63
|
-
clone[i] = obj[i];
|
64
|
-
}
|
65
|
-
}
|
66
|
-
return clone;
|
67
|
-
};
|
68
|
-
|
69
|
-
// 链式读取对象属性
|
70
|
-
export const getProperty = (obj = {}, str = "") => {
|
71
|
-
let dic = deepClone(obj);
|
72
|
-
const props = str.replace(/\[(\w+)\]/g, ".$1"); // 处理数组下标
|
73
|
-
const keys = props.split(".");
|
74
|
-
for (const key of keys) {
|
75
|
-
dic = dic[key] || "";
|
76
|
-
}
|
77
|
-
return dic;
|
78
|
-
};
|
79
|
-
|
80
|
-
// 链式设置对象属性
|
81
|
-
export const setProperty = (obj = {}, str = "", value = "", isClone) => {
|
82
|
-
let dic = isClone ? deepClone(obj) : obj;
|
83
|
-
let propValue = "";
|
84
|
-
const props = str.replace(/\[(\w+)\]/g, ".$1"); // 处理数组下标
|
85
|
-
const keys = props.split(".");
|
86
|
-
for (let i = 0; i < keys.length; i++) {
|
87
|
-
const key = keys[i];
|
88
|
-
if (keys.length === 1) {
|
89
|
-
dic[key] = value;
|
90
|
-
} else if (i === keys.length - 1) {
|
91
|
-
propValue[key] = value;
|
92
|
-
} else {
|
93
|
-
if (!dic[key]) dic[key] = {};
|
94
|
-
propValue = dic[key];
|
95
|
-
}
|
96
|
-
}
|
97
|
-
return dic;
|
98
|
-
};
|
1
|
+
export const loadJs = url => {
|
2
|
+
return new Promise((resolve, reject) => {
|
3
|
+
const script = document.createElement("script");
|
4
|
+
script.src = url;
|
5
|
+
script.type = "text/javascript";
|
6
|
+
document.body.appendChild(script);
|
7
|
+
script.onload = () => {
|
8
|
+
resolve();
|
9
|
+
};
|
10
|
+
});
|
11
|
+
};
|
12
|
+
|
13
|
+
export const loadCss = url => {
|
14
|
+
return new Promise((resolve, reject) => {
|
15
|
+
const link = document.createElement("link");
|
16
|
+
link.rel = "stylesheet";
|
17
|
+
link.href = url;
|
18
|
+
document.head.appendChild(link);
|
19
|
+
link.onload = () => {
|
20
|
+
resolve();
|
21
|
+
};
|
22
|
+
});
|
23
|
+
};
|
24
|
+
|
25
|
+
export const generateUUID = () => {
|
26
|
+
var d = new Date().getTime();
|
27
|
+
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
28
|
+
c
|
29
|
+
) {
|
30
|
+
var r = (d + Math.random() * 16) % 16 | 0;
|
31
|
+
d = Math.floor(d / 16);
|
32
|
+
return (c == "x" ? r : (r & 0x7) | 0x8).toString(16);
|
33
|
+
});
|
34
|
+
return uuid;
|
35
|
+
};
|
36
|
+
|
37
|
+
export const inputTypeDict = val => {
|
38
|
+
const dict = {
|
39
|
+
email: "email",
|
40
|
+
url: "url"
|
41
|
+
};
|
42
|
+
return dict[val] || "text";
|
43
|
+
};
|
44
|
+
|
45
|
+
export const deepClone = (obj, clone) => {
|
46
|
+
//判断拷贝的要进行深拷贝的是数组还是对象,是数组的话进行数组拷贝,对象的话进行对象拷贝
|
47
|
+
const toString = Object.prototype.toString;
|
48
|
+
toString.call(obj) === "[object Array]"
|
49
|
+
? (clone = clone || [])
|
50
|
+
: (clone = clone || {});
|
51
|
+
for (const i in obj) {
|
52
|
+
if (typeof obj[i] === "object" && obj[i] !== null) {
|
53
|
+
// 要考虑深复制问题了
|
54
|
+
if (Array.isArray(obj[i])) {
|
55
|
+
// 这是数组
|
56
|
+
clone[i] = [];
|
57
|
+
} else {
|
58
|
+
// 这是对象
|
59
|
+
clone[i] = {};
|
60
|
+
}
|
61
|
+
deepClone(obj[i], clone[i]);
|
62
|
+
} else {
|
63
|
+
clone[i] = obj[i];
|
64
|
+
}
|
65
|
+
}
|
66
|
+
return clone;
|
67
|
+
};
|
68
|
+
|
69
|
+
// 链式读取对象属性
|
70
|
+
export const getProperty = (obj = {}, str = "") => {
|
71
|
+
let dic = deepClone(obj);
|
72
|
+
const props = str.replace(/\[(\w+)\]/g, ".$1"); // 处理数组下标
|
73
|
+
const keys = props.split(".");
|
74
|
+
for (const key of keys) {
|
75
|
+
dic = dic[key] || "";
|
76
|
+
}
|
77
|
+
return dic;
|
78
|
+
};
|
79
|
+
|
80
|
+
// 链式设置对象属性
|
81
|
+
export const setProperty = (obj = {}, str = "", value = "", isClone) => {
|
82
|
+
let dic = isClone ? deepClone(obj) : obj;
|
83
|
+
let propValue = "";
|
84
|
+
const props = str.replace(/\[(\w+)\]/g, ".$1"); // 处理数组下标
|
85
|
+
const keys = props.split(".");
|
86
|
+
for (let i = 0; i < keys.length; i++) {
|
87
|
+
const key = keys[i];
|
88
|
+
if (keys.length === 1) {
|
89
|
+
dic[key] = value;
|
90
|
+
} else if (i === keys.length - 1) {
|
91
|
+
propValue[key] = value;
|
92
|
+
} else {
|
93
|
+
if (!dic[key]) dic[key] = {};
|
94
|
+
propValue = dic[key];
|
95
|
+
}
|
96
|
+
}
|
97
|
+
return dic;
|
98
|
+
};
|
@@ -1,88 +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
|
-
};
|
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
|
+
};
|
@@ -631,7 +631,7 @@
|
|
631
631
|
<el-tooltip
|
632
632
|
slot="label"
|
633
633
|
effect="light"
|
634
|
-
content="按钮点击事件绑定的原生页面路径,参数可使用key=value占位,例:/page/path?id=id"
|
634
|
+
content="按钮点击事件绑定的原生页面路径,参数可使用key={value}占位,例:/page/path?id={id}&name=123"
|
635
635
|
placement="top"
|
636
636
|
>
|
637
637
|
<span style="color: #409EFF;">关联页面</span>
|