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.
Files changed (38) hide show
  1. package/.babelrc +2 -11
  2. package/lib/index.css +18560 -0
  3. package/lib/index.esm.js +2958 -0
  4. package/lib/index.umd.js +2997 -0
  5. package/package.json +47 -69
  6. package/rollup.config.js +59 -0
  7. package/tsconfig.json +24 -0
  8. package/typings/shims-vue.d.ts +6 -0
  9. package/.editorconfig +0 -9
  10. package/.eslintrc.js +0 -40
  11. package/.prettierrc.js +0 -16
  12. package/debug.log +0 -1
  13. package/dist/bundler.js +0 -7
  14. package/dist/bundler.js.map +0 -1
  15. package/index.html +0 -19
  16. package/src/App.vue +0 -134
  17. package/src/lib/index.js +0 -27
  18. package/src/main.js +0 -25
  19. package/src/packages/dialog/index.js +0 -32
  20. package/src/packages/dialog/src/main.vue +0 -197
  21. package/src/packages/slide-verify/index.js +0 -12
  22. package/src/packages/slide-verify/src/main.vue +0 -479
  23. package/src/packages/slide-verify/src/static/close.png +0 -0
  24. package/src/packages/slide-verify/src/static/placeholder.png +0 -0
  25. package/src/packages/slide-verify/src/static/range_btn.png +0 -0
  26. package/src/packages/slide-verify/src/static/refresh.png +0 -0
  27. package/src/packages/task-detail/index.js +0 -12
  28. package/src/packages/task-detail/src/components/formDetail.vue +0 -79
  29. package/src/packages/task-detail/src/components/mixin.js +0 -105
  30. package/src/packages/task-detail/src/components/styles/index.scss +0 -162
  31. package/src/packages/task-detail/src/components/surveyDetail.vue +0 -337
  32. package/src/packages/task-detail/src/config/fields.js +0 -655
  33. package/src/packages/task-detail/src/config/index.js +0 -34
  34. package/src/packages/task-detail/src/main.vue +0 -108
  35. package/src/packages/task-detail/src/static/fieldsMap.js +0 -274
  36. package/src/packages/task-detail/src/test/testData.js +0 -743
  37. package/src/packages/task-detail/src/tools/index.js +0 -290
  38. package/webpack.config.js +0 -93
@@ -1,108 +0,0 @@
1
- <!--
2
- * @Description:
3
- * @Date: 2021-02-23 10:34:32
4
- * @LastEditors: jml
5
- -->
6
- <template>
7
- <div class="xrk-task-detail">
8
- <SurveyDetail
9
- :config="detailConfig"
10
- :initData="initTaskDetail"
11
- v-if="isSurvey"
12
- ></SurveyDetail>
13
- <FormDetail
14
- :config="detailConfig"
15
- :initData="initTaskDetail"
16
- v-else
17
- ></FormDetail>
18
- </div>
19
- </template>
20
-
21
- <script>
22
- import createFieldsMap from './static/fieldsMap';
23
- import FormDetail from './components/formDetail';
24
- import SurveyDetail from './components/surveyDetail';
25
- export default {
26
- name: 'TaskDetail',
27
- components: { FormDetail, SurveyDetail },
28
- props: {
29
- config: {
30
- type: Object,
31
- default: () => ({
32
- remoteApi: {},
33
- insertFields: [],
34
- initTaskDetail: {},
35
- customFieldsMap: {},
36
- hideFieldsKeys: []
37
- })
38
- }
39
- },
40
- data() {
41
- return {};
42
- },
43
- computed: {
44
- detailConfig() {
45
- const { isHideField } = this;
46
- const {
47
- projectType,
48
- insertFields = [],
49
- customFieldsMap = {},
50
- hideFieldsKeys = []
51
- } = this.config;
52
- const _fieldsMap = createFieldsMap(this);
53
-
54
- _fieldsMap[projectType]['fieldsArr'] = Array.isArray(insertFields)
55
- ? insertFields.concat(_fieldsMap[projectType]['fieldsArr'])
56
- : _fieldsMap[projectType]['fieldsArr'];
57
-
58
- if (
59
- Object.keys(customFieldsMap).length > 0 ||
60
- hideFieldsKeys.length > 0
61
- ) {
62
- // 存在自定义字段 或 存在需隐藏字段
63
- _fieldsMap[projectType]['fieldsArr'] = _fieldsMap[projectType]['fieldsArr'].reduce((pre, cur) => {
64
- const { prop } = cur;
65
- if (customFieldsMap[prop]) {
66
- // 字段被修改
67
- pre.push({
68
- ...customFieldsMap[prop],
69
- isHideField: isHideField(prop),
70
- _IsCustomField: true,
71
- _ComponentDefaultField: cur
72
- });
73
- } else {
74
- pre.push({
75
- ...cur,
76
- isHideField: isHideField(prop),
77
- _IsCustomField: false
78
- });
79
- }
80
- return pre;
81
- }, []);
82
- }
83
- return _fieldsMap[projectType];
84
- },
85
- projectType() {
86
- return this.config.projectType;
87
- },
88
- initTaskDetail() {
89
- return this.config.initTaskDetail || {};
90
- },
91
- isSurvey() {
92
- return [5, 7, 20].includes(+this.projectType);
93
- }
94
- },
95
- methods: {
96
- /**
97
- * 字段是否隐藏
98
- */
99
- isHideField(prop) {
100
- return this.config.hideFieldsKeys.indexOf(prop) > -1;
101
- }
102
- }
103
- };
104
- </script>
105
- <style lang="scss" scoped>
106
- // .xrk-task-detail {
107
- // }
108
- </style>
@@ -1,274 +0,0 @@
1
- /*
2
- * @Description:
3
- * @Date: 2021-02-23 11:38:31
4
- * @LastEditors: jml
5
- */
6
- import { config } from '../tools/index';
7
- const { CONFIG_PROJECT } = config;
8
- import createFields from '../config/fields';
9
-
10
- export default Vue => {
11
- const _F = createFields(Vue);
12
- const fieldsArrMap = {
13
- /**
14
- * 学术拜访
15
- */
16
- 1: [
17
- _F.fullName,
18
- _F.phone,
19
- _F.customerName,
20
- _F.hospitalName,
21
- _F.departmentName,
22
- _F.dutyName,
23
- _F.visitTime,
24
- _F.visitMinute,
25
- _F.visitAddress,
26
- _F.messages,
27
- _F.customerRemark,
28
- _F.productName,
29
- _F.jixing,
30
- _F.guige,
31
- _F.approvalNumber,
32
- _F.autographPicUrl,
33
- _F.pics
34
- ],
35
- /**
36
- * OTC 拜访
37
- */
38
- 2: [
39
- _F.pharmacyName,
40
- _F.startDt,
41
- {
42
- ..._F.visitAddress,
43
- label: '药店定位'
44
- },
45
- _F.productName,
46
- _F.price,
47
- _F.salesPrice,
48
- _F.productRequire,
49
- _F.displayStatus,
50
- _F.isProdectPop,
51
- _F.isKnow,
52
- _F.displayPhotos,
53
- _F.competitor,
54
- _F.stock
55
- ],
56
- /**
57
- * 科室会
58
- */
59
- 3: [
60
- _F.hospitalName,
61
- {
62
- ..._F.meetingMinute,
63
- label: '拜访时长'
64
- },
65
- _F.visitAddress,
66
- _F.messages,
67
- _F.customerRemark,
68
- _F.displayPhotos,
69
- _F.signInformationTotal,
70
- _F.signInfo
71
- ],
72
- /**
73
- * 患教会
74
- */
75
- 4: [
76
- _F.fullName,
77
- {
78
- ..._F.visitAddress,
79
- label: '会议地址'
80
- },
81
- _F.meetingMinute,
82
- _F.longitudeAndLatitude,
83
- _F.customerFeedback,
84
- _F.visitTime,
85
- _F.displayPhotos,
86
- _F.signInformationTotal,
87
- _F.signInfo
88
- ],
89
- /**
90
- * 线上推广
91
- */
92
- 6: [_F.xstg],
93
- /**
94
- * 等级医院拜访
95
- */
96
- 9: [
97
- _F.fullName,
98
- _F.phone,
99
- _F.customerName,
100
- _F.hospitalName,
101
- _F.gradeName,
102
- _F.departmentName,
103
- _F.dutyName,
104
- _F.visitTime,
105
- _F.visitMinute,
106
- _F.visitAddress,
107
- _F.pics,
108
- _F.autographPicUrl,
109
- _F.messages,
110
- _F.customerRemark,
111
- _F.productName,
112
- _F.jixing,
113
- _F.guige,
114
- _F.approvalNumber
115
- ],
116
- /**
117
- * 基层医疗机构拜访
118
- */
119
- 10: [
120
- _F.fullName,
121
- _F.phone,
122
- _F.customerName,
123
- {
124
- ..._F.hospitalName,
125
- label: '医疗机构'
126
- },
127
- {
128
- ..._F.gradeName,
129
- label: '医疗机构类别'
130
- },
131
- _F.departmentName,
132
- _F.visitTime,
133
- _F.visitMinute,
134
- _F.visitAddress,
135
- _F.pics,
136
- _F.autographPicUrl,
137
- _F.messages,
138
- _F.customerRemark,
139
- _F.productName,
140
- _F.jixing,
141
- _F.guige,
142
- _F.approvalNumber
143
- ],
144
- /**
145
- * 数字拜访
146
- */
147
- 17: [
148
- _F.fullName,
149
- _F.phone,
150
- _F.customerName,
151
- {
152
- prop: 'area',
153
- label: row => {
154
- const { szVisitType } = row;
155
- let name = '医疗机构地区';
156
- switch (szVisitType) {
157
- case 3:
158
- name = '省市';
159
- break;
160
- }
161
- return name;
162
- },
163
- hide: row => {
164
- const { szVisitType } = row;
165
- return szVisitType == 1;
166
- },
167
- render(row) {
168
- const { ssq, provinceName, cityName, districtName } = row;
169
- return ssq || `${provinceName}${cityName}${districtName}`;
170
- }
171
- },
172
- {
173
- label: '地址',
174
- prop: 'address',
175
- hide: row => {
176
- const { szVisitType } = row;
177
- return szVisitType != 3;
178
- }
179
- },
180
- {
181
- label: '职称',
182
- prop: 'dutyName',
183
- hide: row => {
184
- const { szVisitType } = row;
185
- return szVisitType == 2;
186
- },
187
- render(row) {
188
- const { szVisitType, dutyName, pharmacyPeopleDuty } = row;
189
- if (szVisitType == 1) {
190
- return dutyName || '-';
191
- }
192
- if (szVisitType == 3) {
193
- return ['-', '店长', '副店长', '店员', '业务员', '采购', '其他'][
194
- pharmacyPeopleDuty || 0
195
- ];
196
- }
197
- return '-';
198
- }
199
- },
200
- {
201
- label: row => {
202
- const { szVisitType } = row;
203
- let name = '医院名称';
204
- switch (szVisitType) {
205
- case 2:
206
- name = '医院机构名称';
207
- break;
208
- case 3:
209
- name = '药店名称';
210
- break;
211
- }
212
- return name;
213
- },
214
- prop: 'hospitalName',
215
- render(row) {
216
- const { szVisitType, hospitalName, pharmacyName } = row;
217
- return szVisitType == 3 ? pharmacyName : hospitalName;
218
- }
219
- },
220
- {
221
- label: row => {
222
- const { szVisitType } = row;
223
- let name = '医院等级';
224
- switch (szVisitType) {
225
- case 2:
226
- name = '医院机构类别';
227
- break;
228
- }
229
- return name;
230
- },
231
- hide: row => {
232
- const { szVisitType } = row;
233
- return szVisitType == 3;
234
- },
235
- prop: 'gradeName'
236
- },
237
- {
238
- label: '科室名称',
239
- hide: row => {
240
- const { szVisitType } = row;
241
- return szVisitType == 3;
242
- },
243
- prop: 'departmentName',
244
- render(row) {
245
- return `${row['firstDepartmentName']}-${row['departmentName']}`;
246
- }
247
- },
248
- _F.visitType,
249
- _F.visitTime,
250
- _F.feedbackDt,
251
- _F.customerRemark,
252
- _F.numberVisitMessage,
253
- _F.xinxifankui,
254
- _F.xinxizhuanf
255
- ],
256
- /**
257
- * 病例收集
258
- */
259
- 8: [_F.title, _F.imgList, _F.fileList, _F.content],
260
- /**
261
- * 医学病例收集
262
- */
263
- 18: [_F.title, _F.imgList, _F.fileList, _F.content]
264
- };
265
-
266
- const fieldsMap = CONFIG_PROJECT.reduce((pre, cur) => {
267
- pre[cur.value] = {
268
- ...cur,
269
- fieldsArr: fieldsArrMap[cur.value]
270
- };
271
- return pre;
272
- }, {});
273
- return fieldsMap;
274
- };