xrk-components 0.1.0 → 0.3.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/.babelrc +2 -11
- package/lib/index.css +18560 -0
- package/lib/index.esm.js +2958 -0
- package/lib/index.umd.js +2997 -0
- package/package.json +47 -69
- package/rollup.config.js +59 -0
- package/tsconfig.json +24 -0
- package/typings/shims-vue.d.ts +6 -0
- package/.editorconfig +0 -9
- package/.eslintrc.js +0 -40
- package/.prettierrc.js +0 -16
- package/debug.log +0 -1
- package/dist/bundler.js +0 -7
- package/dist/bundler.js.map +0 -1
- package/index.html +0 -19
- package/src/App.vue +0 -134
- package/src/lib/index.js +0 -27
- package/src/main.js +0 -25
- package/src/packages/dialog/index.js +0 -32
- package/src/packages/dialog/src/main.vue +0 -197
- package/src/packages/slide-verify/index.js +0 -12
- package/src/packages/slide-verify/src/main.vue +0 -479
- package/src/packages/slide-verify/src/static/close.png +0 -0
- package/src/packages/slide-verify/src/static/placeholder.png +0 -0
- package/src/packages/slide-verify/src/static/range_btn.png +0 -0
- package/src/packages/slide-verify/src/static/refresh.png +0 -0
- package/src/packages/task-detail/index.js +0 -12
- package/src/packages/task-detail/src/components/formDetail.vue +0 -79
- package/src/packages/task-detail/src/components/mixin.js +0 -105
- package/src/packages/task-detail/src/components/styles/index.scss +0 -162
- package/src/packages/task-detail/src/components/surveyDetail.vue +0 -337
- package/src/packages/task-detail/src/config/fields.js +0 -655
- package/src/packages/task-detail/src/config/index.js +0 -34
- package/src/packages/task-detail/src/main.vue +0 -108
- package/src/packages/task-detail/src/static/fieldsMap.js +0 -274
- package/src/packages/task-detail/src/test/testData.js +0 -743
- package/src/packages/task-detail/src/tools/index.js +0 -290
- package/webpack.config.js +0 -93
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Description:
|
|
3
|
-
* @Author: jml
|
|
4
|
-
* @Date: 2021-03-03 11:14:36
|
|
5
|
-
* @LastEditors: jml
|
|
6
|
-
* @LastEditTime: 2021-03-03 11:30:27
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const _getType = param => {
|
|
10
|
-
return Object.prototype.toString.call(param);
|
|
11
|
-
};
|
|
12
|
-
const _moneyFunctional = (num, callbackTrue, callbackFalse) => {
|
|
13
|
-
const { isNumber, isFunction } = check;
|
|
14
|
-
if (isNumber(num)) {
|
|
15
|
-
return callbackTrue !== undefined && isFunction(callbackTrue)
|
|
16
|
-
? callbackTrue()
|
|
17
|
-
: callbackTrue;
|
|
18
|
-
} else {
|
|
19
|
-
console.warn(`入参${num}不是正确的数字`);
|
|
20
|
-
return callbackFalse !== undefined && isFunction(callbackFalse)
|
|
21
|
-
? callbackFalse()
|
|
22
|
-
: callbackFalse;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const check = {
|
|
27
|
-
isObject(param) {
|
|
28
|
-
return _getType(param) === '[object Object]';
|
|
29
|
-
},
|
|
30
|
-
isFunction(param) {
|
|
31
|
-
return _getType(param) === '[object Function]';
|
|
32
|
-
},
|
|
33
|
-
isString(param) {
|
|
34
|
-
return _getType(param) === '[object String]';
|
|
35
|
-
},
|
|
36
|
-
isDate(param) {
|
|
37
|
-
return _getType(param) === '[object Date]';
|
|
38
|
-
},
|
|
39
|
-
isNumber(num) {
|
|
40
|
-
if (/^0+[0-9]+\./g.test(String(num))) {
|
|
41
|
-
// 例如 000.11、012.212
|
|
42
|
-
// 不是合法数字
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
return /^[+,-]?[0-9]+(\.[0-9]+)?$/g.test(String(num));
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const date = {
|
|
50
|
-
dateFormat(date = new Date(), fmt = 'Y-M-D H:m:s', autoFillZero = true) {
|
|
51
|
-
let _date = new Date();
|
|
52
|
-
if (check.isNumber(date)) {
|
|
53
|
-
// 时间戳
|
|
54
|
-
_date = new Date(Math.round(Number(String(date).padEnd(13, '0'))));
|
|
55
|
-
} else if (check.isDate(date)) {
|
|
56
|
-
// 时间对象
|
|
57
|
-
_date = date;
|
|
58
|
-
} else {
|
|
59
|
-
// 错误传参
|
|
60
|
-
console.warn(`入参${date}不是正确的时间对象或时间戳`);
|
|
61
|
-
return date;
|
|
62
|
-
}
|
|
63
|
-
const fillZero = (number, count = 2) => {
|
|
64
|
-
return String(number).padStart(count, '0');
|
|
65
|
-
};
|
|
66
|
-
const _fullYear = _date.getFullYear();
|
|
67
|
-
const _month = _date.getMonth() + 1;
|
|
68
|
-
const _day = _date.getDate();
|
|
69
|
-
const _hours = _date.getHours();
|
|
70
|
-
const _minutes = _date.getMinutes();
|
|
71
|
-
const _seconds = _date.getSeconds();
|
|
72
|
-
const fmtMap = {
|
|
73
|
-
Y: _fullYear,
|
|
74
|
-
M: autoFillZero ? fillZero(_month) : _month,
|
|
75
|
-
D: autoFillZero ? fillZero(_day) : _day,
|
|
76
|
-
H: autoFillZero ? fillZero(_hours) : _hours,
|
|
77
|
-
m: autoFillZero ? fillZero(_minutes) : _minutes,
|
|
78
|
-
s: autoFillZero ? fillZero(_seconds) : _seconds
|
|
79
|
-
};
|
|
80
|
-
let _fmt = String(fmt);
|
|
81
|
-
for (const key in fmtMap) {
|
|
82
|
-
if (Object.hasOwnProperty.call(fmtMap, key)) {
|
|
83
|
-
_fmt = _fmt.replace(
|
|
84
|
-
new RegExp(`${key}`),
|
|
85
|
-
String(Reflect.get(fmtMap, key))
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return _fmt;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const base = {
|
|
94
|
-
numberFormat(num, divisor = 100, decimalPlaces = 2, unit = '') {
|
|
95
|
-
if (check.isNumber(num)) {
|
|
96
|
-
if (num == 0) {
|
|
97
|
-
return Number(num).toFixed(decimalPlaces) + unit;
|
|
98
|
-
}
|
|
99
|
-
return (Number(num) / divisor).toFixed(decimalPlaces) + unit;
|
|
100
|
-
} else {
|
|
101
|
-
console.warn(`入参${num}不是正确的数字`);
|
|
102
|
-
return num;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const money = {
|
|
108
|
-
moneyFixed(num, decimalPlaces = 2, unit = '元') {
|
|
109
|
-
return _moneyFunctional(
|
|
110
|
-
num,
|
|
111
|
-
() => base.numberFormat(num, 100, decimalPlaces, unit),
|
|
112
|
-
() => '-'
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const config = {
|
|
118
|
-
CONFIG_PROJECT: [
|
|
119
|
-
{
|
|
120
|
-
label: '学术拜访',
|
|
121
|
-
value: 1
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
label: 'OTC拜访',
|
|
125
|
-
value: 2
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
label: '科室会',
|
|
129
|
-
value: 3
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
label: '患教会',
|
|
133
|
-
value: 4
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
label: '医学助手项目调研',
|
|
137
|
-
value: 5
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
label: '线上推广',
|
|
141
|
-
value: 6
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
label: '医生调查问卷',
|
|
145
|
-
value: 7
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
label: '病例收集',
|
|
149
|
-
value: 8
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
label: '等级医院拜访',
|
|
153
|
-
value: 9
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
label: '基层医疗机构拜访',
|
|
157
|
-
value: 10
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
label: '特级三甲医院市场准入',
|
|
161
|
-
value: 11
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
label: '三级医院市场准入',
|
|
165
|
-
value: 12
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
label: '二级医院市场准入',
|
|
169
|
-
value: 13
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
label: '基层医疗机构市场准入',
|
|
173
|
-
value: 14
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
label: '零售药店市场准入',
|
|
177
|
-
value: 15
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
label: 'AI健康管理',
|
|
181
|
-
value: 16
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
label: '数字拜访',
|
|
185
|
-
value: 17
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
label: '医学病例收集',
|
|
189
|
-
value: 18
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
label: '协定服务',
|
|
193
|
-
value: 19
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
label: '可配置场景',
|
|
197
|
-
value: 20
|
|
198
|
-
}
|
|
199
|
-
],
|
|
200
|
-
CONFIG_QUESTION: [
|
|
201
|
-
{
|
|
202
|
-
label: '定位题',
|
|
203
|
-
value: -3
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
label: '时间段题',
|
|
207
|
-
value: -2
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
label: '目标题',
|
|
211
|
-
value: -1
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
label: '单选题',
|
|
215
|
-
value: 1
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
label: '多选题',
|
|
219
|
-
value: 2
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
label: '单选投票题',
|
|
223
|
-
value: 3
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
label: '单项填空题',
|
|
227
|
-
value: 4
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
label: '多项填空题',
|
|
231
|
-
value: 5
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
label: '打分题',
|
|
235
|
-
value: 6
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
label: '地址',
|
|
239
|
-
value: 7
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
label: '上传附件',
|
|
243
|
-
value: 8
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
label: '上传pdf',
|
|
247
|
-
value: 9
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
label: '上传word',
|
|
251
|
-
value: 10
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
label: '上传excel',
|
|
255
|
-
value: 11
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
label: '上传ppt',
|
|
259
|
-
value: 12
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
label: '上传图片',
|
|
263
|
-
value: 13
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
label: '时间题',
|
|
267
|
-
value: 14
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
label: '月度题',
|
|
271
|
-
value: 15
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
label: '定位题',
|
|
275
|
-
value: 16
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
label: '描述题',
|
|
279
|
-
value: 17
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
label: '描述题',
|
|
283
|
-
value: 18
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
label: '数字填空题',
|
|
287
|
-
value: 19
|
|
288
|
-
}
|
|
289
|
-
]
|
|
290
|
-
};
|
package/webpack.config.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Description:
|
|
3
|
-
* @LastEditors: jml
|
|
4
|
-
* @Date: 2021-01-28 23:29:19
|
|
5
|
-
*/
|
|
6
|
-
var path = require('path');
|
|
7
|
-
var webpack = require('webpack');
|
|
8
|
-
var entry =
|
|
9
|
-
process.env.NODE_ENV === 'development'
|
|
10
|
-
? './src/main.js'
|
|
11
|
-
: './src/lib/index.js';
|
|
12
|
-
module.exports = {
|
|
13
|
-
entry: entry,
|
|
14
|
-
output: {
|
|
15
|
-
path: path.resolve(__dirname, './dist'),
|
|
16
|
-
publicPath: '/dist/',
|
|
17
|
-
filename: 'bundler.js',
|
|
18
|
-
library: 'Xrk',
|
|
19
|
-
libraryExport: 'default',
|
|
20
|
-
libraryTarget: 'umd',
|
|
21
|
-
umdNamedDefine: true
|
|
22
|
-
},
|
|
23
|
-
module: {
|
|
24
|
-
rules: [
|
|
25
|
-
{
|
|
26
|
-
test: /\.css$/,
|
|
27
|
-
use: ['style-loader', 'css-loader']
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
test: /\.vue$/,
|
|
31
|
-
loader: 'vue-loader',
|
|
32
|
-
options: {
|
|
33
|
-
loaders: {}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
test: /\.js$/,
|
|
39
|
-
loader: 'babel-loader',
|
|
40
|
-
exclude: /node_modules/
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
test: /\.(png|jpg|gif|svg)$/,
|
|
44
|
-
use: [
|
|
45
|
-
{
|
|
46
|
-
loader: 'url-loader',
|
|
47
|
-
options: {
|
|
48
|
-
limit: '8192',
|
|
49
|
-
name: 'imgs/[name].[hash].[ext]',
|
|
50
|
-
publicPath: './dist/'
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
resolve: {
|
|
58
|
-
alias: {
|
|
59
|
-
vue$: 'vue/dist/vue.esm.js'
|
|
60
|
-
},
|
|
61
|
-
extensions: ['*', '.js', '.vue', '.json']
|
|
62
|
-
},
|
|
63
|
-
devServer: {
|
|
64
|
-
host: '0.0.0.0',
|
|
65
|
-
historyApiFallback: true,
|
|
66
|
-
noInfo: true,
|
|
67
|
-
overlay: true
|
|
68
|
-
},
|
|
69
|
-
performance: {
|
|
70
|
-
hints: false
|
|
71
|
-
},
|
|
72
|
-
devtool: '#eval-source-map'
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
if (process.env.NODE_ENV === 'production') {
|
|
76
|
-
module.exports.devtool = '#source-map';
|
|
77
|
-
module.exports.plugins = (module.exports.plugins || []).concat([
|
|
78
|
-
new webpack.DefinePlugin({
|
|
79
|
-
'process.env': {
|
|
80
|
-
NODE_ENV: '"production"'
|
|
81
|
-
}
|
|
82
|
-
}),
|
|
83
|
-
new webpack.optimize.UglifyJsPlugin({
|
|
84
|
-
sourceMap: true,
|
|
85
|
-
compress: {
|
|
86
|
-
warnings: false
|
|
87
|
-
}
|
|
88
|
-
}),
|
|
89
|
-
new webpack.LoaderOptionsPlugin({
|
|
90
|
-
minimize: true
|
|
91
|
-
})
|
|
92
|
-
]);
|
|
93
|
-
}
|