tableMixin.js
888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { mapGetters } from 'vuex'
// 引入详情弹框
import dataDetails from "@/components/dataDetails/edit-dialog";
let mixin = {
data () {
return {
formData: {
pageSize: 10
}
}
},
components: {
dataDetails,
},
computed: {
...mapGetters(['dicData'])
},
created () {
this.featchData()
},
methods: {
// 表格索引得问题
indexMethod (index) {
return index + 1 + (this.form.currentPage - 1) * this.formData.pageSize;
},
handleSizeChange (val) {
this.formData.pageSize = val
this.featchData()
},
handleCurrentChange (val) {
this.form.currentPage = val
this.featchData()
},
handleSubmit () {
this.featchData()
},
// 详情
handleEdit (row) {
this.title = row.rectypeName
this.$refs.editLog.isShow(row);
}
}
}
export default mixin