|
@@ -1027,12 +1027,12 @@ export default {
|
|
|
if (event.key === 'Enter' || event.keyCode === 13) {
|
|
if (event.key === 'Enter' || event.keyCode === 13) {
|
|
|
// 检查焦点是否在可编辑元素中
|
|
// 检查焦点是否在可编辑元素中
|
|
|
const activeElement = document.activeElement
|
|
const activeElement = document.activeElement
|
|
|
- const isInEditableElement =
|
|
|
|
|
|
|
+ const isInEditableElement =
|
|
|
activeElement.tagName === 'INPUT' ||
|
|
activeElement.tagName === 'INPUT' ||
|
|
|
activeElement.tagName === 'TEXTAREA' ||
|
|
activeElement.tagName === 'TEXTAREA' ||
|
|
|
activeElement.tagName === 'SELECT' ||
|
|
activeElement.tagName === 'SELECT' ||
|
|
|
activeElement.contentEditable === 'true'
|
|
activeElement.contentEditable === 'true'
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果焦点在可编辑元素中,让原生事件处理(如搜索表单的handleEnter)
|
|
// 如果焦点在可编辑元素中,让原生事件处理(如搜索表单的handleEnter)
|
|
|
// 如果焦点不在可编辑元素中,则触发查询
|
|
// 如果焦点不在可编辑元素中,则触发查询
|
|
|
if (!isInEditableElement) {
|
|
if (!isInEditableElement) {
|
|
@@ -1042,11 +1042,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.globalEnterHandler = handleGlobalEnter
|
|
this.globalEnterHandler = handleGlobalEnter
|
|
|
document.addEventListener('keydown', this.globalEnterHandler)
|
|
document.addEventListener('keydown', this.globalEnterHandler)
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 移除全局回车键监听
|
|
* 移除全局回车键监听
|
|
|
*/
|
|
*/
|
|
@@ -1056,24 +1056,26 @@ export default {
|
|
|
this.globalEnterHandler = null
|
|
this.globalEnterHandler = null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 处理全局回车键事件
|
|
* 处理全局回车键事件
|
|
|
*/
|
|
*/
|
|
|
handleGlobalEnter() {
|
|
handleGlobalEnter() {
|
|
|
// 检查是否启用键盘回车查询功能(通过t_ipcc的setting里的内容)
|
|
// 检查是否启用键盘回车查询功能(通过t_ipcc的setting里的内容)
|
|
|
- const keyboardEnterEnabled = this.setting?.system?.keyboardEnterForsearch === true
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const keyboardEnterEnabled =
|
|
|
|
|
+ this.setting?.system?.keyboardEnterForsearch === true
|
|
|
|
|
+
|
|
|
if (!keyboardEnterEnabled) {
|
|
if (!keyboardEnterEnabled) {
|
|
|
return // 未启用键盘回车查询功能,直接返回
|
|
return // 未启用键盘回车查询功能,直接返回
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 检查是否有查询按钮权限
|
|
// 检查是否有查询按钮权限
|
|
|
- const hasSearchButton = this.listConfig.toolbars &&
|
|
|
|
|
- this.listConfig.toolbars.some(button =>
|
|
|
|
|
- button.button_type === 'search' || button.key === 'search'
|
|
|
|
|
|
|
+ const hasSearchButton =
|
|
|
|
|
+ this.listConfig.toolbars &&
|
|
|
|
|
+ this.listConfig.toolbars.some(
|
|
|
|
|
+ (button) => button.button_type === 'search' || button.key === 'search'
|
|
|
)
|
|
)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (hasSearchButton) {
|
|
if (hasSearchButton) {
|
|
|
// 模拟点击查询按钮
|
|
// 模拟点击查询按钮
|
|
|
// 数据模板列表查询数据前先清除已选中数据,(弹框除外)
|
|
// 数据模板列表查询数据前先清除已选中数据,(弹框除外)
|
|
@@ -1084,7 +1086,7 @@ export default {
|
|
|
this.search()
|
|
this.search()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 处理分页事件
|
|
* 处理分页事件
|
|
|
*/
|
|
*/
|
|
@@ -1153,7 +1155,10 @@ export default {
|
|
|
scanOff(val) {
|
|
scanOff(val) {
|
|
|
this.scanVisible = false
|
|
this.scanVisible = false
|
|
|
this.scanName = ''
|
|
this.scanName = ''
|
|
|
- this.search()
|
|
|
|
|
|
|
+ // false:打印类弹窗关闭,无需刷新;其它业务刷新当前页(不重置到第一页)
|
|
|
|
|
+ if (val !== 'noRefresh') {
|
|
|
|
|
+ this.search()
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
resetSearchForm() {
|
|
resetSearchForm() {
|
|
|
if (this.$refs['searchForm']) {
|
|
if (this.$refs['searchForm']) {
|