web-component-gallery 2.1.0 → 2.1.1
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/dist/js.umd.js +1 -1
- package/lib/amap-draw/index.jsx +22 -6
- package/lib/icon-font/index.js +1 -1
- package/lib/no-data/directive.js +2 -2
- package/lib/no-data/index.vue +9 -4
- package/lib/table/index.vue +1 -1
- package/package.json +1 -1
package/lib/amap-draw/index.jsx
CHANGED
|
@@ -53,7 +53,7 @@ const AmapDraw = {
|
|
|
53
53
|
return this.drawInfo
|
|
54
54
|
},
|
|
55
55
|
set(newValue) {
|
|
56
|
-
this.$emit('getAMapLayersInfo', newValue)
|
|
56
|
+
this.$emit('getAMapLayersInfo', this.initDrawInfo(newValue))
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
// 优化后的按钮配置
|
|
@@ -98,7 +98,7 @@ const AmapDraw = {
|
|
|
98
98
|
this.drawLimitArea && this.setDrawLimitArea()
|
|
99
99
|
},
|
|
100
100
|
destroyed() {
|
|
101
|
-
this.
|
|
101
|
+
this.handleDrawClear()
|
|
102
102
|
},
|
|
103
103
|
methods: {
|
|
104
104
|
/**
|
|
@@ -109,6 +109,21 @@ const AmapDraw = {
|
|
|
109
109
|
this.amapSatellite = new this.amapStore.AMap.TileLayer.Satellite()
|
|
110
110
|
this.amap.add(this.amapSatellite)
|
|
111
111
|
},
|
|
112
|
+
/**
|
|
113
|
+
* 根据绘制类型初始化绘制属性
|
|
114
|
+
*/
|
|
115
|
+
initDrawInfo(newVal) {
|
|
116
|
+
if (Object.keys(newVal).length) return newVal
|
|
117
|
+
|
|
118
|
+
if (this.drawType === 'point')
|
|
119
|
+
return {
|
|
120
|
+
longitude: null,
|
|
121
|
+
latitude: null,
|
|
122
|
+
address: null
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return { range: null }
|
|
126
|
+
},
|
|
112
127
|
/**
|
|
113
128
|
* 开始绘制
|
|
114
129
|
*/
|
|
@@ -172,6 +187,7 @@ const AmapDraw = {
|
|
|
172
187
|
* 保存绘制
|
|
173
188
|
*/
|
|
174
189
|
handleDrawSave() {
|
|
190
|
+
if (!this.drawLayers) return this.$message.error('请先在地图上绘制!')
|
|
175
191
|
this.assignDrawLayers(this.drawType)
|
|
176
192
|
this.buttonProps = [...this.optimizedButtonProps.draw]
|
|
177
193
|
},
|
|
@@ -284,7 +300,7 @@ const AmapDraw = {
|
|
|
284
300
|
*/
|
|
285
301
|
removeOverlay(layerItem) {
|
|
286
302
|
this.amap.remove(layerItem)
|
|
287
|
-
this.$message.error('未在区域范围内,请重新描绘!')
|
|
303
|
+
this.$message.error('未在区域范围内,请重新描绘!')
|
|
288
304
|
|
|
289
305
|
try {
|
|
290
306
|
if (Array.isArray(this.drawLayers)) {
|
|
@@ -292,10 +308,10 @@ const AmapDraw = {
|
|
|
292
308
|
if (index !== -1) {
|
|
293
309
|
this.drawLayers.splice(index, 1)
|
|
294
310
|
}
|
|
295
|
-
|
|
296
|
-
this.drawLayers = null
|
|
297
|
-
this.drawLayersInfo = {}
|
|
311
|
+
return
|
|
298
312
|
}
|
|
313
|
+
this.drawLayers = null
|
|
314
|
+
this.drawLayersInfo = {}
|
|
299
315
|
} catch (error) {
|
|
300
316
|
console.error('移除覆盖物出错:', error)
|
|
301
317
|
}
|
package/lib/icon-font/index.js
CHANGED
package/lib/no-data/directive.js
CHANGED
|
@@ -18,7 +18,7 @@ const isEmpty = value => {
|
|
|
18
18
|
|
|
19
19
|
export default function(Vue) {
|
|
20
20
|
const createNoDataInstance = (el, binding) => {
|
|
21
|
-
const modifierType = Object.keys(binding.modifiers)[0] || '
|
|
21
|
+
const modifierType = Object.keys(binding.modifiers)[0] || 'data'
|
|
22
22
|
|
|
23
23
|
const instance = new (Vue.extend(NoData))({
|
|
24
24
|
propsData: {
|
|
@@ -51,7 +51,7 @@ export default function(Vue) {
|
|
|
51
51
|
if (!el._noDataInstance) {
|
|
52
52
|
createNoDataInstance(el, binding)
|
|
53
53
|
} else {
|
|
54
|
-
const modifierType = Object.keys(binding.modifiers)[0] || '
|
|
54
|
+
const modifierType = Object.keys(binding.modifiers)[0] || 'data'
|
|
55
55
|
el._noDataInstance.text = binding.arg || '暂无数据'
|
|
56
56
|
el._noDataInstance.type = modifierType
|
|
57
57
|
}
|
package/lib/no-data/index.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
class="no-data-container"
|
|
5
5
|
>
|
|
6
6
|
<div slot="image">
|
|
7
|
-
<IconFont :type="`icon
|
|
7
|
+
<IconFont :type="`icon-noData_${type}`" />
|
|
8
8
|
</div>
|
|
9
9
|
<slot></slot>
|
|
10
10
|
</Empty>
|
|
@@ -23,10 +23,15 @@ export default {
|
|
|
23
23
|
type: String,
|
|
24
24
|
default: '暂无数据'
|
|
25
25
|
},
|
|
26
|
+
/**
|
|
27
|
+
* data 暂无数据
|
|
28
|
+
* img 暂无图片
|
|
29
|
+
* chart 暂无图表
|
|
30
|
+
**/
|
|
26
31
|
type: {
|
|
27
32
|
type: String,
|
|
28
|
-
default: '
|
|
33
|
+
default: 'data'
|
|
29
34
|
}
|
|
30
|
-
}
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
|
-
</script>
|
|
37
|
+
</script>
|
package/lib/table/index.vue
CHANGED
|
@@ -124,7 +124,7 @@ export default {
|
|
|
124
124
|
rowSelection: { selectedRowKeys: this.selectedRowKeys, onChange: this.onSelectChange },
|
|
125
125
|
locale: {
|
|
126
126
|
emptyText: <div class="WebComponentTable__List__Empty">
|
|
127
|
-
<IconFont type="icon-
|
|
127
|
+
<IconFont type="icon-noData_data" />
|
|
128
128
|
<span>暂无数据</span>
|
|
129
129
|
</div>
|
|
130
130
|
},
|