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

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

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

Loading…
Cancel
Save