修改定位方式为固定定位,修正定位位置
This commit is contained in:
parent
05dc278d28
commit
e7e9ee2a65
@ -95,7 +95,7 @@ const webpackConfig = {
|
|||||||
new VueLoaderPlugin(),
|
new VueLoaderPlugin(),
|
||||||
],
|
],
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,//可以自行配置是否压缩
|
minimize: false,//可以自行配置是否压缩
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
13469
dist/static/2.js
vendored
13469
dist/static/2.js
vendored
File diff suppressed because one or more lines are too long
1126
dist/static/3.js
vendored
1126
dist/static/3.js
vendored
File diff suppressed because one or more lines are too long
120375
dist/static/docs.js
vendored
120375
dist/static/docs.js
vendored
File diff suppressed because one or more lines are too long
8
dist/xm-select.js
vendored
8
dist/xm-select.js
vendored
File diff suppressed because one or more lines are too long
9070
package-lock.json
generated
Normal file
9070
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
6638
pnpm-lock.yaml
Normal file
6638
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@ -414,7 +414,7 @@ class Framework extends Component{
|
|||||||
}else
|
}else
|
||||||
//聚焦label搜索框
|
//聚焦label搜索框
|
||||||
if(type === 'labelSearchBlur'){
|
if(type === 'labelSearchBlur'){
|
||||||
this.labelRef.blur(data);
|
this.labelRef && this.labelRef.blur(data);
|
||||||
}else
|
}else
|
||||||
//聚焦label搜索框
|
//聚焦label搜索框
|
||||||
if(type === 'labelSearch'){
|
if(type === 'labelSearch'){
|
||||||
@ -455,7 +455,9 @@ class Framework extends Component{
|
|||||||
}
|
}
|
||||||
|
|
||||||
calcPosition(){
|
calcPosition(){
|
||||||
if(this.state.show && this.props.model.type === 'fixed'){
|
if(!this.base || !this.state.show){
|
||||||
|
return {}
|
||||||
|
}
|
||||||
let rect = this.base.getBoundingClientRect();
|
let rect = this.base.getBoundingClientRect();
|
||||||
(Date.now() - this.state.time > 10) && this.setState({ time: Date.now() })
|
(Date.now() - this.state.time > 10) && this.setState({ time: Date.now() })
|
||||||
return {
|
return {
|
||||||
@ -464,7 +466,6 @@ class Framework extends Component{
|
|||||||
top: rect.y + rect.height + 4,
|
top: rect.y + rect.height + 4,
|
||||||
width: rect.width,
|
width: rect.width,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -600,6 +601,7 @@ class Framework extends Component{
|
|||||||
}
|
}
|
||||||
|
|
||||||
let rect = this.base.getBoundingClientRect();
|
let rect = this.base.getBoundingClientRect();
|
||||||
|
let bodyViewHeight;
|
||||||
if(direction === 'auto'){
|
if(direction === 'auto'){
|
||||||
//用于控制js获取下拉框的高度
|
//用于控制js获取下拉框的高度
|
||||||
this.bodyView.style.display = 'block';
|
this.bodyView.style.display = 'block';
|
||||||
@ -607,7 +609,7 @@ class Framework extends Component{
|
|||||||
|
|
||||||
//获取下拉元素的高度
|
//获取下拉元素的高度
|
||||||
let bodyViewRect = this.bodyView.getBoundingClientRect();
|
let bodyViewRect = this.bodyView.getBoundingClientRect();
|
||||||
let bodyViewHeight = bodyViewRect.height;
|
bodyViewHeight = bodyViewRect.height;
|
||||||
|
|
||||||
//还原控制效果
|
//还原控制效果
|
||||||
this.bodyView.style.display = '';
|
this.bodyView.style.display = '';
|
||||||
@ -619,13 +621,12 @@ class Framework extends Component{
|
|||||||
let diff = clientHeight - y - rect.height - 20;
|
let diff = clientHeight - y - rect.height - 20;
|
||||||
direction = diff > bodyViewHeight || y < diff ? 'down' : 'up';
|
direction = diff > bodyViewHeight || y < diff ? 'down' : 'up';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(direction == 'down'){
|
if(direction == 'down'){
|
||||||
this.bodyView.style.top = rect.height + 4 + 'px';
|
this.bodyView.style.top = (rect.height + 4 + rect.y )+ 'px';
|
||||||
this.bodyView.style.bottom = 'auto';
|
this.bodyView.style.bottom = 'auto';
|
||||||
}else{
|
}else{
|
||||||
this.bodyView.style.top = 'auto';
|
this.bodyView.style.top = (4 +rect.y - bodyViewHeight )+ 'px';
|
||||||
this.bodyView.style.bottom = rect.height + 4 + 'px';
|
this.bodyView.style.bottom = 'auto';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user