| | |
| | | |
| | | <el-table |
| | | ref="fromTable" |
| | | v-if="tableShow" |
| | | :data="tableList.tableData" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | |
| | | } |
| | | " |
| | | ></el-input> |
| | | <div class="common-select-btn" @click="clearupColumn(item.prop)"> |
| | | {{item.prop}} |
| | | <div class="common-select-btn" @click="clearupColumn(item.prop,i)"> |
| | | <i class="el-icon-remove" title="删除"></i> |
| | | </div> |
| | | </div> |
| | |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | // 是否可以编辑表头 |
| | | isEdit: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | silkTableList: { |
| | | type: Object, |
| | | default: () => { |
| | |
| | | productList: [], |
| | | tableList: [], |
| | | projectIndex: 0, |
| | | projectOptions: getDataByType("projectOptions") |
| | | projectOptions: getDataByType("projectOptions"), |
| | | tableShow:true, |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getTableInfo() |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | 'silkTableList.tableColumn': { |
| | | handler() { |
| | | this.tableShow=false; |
| | | this.$nextTick(()=>{ |
| | | this.tableShow=true; |
| | | this.$forceUpdate() |
| | | }) |
| | | |
| | | }, |
| | | immediate: true |
| | | }, |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | |
| | | this.$emit("addColumnInputChange", val, prop) |
| | | }, |
| | | editColumnInput(item,i,prop){ |
| | | console.log(item,'===item') |
| | | console.log(i,'===i') |
| | | console.log(prop,'===prop') |
| | | if(prop.indexOf('prop')!=-1){ |
| | | if(prop.indexOf('prop')!=-1&&this.isEdit){ |
| | | item.addColumn=true; |
| | | this.$set(this.tableList.tableColumn[i],'addColumn',true) |
| | | this.$forceUpdate() |
| | | this.$emit("editColumnInput", item, i,prop) |
| | | } |
| | | |
| | | }, |
| | | // 删除列 |
| | | clearupColumn(prop) { |
| | | clearupColumn(prop,index) { |
| | | console.log(prop) |
| | | this.$emit("clearupColumn", prop) |
| | | this.$emit("clearupColumn", prop,index) |
| | | } |
| | | }, |
| | | //解决表格抖动问题 |
| | |
| | | } |
| | | .el-input__inner { |
| | | // text-align: left; |
| | | text-align: center !important; |
| | | // text-align: center !important; |
| | | } |
| | | } |
| | | </style> |