Browse Source

tableForm组件 输入框 添加失去焦点事件

master
陈薪名 10 months ago
parent
commit
9191ed8eac
  1. 8
      src/components/BasicForm/src/BasicForm.vue
  2. 9
      src/components/TableForm/src/TableForm.vue

8
src/components/BasicForm/src/BasicForm.vue

@ -82,6 +82,7 @@
@handleTableSelect="handleTableSelect"
@inpuFocus="inpuFocus"
@buttonOperationClick="buttonOperationClick"
@inputStringBlur="inputStringBlur"
/>
</div>
<div v-if="isBusiness && formType == 'create' && fromeWhere == 'countPlan'">
@ -453,7 +454,8 @@ const emit = defineEmits([
'selectChange',
'selectChangeDetail',
'tableFormChange',
'buttonOperationClick'
'buttonOperationClick',
'inputStringBlur'
])
//
const formSelectChange = (field, val, row) => {
@ -522,6 +524,10 @@ const buttonOperationClick = (row, label, index)=> {
emit("buttonOperationClick", row, label, index);
}
const inputStringBlur = (headerItem, row, index)=> {
emit("inputStringBlur", headerItem, row, index);
}
</script>
<style lang="scss" scoped>
.table {

9
src/components/TableForm/src/TableForm.vue

@ -65,6 +65,7 @@
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false"
style="flex:1"
@blur="inputStringBlur(headerItem.field, $event, row)"
/>
<el-button v-if="headerItem?.tableForm?.isInpuFocusShow" @click="inpuFocus(headerItem,row,index)"><Icon icon="ep:search" size="14"/></el-button>
</el-form-item>
@ -343,7 +344,8 @@ const emit = defineEmits([
'handleDeleteTable',
'handleAddTable',
'inpuFocus',
'buttonOperationClick'
'buttonOperationClick',
'inputStringBlur'
])
// | type = radio | type = select
const initSelectOptions = (item) => {
@ -413,6 +415,11 @@ const inpuFocus = (headerItem, row, index)=>{
}
}
// input
const inputStringBlur = (field, val,row) => {
emit('inputStringBlur', field, val,row)
}
//table
const buttonOperationClick = (row, label, index)=> {
emit("buttonOperationClick", row, label, index);

Loading…
Cancel
Save