Browse Source

不需要双击,点击其他地方保存

java8
han\hanst 2 months ago
parent
commit
838d0cc31b
  1. 9
      src/views/modules/part/quicklyCreateBom.vue

9
src/views/modules/part/quicklyCreateBom.vue

@ -21,11 +21,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
:height="60"
:max-height="120"
:data="dataList" :data="dataList"
border border
v-loading="this.dataListLoading" v-loading="this.dataListLoading"
style="width: 100%;">
style="width: 100%;"
:header-cell-style="{whiteSpace: 'nowrap', padding: '5px 0'}">
<el-table-column <el-table-column
v-for="(item,index) in columnList" :key="index" v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable" :sortable="item.columnSortable"
@ -37,14 +38,14 @@
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="!item.columnHidden" @dblclick="startEditCell(scope.$index, item.columnProp, scope.row[item.columnProp])" style="min-height: 23px; cursor: pointer;" :title="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp ? '' : '双击编辑,回车保存'">
<div v-if="!item.columnHidden" @dblclick="startEditCell(scope.$index, item.columnProp, scope.row[item.columnProp])" style="min-height: 23px; cursor: pointer;" :title="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp ? '' : '双击编辑,点击其他地方保存'">
<el-input <el-input
v-if="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp" v-if="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp"
v-model="editingCell.value" v-model="editingCell.value"
size="small" size="small"
ref="editInput" ref="editInput"
:disabled="editingCell.isSaving" :disabled="editingCell.isSaving"
@keyup.enter.native="saveEditCell(scope.$index, item.columnProp, item.columnLabel)"
@blur="saveEditCell(scope.$index, item.columnProp, item.columnLabel)"
@keyup.esc.native="cancelEditCell" @keyup.esc.native="cancelEditCell"
style="width: 100%;"> style="width: 100%;">
</el-input> </el-input>

Loading…
Cancel
Save