sone-ui-component-3.2.4 2.1.11 → 2.1.14

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": "sone-ui-component-3.2.4",
3
- "version": "2.1.11",
3
+ "version": "2.1.14",
4
4
  "private": false,
5
5
  "main": "lib/sone-ui.common.js",
6
6
  "files": [
@@ -85,7 +85,7 @@
85
85
  </el-popover>
86
86
  </div>
87
87
  <el-input :placeholder="placeholder" v-model="filterText" :clearable="clearable" @clear="$emit('clear', '')"></el-input>
88
- <div class="sone-tree-wrap">
88
+ <div class="sone-tree-wrap" ref="soneTreeWrap">
89
89
  <el-tree
90
90
  class="filter-tree"
91
91
  :data="handleTypeData"
@@ -137,12 +137,10 @@
137
137
  </span>
138
138
  </el-tree>
139
139
 
140
- <!-- 操作菜单 -->
141
- <!-- <div class="sone-tree-components-handleMenu-wrap"> -->
140
+ <!-- 操作菜单 -->
142
141
  <div class="sone-tree-components-handleMenu" ref="handleMenu" v-show="handleMenuFlag" >
143
142
  <slot name="handleMenu" :node="node" ></slot>
144
143
  </div>
145
- <!-- </div> -->
146
144
  </div>
147
145
 
148
146
 
@@ -253,6 +251,11 @@ export default {
253
251
  showMoreBtn:{
254
252
  type:Boolean,
255
253
  default:true
254
+ },
255
+ menuHeight:{
256
+ type:Number,
257
+ default:0,
258
+ remark:"菜单高度"
256
259
  }
257
260
  },
258
261
  data() {
@@ -273,7 +276,6 @@ export default {
273
276
  checkedData:{},
274
277
 
275
278
  node:{},
276
-
277
279
  };
278
280
  },
279
281
  watch: {
@@ -351,9 +353,21 @@ export default {
351
353
  document.removeEventListener('click',() => {})
352
354
  },
353
355
  handleContextmenu(event, data, node, self) {
356
+ console.log('self.$el.offsetTop---',self.$el.offsetTop );
357
+ console.log('this.menuHeight---',this.menuHeight );
358
+ console.log('self.$el.offsetTop + this.menuHeight---',self.$el.offsetTop + this.menuHeight);
354
359
  if ( this.type != 'handle' ) return
355
- this.$refs.handleMenu.style.top = self.$el.offsetTop - 0 + 25 + 'px'
356
- this.$refs.handleMenu.style.right = '5px'
360
+ let soneTreeWrapHeight = this.$refs.soneTreeWrap.clientHeight
361
+ console.log('soneTreeWrapHeight---',soneTreeWrapHeight);
362
+
363
+ //self.offsetTop + menuHeight >父元素高度 用向上展开的样式
364
+ if(this.menuHeight > 0 && self.$el.offsetTop + this.menuHeight > soneTreeWrapHeight){
365
+ this.$refs.handleMenu.style.top = self.$el.offsetTop - 0 - this.menuHeight + 'px'
366
+ this.$refs.handleMenu.style.right = '5px'
367
+ }else{
368
+ this.$refs.handleMenu.style.top = self.$el.offsetTop - 0 + 25 + 'px'
369
+ this.$refs.handleMenu.style.right = '5px'
370
+ }
357
371
  node.data.noMoreBtn ? this.handleMenuFlag = false : this.handleMenuFlag = true
358
372
 
359
373
  this.checkedData = node
@@ -387,7 +401,7 @@ export default {
387
401
  if (!value) return true;
388
402
  return data[this.treeProps.label].indexOf(value) !== -1||data[this.treeProps.label]===this.allowShowLabel;
389
403
  },
390
- handleNodeClick(data) {
404
+ handleNodeClick(data,node,self) {
391
405
  this.handleMenuFlag = false
392
406
  this.$emit("node-click", data);
393
407
  },
package/src/index.js CHANGED
@@ -55,7 +55,7 @@ if (typeof window !== 'undefined' && window.Vue) {
55
55
  }
56
56
 
57
57
  export default {
58
- version: '2.1.11',
58
+ version: '2.1.14',
59
59
  locale: locale.use,
60
60
  i18n: locale.i18n,
61
61
  install,