|
|
|
@ -162,8 +162,9 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const suggest = new SearchSuggest(layui, 'searchKeyInput') |
|
|
|
|
suggest.onClick((text) => { |
|
|
|
|
|
|
|
|
|
suggest.onClickItem(function (text) { |
|
|
|
|
setSearchKeyCondition(text, preciseQuery === 'eq' ? 'eq' : 'like'); |
|
|
|
|
this.$searchBtn.click(); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -276,17 +277,17 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop |
|
|
|
|
let value = $(this).val(); |
|
|
|
|
setSearchKeyCondition(value, preciseQuery === 'eq' ? 'eq' : 'like'); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function setSearchKeyCondition(value, logic) { |
|
|
|
|
let where = metaListTable.where || {}; |
|
|
|
|
let conditions = where.conditions || []; |
|
|
|
|
conditions = conditions.filter(item => item.fieldName !== 'metadataName') |
|
|
|
|
if (value && value.trim()) { |
|
|
|
|
conditions.push({fieldName: 'metadataName', fieldValue: value.trim(), logicJudgement: logic}) |
|
|
|
|
} |
|
|
|
|
where.conditions = conditions; |
|
|
|
|
metaListTable.where = where; |
|
|
|
|
function setSearchKeyCondition(value, logic) { |
|
|
|
|
let where = metaListTable.where || {}; |
|
|
|
|
let conditions = where.conditions || []; |
|
|
|
|
conditions = conditions.filter(item => item.fieldName !== 'metadataName') |
|
|
|
|
if (value && value.trim()) { |
|
|
|
|
conditions.push({fieldName: 'metadataName', fieldValue: value.trim(), logicJudgement: logic}) |
|
|
|
|
} |
|
|
|
|
where.conditions = conditions; |
|
|
|
|
metaListTable.where = where; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function setMarkTagInputValue() { |
|
|
|
@ -488,7 +489,11 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop |
|
|
|
|
cols: THeadSetLayer.convertColumns(theadConfig, 'dirFileTable'), |
|
|
|
|
done: () => { |
|
|
|
|
form.val('full-search-form', {queryType}); |
|
|
|
|
new SearchSuggest(layui, 'fileSearchKeyInput'); |
|
|
|
|
const suggest = new SearchSuggest(layui, 'fileSearchKeyInput'); |
|
|
|
|
suggest.onClickItem(function (text) { |
|
|
|
|
$('#fileSearchKeyInput').val(text); |
|
|
|
|
this.$searchBtn.click(); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
@ -574,7 +579,7 @@ class SearchSuggest { |
|
|
|
|
this.$elem.find('ul li').on('click', (event) => { |
|
|
|
|
const $li = $(event.target); |
|
|
|
|
this.$bindElem.val($li.text()); |
|
|
|
|
this.$searchBtn.click(); |
|
|
|
|
this.onclickItemCallback && this.onclickItemCallback($li.text()); |
|
|
|
|
}); |
|
|
|
|
this.isHide = false; |
|
|
|
|
} |
|
|
|
@ -588,8 +593,8 @@ class SearchSuggest { |
|
|
|
|
this.bindElem(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onClick(onclick) { |
|
|
|
|
this.onclick = onclick; |
|
|
|
|
onClickItem(callback) { |
|
|
|
|
this.onclickItemCallback = callback; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|