Skip to content

Commit 4c78dbb

Browse files
gongjsvanoneang
authored andcommitted
fix:优化lin-table (#133)
1 parent f3ef093 commit 4c78dbb

7 files changed

Lines changed: 44 additions & 90 deletions

File tree

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
"element-ui": "^2.8.2",
1919
"event-source-polyfill": "^0.0.16",
2020
"fastscan": "^1.0.4",
21-
"file-saver": "^2.0.1",
2221
"good-storage": "^1.1.0",
2322
"js-cookie": "^2.2.0",
24-
"sortablejs": "^1.9.0",
2523
"vue": "^2.6.8",
2624
"vue-awesome-swiper": "^3.1.3",
2725
"vue-router": "~3.0.1",

src/components/base/line/lin-1px.vue

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/components/base/table/lin-table.vue

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
</template>
6868

6969
<script>
70-
import Sortable from 'sortablejs'
71-
import FileSaver from 'file-saver'
70+
// import Sortable from 'sortablejs'
71+
// import FileSaver from 'file-saver'
7272
7373
export default {
7474
props: {
@@ -278,44 +278,44 @@ export default {
278278
this.oldVal = [...val]
279279
},
280280
// 拖拽
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+
// },
301301
// 导出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+
// },
310310
// 导出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+
// },
319319
},
320320
watch: {
321321
fixedLeftList: {

src/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import '@babel/polyfill'
22
import Vue from 'vue'
33
import ElementUI from 'element-ui'
44

5-
import Lin1px from '@/components/base/line/lin-1px'
65
import StickyTop from '@/components/base/sticky-top/sticky-top'
76
import SourceCode from '@/components/base/source-code/source-code'
87

@@ -28,7 +27,6 @@ Vue.use(plugins)
2827

2928
Vue.component(CollapseTransition.name, CollapseTransition)
3029

31-
Vue.component('lin-1px', Lin1px)
3230
Vue.component('sticky-top', StickyTop)
3331
Vue.component('source-code', SourceCode)
3432

src/plugins/LinCmsUi/views/table/TableCombo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export default {
300300
type: 'success',
301301
message: '修改成功',
302302
})
303-
}, 100)
303+
}, 1000)
304304
},
305305
handleCellCancel(row) {
306306
row.editFlag = false; // eslint-disable-line

src/views/log/Log.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</lin-date-picker>
2727
</div>
2828
</div>
29-
<lin-1px v-if="!keyword" :addWidth="40"></lin-1px>
29+
<el-divider v-if="!keyword"></el-divider>
3030
</sticky-top>
3131
<transition name="fade">
3232
<div class="search" v-if="keyword">
@@ -50,7 +50,7 @@
5050
</section>
5151
</article>
5252

53-
<lin-1px></lin-1px>
53+
<el-divider></el-divider>
5454
<div class="more">
5555
<i v-if="more" class="iconfont icon-loading"></i>
5656
<div v-show="!more && !finished" @click="nextPage">
@@ -264,6 +264,7 @@ export default {
264264
justify-content: space-between;
265265
align-items: center;
266266
padding: 0 20px;
267+
margin-bottom: -24px;
267268
268269
.header-left {
269270
float: left;
@@ -292,6 +293,7 @@ export default {
292293
display: flex;
293294
flex-direction: row;
294295
justify-content: space-between;
296+
margin-top:24px;
295297
296298
.search-tip {
297299
margin-left: 40px;
@@ -327,6 +329,7 @@ export default {
327329
328330
article {
329331
position: relative;
332+
margin-bottom: -24px;
330333
331334
section {
332335
padding: 0 0 36px;

yarn.lock

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,11 +3921,6 @@ file-loader@^3.0.1:
39213921
loader-utils "^1.0.2"
39223922
schema-utils "^1.0.0"
39233923

3924-
file-saver@^2.0.1:
3925-
version "2.0.1"
3926-
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.1.tgz#7fe2242af1cbc559a29d8176078a8b56d781fa79"
3927-
integrity sha512-dCB3K7/BvAcUmtmh1DzFdv0eXSVJ9IAFt1mw3XZfAexodNRoE29l3xB2EX4wH2q8m/UTzwzEPq/ArYk98kUkBQ==
3928-
39293924
filesize@^3.6.1:
39303925
version "3.6.1"
39313926
resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317"
@@ -8340,11 +8335,6 @@ sockjs@0.3.19:
83408335
faye-websocket "^0.10.0"
83418336
uuid "^3.0.1"
83428337

8343-
sortablejs@^1.9.0:
8344-
version "1.9.0"
8345-
resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.9.0.tgz#2d1e74ae6bac2cb4ad0622908f340848969eb88d"
8346-
integrity sha512-Ot6bYJ6PoqPmpsqQYXjn1+RKrY2NWQvQt/o4jfd/UYwVWndyO5EPO8YHbnm5HIykf8ENsm4JUrdAvolPT86yYA==
8347-
83488338
source-list-map@^2.0.0:
83498339
version "2.0.0"
83508340
resolved "http://r.cnpmjs.org/source-list-map/download/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"

0 commit comments

Comments
 (0)