Browse Source

tableform 日期改变事件

master_hella_20240701
陈薪名 9 months ago
parent
commit
fbce24e858
  1. 8
      src/components/BasicForm/src/BasicForm.vue
  2. 10
      src/components/TableForm/src/TableForm.vue

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

@ -87,6 +87,7 @@
@inputStringBlur="inputStringBlur" @inputStringBlur="inputStringBlur"
@inputNumberChange="inputNumberChange" @inputNumberChange="inputNumberChange"
@tableFormSelectOnBlur="tableFormSelectOnBlur" @tableFormSelectOnBlur="tableFormSelectOnBlur"
@formFormDateChange="formFormDateChange"
/> />
</div> </div>
<div v-if="isBusiness && formType == 'create' && fromeWhere == 'countPlan'"> <div v-if="isBusiness && formType == 'create' && fromeWhere == 'countPlan'">
@ -484,12 +485,17 @@ const emit = defineEmits([
'inputStringBlur', 'inputStringBlur',
'onChange', 'onChange',
'onBlur', 'onBlur',
'inputNumberChange' 'inputNumberChange',
'formFormDateChange'
]) ])
// //
const formSelectChange = (field, val, row) => { const formSelectChange = (field, val, row) => {
emit('formSelectChange', field, val, row) emit('formSelectChange', field, val, row)
} }
//
const formFormDateChange = (field, val,row, index) => {
emit('formFormDateChange', field, val,row, index)
}
const formSelectvVisibleChange = (field, val, row) => { const formSelectvVisibleChange = (field, val, row) => {
emit('formSelectvVisibleChange', field, val, row) emit('formSelectvVisibleChange', field, val, row)
} }

10
src/components/TableForm/src/TableForm.vue

@ -146,7 +146,8 @@
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期'" :placeholder="headerItem?.tableForm?.placeholder || '选择日期'"
:format="headerItem?.tableForm?.format || 'YYYY-MM-DD'" :format="headerItem?.tableForm?.format || 'YYYY-MM-DD'"
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DD'" /> :value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DD'"
@change="formFormDateChange(headerItem.field, $event,row, $index)" />
</el-form-item> </el-form-item>
<!-- 日期时间选择器 --> <!-- 日期时间选择器 -->
<el-form-item <el-form-item
@ -348,7 +349,8 @@ const emit = defineEmits([
'inpuFocus', 'inpuFocus',
'buttonOperationClick', 'buttonOperationClick',
'inputStringBlur', 'inputStringBlur',
'tableFormSelectOnBlur' 'tableFormSelectOnBlur',
'formFormDateChange'
]) ])
// | type = radio | type = select // | type = radio | type = select
const initSelectOptions = (item) => { const initSelectOptions = (item) => {
@ -358,6 +360,10 @@ const initSelectOptions = (item) => {
const formSelectChange = (field, val,row) => { const formSelectChange = (field, val,row) => {
emit('formSelectChange', field, val,row) emit('formSelectChange', field, val,row)
} }
//
const formFormDateChange = (field, val,row, index) => {
emit('formFormDateChange', field, val,row, index)
}
// //
const tableFormSelectOnBlur = (field, val,row,index) => { const tableFormSelectOnBlur = (field, val,row,index) => {
emit('tableFormSelectOnBlur', field, val,row,index) emit('tableFormSelectOnBlur', field, val,row,index)

Loading…
Cancel
Save