wl-design-mobile 0.0.1 → 0.0.2
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/api/doc.js +25 -0
- package/api/x1.js +56 -0
- package/btn/lambo-big-button.vue +125 -121
- package/btn/lambo-button-group.vue +47 -47
- package/btn/lambo-medium-button.vue +123 -121
- package/btn/lambo-small-button-group.vue +31 -31
- package/btn/lambo-small-button-select.vue +53 -53
- package/btn/lambo-small-button.vue +123 -121
- package/card-item/card-row-icon.vue +0 -1
- package/card-item/filtrate-row.vue +1 -0
- package/collapse/lambo-collapse.vue +80 -80
- package/config/config.js +14 -0
- package/detail/lambo-detail-grid.vue +87 -57
- package/detail/lambo-detail-row.vue +59 -59
- package/doc/file/lambo-file-upload.vue +176 -179
- package/doc/file/styles/css/index.css +118 -118
- package/doc/img/lambo-img-upload.vue +109 -109
- package/edit/list/Lambo-edit-list.vue +90 -90
- package/edit/list/lambo-edit-card-group.vue +103 -103
- package/edit/select/lambo-edit-date-range.vue +135 -135
- package/edit/select/lambo-edit-date-time.vue +105 -0
- package/edit/select/lambo-edit-date.vue +108 -108
- package/edit/select/lambo-edit-input-textarea.vue +92 -92
- package/edit/select/lambo-edit-input.vue +92 -92
- package/edit/select/lambo-edit-multi-select.vue +160 -160
- package/edit/select/lambo-edit-single-select.vue +153 -153
- package/flow/lambo-flow-detail.vue +30 -30
- package/flow/lambo-flow-edit.vue +30 -30
- package/icon/lambo-required-red-star.vue +47 -47
- package/list/lambo-list.vue +1 -1
- package/nav/lambo-top-nav.vue +89 -89
- package/package.json +4 -2
- package/search/lambo-date-range-page.vue +191 -191
- package/search/lambo-date-range.vue +107 -107
- package/search/lambo-input.vue +74 -74
- package/search/lambo-multi-select.vue +125 -125
- package/search/lambo-org-select-page.vue +109 -109
- package/search/lambo-search-box.vue +55 -55
- package/search/lambo-single-select.vue +119 -119
- package/styles/base.less +75 -75
- package/styles/components/btn.less +7 -7
- package/styles/components/search.less +33 -33
- package/styles/components/tag.less +181 -181
- package/styles/index.less +4 -4
- package/tag/lambo-tag.vue +25 -0
- package/title/lambo-title1.vue +129 -129
- package/title/lambo-title2.vue +37 -37
- package/util/assist.js +43 -0
- package/util/axios/cacheconf.js +19 -0
- package/util/axios/index.js +11 -0
- package/util/axios/interceptors.js +101 -0
- package/util/bus.js +4 -0
- package/util/token.js +36 -0
package/title/lambo-title2.vue
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="indicator-card-title">
|
|
3
|
-
<div class="tag-line"/>
|
|
4
|
-
{{ title }}
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
<script>
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
name: "LamboTitle2",
|
|
11
|
-
props: {
|
|
12
|
-
title: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: "",
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
<style scoped>
|
|
20
|
-
@import "../styles/index.less";
|
|
21
|
-
|
|
22
|
-
.indicator-card-title {
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
color: black;
|
|
26
|
-
font-weight: bold;
|
|
27
|
-
font-size: var(--ind-font-size-md);
|
|
28
|
-
margin-left: 10px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.indicator-card-title .tag-line {
|
|
32
|
-
width: 3px;
|
|
33
|
-
height: 14px;
|
|
34
|
-
background-color: var(--scl-blue);
|
|
35
|
-
margin-right: var(--ind-padding-xs);
|
|
36
|
-
}
|
|
37
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="indicator-card-title">
|
|
3
|
+
<div class="tag-line"/>
|
|
4
|
+
{{ title }}
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
<script>
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: "LamboTitle2",
|
|
11
|
+
props: {
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "",
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<style scoped>
|
|
20
|
+
@import "../styles/index.less";
|
|
21
|
+
|
|
22
|
+
.indicator-card-title {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
color: black;
|
|
26
|
+
font-weight: bold;
|
|
27
|
+
font-size: var(--ind-font-size-md);
|
|
28
|
+
margin-left: 10px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.indicator-card-title .tag-line {
|
|
32
|
+
width: 3px;
|
|
33
|
+
height: 14px;
|
|
34
|
+
background-color: var(--scl-blue);
|
|
35
|
+
margin-right: var(--ind-padding-xs);
|
|
36
|
+
}
|
|
37
|
+
</style>
|
package/util/assist.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// 深拷贝
|
|
2
|
+
export function deepCopy(data) {
|
|
3
|
+
let i;
|
|
4
|
+
const t = typeOf(data);
|
|
5
|
+
let o;
|
|
6
|
+
|
|
7
|
+
if (t === 'array') {
|
|
8
|
+
o = [];
|
|
9
|
+
} else if (t === 'object') {
|
|
10
|
+
o = {};
|
|
11
|
+
} else {
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (t === 'array') {
|
|
16
|
+
for (i = 0; i < data.length; i++) {
|
|
17
|
+
o.push(deepCopy(data[i]));
|
|
18
|
+
}
|
|
19
|
+
} else if (t === 'object') {
|
|
20
|
+
for (i in data) {
|
|
21
|
+
o[i] = deepCopy(data[i]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return o;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 判断对象类型
|
|
28
|
+
export function typeOf(obj) {
|
|
29
|
+
const toString = Object.prototype.toString;
|
|
30
|
+
const map = {
|
|
31
|
+
'[object Boolean]': 'boolean',
|
|
32
|
+
'[object Number]': 'number',
|
|
33
|
+
'[object String]': 'string',
|
|
34
|
+
'[object Function]': 'function',
|
|
35
|
+
'[object Array]': 'array',
|
|
36
|
+
'[object Date]': 'date',
|
|
37
|
+
'[object RegExp]': 'regExp',
|
|
38
|
+
'[object Undefined]': 'undefined',
|
|
39
|
+
'[object Null]': 'null',
|
|
40
|
+
'[object Object]': 'object'
|
|
41
|
+
};
|
|
42
|
+
return map[toString.call(obj)];
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置在该文件下的正则匹配都会被缓存
|
|
3
|
+
* @type {RegExp[]}
|
|
4
|
+
*/
|
|
5
|
+
const cacheRules = [
|
|
6
|
+
/manage\/menu\/list/,
|
|
7
|
+
/manage\/menu\/list/,
|
|
8
|
+
/dict\/getDictsMap/,
|
|
9
|
+
/dict\/getDicts/,
|
|
10
|
+
/dict\/getDictsForMulti/,
|
|
11
|
+
/upmsOrg\/getSubOrgCodes/,
|
|
12
|
+
/upmsOrg\/getSubDeptCodesByOrgCode/,
|
|
13
|
+
/upmsOrg\/getProvincesCodes/,
|
|
14
|
+
/upmsOrg\/getCitysCodes/,
|
|
15
|
+
/upmsOrg\/getIndustrysCodes/,
|
|
16
|
+
/manage\/permission\/check/
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default cacheRules
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
import config from '../../config/config'
|
|
3
|
+
import interceptors from './interceptors'
|
|
4
|
+
|
|
5
|
+
const ajax = axios.create();
|
|
6
|
+
ajax.defaults.baseURL = config.serverContext
|
|
7
|
+
ajax.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8'
|
|
8
|
+
ajax.interceptors.request.use(interceptors.requestInterceptors, interceptors.requestError);
|
|
9
|
+
ajax.interceptors.response.use(interceptors.responseInterceptors, interceptors.responseError);
|
|
10
|
+
|
|
11
|
+
export {ajax as axios}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import cacheRules from "./cacheconf";
|
|
2
|
+
import {getToken, getUrlParams, TOKEN_KEY} from '../token'
|
|
3
|
+
import Bus from '../bus';
|
|
4
|
+
import {Dialog} from 'vant'
|
|
5
|
+
|
|
6
|
+
let timer1, timer2;
|
|
7
|
+
let hasDialog = false;
|
|
8
|
+
|
|
9
|
+
function requestInterceptors(config) {
|
|
10
|
+
const params = getUrlParams();
|
|
11
|
+
|
|
12
|
+
let token = getToken();
|
|
13
|
+
if (token) {
|
|
14
|
+
config.headers.token = token;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//sso_token认证
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(params, 'sso_token') || sessionStorage.getItem('sso_token')) {
|
|
19
|
+
config.params = Object.assign({
|
|
20
|
+
sso_token: params.sso_token || sessionStorage.getItem('sso_token'),
|
|
21
|
+
sso_id: params.sso_id
|
|
22
|
+
}, config.params)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//oauth认证
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(params, 'token')) {
|
|
27
|
+
if (config.url.indexOf('?') === -1) {
|
|
28
|
+
config.url = config.url + "?token=" + params.token + "&ssoid=" + params.ssoid;
|
|
29
|
+
} else {
|
|
30
|
+
config.url = config.url + "&token=" + params.token + "&ssoid=" + params.ssoid;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (config.method === 'post') {
|
|
35
|
+
// payload为自定义不使用qs.stringify序列化的标记,默认config.payload == undefined;
|
|
36
|
+
// 为true时用于匹配@requestBody定义参数的接口
|
|
37
|
+
// 使用方式:post(config.AAAServerContext + '/AAA/BBB/CCC', { ...paramRequestBody }, { payload: true })
|
|
38
|
+
if (!config.payload) {
|
|
39
|
+
config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
40
|
+
// config.data = qs.stringify(config.data)
|
|
41
|
+
}
|
|
42
|
+
} else if (config.method === 'get') {
|
|
43
|
+
for (let rule of cacheRules) {
|
|
44
|
+
if (rule.test(config.url)) {
|
|
45
|
+
return config;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (config.url.indexOf('?') === -1) {
|
|
49
|
+
config.url = config.url + "?t=" + new Date().getTime();
|
|
50
|
+
} else {
|
|
51
|
+
config.url = config.url + "&t=" + new Date().getTime();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return config;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function requestError(error) {
|
|
58
|
+
console.error("服务器内部异常,请稍候再试", error);
|
|
59
|
+
return Promise.reject(error);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function responseInterceptors(response) {
|
|
63
|
+
let data = response.data;
|
|
64
|
+
|
|
65
|
+
if (data instanceof Object) {
|
|
66
|
+
const code = data["code"];
|
|
67
|
+
if (code === 10106) {
|
|
68
|
+
sessionStorage.removeItem(TOKEN_KEY)
|
|
69
|
+
if (!hasDialog) {
|
|
70
|
+
clearTimeout(timer1);
|
|
71
|
+
timer1 = setTimeout(function () {
|
|
72
|
+
hasDialog = true;
|
|
73
|
+
Dialog.alert({
|
|
74
|
+
message: '会话已失效,请重新登录',
|
|
75
|
+
theme: 'round-button',
|
|
76
|
+
confirmButtonColor: '#0070D2'
|
|
77
|
+
}).then(() => {
|
|
78
|
+
hasDialog = false;
|
|
79
|
+
Bus.$emit("needLogin");
|
|
80
|
+
});
|
|
81
|
+
}, 500)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function responseError(error) {
|
|
89
|
+
clearTimeout(timer2);
|
|
90
|
+
timer2 = setTimeout(function () {
|
|
91
|
+
console.error("服务器内部异常,请稍候再试");
|
|
92
|
+
}, 500)
|
|
93
|
+
return Promise.reject(error);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default {
|
|
97
|
+
requestInterceptors,
|
|
98
|
+
responseInterceptors,
|
|
99
|
+
requestError,
|
|
100
|
+
responseError
|
|
101
|
+
}
|
package/util/bus.js
ADDED
package/util/token.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const TOKEN_KEY = 'lambo-token'
|
|
2
|
+
|
|
3
|
+
export const COOKIE_KEY = 'lambo-sso-key'
|
|
4
|
+
|
|
5
|
+
export const SSO_TOKEN_KEY = 'lambo-sso-token'
|
|
6
|
+
|
|
7
|
+
export const setToken = (token) => {
|
|
8
|
+
sessionStorage.setItem(TOKEN_KEY, token)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getToken = () => {
|
|
12
|
+
const token = sessionStorage.getItem(TOKEN_KEY)
|
|
13
|
+
if (token) return token
|
|
14
|
+
else return false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 获取浏览器地址url中的参数
|
|
19
|
+
* @param url
|
|
20
|
+
* @returns {Object}
|
|
21
|
+
*/
|
|
22
|
+
export const getUrlParams = (url) => {
|
|
23
|
+
if (!url) {
|
|
24
|
+
url = location.search;
|
|
25
|
+
}
|
|
26
|
+
//const url = location.search; //获取url中"?"符后的字串
|
|
27
|
+
const theRequest = {};
|
|
28
|
+
if (url.indexOf("?") !== -1) {
|
|
29
|
+
const str = url.substr(1);
|
|
30
|
+
let strs = str.split("&");
|
|
31
|
+
for (let i = 0; i < strs.length; i++) {
|
|
32
|
+
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return theRequest;
|
|
36
|
+
}
|