meixioacomponent 0.3.48 → 0.3.49

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.3.48",
3
+ "version": "0.3.49",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -141,15 +141,22 @@ export default {
141
141
  .event {
142
142
  cursor: pointer;
143
143
  &:hover {
144
- // background: var(--hover-gray);
144
+ background: var(--hover-gray);
145
145
  i {
146
- color: var(--color-primary);
146
+ color: var(--color-primary) !important;
147
147
  }
148
148
  }
149
149
  }
150
150
  .plain {
151
151
  width: auto;
152
152
  height: auto;
153
+ cursor: pointer;
154
+ &:hover {
155
+ background: transparent !important;
156
+ i {
157
+ color: var(--icon-color-d) !important;
158
+ }
159
+ }
153
160
  }
154
161
  .disable {
155
162
  cursor: not-allowed;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="base-img-wrap" :class="[shape]">
2
+ <div class="base-img-wrap" :class="[shape]" :style="baseImgWrap">
3
3
  <img
4
4
  alt=""
5
5
  :src="src"
@@ -63,6 +63,14 @@ export default {
63
63
  type: String,
64
64
  default: 'rect',
65
65
  },
66
+ size: {
67
+ type: Array,
68
+ default: () => ['100%', '100%'],
69
+ },
70
+ radius: {
71
+ type: Number,
72
+ default: 0,
73
+ },
66
74
  },
67
75
  computed: {
68
76
  imgStyle() {
@@ -79,6 +87,15 @@ export default {
79
87
  this.isError = true
80
88
  return false
81
89
  },
90
+
91
+ baseImgWrap() {
92
+ const { size, radius } = this.$props
93
+ return {
94
+ borderRadius: `${radius}px`,
95
+ width: typeof size[0] == 'number' ? `${size[0]}px` : size[0],
96
+ height: typeof size[1] == 'number' ? `${size[1]}px` : size[1],
97
+ }
98
+ },
82
99
  },
83
100
  methods: {
84
101
  init() {
@@ -4,6 +4,7 @@
4
4
  <baseUploadItemVue
5
5
  :key="index"
6
6
  :type="`img`"
7
+ :size="outline"
7
8
  :isGroup="true"
8
9
  :uploadItem="item"
9
10
  v-for="(item, index) in module"
@@ -14,13 +15,17 @@
14
15
  v-show="!isMax"
15
16
  ref="itemUpload"
16
17
  :isGroup="true"
18
+ :size="outline"
19
+ :fileSize="fileSize"
17
20
  :fileType="fileType"
18
21
  :uploadType="`multiple`"
19
22
  @inputChange="inputChange"
20
23
  ></baseUploadItemVue>
21
24
  </div>
22
25
  <div class="base-upload-footer">
23
- <span>{{ textNotic }}(最大{{ max }}张)</span>
26
+ <span>
27
+ {{ textNotic }}(最多{{ max }}张),文件大小限制{{ fileSize }}MB
28
+ </span>
24
29
  </div>
25
30
  </div>
26
31
  </template>
@@ -65,6 +70,12 @@ export default {
65
70
  type: String,
66
71
  default: 'img',
67
72
  },
73
+ outline: {
74
+ type: Array,
75
+ },
76
+ fileSize: {
77
+ default: 99,
78
+ },
68
79
  },
69
80
  computed: {
70
81
  module: {
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <div
3
- class="base-upload-item-wrap"
3
+ :style="wrapStyle"
4
4
  :class="[`${shape}`]"
5
5
  v-on:paste="onPasteFile"
6
+ class="base-upload-item-wrap"
6
7
  >
7
8
  <div class="type-upload" v-if="type == 'upload'">
8
9
  <input
@@ -113,6 +114,14 @@ export default {
113
114
  isGroup: {
114
115
  default: false,
115
116
  },
117
+
118
+ size: {
119
+ type: Array,
120
+ },
121
+
122
+ fileSize: {
123
+ default: 99,
124
+ },
116
125
  },
117
126
  computed: {
118
127
  module: {
@@ -156,6 +165,39 @@ export default {
156
165
  props.uploadType == 'single'
157
166
  )
158
167
  },
168
+
169
+ wrapStyle() {
170
+ const { size, shape } = this.$props
171
+ if (size) {
172
+ return {
173
+ width: `${size[0]}px`,
174
+ height: `${size[1]}px`,
175
+ }
176
+ } else {
177
+ switch (shape) {
178
+ case 'rect':
179
+ return {
180
+ width: '140px',
181
+ height: '80px',
182
+ }
183
+ case 'cir':
184
+ return {
185
+ width: '80px',
186
+ height: '80px',
187
+ }
188
+ case 'square':
189
+ return {
190
+ width: '100px',
191
+ height: '100px',
192
+ }
193
+ case 'pro':
194
+ return {
195
+ width: '100%',
196
+ height: '100%',
197
+ }
198
+ }
199
+ }
200
+ },
159
201
  },
160
202
  methods: {
161
203
  clickFile() {
@@ -166,13 +208,18 @@ export default {
166
208
 
167
209
  async returnFiles(files) {
168
210
  let list = []
211
+ const { fileSize } = this.$props
169
212
  for (let i = 0; i < files.length; i++) {
170
- let obj = {
171
- url: null,
172
- process: 0,
173
- file: files[i],
213
+ if (files[i].size < fileSize * 1048576) {
214
+ let obj = {
215
+ url: null,
216
+ process: 0,
217
+ file: files[i],
218
+ }
219
+ list.push(obj)
220
+ } else {
221
+ this.$message.error('文件大小超过限制')
174
222
  }
175
- list.push(obj)
176
223
  }
177
224
  return list
178
225
  },
@@ -180,7 +227,10 @@ export default {
180
227
  async valueChange(e) {
181
228
  let files = e.target.files
182
229
  let list = await this.returnFiles(files)
183
- this.emitEvent(list)
230
+ if (list.length > 0) {
231
+ this.emitEvent(list)
232
+ }
233
+
184
234
  this.$refs.inputFile.value = ''
185
235
  },
186
236
 
@@ -315,23 +365,13 @@ export default {
315
365
  }
316
366
  }
317
367
  }
318
- .rect {
319
- width: 140px;
320
- height: 80px;
321
- }
368
+
322
369
  .cir {
323
- width: 80px;
324
- height: 80px;
325
370
  overflow: hidden;
326
371
  border-radius: 50%;
327
372
  }
328
- .square {
329
- width: 100px;
330
- height: 100px;
331
- }
373
+
332
374
  .pro {
333
- width: 100%;
334
- height: 100%;
335
375
  display: flex;
336
376
  align-items: center;
337
377
  flex-flow: row nowrap;
@@ -967,5 +967,11 @@ export default {
967
967
  background-color: transparent !important;
968
968
  }
969
969
  }
970
+
971
+ /deep/ .el-table__cell {
972
+ .gutter {
973
+ border-color: transparent !important;
974
+ }
975
+ }
970
976
  }
971
977
  </style>
package/src/App.vue CHANGED
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div id="app">
3
3
  <div style="height: 100vh;">
4
- <test></test>
5
- <!-- <base-upload v-model="test"></base-upload> -->
4
+ <!-- <test></test> -->
5
+ <base-upload v-model="test"></base-upload>
6
6
  </div>
7
7
  </div>
8
8
  </template>