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,162 +0,0 @@
1
- .detail {
2
- max-width: 1300px;
3
- display: flex;
4
- flex-wrap: wrap;
5
- &_item {
6
- display: flex;
7
- padding: 15px 0;
8
- width: 50%;
9
- min-width: 450px;
10
- &_label {
11
- min-width: 60px;
12
- font-size: 14px;
13
- color: #767a90;
14
- text-align: right;
15
- cursor: default;
16
- flex-shrink: 0;
17
- }
18
- &_value {
19
- width: 100%;
20
- font-size: 14px;
21
- display: flex;
22
- flex-direction: column;
23
- padding-right: 30px;
24
- box-sizing: border-box;
25
- text-align: left;
26
- & > img:nth-child(2) {
27
- display: inline-block;
28
- margin-top: 20px;
29
- }
30
- img {
31
- cursor: pointer;
32
- width: 100%;
33
- max-width: 450px;
34
- max-height: 350px;
35
- object-fit: cover;
36
- box-shadow: 1px 2px 5px 0;
37
- color: rgba($color: #000000, $alpha: 0.3);
38
- }
39
- .img-group {
40
- width: 100%;
41
- // display: flex;
42
- >>> .d_img {
43
- width: 150px;
44
- max-height: 400px;
45
- object-fit: contain;
46
- box-shadow: 1px 2px 5px 0;
47
- color: rgba(0, 0, 0, 0.3);
48
- vertical-align: text-top;
49
- & + .d_img {
50
- margin-left: 20px;
51
- }
52
- }
53
- }
54
- &_table {
55
- display: flex;
56
- margin-bottom: 12px;
57
- padding-left: 0;
58
- .first {
59
- border: 1px solid rgba(163, 208, 253, 1);
60
- border-radius: 4px 0 0 4px;
61
- div {
62
- background: #e6f1fc;
63
- width: 88px;
64
- text-align: center;
65
- color: #333333;
66
- font-size: 14px;
67
- font-weight: bold;
68
- height: 46px;
69
- line-height: 46px;
70
- }
71
- > div:first-of-type {
72
- border-bottom: 1px solid rgba(163, 208, 253, 1);
73
- }
74
- }
75
- li {
76
- border: 1px solid rgba(220, 223, 230, 1);
77
- border-left: none;
78
- list-style: none;
79
- > div {
80
- width: 172px;
81
- height: 46px;
82
- color: #666;
83
- font-size: 14px;
84
- text-align: center;
85
- display: flex;
86
- flex-direction: column;
87
- justify-content: center;
88
- padding: 8px 16px;
89
- box-sizing: border-box;
90
- }
91
- > div:first-of-type {
92
- border-bottom: 1px solid rgba(220, 223, 230, 1);
93
- }
94
- .nickName {
95
- line-height: 20px;
96
- span {
97
- display: -webkit-box;
98
- -webkit-box-orient: vertical;
99
- -webkit-line-clamp: 2;
100
- overflow: hidden;
101
- }
102
- }
103
- }
104
- }
105
- >>> .xstg_table {
106
- overflow: auto;
107
- &_column {
108
- display: flex;
109
- background-color: #e6f1fc;
110
- &_item {
111
- border: 1px solid #a3d0fd;
112
- text-align: center;
113
- box-sizing: border-box;
114
- font-size: 14px;
115
- min-height: 38px;
116
- line-height: 1.2;
117
- display: flex;
118
- align-items: center;
119
- justify-content: center;
120
- padding: 10px;
121
- word-break: break-all;
122
- & + .xstg_table_column_item {
123
- border-left: 0;
124
- }
125
- }
126
- & + .xstg_table_column {
127
- background-color: #fff;
128
- .xstg_table_column_item {
129
- border-color: #ebeef5;
130
- border-top: 0;
131
- }
132
- }
133
- }
134
- }
135
- .case_imgs {
136
- display: flex;
137
- flex-wrap: wrap;
138
- transform: translate(-5px, -5px);
139
- padding-left: 0;
140
- >>> & > li {
141
- text-align: center;
142
- margin: 5px;
143
- // list-style: decimal;
144
- list-style: none;
145
- & > img {
146
- width: 100%;
147
- width: 300px;
148
- max-height: 260px;
149
- box-shadow: 1px 2px 5px 0;
150
- color: rgba($color: #000000, $alpha: 0.3);
151
- }
152
- & > div {
153
- width: 300px;
154
- margin-top: 5px;
155
- font-size: 14px;
156
- color: #333333;
157
- }
158
- }
159
- }
160
- }
161
- }
162
- }
@@ -1,337 +0,0 @@
1
- <!--
2
- * @Description:
3
- * @Author: jml
4
- * @Date: 2021-02-23 14:20:59
5
- * @LastEditors: jml
6
- * @LastEditTime: 2021-03-03 11:24:16
7
- -->
8
- <template>
9
- <div class="detail">
10
- <div v-if="isSurvey" style="margin-bottom:20px;">
11
- <div style="font-weight:bold;font-size:16px;">问卷信息</div>
12
- <div class="detail_info">
13
- <div class="detail_info_header">
14
- <div>问卷发起人</div>
15
- <div>发起人手机号码</div>
16
- <div>开始时间</div>
17
- <div>结束时间</div>
18
- <div>答题时间</div>
19
- </div>
20
- <div class="detail_info_row">
21
- <div>{{ userData.fullName }}</div>
22
- <div>{{ userData.phone }}</div>
23
- <div>{{ userData.answerStartDt | dateFormat('Y年M月D日 H:m:s') }}</div>
24
- <div>{{ userData.answerEndDt | dateFormat('Y年M月D日 H:m:s') }}</div>
25
- <div>{{ userData.answerEndDt - userData.answerStartDt }}秒</div>
26
- </div>
27
- </div>
28
- </div>
29
- <div style="font-weight:bold;font-size:16px;">问卷详情</div>
30
- <span
31
- style="color: grey; font-size: 14px;margin-top:10px;display:inline-block;"
32
- v-if="sceneRemark"
33
- >备注:{{ sceneRemark }}</span>
34
- <div class="detail_item" v-for="(item, index) in answerList" :key="`${item.id}-${index}`">
35
- <div class="detail_item_index">{{ +index + 1 }}:</div>
36
- <div>
37
- <div class="detail_item_label" name="标题">
38
- {{ item.title }}
39
- <span name="题目类型">{{ getQuestionName(item.type) }}</span>
40
- <span name="必填">{{ isMultiple(item) }}</span>
41
- </div>
42
- <div class="detail_item_value">
43
- <div class="detail_item_value_images" v-if="isPic(item)" name="图片题">
44
- <img
45
- :src="picInfo.url"
46
- alt
47
- v-for="picInfo in dealPic(item.answer)"
48
- :key="picInfo.url"
49
- :preview="picInfo.url"
50
- />
51
- </div>
52
- <ul v-else-if="isFile(item)" style="padding-left:19px;" name="文件题">
53
- <li
54
- class="detail_item_value_filename"
55
- v-for="fileInfo in dealFile(item.answer)"
56
- :key="fileInfo.url"
57
- >
58
- <span @click="downloadFile(fileInfo.url, fileInfo.name)">{{ fileInfo.name }}</span>
59
- </li>
60
- </ul>
61
- <template v-else-if="isBlanks(item)" name="多项填空题">
62
- <div v-for="(bItem, bIndex) in item.manyTitleJson" :key="bItem">
63
- <div>{{ bItem }}:{{ item.answer[bIndex] }}</div>
64
- </div>
65
- </template>
66
- <template v-else-if="isLocation(item)" name="定位题">
67
- <span style="padding-bottom: 10px;display: block;">{{ item.answer['name'] }}</span>
68
- <div class="detail_item_value_images">
69
- <img :src="item.answer['addressPicUrl']" alt :preview="item.answer['addressPicUrl']" />
70
- </div>
71
- </template>
72
- <template v-else>
73
- <template v-if="Array.isArray(item.answer)">{{ item.answer.join('、') }}</template>
74
- <template v-else>{{ item.answer }}</template>
75
- </template>
76
- </div>
77
- </div>
78
- </div>
79
- </div>
80
- </template>
81
- <script>
82
- import { check, config, date } from '../tools/index';
83
- console.log('题目配置', config.CONFIG_QUESTION);
84
- export default {
85
- name: 'Detail',
86
- props: {
87
- initData: {
88
- type: Object,
89
- default: () => ({})
90
- }
91
- },
92
- data() {
93
- return {
94
- sceneRemark: '',
95
- answerList: []
96
- };
97
- },
98
- filters: {
99
- dateFormat: date.dateFormat
100
- },
101
- computed: {
102
- isSurvey() {
103
- /* eslint-disable */
104
- return (this.initData || {}).hasOwnProperty('userData');
105
- },
106
- userData() {
107
- return this.initData.userData || {};
108
- }
109
- },
110
- methods: {
111
- getQuestionName(type) {
112
- const info = config.CONFIG_QUESTION.find(item => item.value == type);
113
- if (info) {
114
- return `[${info.label}]`;
115
- } else {
116
- return '';
117
- }
118
- },
119
- isMultiple(item) {
120
- const { isMustFill, type } = item;
121
- if (type == 18) {
122
- return '';
123
- }
124
- return isMustFill == 1 ? '(必填)' : '(非必填)';
125
- },
126
- isBlanks(item) {
127
- // 多项填空题
128
- return [5].includes(+item.type);
129
- },
130
- isLocation(item) {
131
- // 定位题
132
- return [16].includes(+item.type);
133
- },
134
- isPic(item) {
135
- return [20, 13].includes(+item.type);
136
- },
137
- isFile(item) {
138
- return [9, 10, 11, 12].includes(+item.type);
139
- },
140
- dealPic(value) {
141
- if (check.isString(value)) {
142
- return [
143
- {
144
- url: value
145
- }
146
- ];
147
- } else if (Array.isArray(value)) {
148
- return value;
149
- }
150
- console.warn('图片传入字符串或者对象数组,例如[{url:url}]');
151
- return [];
152
- },
153
- dealFile(value) {
154
- return value || [];
155
- },
156
- downloadFile(url, fileName) {
157
- window.open(url);
158
- // file.getNetFile(url).then(blob => {
159
- // if (window.navigator.msSaveOrOpenBlob) {
160
- // navigator.msSaveBlob(blob, fileName);
161
- // } else {
162
- // var link = document.createElement('a');
163
- // link.href = window.URL.createObjectURL(blob);
164
- // link.download = fileName;
165
- // link.click();
166
- // window.URL.revokeObjectURL(link.href);
167
- // }
168
- // });
169
- },
170
- dealData(initData) {
171
- const { contentTitleList, topicList, answerList } = initData;
172
- const makeSceneMap = initData.makeSceneMap
173
- ? { ...initData.makeSceneMap }
174
- : initData;
175
- const {
176
- isSetTarget,
177
- isSetTime,
178
- isSetLocation,
179
- targetTitle,
180
- timeTitle,
181
- locationTitle,
182
- targetRemark,
183
- timeRemark,
184
- locationRemark,
185
- customerName,
186
- addressPicUrl,
187
- sceneRemark,
188
- timeType,
189
- timeQuestions
190
- } = makeSceneMap;
191
- const tArr = [
192
- {
193
- title: (targetTitle || '') + '[目标题]',
194
- remark: targetRemark,
195
- answer: customerName,
196
- show: isSetTarget,
197
- isMustFill: 1
198
- },
199
- {
200
- title: (timeTitle || '') + `[${timeType === 1 ? '时间' : '时刻'}题]`,
201
- remark: timeRemark,
202
- answer: timeQuestions || '',
203
- show: isSetTime,
204
- isMustFill: 1
205
- },
206
- {
207
- title: (locationTitle || '') + '[定位题]',
208
- answer: addressPicUrl,
209
- remark: locationRemark,
210
- show: isSetLocation,
211
- isLocation: true,
212
- type: 20,
213
- isMustFill: 1
214
- }
215
- ].filter(item => item.show == 1);
216
- this.sceneRemark = sceneRemark;
217
- this.answerList = tArr.concat(
218
- (contentTitleList || topicList || answerList || []).map(item => {
219
- item.manyTitleJson = item.manyTitleJson || '[]';
220
- const isString = content => {
221
- return check.isString(content);
222
- };
223
- if (
224
- isString(item.answer) &&
225
- [2, 5, 9, 10, 11, 12, 13, 16].includes(+item.type)
226
- ) {
227
- try {
228
- item.answer = JSON.parse(item.answer);
229
- } catch (error) {
230
- console.log(item.answer, error);
231
- }
232
- }
233
- if (isString(item.manyTitleJson) && [5].includes(+item.type)) {
234
- try {
235
- item.manyTitleJson = JSON.parse(item.manyTitleJson);
236
- } catch (error) {
237
- console.log(error);
238
- }
239
- }
240
- return item;
241
- })
242
- );
243
- }
244
- },
245
- watch: {
246
- initData: {
247
- handler(newV) {
248
- this.dealData(newV);
249
- },
250
- deep: true,
251
- immediate: true
252
- }
253
- }
254
- };
255
- </script>
256
-
257
- <style lang="scss" scoped>
258
- // @import './styles/index.scss';
259
- .detail {
260
- text-align: left;
261
- &_info {
262
- margin-top: 10px;
263
- max-width: 1200px;
264
- & > div {
265
- display: flex;
266
- background-color: #e6f1fc;
267
- & > div {
268
- width: 100%;
269
- text-align: center;
270
- border: 1px solid #a3d0fd;
271
- text-align: center;
272
- box-sizing: border-box;
273
- font-size: 14px;
274
- min-height: 38px;
275
- line-height: 1.2;
276
- display: flex;
277
- align-items: center;
278
- justify-content: center;
279
- padding: 10px;
280
- word-break: break-all;
281
- & + div {
282
- border-left: 0;
283
- }
284
- }
285
- & + div {
286
- background-color: #fff;
287
- & > div {
288
- border-color: #ebeef5;
289
- border-top: 0;
290
- }
291
- }
292
- }
293
- }
294
- &_item {
295
- display: flex;
296
- border-bottom: 1px solid #f5f5f5;
297
- padding: 20px 0;
298
- font-size: 16px;
299
- &_index {
300
- cursor: default;
301
- font-size: 16px;
302
- flex-shrink: 0;
303
- width: 40px;
304
- text-align: right;
305
- }
306
- &_label {
307
- font-size: 16px;
308
- cursor: default;
309
- text-align: left;
310
- }
311
- &_value {
312
- font-size: 14px;
313
- line-height: 1.5;
314
- padding-top: 10px;
315
- text-align: left;
316
- &_filename {
317
- color: #409eff;
318
- cursor: pointer;
319
- list-style: disc;
320
- }
321
- &_images {
322
- transform: translateX(-5px);
323
- & > img {
324
- cursor: pointer;
325
- width: 100%;
326
- max-width: 350px;
327
- max-height: 250px;
328
- object-fit: cover;
329
- box-shadow: 1px 2px 5px 0;
330
- color: rgba($color: #000000, $alpha: 0.3);
331
- margin: 0 5px;
332
- }
333
- }
334
- }
335
- }
336
- }
337
- </style>