Commit 3038c1b513c0468a68519d5b5323116945c19008
1 parent
7967b16a
Exists in
master
and in
1 other branch
修复Scheme无操作按钮时隐藏操作列
Showing
1 changed file
with
29 additions
and
14 deletions
Show diff stats
packages/scheme/index.vue
| @@ -150,20 +150,35 @@ | @@ -150,20 +150,35 @@ | ||
| 150 | <slot name="table-operation" slot="$end" v-bind="slotMethod"></slot> | 150 | <slot name="table-operation" slot="$end" v-bind="slotMethod"></slot> |
| 151 | </template> | 151 | </template> |
| 152 | <!-- 表格操作栏插槽 - 默认 --> | 152 | <!-- 表格操作栏插槽 - 默认 --> |
| 153 | - <el-table-column v-else slot="$end" prop="$operation" :label="i18n('eagle.scheme.operation') || '操作'" min-width="140" fixed="right"> | ||
| 154 | - <div class="eagle-scheme__table-operation" slot-scope="slotScope"> | ||
| 155 | - <!-- 表格操作栏插槽 - 前置插槽 --> | ||
| 156 | - <slot v-if="$scopedSlots['table-operation-btn'] || $slots['table-operation-btn']" name="table-operation-btn" :slotScope="slotScope" v-bind="slotMethod"></slot> | ||
| 157 | - <el-button v-if="option.showViewBtn !== false" class="eagle-scheme__table-btn" type="text" icon="el-icon-view" :title="i18n('eagle.scheme.detail') || '详情'" @click="handleView(slotScope)"></el-button> | ||
| 158 | - <slot v-if="$scopedSlots['table-operation-btn-edit'] || $slots['table-operation-btn-edit']" name="table-operation-btn-edit" :slotScope="slotScope" v-bind="slotMethod"></slot> | ||
| 159 | - <el-button v-else-if="option.showEditBtn !== false" class="eagle-scheme__table-btn" type="text" icon="el-icon-edit" :title="i18n('eagle.scheme.edit') || '编辑'" @click="handleEdit(slotScope)"></el-button> | ||
| 160 | - <component v-if="option.showDeleteBtn !== false" :is="_confirmComponent" class="eagle-scheme__table-btn" :title="i18n('eagle.scheme.deleteConfirm') || '是否删除?'" @confirm="handleDelete('one', slotScope)"> | ||
| 161 | - <el-button type="text" icon="el-icon-delete" :title="i18n('eagle.scheme.delete') || '删除'"></el-button> | ||
| 162 | - </component> | ||
| 163 | - <!-- 表格操作栏插槽 - 后置插槽 --> | ||
| 164 | - <slot v-if="$scopedSlots['table-operation-btn-append'] || $slots['table-operation-btn-append']" name="table-operation-btn-append" :slotScope="slotScope" v-bind="slotMethod"></slot> | ||
| 165 | - </div> | ||
| 166 | - </el-table-column> | 153 | + <template v-else> |
| 154 | + <template v-if="!( | ||
| 155 | + option.showViewBtn === false | ||
| 156 | + && option.showEditBtn === false | ||
| 157 | + && option.showDeleteBtn === false | ||
| 158 | + && !$scopedSlots['table-operation-btn'] | ||
| 159 | + && !$slots['table-operation-btn'] | ||
| 160 | + && !$scopedSlots['table-operation-btn-edit'] | ||
| 161 | + && !$slots['table-operation-btn-edit'] | ||
| 162 | + && !$scopedSlots['table-operation-btn-append'] | ||
| 163 | + && !$slots['table-operation-btn-append'] | ||
| 164 | + )" | ||
| 165 | + > | ||
| 166 | + <el-table-column slot="$end" prop="$operation" :label="i18n('eagle.scheme.operation') || '操作'" min-width="140" fixed="right"> | ||
| 167 | + <div class="eagle-scheme__table-operation" slot-scope="slotScope"> | ||
| 168 | + <!-- 表格操作栏插槽 - 前置插槽 --> | ||
| 169 | + <slot v-if="$scopedSlots['table-operation-btn'] || $slots['table-operation-btn']" name="table-operation-btn" :slotScope="slotScope" v-bind="slotMethod"></slot> | ||
| 170 | + <el-button v-if="option.showViewBtn !== false" class="eagle-scheme__table-btn" type="text" icon="el-icon-view" :title="i18n('eagle.scheme.detail') || '详情'" @click="handleView(slotScope)"></el-button> | ||
| 171 | + <slot v-if="$scopedSlots['table-operation-btn-edit'] || $slots['table-operation-btn-edit']" name="table-operation-btn-edit" :slotScope="slotScope" v-bind="slotMethod"></slot> | ||
| 172 | + <el-button v-else-if="option.showEditBtn !== false" class="eagle-scheme__table-btn" type="text" icon="el-icon-edit" :title="i18n('eagle.scheme.edit') || '编辑'" @click="handleEdit(slotScope)"></el-button> | ||
| 173 | + <component v-if="option.showDeleteBtn !== false" :is="_confirmComponent" class="eagle-scheme__table-btn" :title="i18n('eagle.scheme.deleteConfirm') || '是否删除?'" @confirm="handleDelete('one', slotScope)"> | ||
| 174 | + <el-button type="text" icon="el-icon-delete" :title="i18n('eagle.scheme.delete') || '删除'"></el-button> | ||
| 175 | + </component> | ||
| 176 | + <!-- 表格操作栏插槽 - 后置插槽 --> | ||
| 177 | + <slot v-if="$scopedSlots['table-operation-btn-append'] || $slots['table-operation-btn-append']" name="table-operation-btn-append" :slotScope="slotScope" v-bind="slotMethod"></slot> | ||
| 178 | + </div> | ||
| 179 | + </el-table-column> | ||
| 180 | + </template> | ||
| 181 | + </template> | ||
| 167 | </component> | 182 | </component> |
| 168 | <!-- 分页器 --> | 183 | <!-- 分页器 --> |
| 169 | <div v-if="option.showPagination !== false" class="eagle-scheme__pagination" :style="{ 'text-align': paginationProps.textAlign || 'right' }"> | 184 | <div v-if="option.showPagination !== false" class="eagle-scheme__pagination" :style="{ 'text-align': paginationProps.textAlign || 'right' }"> |