Browse Source

优化明细TableForm可能存在的卡顿情况

master_hella_20240701
yufei0306 8 months ago
parent
commit
53a0112118
  1. 16
      src/components/TableForm/src/TableForm.vue

16
src/components/TableForm/src/TableForm.vue

@ -76,7 +76,7 @@
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'number'" v-if="headerItem?.tableForm?.type == 'number'"
:prop="headerItem.field"> :prop="headerItem.field">
<el-input <el-input :key="headerItem.field+$index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
clearable clearable
type="number" type="number"
@ -131,7 +131,7 @@
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'SelectGroup'" v-if="headerItem?.tableForm?.type == 'SelectGroup'"
:prop="headerItem.field"> :prop="headerItem.field">
<el-select <el-select :key="headerItem.field+$index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:clearable="headerItem?.tableForm.clearable || true" :clearable="headerItem?.tableForm.clearable || true"
:multiple="headerItem?.tableForm.multiple" :multiple="headerItem?.tableForm.multiple"
@ -164,7 +164,7 @@
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'FormTime'" v-if="headerItem?.tableForm?.type == 'FormTime'"
:prop="headerItem.field"> :prop="headerItem.field">
<el-time-picker <el-time-picker :key="headerItem.field+$index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:clearable="true" :clearable="true"
:placeholder="headerItem?.tableForm?.placeholder || '选择时间'" :placeholder="headerItem?.tableForm?.placeholder || '选择时间'"
@ -206,7 +206,7 @@
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'FormTimerange'" v-if="headerItem?.tableForm?.type == 'FormTimerange'"
:prop="headerItem.field"> :prop="headerItem.field">
<el-date-picker <el-date-picker :key="headerItem.field+$index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:clearable="true" :clearable="true"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
@ -221,7 +221,7 @@
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'Switch'" v-if="headerItem?.tableForm?.type == 'Switch'"
:prop="headerItem.field"> :prop="headerItem.field">
<el-switch <el-switch :key="headerItem.field+$index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:loading="headerItem?.tableForm?.loading" :loading="headerItem?.tableForm?.loading"
@ -239,7 +239,7 @@
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'Radio'" v-if="headerItem?.tableForm?.type == 'Radio'"
:prop="headerItem.field"> :prop="headerItem.field">
<el-radio-group <el-radio-group :key="headerItem.field+$index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:size="headerItem?.tableForm?.size" :size="headerItem?.tableForm?.size"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
@ -262,7 +262,7 @@
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'Checkbox'" v-if="headerItem?.tableForm?.type == 'Checkbox'"
:prop="headerItem.field"> :prop="headerItem.field">
<el-checkbox-group <el-checkbox-group :key="headerItem.field+$index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:size="headerItem?.tableForm?.size" :size="headerItem?.tableForm?.size"
@ -287,7 +287,7 @@
</el-form-item> </el-form-item>
<!-- table表添加操作列 --> <!-- table表添加操作列 -->
<!-- <el-form-item> --> <!-- <el-form-item> -->
<div v-if="headerItem?.tableForm?.type == 'action'"> <div v-if="headerItem?.tableForm?.type == 'action'" :key="headerItem.field+$index">
<el-button <el-button
v-for="(itemButton, indexButton) in headerItem?.tableForm?.buttonText.split('|')" v-for="(itemButton, indexButton) in headerItem?.tableForm?.buttonText.split('|')"
:key="indexButton" :key="indexButton"

Loading…
Cancel
Save