@yilianjituan/yilian_dgerm 0.0.1-alpha.17
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/.eslintrc.js +50 -0
- package/LICENSE +21 -0
- package/README.md +95 -0
- package/dist/commonAxios/Axios.d.ts +42 -0
- package/dist/commonAxios/Axios.js +300 -0
- package/dist/commonAxios/http.d.ts +3 -0
- package/dist/commonAxios/http.js +23 -0
- package/dist/commonAxios/index.d.ts +2 -0
- package/dist/commonAxios/index.js +177 -0
- package/dist/commonAxios/juicer.d.ts +8 -0
- package/dist/commonAxios/juicer.js +58 -0
- package/dist/commonData/address.d.ts +22 -0
- package/dist/commonData/address.js +1 -0
- package/dist/commonImg/ic_im_no_archives_new.png +0 -0
- package/dist/commonType/globalEnum.d.ts +398 -0
- package/dist/commonType/globalEnum.js +527 -0
- package/dist/commonType/globalFun.d.ts +31 -0
- package/dist/commonType/globalFun.js +104 -0
- package/dist/components/BigImage/index.d.ts +4 -0
- package/dist/components/BigImage/index.interface.d.ts +25 -0
- package/dist/components/BigImage/index.interface.js +1 -0
- package/dist/components/BigImage/index.js +36 -0
- package/dist/components/DropDownSelect/index.d.ts +4 -0
- package/dist/components/DropDownSelect/index.interface.d.ts +62 -0
- package/dist/components/DropDownSelect/index.interface.js +1 -0
- package/dist/components/DropDownSelect/index.js +211 -0
- package/dist/components/EmptyDom/index.d.ts +4 -0
- package/dist/components/EmptyDom/index.interface.d.ts +17 -0
- package/dist/components/EmptyDom/index.interface.js +1 -0
- package/dist/components/EmptyDom/index.js +22 -0
- package/dist/components/Entry/index.d.ts +5 -0
- package/dist/components/Entry/index.interface.d.ts +7 -0
- package/dist/components/Entry/index.interface.js +1 -0
- package/dist/components/Entry/index.js +8 -0
- package/dist/components/Entry/index.scss +3 -0
- package/dist/components/ExportExcels/ExportExcels.scss +12 -0
- package/dist/components/ExportExcels/index.d.ts +10 -0
- package/dist/components/ExportExcels/index.interface.d.ts +12 -0
- package/dist/components/ExportExcels/index.interface.js +1 -0
- package/dist/components/ExportExcels/index.js +31 -0
- package/dist/components/FilterRadio/index.d.ts +5 -0
- package/dist/components/FilterRadio/index.interface.d.ts +62 -0
- package/dist/components/FilterRadio/index.interface.js +1 -0
- package/dist/components/FilterRadio/index.js +76 -0
- package/dist/components/FilterRadio/index.scss +60 -0
- package/dist/components/MyBtn/index.d.ts +4 -0
- package/dist/components/MyBtn/index.interface.d.ts +13 -0
- package/dist/components/MyBtn/index.interface.js +1 -0
- package/dist/components/MyBtn/index.js +12 -0
- package/dist/components/NumberInput/index.d.ts +5 -0
- package/dist/components/NumberInput/index.interface.d.ts +3 -0
- package/dist/components/NumberInput/index.interface.js +1 -0
- package/dist/components/NumberInput/index.js +47 -0
- package/dist/components/NumberInput/index.scss +3 -0
- package/dist/components/PageTemplate/index.d.ts +5 -0
- package/dist/components/PageTemplate/index.interface.d.ts +54 -0
- package/dist/components/PageTemplate/index.interface.js +1 -0
- package/dist/components/PageTemplate/index.js +340 -0
- package/dist/components/PageTemplate/index.scss +72 -0
- package/dist/components/SelectMax/index.d.ts +4 -0
- package/dist/components/SelectMax/index.interface.d.ts +21 -0
- package/dist/components/SelectMax/index.interface.js +1 -0
- package/dist/components/SelectMax/index.js +63 -0
- package/dist/components/SuperCascader/index.d.ts +4 -0
- package/dist/components/SuperCascader/index.interface.d.ts +13 -0
- package/dist/components/SuperCascader/index.interface.js +1 -0
- package/dist/components/SuperCascader/index.js +26 -0
- package/dist/components/SuperInput/index.d.ts +4 -0
- package/dist/components/SuperInput/index.interface.d.ts +11 -0
- package/dist/components/SuperInput/index.interface.js +1 -0
- package/dist/components/SuperInput/index.js +70 -0
- package/dist/components/VideoProgressModal/index.d.ts +5 -0
- package/dist/components/VideoProgressModal/index.interface.d.ts +11 -0
- package/dist/components/VideoProgressModal/index.interface.js +1 -0
- package/dist/components/VideoProgressModal/index.js +16 -0
- package/dist/components/VideoProgressModal/index.scss +27 -0
- package/dist/components/YLModal/drag.d.ts +3 -0
- package/dist/components/YLModal/drag.js +56 -0
- package/dist/components/YLModal/index.d.ts +4 -0
- package/dist/components/YLModal/index.interface.d.ts +21 -0
- package/dist/components/YLModal/index.interface.js +1 -0
- package/dist/components/YLModal/index.js +35 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/react-app-env.d.ts +18 -0
- package/dist/utils/common.d.ts +14 -0
- package/dist/utils/common.js +105 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/notificationHelper.d.ts +7 -0
- package/dist/utils/notificationHelper.js +27 -0
- package/dist/utils/responseMessage.d.ts +50 -0
- package/dist/utils/responseMessage.js +56 -0
- package/dist/utils/userSessionActions.d.ts +31 -0
- package/dist/utils/userSessionActions.js +37 -0
- package/package.json +113 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import axios from 'axios';
|
|
8
|
+
import juicer from "./juicer";
|
|
9
|
+
import qs from "qs";
|
|
10
|
+
import { callBackMessage, notificationHelper, userSessionActions } from "../utils";
|
|
11
|
+
// todo ... 这里如何整合redux 目前没有实现
|
|
12
|
+
|
|
13
|
+
// 参数过滤默认规则
|
|
14
|
+
var defaultRulesOptions = {
|
|
15
|
+
noEmoji: false,
|
|
16
|
+
// 默认不过滤表情
|
|
17
|
+
noEmptyString: true // 默认过滤空字符串
|
|
18
|
+
};
|
|
19
|
+
var instance = axios.create({
|
|
20
|
+
timeout: 300000,
|
|
21
|
+
withCredentials: true,
|
|
22
|
+
headers: {
|
|
23
|
+
'Content-Type': 'application/json;charset=UTF-8',
|
|
24
|
+
'Accept': "application/json, text/javascript, */*; q=0.01",
|
|
25
|
+
'terminal': process.env.REACT_APP_PRODUCT
|
|
26
|
+
},
|
|
27
|
+
responseType: "json"
|
|
28
|
+
});
|
|
29
|
+
var urlPre = process.env.REACT_APP_WEB_PLATFORM_TITLE;
|
|
30
|
+
instance.interceptors.request.use(function (config) {
|
|
31
|
+
var params = config.params;
|
|
32
|
+
// 接受rules
|
|
33
|
+
var rules = params && params.rules ? _objectSpread(_objectSpread({}, defaultRulesOptions), params.rules) : _objectSpread({}, defaultRulesOptions);
|
|
34
|
+
var token = sessionStorage.getItem("X_ACCESS_TOKEN");
|
|
35
|
+
if (token) config.headers['token'] = token;
|
|
36
|
+
if (config.data && !(config.data instanceof FormData)) {
|
|
37
|
+
config.data = JSON.stringify(config.data);
|
|
38
|
+
}
|
|
39
|
+
if (config.method === 'get') {
|
|
40
|
+
// 处理get请求传参数为数组
|
|
41
|
+
config.paramsSerializer = function (params) {
|
|
42
|
+
return qs.stringify(params, {
|
|
43
|
+
arrayFormat: 'comma'
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
config.params = _objectSpread({
|
|
47
|
+
_t: Date.parse(new Date().toString()) / 1000
|
|
48
|
+
}, config.params);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 统一添加url前缀
|
|
52
|
+
config.url = "".concat(urlPre, "/").concat(config.url);
|
|
53
|
+
config.withCredentials = true;
|
|
54
|
+
|
|
55
|
+
// 参数拦截处理
|
|
56
|
+
// if (config.params && config.params instanceof Object) {
|
|
57
|
+
// const cpData = _.cloneDeep(config.params);
|
|
58
|
+
// if (!Object.keys(cpData).length) {
|
|
59
|
+
// return;
|
|
60
|
+
// }
|
|
61
|
+
// Object.entries(cpData).forEach(item => {
|
|
62
|
+
// console.log(item, 'itemitemitemitem');
|
|
63
|
+
// let kVal = item[0];
|
|
64
|
+
// let vVal = item[1];
|
|
65
|
+
// if (typeof vVal === 'string') {
|
|
66
|
+
// cpData[kVal] = vVal = vVal.trim();
|
|
67
|
+
// }
|
|
68
|
+
// if (!vVal && typeof vVal !== 'number') {
|
|
69
|
+
// delete cpData[kVal];
|
|
70
|
+
// }
|
|
71
|
+
// });
|
|
72
|
+
|
|
73
|
+
// config.params = cpData;
|
|
74
|
+
// }
|
|
75
|
+
|
|
76
|
+
// 参数拦截处理
|
|
77
|
+
config.params = juicer(_objectSpread({}, config.params), rules);
|
|
78
|
+
|
|
79
|
+
// 删除携带的rules
|
|
80
|
+
delete config.params.rules;
|
|
81
|
+
return config;
|
|
82
|
+
}, function (error) {
|
|
83
|
+
return Promise.reject(error);
|
|
84
|
+
});
|
|
85
|
+
instance.interceptors.response.use(function (response) {
|
|
86
|
+
/**
|
|
87
|
+
* 导出Excel
|
|
88
|
+
*/
|
|
89
|
+
if (response.config.responseType === 'blob') {
|
|
90
|
+
return response;
|
|
91
|
+
}
|
|
92
|
+
if (response.data.code === 'OK') {
|
|
93
|
+
return response;
|
|
94
|
+
} else {
|
|
95
|
+
if (response.config && response.config.url && response.config.url === '/api/yft/common/custom/ocr/recognition/template') {
|
|
96
|
+
// ocr识别错误拦截
|
|
97
|
+
return response;
|
|
98
|
+
}
|
|
99
|
+
switch (response.data.code) {
|
|
100
|
+
case 'USER_LOCKED':
|
|
101
|
+
case 'DMS_STORE_LOCKED_ERROR':
|
|
102
|
+
case 'AGENCY_NOT_FOUND_ERROR':
|
|
103
|
+
notificationHelper.error(response.data.message);
|
|
104
|
+
break;
|
|
105
|
+
case 'AUTH_TOKEN_NOT_FOUND':
|
|
106
|
+
case 'TOKEN_VALIDATE_ERROR':
|
|
107
|
+
case 'TOKEN_REQUIRED':
|
|
108
|
+
window.location.href = userSessionActions['DEF_USER'];
|
|
109
|
+
break;
|
|
110
|
+
case 'Method Not Allowed':
|
|
111
|
+
case 'Data Validate Error':
|
|
112
|
+
case 'balance_not_enough':
|
|
113
|
+
case 'duplicate_data':
|
|
114
|
+
notificationHelper.error(response.data.message);
|
|
115
|
+
break;
|
|
116
|
+
case 'Not Found':
|
|
117
|
+
notificationHelper.error(response.data.message);
|
|
118
|
+
break;
|
|
119
|
+
// 药品
|
|
120
|
+
case 'ENT_REBATE_TEMPLATE_NOT_SETTING':
|
|
121
|
+
break;
|
|
122
|
+
// 短信验证码抛错
|
|
123
|
+
case 'sendSmsFrequently':
|
|
124
|
+
case 'the number of sms messages sent from a single mobile number every day exceeds the upper limit':
|
|
125
|
+
case 'verify_code_empty':
|
|
126
|
+
case 'verify_code_failure':
|
|
127
|
+
case 'verify_code_expired':
|
|
128
|
+
notificationHelper.error(response.data.message);
|
|
129
|
+
break;
|
|
130
|
+
// 开户抛错
|
|
131
|
+
case 'MUST_ONESELF_CARD':
|
|
132
|
+
notificationHelper.error(response.data.message);
|
|
133
|
+
break;
|
|
134
|
+
case 'MEMBER_NOT_FOUND':
|
|
135
|
+
break;
|
|
136
|
+
// 药代
|
|
137
|
+
case 'ADD_AGENT_PHONE_EXIST':
|
|
138
|
+
break;
|
|
139
|
+
// 结算数据
|
|
140
|
+
case 'MEMBER_NORMAL':
|
|
141
|
+
break;
|
|
142
|
+
//分成比例
|
|
143
|
+
case 'METHOD_ARGUMENT_VALID_ERROR':
|
|
144
|
+
// notificationHelper.error('分成比例输入不合法'); ???公用code,不能写死抛错信息
|
|
145
|
+
notificationHelper.error(response.data.message);
|
|
146
|
+
break;
|
|
147
|
+
// 团队
|
|
148
|
+
case 'CAN_HAVE_A_TEAM_WITHOUT_A_LEADER':
|
|
149
|
+
case 'MEMBER_ENTER_IM_GROUP_FAILURE':
|
|
150
|
+
case 'MEMBER_DELETE_FAILURE':
|
|
151
|
+
case 'MEMBER_UPDATE_FAILURE':
|
|
152
|
+
case 'DOCTOR_GROUP_DATA_NOT':
|
|
153
|
+
case 'DOCTOR_DATA_NOT':
|
|
154
|
+
case 'DOCTOR_CAN_ONLY_JOIN_ONE_TEAM': // 医生已经加入该团队!
|
|
155
|
+
case 'THERE_CAN_ONLY_BE_ONE_LEADER_IN_A_TEAM':
|
|
156
|
+
case 'TEAM_MEMBERS_DON_IT_EXIST':
|
|
157
|
+
case 'THE_PATIENT_WAS_NOT_ON_THE_TEAM':
|
|
158
|
+
case 'HAVE_OTHER_MEMBER_CANNOT_DELETE_LEADER': // 团队中还有其他成员不能删除组长
|
|
159
|
+
case 'DB_DATA_EXIST': // 关联健管师重复添加
|
|
160
|
+
case 'THE_PHONE_NUMBER_IS_EMPTY':
|
|
161
|
+
// 账号未关联手机号
|
|
162
|
+
break;
|
|
163
|
+
default:
|
|
164
|
+
notificationHelper.error(callBackMessage[response.data.code] ? callBackMessage[response.data.code] : response.data.message);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
return response;
|
|
168
|
+
}
|
|
169
|
+
}, function (error) {
|
|
170
|
+
if (error.response === undefined) {
|
|
171
|
+
notificationHelper.error('服务器响应超时,请稍后再试!');
|
|
172
|
+
} else {
|
|
173
|
+
notificationHelper.error(callBackMessage[error.response.status] ? callBackMessage[error.response.status] : error.response.data.message);
|
|
174
|
+
}
|
|
175
|
+
return Promise.reject(error);
|
|
176
|
+
});
|
|
177
|
+
export default instance;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var checkRules = function checkRules(val, rules) {
|
|
3
|
+
var _rules$noEmptyString = rules.noEmptyString,
|
|
4
|
+
noEmptyString = _rules$noEmptyString === void 0 ? false : _rules$noEmptyString;
|
|
5
|
+
if (val === undefined || val === 'undefined') return false;
|
|
6
|
+
if (noEmptyString && val === '') return false;
|
|
7
|
+
return true;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/* 判断元素类型 */
|
|
11
|
+
var getItemType = function getItemType(data) {
|
|
12
|
+
var dataType;
|
|
13
|
+
if (_typeof(data) === 'object' && Object.prototype.toString.call(data) === '[object Object]') {
|
|
14
|
+
dataType = 'object';
|
|
15
|
+
} else if (_typeof(data) === 'object' && Object.prototype.toString.call(data) === '[object Array]') {
|
|
16
|
+
dataType = 'array';
|
|
17
|
+
} else if (typeof data === 'string') {
|
|
18
|
+
dataType = 'string';
|
|
19
|
+
}
|
|
20
|
+
return dataType;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 去除request data中 undefined 或者 空字符串(trim之后,由rules中的noEmptyString决定)
|
|
25
|
+
*
|
|
26
|
+
* @param {object} data request data
|
|
27
|
+
* @param {object} rules 数据规则,noEmoji, 默认true
|
|
28
|
+
*/
|
|
29
|
+
var juicer = function juicer(data) {
|
|
30
|
+
var rules = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
31
|
+
switch (getItemType(data)) {
|
|
32
|
+
case 'string':
|
|
33
|
+
if (rules.noEmoji) {
|
|
34
|
+
var ranges = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[A9|AE]\u3030|\uA9|\uAE|\u3030/ig;
|
|
35
|
+
return data.trim().replace(ranges, '');
|
|
36
|
+
}
|
|
37
|
+
return data.trim();
|
|
38
|
+
case 'array':
|
|
39
|
+
return data.reduce(function (ret, item) {
|
|
40
|
+
var nItem = juicer(item, rules);
|
|
41
|
+
if (checkRules(nItem, rules)) {
|
|
42
|
+
ret.push(nItem);
|
|
43
|
+
}
|
|
44
|
+
return ret;
|
|
45
|
+
}, []);
|
|
46
|
+
case 'object':
|
|
47
|
+
return Object.keys(data).reduce(function (ret, item) {
|
|
48
|
+
var nItem = juicer(data[item], rules);
|
|
49
|
+
if (checkRules(nItem, rules)) {
|
|
50
|
+
ret[item] = nItem;
|
|
51
|
+
}
|
|
52
|
+
return ret;
|
|
53
|
+
}, {});
|
|
54
|
+
default:
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export default juicer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const AddressData: {
|
|
2
|
+
label: string;
|
|
3
|
+
areaType: string;
|
|
4
|
+
value: string;
|
|
5
|
+
id: string;
|
|
6
|
+
parentCode: string;
|
|
7
|
+
children: {
|
|
8
|
+
label: string;
|
|
9
|
+
areaType: string;
|
|
10
|
+
value: string;
|
|
11
|
+
id: string;
|
|
12
|
+
parentCode: string;
|
|
13
|
+
children: {
|
|
14
|
+
label: string;
|
|
15
|
+
areaType: string;
|
|
16
|
+
value: string;
|
|
17
|
+
id: string;
|
|
18
|
+
parentCode: string;
|
|
19
|
+
children: never[];
|
|
20
|
+
}[];
|
|
21
|
+
}[];
|
|
22
|
+
}[];
|