imeik-imui 2.0.2 → 2.0.4

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.
Binary file
@@ -347,7 +347,11 @@ export default {
347
347
  if (params.name) {
348
348
  const dicValues = queryParams.dicValues
349
349
  this.options = resData.filter(item => {
350
- return item[this.attrLabel].includes(params.name) || dicValues.includes(item[this.attrValue])
350
+ if (this.isMultiple) {
351
+ return item[this.attrLabel].includes(params.name) || dicValues.includes(item[this.attrValue])
352
+ } else {
353
+ return item[this.attrLabel].includes(params.name)
354
+ }
351
355
  })
352
356
  } else {
353
357
  this.options = resData
@@ -13,7 +13,19 @@
13
13
  :before-upload="onBeforeUpload"
14
14
  v-on="listeners"
15
15
  >
16
- <i class="el-icon-plus"></i>
16
+ <div v-if="uploadedImageList.length && isView" class="imageHolder" @click.stop="stopClick">
17
+ <div v-for="(item, index) in uploadedImageList" :key="index">
18
+ <el-image style="width: 146px; height: 146px" :src="item" fit="cover"></el-image>
19
+ <div class="operate">
20
+ <i class="el-icon-view" @click="showImgView({url: item})"></i>
21
+ <i v-if="!attrs.disabled && !isView" class="el-icon-delete" @click.stop="handleRemove"></i>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <i v-else class="el-icon-plus"></i>
26
+ <div v-if="!attrs.disabled && !isView" slot="tip" class="el-upload__tip">
27
+ {{ attrs.tipText || '请上传.png,.jpg,.jpeg,.gif,.svg格式文件,且不超过20M' }}
28
+ </div>
17
29
  </el-upload>
18
30
  </template>
19
31
  <script>
@@ -63,6 +75,9 @@ export default {
63
75
  } else {
64
76
  return false
65
77
  }
78
+ },
79
+ isView() {
80
+ return this.attrs.isView
66
81
  }
67
82
  },
68
83
  watch: {
@@ -83,7 +98,7 @@ export default {
83
98
  if (res.response) {
84
99
  file = res.response
85
100
  }
86
- const index = this.uploadedImageList.findIndex(i => i === file.url)
101
+ const index = this.uploadedImageList.findIndex((i) => i === file.url)
87
102
  this.$viewerApi({
88
103
  options: {
89
104
  navbar: false,
@@ -108,7 +123,7 @@ export default {
108
123
  },
109
124
 
110
125
  handleRemove(file) {
111
- const index = this.uploadedImageList.findIndex(i => i === file.url)
126
+ const index = this.uploadedImageList.findIndex((i) => i === file.url)
112
127
  this.uploadedImageList.splice(index, 1)
113
128
  this.onUpdate()
114
129
  },
@@ -161,14 +176,14 @@ export default {
161
176
  cursor: pointer;
162
177
 
163
178
  i {
164
- padding:4px;
179
+ padding: 4px;
165
180
  color: white;
166
181
  font-size: 24px;
167
182
  }
168
183
  }
169
184
 
170
185
  &:hover {
171
- .operate{
186
+ .operate {
172
187
  display: block;
173
188
  background: rgba(0, 0, 0, 0.5);
174
189
  opacity: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imeik-imui",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "ch_name": "imeik基础UI组件库-PC端",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve --mode dev",