eoss-mobiles 0.2.62 → 0.2.63
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/lib/eoss-mobile.common.js +25 -13
- package/lib/grid.js +19 -7
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/main.vue +88 -80
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="em-grid" @click="showHide = false">
|
|
3
|
-
<van-grid
|
|
3
|
+
<van-grid
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
:border="border"
|
|
7
|
+
:column-num="columnNum"
|
|
8
|
+
>
|
|
4
9
|
<draggable
|
|
5
10
|
v-if="draggable"
|
|
6
11
|
v-model="newData"
|
|
@@ -102,7 +107,7 @@
|
|
|
102
107
|
>
|
|
103
108
|
<!-- @mousedown.stop="onMouseDown(item)"
|
|
104
109
|
@mouseup.stop="onMouseUp($event, item)" -->
|
|
105
|
-
|
|
110
|
+
<!-- <div
|
|
106
111
|
:style="`display: inline-block;width:${100 / columnNum}%`"
|
|
107
112
|
class="van-grid-item"
|
|
108
113
|
:class="{'border-none':!border}"
|
|
@@ -114,74 +119,73 @@
|
|
|
114
119
|
<div
|
|
115
120
|
class="van-grid-item__content van-grid-item__content--center van-hairline"
|
|
116
121
|
> -->
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
<i
|
|
123
|
+
class="van-icon van-grid-item__icon"
|
|
124
|
+
:class="
|
|
125
|
+
item.icon.startsWith('http') && item.icon.indexOf('/') != -1
|
|
126
|
+
? ''
|
|
127
|
+
: `van-icon-${item.icon}`
|
|
128
|
+
"
|
|
129
|
+
:style="{
|
|
130
|
+
fontSize:
|
|
131
|
+
item.iconSize || $attrs['icon-size']
|
|
132
|
+
? item.iconSize || $attrs['icon-size']
|
|
133
|
+
: ''
|
|
134
|
+
}"
|
|
135
|
+
>
|
|
136
|
+
<em-image
|
|
137
|
+
v-if="item.icon.startsWith('http') || item.icon.indexOf('/') != -1"
|
|
138
|
+
class="van-icon__image"
|
|
139
|
+
:src="item.icon"
|
|
140
|
+
:error-icon="errorIcon"
|
|
124
141
|
:style="{
|
|
125
|
-
|
|
142
|
+
width:
|
|
143
|
+
item.iconSize || $attrs['icon-size']
|
|
144
|
+
? item.iconSize || $attrs['icon-size']
|
|
145
|
+
: '',
|
|
146
|
+
height:
|
|
126
147
|
item.iconSize || $attrs['icon-size']
|
|
127
148
|
? item.iconSize || $attrs['icon-size']
|
|
128
149
|
: ''
|
|
129
150
|
}"
|
|
130
|
-
>
|
|
131
|
-
<img
|
|
132
|
-
v-if="
|
|
133
|
-
item.icon.startsWith('http') || item.icon.indexOf('/') != -1
|
|
134
|
-
"
|
|
135
|
-
class="van-icon__image"
|
|
136
|
-
:src="item.icon"
|
|
137
|
-
:style="{
|
|
138
|
-
width:
|
|
139
|
-
item.iconSize || $attrs['icon-size']
|
|
140
|
-
? item.iconSize || $attrs['icon-size']
|
|
141
|
-
: '',
|
|
142
|
-
height:
|
|
143
|
-
item.iconSize || $attrs['icon-size']
|
|
144
|
-
? item.iconSize || $attrs['icon-size']
|
|
145
|
-
: ''
|
|
146
|
-
}"
|
|
147
|
-
/>
|
|
148
|
-
<div
|
|
149
|
-
v-show="item.dot"
|
|
150
|
-
:style="{ background: item.dotColor || '' }"
|
|
151
|
-
class="van-info van-info--dot"
|
|
152
|
-
></div>
|
|
153
|
-
<div
|
|
154
|
-
class="van-info"
|
|
155
|
-
:style="{ background: badgeColor || '' }"
|
|
156
|
-
v-show="item.badge"
|
|
157
|
-
>
|
|
158
|
-
{{
|
|
159
|
-
maxBadge &&
|
|
160
|
-
!isNaN(item.badge) &&
|
|
161
|
-
Number(maxBadge) < Number(item.badge)
|
|
162
|
-
? maxBadge + '+'
|
|
163
|
-
: item.badge
|
|
164
|
-
}}
|
|
165
|
-
</div>
|
|
166
|
-
</i>
|
|
167
|
-
<em-popover
|
|
168
|
-
v-model="item.showPopover"
|
|
169
|
-
:placement="placement"
|
|
170
|
-
@select="popoverSelect($event,item)"
|
|
171
|
-
:theme="popoverTheme"
|
|
172
|
-
:actions="popoverActions"
|
|
173
|
-
></em-popover>
|
|
174
|
-
<span class="van-grid-item__text">{{ item.text }}</span>
|
|
175
|
-
<van-icon
|
|
176
|
-
v-if="showHide && item.menuType != 'add'"
|
|
177
|
-
@click.stop="handleHide(item)"
|
|
178
|
-
name="clear"
|
|
179
|
-
size="20px"
|
|
180
|
-
class="em-grid-del"
|
|
181
151
|
/>
|
|
182
|
-
<div
|
|
183
|
-
|
|
152
|
+
<div
|
|
153
|
+
v-show="item.dot"
|
|
154
|
+
:style="{ background: item.dotColor || '' }"
|
|
155
|
+
class="van-info van-info--dot"
|
|
156
|
+
></div>
|
|
157
|
+
<div
|
|
158
|
+
class="van-info"
|
|
159
|
+
:style="{ background: badgeColor || '' }"
|
|
160
|
+
v-show="item.badge"
|
|
161
|
+
>
|
|
162
|
+
{{
|
|
163
|
+
maxBadge &&
|
|
164
|
+
!isNaN(item.badge) &&
|
|
165
|
+
Number(maxBadge) < Number(item.badge)
|
|
166
|
+
? maxBadge + '+'
|
|
167
|
+
: item.badge
|
|
168
|
+
}}
|
|
184
169
|
</div>
|
|
170
|
+
</i>
|
|
171
|
+
<em-popover
|
|
172
|
+
v-model="item.showPopover"
|
|
173
|
+
:placement="placement"
|
|
174
|
+
@select="popoverSelect($event, item)"
|
|
175
|
+
:theme="popoverTheme"
|
|
176
|
+
:actions="popoverActions"
|
|
177
|
+
></em-popover>
|
|
178
|
+
<span class="van-grid-item__text">{{ item.text }}</span>
|
|
179
|
+
<van-icon
|
|
180
|
+
v-if="showHide && item.menuType != 'add'"
|
|
181
|
+
@click.stop="handleHide(item)"
|
|
182
|
+
name="clear"
|
|
183
|
+
size="20px"
|
|
184
|
+
class="em-grid-del"
|
|
185
|
+
/>
|
|
186
|
+
<div v-if="item.showMenu" class="em-grid-select-box">
|
|
187
|
+
<van-icon size="30px" color="#fff" name="success" />
|
|
188
|
+
</div>
|
|
185
189
|
<!-- </div>
|
|
186
190
|
</div> -->
|
|
187
191
|
</van-grid-item>
|
|
@@ -272,24 +276,28 @@ export default {
|
|
|
272
276
|
},
|
|
273
277
|
popoverActions: {
|
|
274
278
|
type: Array,
|
|
275
|
-
default: () => [{ text: '隐藏菜单',type:'hideMenu' }]
|
|
279
|
+
default: () => [{ text: '隐藏菜单', type: 'hideMenu' }]
|
|
276
280
|
},
|
|
277
281
|
isTouch: {
|
|
278
282
|
type: Boolean,
|
|
279
283
|
default: false
|
|
280
284
|
},
|
|
281
|
-
placement:{
|
|
282
|
-
type:String,
|
|
283
|
-
default:'top'
|
|
285
|
+
placement: {
|
|
286
|
+
type: String,
|
|
287
|
+
default: 'top'
|
|
288
|
+
},
|
|
289
|
+
popoverTheme: {
|
|
290
|
+
type: String,
|
|
291
|
+
default: 'dark'
|
|
284
292
|
},
|
|
285
|
-
|
|
286
|
-
type:
|
|
287
|
-
default:
|
|
293
|
+
border: {
|
|
294
|
+
type: Boolean,
|
|
295
|
+
default: true
|
|
288
296
|
},
|
|
289
|
-
|
|
290
|
-
type:
|
|
291
|
-
default:
|
|
292
|
-
}
|
|
297
|
+
errorIcon: {
|
|
298
|
+
type: String,
|
|
299
|
+
default: ''
|
|
300
|
+
}
|
|
293
301
|
},
|
|
294
302
|
data() {
|
|
295
303
|
return {
|
|
@@ -322,10 +330,10 @@ export default {
|
|
|
322
330
|
},
|
|
323
331
|
methods: {
|
|
324
332
|
popoverSelect(val, item) {
|
|
325
|
-
if(val.type == 'hideMenu'){
|
|
326
|
-
this.handleHide(item)
|
|
327
|
-
}else{
|
|
328
|
-
this.$emit('touchSelect',{action:val,data:item})
|
|
333
|
+
if (val.type == 'hideMenu') {
|
|
334
|
+
this.handleHide(item);
|
|
335
|
+
} else {
|
|
336
|
+
this.$emit('touchSelect', { action: val, data: item });
|
|
329
337
|
}
|
|
330
338
|
},
|
|
331
339
|
onMouseDown(item) {
|
|
@@ -457,8 +465,8 @@ export default {
|
|
|
457
465
|
return;
|
|
458
466
|
}
|
|
459
467
|
this.timer = setTimeout(() => {
|
|
460
|
-
|
|
461
|
-
|
|
468
|
+
this.$emit('click', val, event);
|
|
469
|
+
this.targetStop && event.stopPropagation();
|
|
462
470
|
}, 300);
|
|
463
471
|
} else {
|
|
464
472
|
this.$emit('click', val, event);
|