|
|
@@ -563,12 +563,41 @@ const query = function getQueryForm(data) {
|
|
|
|
|
|
let ul_div = $("<div class='pl-0 tooltipTarget' style='position: absolute;left: 100px;top:25px; max-height: 150px; overflow-y: scroll; border: 1px solid rgb(221, 221, 221); border-radius: 5px; text-align: center; transform: scale(0.9);z-index:1' tabindex='1'></div>");
|
|
|
let ul = $("<ul name='" + condition.name + "' class='list-group pl-0 m-0 p-0 bg-white' style='list-style-type: none;width: 150px;top:35px; z-index: 100' ></ul>");
|
|
|
+ let check = $("<input type = 'checkbox' style='z-index:101;position:fixed;top:0;right: 0;border:1px green' >");
|
|
|
+ let isMouseenterCheckBox = false;
|
|
|
|
|
|
- select_div.append(input).append(ul_div.append(ul));
|
|
|
+ select_div.append(input).append(ul_div.append(ul).append(check));
|
|
|
div.append(select).append(label).append(select_div);
|
|
|
|
|
|
fillMultipleSelectOption(ul, condition.data, condition.name);
|
|
|
|
|
|
+ check.click(function () {
|
|
|
+ _data[condition.name].value = [];
|
|
|
+ _data[condition.name].select = [];
|
|
|
+ if (check[0].checked === true){
|
|
|
+ condition.data.forEach(function (data) {
|
|
|
+ _data[condition.name].value.push(data.name);
|
|
|
+ if (_data[condition.name].select) _data[condition.name].select.push(data.name);
|
|
|
+ else _data[condition.name].select = [data.name];
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ let dom = {
|
|
|
+ name: condition.name,
|
|
|
+ type: 'select_multiple_select',
|
|
|
+ value: [],
|
|
|
+ select:[],
|
|
|
+ };
|
|
|
+ modifyData(dom);
|
|
|
+ }
|
|
|
+ redenerUl(ul);
|
|
|
+ });
|
|
|
+ check.mouseleave(()=>{
|
|
|
+ isMouseenterCheckBox = false;
|
|
|
+ });
|
|
|
+ check.mouseenter(()=>{
|
|
|
+ isMouseenterCheckBox = true;
|
|
|
+ });
|
|
|
+
|
|
|
input.bind('input propertychange', function () {
|
|
|
let value = this.value;
|
|
|
if (value === '') {
|
|
|
@@ -586,7 +615,7 @@ const query = function getQueryForm(data) {
|
|
|
|
|
|
fillMultipleSelectOption(ul, select_data, condition.name);
|
|
|
redenerUl(ul);
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
select.change(function () {
|
|
|
let dom = {
|
|
|
@@ -602,7 +631,7 @@ const query = function getQueryForm(data) {
|
|
|
})
|
|
|
input.blur(function () {
|
|
|
setTimeout(function () {
|
|
|
- if (!ul_div.is(':focus')) {
|
|
|
+ if (!ul_div.is(':focus') && !check.is(':focus')) {
|
|
|
ul_div.hide();
|
|
|
}
|
|
|
}, 100);
|
|
|
@@ -614,7 +643,9 @@ const query = function getQueryForm(data) {
|
|
|
ul_div.hide();
|
|
|
})
|
|
|
ul_div.blur(function () {
|
|
|
- ul_div.hide();
|
|
|
+ if (!isMouseenterCheckBox){
|
|
|
+ ul_div.hide();
|
|
|
+ }
|
|
|
})
|
|
|
ul_div.hide();
|
|
|
ul_div.mouseleave(function () {
|
|
|
@@ -624,10 +655,12 @@ const query = function getQueryForm(data) {
|
|
|
}
|
|
|
});
|
|
|
ul_div.mouseenter(function () {
|
|
|
- setTimeout(function () {
|
|
|
- ul_div.attr("title","移出多选区域即可自动提交");
|
|
|
- ul_div.tooltip('show');
|
|
|
- },1000);
|
|
|
+ if(_data[condition.name].value.length>0){
|
|
|
+ setTimeout(()=> {
|
|
|
+ ul_div.attr("title","移出多选区域即可自动提交");
|
|
|
+ ul_div.tooltip('show');
|
|
|
+ },1000);
|
|
|
+ }
|
|
|
});
|
|
|
return div;
|
|
|
}
|