meixioacomponent 0.4.38 → 0.4.39

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": "meixioacomponent",
3
- "version": "0.4.38",
3
+ "version": "0.4.39",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -0,0 +1,6 @@
1
+ import baseNumberInput from './index.vue'
2
+
3
+ baseNumberInput.install = function (Vue) {
4
+ Vue.component(baseNumberInput.name, baseNumberInput)
5
+ }
6
+ export default baseNumberInput
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <div class="pro-number-wrap">
3
+ <el-input-number
4
+ :size="size"
5
+ ref="target"
6
+ :controls="false"
7
+ :class="{
8
+ unit: unit,
9
+ }"
10
+ :precision="precision"
11
+ v-model.number="module"
12
+ :disabled="disabled"
13
+ :maxlength="maxlength"
14
+ style="width: 100%; height: 100%;"
15
+ ></el-input-number>
16
+ <div class="number-unit" v-if="unit">
17
+ <span>{{ unit }}</span>
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ export default {
24
+ name: 'baseNumberInput',
25
+ data() {
26
+ return {}
27
+ },
28
+ props: {
29
+ value: {},
30
+ precision: {
31
+ default: 0,
32
+ },
33
+ unit: {},
34
+
35
+ disabled: {
36
+ default: false,
37
+ },
38
+
39
+ maxlength: {},
40
+
41
+ size: {},
42
+ },
43
+ computed: {
44
+ module: {
45
+ set(val) {
46
+ this.$emit('input', val)
47
+ },
48
+ get() {
49
+ return this.$props.value
50
+ },
51
+ },
52
+ },
53
+ methods: {
54
+ focus() {
55
+ this.$refs.target.focus()
56
+ },
57
+ },
58
+ }
59
+ </script>
60
+
61
+ <style lang="less" scoped>
62
+ .pro-number-wrap {
63
+ width: 100%;
64
+ display: flex;
65
+ position: relative;
66
+ justify-items: center;
67
+ &:hover {
68
+ border-color: var(--color-primary);
69
+ }
70
+ .unit {
71
+ width: calc(100%);
72
+ border-radius: inherit;
73
+ /deep/ input {
74
+ padding-right: 34px !important;
75
+ }
76
+ }
77
+
78
+ .number-unit {
79
+ width: 28px;
80
+ height: 28px;
81
+ right: 2px;
82
+ top: 50%;
83
+ transform: translateY(-50%);
84
+ text-align: center;
85
+ line-height: 28px;
86
+ position: absolute;
87
+ background: var(--color-gray-d);
88
+ span {
89
+ color: var(--font-color-d);
90
+ font-size: var(--font-size-s);
91
+ font-weight: var(--font-weight-g);
92
+ }
93
+ }
94
+ }
95
+ </style>
@@ -37,6 +37,7 @@ import baseTreeSelect from './base/baseTreeSelect'
37
37
  import baseUploadTemplate from './base/baseUploadTemplate'
38
38
  import VueCropper from 'vue-cropper'
39
39
  import baseList from './base/baseList'
40
+ import baseNumberInput from './base/baseNumberInput'
40
41
  // js 文件相关
41
42
  import Theme from '../config/theme/theme'
42
43
  import DynamicMount from './dynamicmount/index.js'
@@ -89,7 +90,8 @@ const meixicomponents = [
89
90
  basePopoverButton,
90
91
  baseTreeSelect,
91
92
  baseUploadTemplate,
92
- baseList
93
+ baseList,
94
+ baseNumberInput
93
95
  ]
94
96
 
95
97
  const install = (Vue) => {
@@ -145,6 +147,7 @@ export default {
145
147
  basePopoverButton,
146
148
  baseTreeSelect,
147
149
  baseUploadTemplate,
150
+ baseNumberInput,
148
151
  Theme,
149
152
  SelectStore,
150
153
  useImg,
@@ -83,45 +83,28 @@
83
83
  style="width: 100%; height: 100%;"
84
84
  ></el-input>
85
85
  <!-- 数字类型无小数 -->
86
- <div class="pro-number-wrap" v-else-if="config.type == 'number'">
87
- <el-input-number
88
- ref="target"
89
- :size="size"
90
- :class="{
91
- unit: config.unit,
92
- }"
93
- :controls="false"
94
- v-model.number="module"
95
- :disabled="isDisabled"
96
- :maxlength="config.maxlength"
97
- style="width: 100%; height: 100%;"
98
- ></el-input-number>
99
-
100
- <div class="number-unit" v-if="config.unit">
101
- <span>{{ config.unit }}</span>
102
- </div>
103
- </div>
86
+ <BaseNumberInput
87
+ v-else-if="config.type == 'number'"
88
+ ref="target"
89
+ :size="size"
90
+ v-model="module"
91
+ :unit="config.unit"
92
+ :disabled="isDisabled"
93
+ :maxlength="config.maxlength"
94
+ ></BaseNumberInput>
104
95
 
105
96
  <!--数字类型两位小数 -->
106
97
 
107
- <div class="pro-number-wrap" v-else-if="config.type == 'number2'">
108
- <el-input-number
109
- :size="size"
110
- ref="target"
111
- :precision="2"
112
- :controls="false"
113
- :class="{
114
- unit: config.unit,
115
- }"
116
- v-model.number="module"
117
- :disabled="isDisabled"
118
- :maxlength="config.maxlength"
119
- style="width: 100%; height: 100%;"
120
- ></el-input-number>
121
- <div class="number-unit" v-if="config.unit">
122
- <span>{{ config.unit }}</span>
123
- </div>
124
- </div>
98
+ <BaseNumberInput
99
+ v-else-if="config.type == 'number2'"
100
+ ref="target"
101
+ :size="size"
102
+ v-model="module"
103
+ :precision="2"
104
+ :unit="config.unit"
105
+ :disabled="isDisabled"
106
+ :maxlength="config.maxlength"
107
+ ></BaseNumberInput>
125
108
 
126
109
  <!-- select选择器 -->
127
110
  <el-select
@@ -240,6 +223,7 @@
240
223
  <script>
241
224
  //
242
225
  import componentConfig from '../../../config/componentConfig'
226
+ import BaseNumberInput from '../../base/baseNumberInput/index.vue'
243
227
  export default {
244
228
  data() {
245
229
  return {
@@ -270,7 +254,6 @@ export default {
270
254
  config: {
271
255
  type: Object,
272
256
  },
273
-
274
257
  form: {
275
258
  type: Boolean,
276
259
  default: false,
@@ -279,19 +262,15 @@ export default {
279
262
  type: String,
280
263
  default: `right`,
281
264
  },
282
-
283
265
  value: {},
284
-
285
266
  size: {
286
267
  type: String,
287
268
  default: 'small',
288
269
  },
289
-
290
270
  width: {
291
271
  type: String,
292
272
  },
293
273
  },
294
-
295
274
  computed: {
296
275
  isDisabled() {
297
276
  const { config, disabled } = this.$props
@@ -306,15 +285,12 @@ export default {
306
285
  selectStore() {
307
286
  return componentConfig.selectStore.getStore(this.$props.config.useStore)
308
287
  },
309
-
310
288
  selectData() {
311
289
  return this.selectStore.getData()
312
290
  },
313
-
314
291
  selectConfig() {
315
292
  return this.selectStore.getConfig()
316
293
  },
317
-
318
294
  spContentType() {
319
295
  let configType = this.$props.config.type
320
296
  if (
@@ -327,24 +303,19 @@ export default {
327
303
  }
328
304
  return false
329
305
  },
330
-
331
306
  typeOftemplate() {
332
307
  const { type } = this.$props.config
333
-
334
308
  if (type == 'template' || type == 'area') {
335
309
  return true
336
310
  }
337
-
338
311
  return false
339
312
  },
340
-
341
313
  contentValue() {
342
314
  let type = this.$props.config.type
343
315
  switch (type) {
344
316
  case 'input':
345
317
  case 'textarea':
346
318
  return this.module
347
-
348
319
  case 'select':
349
320
  let list = this.selectData
350
321
  const selectConfig = this.selectConfig
@@ -354,7 +325,6 @@ export default {
354
325
  let index = list.findIndex((item) => {
355
326
  return item[`${selectConfig.value}`] == this.module
356
327
  })
357
-
358
328
  return list[index][`${selectConfig.label}`]
359
329
  } else {
360
330
  return '暂无数据'
@@ -365,7 +335,6 @@ export default {
365
335
  let index = list.findIndex((citem) => {
366
336
  return citem[`${selectConfig.value}`] == item
367
337
  })
368
-
369
338
  text += text
370
339
  ? ` / ${list[index][`${selectConfig.label}`]}`
371
340
  : list[index][`${selectConfig.label}`]
@@ -376,7 +345,6 @@ export default {
376
345
  this.loadSelectData()
377
346
  return this.$props.config.value
378
347
  }
379
-
380
348
  // case "time":
381
349
  // if (this.module) {
382
350
  // let config = this.$props.config;
@@ -385,12 +353,10 @@ export default {
385
353
  // } else {
386
354
  // return "暂无时间";
387
355
  // }
388
-
389
356
  default:
390
357
  return this.module
391
358
  }
392
359
  },
393
-
394
360
  datePickPlace() {
395
361
  const { datePickPlace } = this.$props.config
396
362
  if (!datePickPlace || datePickPlace.length < 2) {
@@ -398,21 +364,17 @@ export default {
398
364
  }
399
365
  return datePickPlace
400
366
  },
401
-
402
367
  type() {
403
368
  return this.$props.config.type
404
369
  },
405
-
406
370
  checkMax() {
407
371
  let max = this.$props.config.max
408
372
  return max ? max : this.$props.config.list.length
409
373
  },
410
-
411
374
  checkMin() {
412
375
  let min = this.$props.config.min
413
376
  return min < 0 || min == undefined || min == null ? 0 : min
414
377
  },
415
-
416
378
  isDatePick() {
417
379
  return (
418
380
  this.type == 'time' ||
@@ -420,7 +382,6 @@ export default {
420
382
  this.type == 'daterange'
421
383
  )
422
384
  },
423
-
424
385
  module: {
425
386
  get() {
426
387
  let type = this.$props.config.type
@@ -429,7 +390,6 @@ export default {
429
390
  this.loadSelectData()
430
391
  }
431
392
  }
432
-
433
393
  return this.$props.value
434
394
  },
435
395
  set(val) {
@@ -505,7 +465,6 @@ export default {
505
465
  type: item.type,
506
466
  result: item.fn(val),
507
467
  }
508
-
509
468
  console.log(val)
510
469
  this.$emit('disableWatcherResult', obj)
511
470
  })
@@ -516,6 +475,7 @@ export default {
516
475
  this.init()
517
476
  },
518
477
  },
478
+ components: { BaseNumberInput },
519
479
  }
520
480
  </script>
521
481
 
@@ -675,36 +635,4 @@ export default {
675
635
  min-height: 24px;
676
636
  }
677
637
  }
678
- .pro-number-wrap {
679
- width: 100%;
680
- display: flex;
681
- position: relative;
682
- justify-items: center;
683
- &:hover {
684
- border-color: var(--color-primary);
685
- }
686
- .unit {
687
- width: calc(100%);
688
- border-radius: inherit;
689
- /deep/ input {
690
- padding-right: 34px !important;
691
- }
692
- }
693
-
694
- .number-unit {
695
- width: 28px;
696
- height: 28px;
697
- right: 2px;
698
- top: 50%;
699
- transform: translateY(-50%);
700
- text-align: center;
701
- line-height: 28px;
702
- position: absolute;
703
- background: var(--color-gray-d);
704
- span {
705
- font-size: var(--font-color-d);
706
- font-weight: var(--font-weight-g);
707
- }
708
- }
709
- }
710
638
  </style>
@@ -558,9 +558,7 @@ export default {
558
558
  <template v-slot:formslot-test1="data">
559
559
  <el-input v-model="data.scope[0].value"></el-input>
560
560
  </template>
561
- <template v-slot:formslot-test3="data">
562
- <el-input v-model="data.scope[3].value"></el-input>
563
- </template>
561
+
564
562
  <!-- <template slot="formWrap-test2">
565
563
  <div style="width: 100%; height: 100px; background: red;"></div>
566
564
  </template> -->
@@ -612,7 +610,8 @@ export default {
612
610
  },
613
611
  {
614
612
  key: 'test3',
615
- type: 'template',
613
+ type: 'number2',
614
+ unit: '元',
616
615
 
617
616
  disabled: false,
618
617
  value: 17490,