|
67 | 67 | </template> |
68 | 68 |
|
69 | 69 | <script> |
70 | | -import Sortable from 'sortablejs' |
71 | | -import FileSaver from 'file-saver' |
| 70 | +// import Sortable from 'sortablejs' |
| 71 | +// import FileSaver from 'file-saver' |
72 | 72 |
|
73 | 73 | export default { |
74 | 74 | props: { |
@@ -278,44 +278,44 @@ export default { |
278 | 278 | this.oldVal = [...val] |
279 | 279 | }, |
280 | 280 | // 拖拽 |
281 | | - setDrag() { |
282 | | - const el = document.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] |
283 | | - this.rowClassName = 'rowClassName' // 设置行样式,添加移动手势 |
284 | | - this.sortable = Sortable.create(el, { |
285 | | - setData(dataTransfer) { |
286 | | - dataTransfer.setData('Text', '') |
287 | | - }, |
288 | | - onEnd: (evt) => { |
289 | | - const dragData = [...this.currentData] |
290 | | - let { oldIndex, newIndex } = evt |
291 | | - if (this.pagination) { |
292 | | - oldIndex = evt.oldIndex * this.currentPage |
293 | | - newIndex = evt.newIndex * this.currentPage |
294 | | - } |
295 | | - dragData[oldIndex] = this.currentData[newIndex] |
296 | | - dragData[newIndex] = this.currentData[oldIndex] |
297 | | - this.$emit('getDragData', { dragData, oldIndex, newIndex }) |
298 | | - }, |
299 | | - }) |
300 | | - }, |
| 281 | + // setDrag() { |
| 282 | + // const el = document.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] |
| 283 | + // this.rowClassName = 'rowClassName' // 设置行样式,添加移动手势 |
| 284 | + // this.sortable = Sortable.create(el, { |
| 285 | + // setData(dataTransfer) { |
| 286 | + // dataTransfer.setData('Text', '') |
| 287 | + // }, |
| 288 | + // onEnd: (evt) => { |
| 289 | + // const dragData = [...this.currentData] |
| 290 | + // let { oldIndex, newIndex } = evt |
| 291 | + // if (this.pagination) { |
| 292 | + // oldIndex = evt.oldIndex * this.currentPage |
| 293 | + // newIndex = evt.newIndex * this.currentPage |
| 294 | + // } |
| 295 | + // dragData[oldIndex] = this.currentData[newIndex] |
| 296 | + // dragData[newIndex] = this.currentData[oldIndex] |
| 297 | + // this.$emit('getDragData', { dragData, oldIndex, newIndex }) |
| 298 | + // }, |
| 299 | + // }) |
| 300 | + // }, |
301 | 301 | // 导出excel |
302 | | - exportExcel(fileName = 'sheet') { |
303 | | - const targetTable = this.$XLSX.utils.table_to_book(document.querySelectorAll('.el-table__body-wrapper > table')[0]) |
304 | | - const writeTable = this.$XLSX.write(targetTable, { bookType: 'xlsx', bookSST: true, type: 'array' }) |
305 | | - try { |
306 | | - FileSaver.saveAs(new Blob([writeTable], { type: 'application/octet-stream' }), `${fileName}.xlsx`) |
307 | | - } catch (e) { if (typeof console !== 'undefined') console.log(e, writeTable) } |
308 | | - return writeTable |
309 | | - }, |
| 302 | + // exportExcel(fileName = 'sheet') { |
| 303 | + // const targetTable = this.$XLSX.utils.table_to_book(document.querySelectorAll('.el-table__body-wrapper > table')[0]) |
| 304 | + // const writeTable = this.$XLSX.write(targetTable, { bookType: 'xlsx', bookSST: true, type: 'array' }) |
| 305 | + // try { |
| 306 | + // FileSaver.saveAs(new Blob([writeTable], { type: 'application/octet-stream' }), `${fileName}.xlsx`) |
| 307 | + // } catch (e) { if (typeof console !== 'undefined') console.log(e, writeTable) } |
| 308 | + // return writeTable |
| 309 | + // }, |
310 | 310 | // 导出csv |
311 | | - exportCsv(fileName = 'sheet') { |
312 | | - const targetTable = this.$XLSX.utils.table_to_book(document.querySelectorAll('.el-table__body-wrapper > table')[0]) |
313 | | - const writeTable = this.$XLSX.write(targetTable, { bookType: 'csv', bookSST: true, type: 'array' }) |
314 | | - try { |
315 | | - FileSaver.saveAs(new Blob([writeTable], { type: 'application/octet-stream' }), `${fileName}.csv`) |
316 | | - } catch (e) { if (typeof console !== 'undefined') console.log(e, writeTable) } |
317 | | - return writeTable |
318 | | - }, |
| 311 | + // exportCsv(fileName = 'sheet') { |
| 312 | + // const targetTable = this.$XLSX.utils.table_to_book(document.querySelectorAll('.el-table__body-wrapper > table')[0]) |
| 313 | + // const writeTable = this.$XLSX.write(targetTable, { bookType: 'csv', bookSST: true, type: 'array' }) |
| 314 | + // try { |
| 315 | + // FileSaver.saveAs(new Blob([writeTable], { type: 'application/octet-stream' }), `${fileName}.csv`) |
| 316 | + // } catch (e) { if (typeof console !== 'undefined') console.log(e, writeTable) } |
| 317 | + // return writeTable |
| 318 | + // }, |
319 | 319 | }, |
320 | 320 | watch: { |
321 | 321 | fixedLeftList: { |
|
0 commit comments