tts
This commit is contained in:
parent
f02bdbcb85
commit
4485912f7e
|
|
@ -58,12 +58,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th
|
|||
// 为表格2绑定事件
|
||||
Table.api.bindevent(table2);
|
||||
|
||||
// ✅ 延迟初始化 citypicker 避免 dropdown 位置异常
|
||||
var $city = $('#select_city');
|
||||
|
||||
// 延迟初始化,确保元素可见
|
||||
setTimeout(function () {
|
||||
var $city = $('#select_city');
|
||||
if (!$city.data('citypicker')) {
|
||||
$city.citypicker();
|
||||
if ($city.data('citypicker')) {
|
||||
$city.citypicker('destroy');
|
||||
}
|
||||
$city.citypicker();
|
||||
|
||||
$city.off("cp:updated").on("cp:updated", function () {
|
||||
var citypicker = $(this).data("citypicker");
|
||||
|
|
@ -71,15 +73,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th
|
|||
$("#select_area_id").val(code);
|
||||
});
|
||||
|
||||
}, 100);
|
||||
// 手动调整弹层位置,补偿插件可能没有正确计算
|
||||
var $dropdown = $('.city-picker-dropdown');
|
||||
var offset = $city.offset();
|
||||
$dropdown.css({
|
||||
top: offset.top + $city.outerHeight(),
|
||||
left: offset.left
|
||||
});
|
||||
|
||||
// ✅ 清理掉异常 dropdown(保险)
|
||||
$('.city-picker-dropdown').each(function () {
|
||||
var offset = $(this).offset();
|
||||
if (offset.top === 0 && offset.left === 0) {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}, 200);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user