Commit 66ee3bad by 乔延琦

Merge branch 'develop-zhouyi' into 'develop'

fix(@gms/gms-plugin-billexpand): 基础数据选择组件修改

See merge request GFP/RBC/rbc-frontend!179
parents 5c8d2092 5168a348
...@@ -165,7 +165,6 @@ export default { ...@@ -165,7 +165,6 @@ export default {
}, },
'groupTableName.define.showFields': { 'groupTableName.define.showFields': {
handler(nv) { handler(nv) {
console.log({nv})
let choiceColumns = this.groupTableName.define.choiceColumns; let choiceColumns = this.groupTableName.define.choiceColumns;
let column = nv.filter(item => item.isQueryColumn && choiceColumns.indexOf(item.columnName)>-1); let column = nv.filter(item => item.isQueryColumn && choiceColumns.indexOf(item.columnName)>-1);
let width = 0 let width = 0
...@@ -287,10 +286,33 @@ export default { ...@@ -287,10 +286,33 @@ export default {
this.getBaseDataList() this.getBaseDataList()
}, },
handleBlur() { handleBlur() {
if (!this.onResultList) { if (this.onResultList) {
this.hasFocus = false this.$refs.searchInput.focus()
this.dataListShow = false return
} }
if (
this.selectIndex >= 0
&& this.selectIndex < this.baseDataList.length
) {
this.selectValue = this.baseDataList[this.selectIndex].name
this.value = this.baseDataList[this.selectIndex]
this.selectedItem = this.baseDataList[this.selectIndex]
this.$emit('data-change', this.value)
this.selectIndex = -1
}
else if (
this.selectValue != this.selectedItem.code
&& this.selectValue != this.selectedItem.name
) {
this.clearList()
}
else {
this.$emit('data-change', this.value)
}
this.hasFocus = false
this.dataListShow = false
}, },
// 输入查询时 // 输入查询时
handleChange() { handleChange() {
...@@ -402,9 +424,10 @@ export default { ...@@ -402,9 +424,10 @@ export default {
this.selectValue = item.code this.selectValue = item.code
this.hasFocus = false this.hasFocus = false
this.dataListShow = false this.dataListShow = false
this.onResultList = false
this.value = item this.value = item
this.selectedItem = item this.selectedItem = item
this.$emit('data-change', this.value) this.handleSelected()
}, },
// 列表上、下、回车 // 列表上、下、回车
handleSelectPrev() { handleSelectPrev() {
...@@ -424,17 +447,6 @@ export default { ...@@ -424,17 +447,6 @@ export default {
} }
}, },
handleSelected() { handleSelected() {
for (var i = 0; i < this.baseDataList.length; i++) {
if (this.selectIndex === i) {
this.selectValue = this.baseDataList[i].code
this.value = this.baseDataList[i]
this.selectedItem = this.baseDataList[i]
}
}
this.hasFocus = false
this.dataListShow = false
this.$emit('data-change', this.value)
this.selectIndex = -1
this.$refs.searchInput.blur() this.$refs.searchInput.blur()
}, },
// 查找索引位置 // 查找索引位置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment