@zykjcommon/questions 0.0.38 → 0.0.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zykjcommon/questions",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "main": "src/components/questions/entry.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -9,7 +9,8 @@
9
9
  "pre": "vue-cli-service build --mode test",
10
10
  "buildTest": "vue-cli-service build --mode buildTest",
11
11
  "lint": "vue-cli-service lint",
12
- "build:lib": "vue-cli-service build --target lib src/components/questions/buildEntry.js --name zykjcommon-questions"
12
+ "build:lib": "vue-cli-service build --target lib src/components/questions/buildEntry.js --name zykjcommon-questions",
13
+ "publishLib": "node tasks/setPublishPackageJson.js && npm publish && node tasks/setOriPackageJson.js"
13
14
  },
14
15
  "dependencies": {
15
16
  "alife-logger": "^1.8.30",
@@ -20,15 +21,9 @@
20
21
  "md5": "^2.2.1",
21
22
  "mitt": "^3.0.0",
22
23
  "mobile-detect": "^1.4.5",
23
- "video.js": "^7.6.0",
24
- "vue": "^3.0.0",
25
- "vue-router": "^4.0.0-0",
26
- "vuex": "^4.0.0-0",
27
- "vuex-composition-helpers": "^2.0.1"
24
+ "video.js": "^7.6.0"
28
25
  },
29
26
  "devDependencies": {
30
- "@zykjcommon/questions": "^0.0.27",
31
- "element-plus": "^2.0.2",
32
27
  "@types/node": "^18.11.9",
33
28
  "@vue/cli-plugin-babel": "^5.0.1",
34
29
  "@vue/cli-plugin-router": "~4.5.0",
@@ -36,6 +31,8 @@
36
31
  "@vue/cli-plugin-vuex": "~4.5.0",
37
32
  "@vue/cli-service": "^5.0.1",
38
33
  "@vue/compiler-sfc": "^3.0.0",
34
+ "@zykjcommon/questions": "^0.0.39",
35
+ "element-plus": "^2.0.2",
39
36
  "file-loader": "^6.2.0",
40
37
  "image-webpack-loader": "^8.1.0",
41
38
  "postcss": "^8.4.6",
@@ -54,10 +51,14 @@
54
51
  "unplugin-vue-components": "^0.17.18",
55
52
  "url-loader": "^4.1.1",
56
53
  "webpack": "^5.88.1",
57
- "yargs": "^16.2.0"
54
+ "yargs": "^16.2.0",
55
+ "vue": "^3.0.0",
56
+ "vue-router": "^4.0.0-0",
57
+ "vuex": "^4.0.0-0",
58
+ "vuex-composition-helpers": "^2.0.1"
58
59
  },
59
60
  "publishConfig": {
60
61
  "access": "public",
61
62
  "registry": "https://registry.npmjs.org/"
62
63
  }
63
- }
64
+ }
@@ -372,7 +372,7 @@ $greenItemFontSize:0.14em;
372
372
  /*background-size: 100% 100%;*/
373
373
  }
374
374
  .main-block{
375
- margin:0.38em auto 0;
375
+ margin:0.38em auto 0.1rem;
376
376
  width: 1.1em;
377
377
  height: 1.1em;
378
378
  background: #76d2ff;
@@ -389,13 +389,16 @@ $greenItemFontSize:0.14em;
389
389
  padding: 0 0.28em 0.15em 0.35em;
390
390
  flex: 1;
391
391
  .main-append{
392
- /*height: 2.72em;*/
393
- height: 2.9em;
392
+ height: 2.77em;
394
393
  overflow: auto;
395
394
  display: flex;
396
395
  flex-wrap: wrap;
397
396
  justify-content: space-between;
398
397
  align-content: start;
398
+ &.noScrollBar::-webkit-scrollbar {
399
+ width: 0;
400
+ height: 0;
401
+ }
399
402
  }
400
403
  }
401
404
  .append-item{
@@ -404,10 +407,11 @@ $greenItemFontSize:0.14em;
404
407
  width: 1.3em;
405
408
  height: 1.3em;
406
409
  margin-right: 0.1em;
410
+ margin-bottom: 0.1em;
407
411
  flex-shrink: 0;
408
412
  cursor: move;
409
413
  text-align: center;
410
- color:rgb(238,252,149);
414
+ /*color:rgb(238,252,149);*/
411
415
  padding:0 0.2em;
412
416
  display: flex;
413
417
  justify-content: center;
@@ -449,6 +453,10 @@ $greenItemFontSize:0.14em;
449
453
  align-items: center;
450
454
  overflow-x: auto;
451
455
  width: 100%;
456
+ &.noScrollBar::-webkit-scrollbar {
457
+ width: 0;
458
+ height: 0;
459
+ }
452
460
  }
453
461
  .prev,.next{
454
462
  width: 0.24em;
@@ -488,7 +496,7 @@ $greenItemFontSize:0.14em;
488
496
  flex-shrink: 0;
489
497
  cursor: move;
490
498
  text-align: center;
491
- color:rgb(238,252,149);
499
+ /*color:rgb(238,252,149);*/
492
500
  padding:0 0.2em;
493
501
  display: flex;
494
502
  justify-content: center;
@@ -526,7 +534,7 @@ $greenItemFontSize:0.14em;
526
534
  flex-shrink: 0;
527
535
  cursor: move;
528
536
  text-align: center;
529
- color:rgb(238,252,149);
537
+ /*color:rgb(238,252,149);*/
530
538
  padding:0 0.2em;
531
539
  display: flex;
532
540
  justify-content: center;
@@ -28,7 +28,7 @@
28
28
  :style="item.bgUrlCss"
29
29
  v-for="(item,index) in optionList"
30
30
  :key="index">
31
- <div class="list-item-text">{{item.content}}</div>
31
+ <div class="list-item-text" v-show="item.content_type!=2">{{item.content}}</div>
32
32
  </div>
33
33
  </div>
34
34
  </div>
@@ -113,6 +113,8 @@ export default {
113
113
  dragWay : '',
114
114
  flag : false,
115
115
  scrollDistance : 3000,//设置一个死的滚动距离,保证能滚到底,目前够用
116
+ lazyDragTimer:null,
117
+ dragingStart:false
116
118
  };
117
119
  },
118
120
  watch: {
@@ -182,8 +184,9 @@ export default {
182
184
  let optionList = []
183
185
  exam_options_data.forEach((item)=>{
184
186
  optionList.push({
187
+ content_type:item.data.content_type,
185
188
  content:item.data.option_content,
186
- bgUrlCss:`background: url(${item.data.file_url}) no-repeat center;background-size: 100% 100%`,
189
+ bgUrlCss:`background: url(${item.data.file_url}) no-repeat center;background-size: 100% 100%;color:${item.data.font_color}`,
187
190
  idx:item.index
188
191
  })
189
192
  })
@@ -215,6 +218,7 @@ export default {
215
218
  $(document).off(this.mouseup)
216
219
  let html = document.getElementsByTagName("html")[0];
217
220
  html.style.fontSize = "";
221
+ document.onselectstart = null
218
222
  },
219
223
  answeredNotify(){
220
224
  let self = this
@@ -256,26 +260,31 @@ export default {
256
260
  })
257
261
  return specArr
258
262
  },
263
+ //移动端为了解决拖动事件和原生滚动条事件冲突,设置延迟100毫秒拖动(PC端不变)
259
264
  bindDragDomEvent(appendItem,way){
260
265
  let self = this
261
- appendItem.on(this.mousedown,function(e){
266
+ function dragDomEventFn(e,ctx){
262
267
  if(self.moveDiv){
263
268
  return
264
269
  }
270
+ env === 'mobile' && self.startLazyDrag()
265
271
  self.flag = false
266
272
  self.dragWay = way
267
273
  console.log(e);
268
274
  e.stopPropagation()
269
275
  e.preventDefault()
270
- self.listItem = $(this)
276
+ self.listItem = $(ctx)
271
277
  self.listItem.addClass('drag')
272
278
  self.p1.moveX = self.listItem.offset().left;
273
279
  self.p1.moveY = self.listItem.offset().top - 30;
274
280
  let idx = self.listItem.attr('idx')
275
- self.moveDiv = $(`<div class="question-classify-moveDiv" idx="${idx}" style="${self.listItemBgCss}"><div class="list-item-text">${self.listItem.find('.list-item-text').text()}</div></div>`)
276
- self.moveDiv.css({left:`${self.p1.moveX}px`,top:`${self.p1.moveY}px`})
281
+ let itemBgCss = `${self.listItem.get(0).style.background}`
282
+ let itemColorCss = `${self.listItem.get(0).style.color}`
283
+ let textDisplayCss = self.listItem.find('.list-item-text').get(0).style.display
284
+ console.log(itemBgCss,1234);
285
+ self.moveDiv = $(`<div class="question-classify-moveDiv" idx="${idx}"><div class="list-item-text" style="${textDisplayCss?'display:'+textDisplayCss:''}">${self.listItem.find('.list-item-text').text()}</div></div>`)
286
+ self.moveDiv.css({left:`${self.p1.moveX}px`,top:`${self.p1.moveY}px`,background:itemBgCss,color:itemColorCss})
277
287
  $(self.$el).append(self.moveDiv)
278
- // $('body').append(self.moveDiv)
279
288
  $(document).on(self.mousemove,function(e2){
280
289
  // e2.preventDefault()
281
290
  e2.stopPropagation()
@@ -289,15 +298,26 @@ export default {
289
298
  })
290
299
 
291
300
  })
292
-
301
+ }
302
+ appendItem.on(this.mousedown,function(e){
303
+ if(env === 'mobile'){
304
+ self.lazyDragTimer = setTimeout(()=>{
305
+ dragDomEventFn(e,this)
306
+ },100)
307
+ }else{
308
+ dragDomEventFn(e,this)
309
+ }
293
310
  })
294
311
  },
295
312
  appendMoveDiv(options){
296
313
  let self = this
297
314
  self.listItem.remove()
298
315
  let idx = self.moveDiv.attr('idx')
299
- let appendItem = $(`<div class="${options.appendItemClassName}" idx="${idx}" style="${self.listItemBgCss}"><div class="list-item-text">${self.moveDiv.find('.list-item-text').text()}</div></div>`)
300
- appendItem.css({opacity:0})
316
+ let itemBgCss = `${self.moveDiv.get(0).style.background}`
317
+ let itemColorCss = `${self.moveDiv.get(0).style.color}`
318
+ let textDisplayCss = self.moveDiv.find('.list-item-text').get(0).style.display
319
+ let appendItem = $(`<div class="${options.appendItemClassName}" idx="${idx}"><div class="list-item-text" style="${textDisplayCss?'display:'+textDisplayCss:''}">${self.moveDiv.find('.list-item-text').text()}</div></div>`)
320
+ appendItem.css({opacity:0,background:itemBgCss,color:itemColorCss})
301
321
  options.targetList.append(appendItem)
302
322
  options.targetList[options.scrollDirection](self.scrollDistance)
303
323
  let appendLeft = appendItem.offset().left
@@ -341,6 +361,7 @@ export default {
341
361
  }
342
362
  self.bindDragDomEvent($(this.$el).find('.question-classify .list-item'),'go')
343
363
  $(document).on(self.mouseup,function(e){
364
+ env === 'mobile' && self.stopLazyDrag()
344
365
  if(self.animationing){
345
366
  return
346
367
  }
@@ -403,9 +424,48 @@ export default {
403
424
  }
404
425
  }
405
426
  })
427
+
428
+ //禁止选中文字,解决拖动过程中文字老是被选中问题
429
+ document.onselectstart = function(){
430
+ return false
431
+ }
432
+ if(env === 'mobile'){
433
+ $('.list').scroll(function(e){
434
+ if(!self.dragingStart){
435
+ self.stopLazyDrag()
436
+ }
437
+ }).addClass('noScrollBar')
438
+ $('.main-append').scroll(function(e){
439
+ if(!self.dragingStart){
440
+ self.stopLazyDrag()
441
+ }
442
+ }).addClass('noScrollBar')
443
+ }
444
+
445
+
406
446
  self.bindNextPrevEvent('next')
407
447
  self.bindNextPrevEvent('prev')
408
448
  },
449
+ startLazyDrag(){
450
+ this.dragingStart = true
451
+ $('.list').css({
452
+ overflow:'hidden'
453
+ })
454
+ $('.main-append').css({
455
+ overflow:'hidden'
456
+ })
457
+ },
458
+ stopLazyDrag(){
459
+ this.dragingStart = false
460
+ this.lazyDragTimer && clearTimeout(this.lazyDragTimer)
461
+ this.lazyDragTimer = null
462
+ $('.list').css({
463
+ overflow:'auto'
464
+ })
465
+ $('.main-append').css({
466
+ overflow:'auto'
467
+ })
468
+ },
409
469
  //回显答案
410
470
  setAnswerDo(){
411
471
  let self = this
@@ -422,8 +482,15 @@ export default {
422
482
  //找到一个删掉一个,要不会有问题
423
483
  listItemIds.splice(idx,1)
424
484
  let listItemDom = $(this.$el).find('.question-classify .list-item').eq(idx)
485
+ let itemBgCss = `${listItemDom.get(0).style.background}`
486
+ let itemColorCss = `${listItemDom.get(0).style.color}`
487
+ let textDisplayCss = listItemDom.find('.list-item-text').get(0).style.display
425
488
  let attrIdx = listItemDom.attr('idx')
426
- let appendItem = $(`<div class="append-item" idx="${attrIdx}" style="${self.listItemBgCss}"><div class="list-item-text">${listItemDom.find('.list-item-text').text()}</div></div>`)
489
+ let appendItem = $(`<div class="append-item" idx="${attrIdx}"><div class="list-item-text" style="${textDisplayCss?'display:'+textDisplayCss:''}">${listItemDom.find('.list-item-text').text()}</div></div>`)
490
+ appendItem.css({
491
+ background:itemBgCss,
492
+ color:itemColorCss
493
+ })
427
494
  self.bindDragDomEvent(appendItem,'back')
428
495
  $(this.$el).find('.main-append').eq(index).append(appendItem)
429
496
  listItemDom.remove()
@@ -180,40 +180,40 @@ export default defineComponent({
180
180
  },
181
181
  "small_type_option_list": [
182
182
  {
183
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
183
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/ed57c2b33d9f14deccb5f0e557aac8denvl359dqel2ftdsh.png-quality_80",
184
184
  "content_type": 3,
185
185
  "file_type": 1,
186
- "name": "sss",
187
- "id": 3489,
186
+ "name": "微信截图_20230630121121",
187
+ "id": 3473,
188
188
  "thumbnail_url": "",
189
- "option_content": "哈哈"
189
+ "option_content": "选项1"
190
190
  },
191
191
  {
192
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
192
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
193
193
  "content_type": 3,
194
194
  "file_type": 1,
195
- "name": "sss",
196
- "id": 3489,
195
+ "name": "微信截图_20230307122255",
196
+ "id": 3466,
197
197
  "thumbnail_url": "",
198
- "option_content": "呵呵"
198
+ "option_content": "选项2"
199
199
  },
200
200
  {
201
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
201
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/82cc10f675b7c5b81142bdf927f1d962z75x1g88ef85n7fq.png-quality_80",
202
202
  "content_type": 3,
203
203
  "file_type": 1,
204
- "name": "sss",
205
- "id": 3489,
204
+ "name": "编组 14备份",
205
+ "id": 3481,
206
206
  "thumbnail_url": "",
207
- "option_content": "哈哈"
207
+ "option_content": "选项1"
208
208
  },
209
209
  {
210
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
210
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/ac5e72352acd82a8d17b58977953ec97y57cnn66qddl115d.png-quality_80",
211
211
  "content_type": 3,
212
212
  "file_type": 1,
213
- "name": "sss",
214
- "id": 3489,
213
+ "name": "微信截图_20230307122245",
214
+ "id": 3467,
215
215
  "thumbnail_url": "",
216
- "option_content": "呵呵"
216
+ "option_content": "选项2"
217
217
  }
218
218
  ],
219
219
  "big_type_option_list": [
@@ -270,9 +270,10 @@ export default defineComponent({
270
270
  "exam_options_data": [
271
271
  {
272
272
  "data": {
273
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
273
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/ed57c2b33d9f14deccb5f0e557aac8denvl359dqel2ftdsh.png-quality_80",
274
274
  "content_type": 3,
275
275
  "file_type": 1,
276
+ "font_color": "#F9FF99",
276
277
  "name": "sss",
277
278
  "id": 3489,
278
279
  "thumbnail_url": "",
@@ -282,21 +283,23 @@ export default defineComponent({
282
283
  },
283
284
  {
284
285
  "data": {
285
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
286
- "content_type": 3,
286
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
287
+ "content_type": 2,
287
288
  "file_type": 1,
289
+ "font_color": "#F9FF99",
288
290
  "name": "sss",
289
291
  "id": 3489,
290
292
  "thumbnail_url": "",
291
- "option_content": "哈哈"
293
+ "option_content": "哈哈2222"
292
294
  },
293
295
  "index": 1
294
296
  },
295
297
  {
296
298
  "data": {
297
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
299
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/ed57c2b33d9f14deccb5f0e557aac8denvl359dqel2ftdsh.png-quality_80",
298
300
  "content_type": 3,
299
301
  "file_type": 1,
302
+ "font_color": "#F9FF99",
300
303
  "name": "sss",
301
304
  "id": 3489,
302
305
  "thumbnail_url": "",
@@ -306,15 +309,94 @@ export default defineComponent({
306
309
  },
307
310
  {
308
311
  "data": {
309
- "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/3629e13ac107f35a57a43f23155c6203u27fvk1q7jvlnc07.png-quality_80",
312
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
310
313
  "content_type": 3,
311
314
  "file_type": 1,
315
+ "font_color": "#F9FF99",
312
316
  "name": "sss",
313
317
  "id": 3489,
314
318
  "thumbnail_url": "",
315
319
  "option_content": "呵呵"
316
320
  },
317
321
  "index": 4
322
+ },
323
+ {
324
+ "data": {
325
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
326
+ "content_type": 3,
327
+ "file_type": 1,
328
+ "font_color": "#F9FF99",
329
+ "name": "sss",
330
+ "id": 3489,
331
+ "thumbnail_url": "",
332
+ "option_content": "呵呵222"
333
+ },
334
+ "index": 5
335
+ },
336
+ {
337
+ "data": {
338
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
339
+ "content_type": 3,
340
+ "file_type": 1,
341
+ "font_color": "#F9FF99",
342
+ "name": "sss",
343
+ "id": 3489,
344
+ "thumbnail_url": "",
345
+ "option_content": "呵呵222"
346
+ },
347
+ "index": 6
348
+ },
349
+ {
350
+ "data": {
351
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
352
+ "content_type": 3,
353
+ "file_type": 1,
354
+ "font_color": "#F9FF99",
355
+ "name": "sss",
356
+ "id": 3489,
357
+ "thumbnail_url": "",
358
+ "option_content": "呵呵222"
359
+ },
360
+ "index": 7
361
+ },
362
+ {
363
+ "data": {
364
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
365
+ "content_type": 3,
366
+ "file_type": 1,
367
+ "font_color": "#F9FF99",
368
+ "name": "sss",
369
+ "id": 3489,
370
+ "thumbnail_url": "",
371
+ "option_content": "呵呵222"
372
+ },
373
+ "index": 8
374
+ },
375
+ {
376
+ "data": {
377
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
378
+ "content_type": 3,
379
+ "file_type": 1,
380
+ "font_color": "#F9FF99",
381
+ "name": "sss",
382
+ "id": 3489,
383
+ "thumbnail_url": "",
384
+ "option_content": "呵呵222"
385
+ },
386
+ "index": 9
387
+ },
388
+ {
389
+ "data": {
390
+ "file_url": "https://dev-resource.thedeer.cn/pre/resource-media/image/4c24fc0c43aea33bd9e6cb224dfd3648jhzavaqzp21mvtvt.png-quality_80",
391
+ "content_type": 3,
392
+ "file_type": 1,
393
+ "font_color": "#F9FF99",
394
+ "name": "sss",
395
+ "id": 3489,
396
+ "thumbnail_url": "",
397
+ "option_content": "呵呵222"
398
+ },
399
+ "index": 10
318
400
  }
319
401
  ],
320
402
  "draw_img": null,
@@ -361,7 +443,7 @@ export default defineComponent({
361
443
  {
362
444
  "big_type_index": 2,
363
445
  "small_type_index_list": [
364
- 3
446
+ // 3
365
447
  ]
366
448
  }
367
449
  ],
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Created by Allen Liu on 2023/8/22.
3
+ */
4
+ module.exports = {
5
+ buildLibNeedOpDependenciesKeys:['vue','vue-router','vuex','vuex-composition-helpers']
6
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Created by Allen Liu on 2023/8/22.
3
+ */
4
+ let fs = require('fs')
5
+ let path = require('path')
6
+ let minxins = require('./mixins')
7
+ let needOpKeyArr = minxins.buildLibNeedOpDependenciesKeys
8
+ let pblishJsonStr = fs.readFileSync(path.resolve(__dirname,'../package.json'),'utf8')
9
+ let publishJsonStr = getOriJson(pblishJsonStr)
10
+ fs.writeFileSync(path.resolve(__dirname,'../package.json'),publishJsonStr)
11
+
12
+
13
+ function getOriJson(jsonStr){
14
+ let result = ''
15
+ let json = JSON.parse(jsonStr)
16
+ needOpKeyArr.forEach((item)=>{
17
+ json.dependencies[item] = json.devDependencies[item]
18
+ delete json.devDependencies[item]
19
+ })
20
+ result = JSON.stringify(json,null,2)
21
+ return result
22
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Created by Allen Liu on 2023/8/22.
3
+ */
4
+ let fs = require('fs')
5
+ let path = require('path')
6
+ let minxins = require('./mixins')
7
+ let needOpKeyArr = minxins.buildLibNeedOpDependenciesKeys
8
+ let oriJsonStr = fs.readFileSync(path.resolve(__dirname,'../package.json'),'utf8')
9
+ let publishJsonStr = getPublishJson(oriJsonStr)
10
+ fs.writeFileSync(path.resolve(__dirname,'../package.json'),publishJsonStr)
11
+
12
+ function getPublishJson(jsonStr){
13
+ let result = ''
14
+ let json = JSON.parse(jsonStr)
15
+ needOpKeyArr.forEach((item)=>{
16
+ json.devDependencies[item] = json.dependencies[item]
17
+ delete json.dependencies[item]
18
+ })
19
+ result = JSON.stringify(json,null,2)
20
+ return result
21
+ }