This commit is contained in:
xman 2025-07-08 10:03:25 +08:00
parent 9e28431346
commit ca630c0c6d
2 changed files with 16 additions and 14 deletions

View File

@ -11,7 +11,9 @@
z-index: 9999;
max-height: 400px;
overflow: auto;
display: none;
background: #fff;
border: 1px solid #ccc;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
</style>

View File

@ -58,22 +58,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th
// 为表格2绑定事件
Table.api.bindevent(table2);
// ✅ 初始化 citypicker只初始化一次
// ✅ 延迟初始化 citypicker 避免 dropdown 位置异常
setTimeout(function () {
var $city = $('#select_city');
if (!$city.data('citypicker')) {
$city.citypicker();
}
// ✅ 绑定 updated 事件(也只绑定一次)
$city.off("cp:updated").on("cp:updated", function () {
var citypicker = $(this).data("citypicker");
var code = citypicker.getCode("district") || citypicker.getCode("city") || citypicker.getCode("province");
$("#select_area_id").val(code);
});
// ✅ 删除错误 dropdown
}, 100);
// ✅ 清理掉异常 dropdown保险
$('.city-picker-dropdown').each(function () {
var offset = $(this).offset();
if (offset.top === 0 && offset.left === 0) {