tableMixin.js
1.3 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { mapGetters } from 'vuex'
import business from '@/api/business'
let mixin = {
data () {
return {
formData: {
pageSize: 10
}
}
},
computed: {
...mapGetters(['dicData'])
},
created () {
this.featchData()
this.keyupSubmit()
},
methods: {
async handleXmlres (index, row) {
try {
let { result: res } = await business.queryXML(row.BSM_SJSB)
if (res != null) {
this.xml = res
this.$refs.dialog.$refs.xmlDialog.isShow();
} else {
this.$message('报文为空')
}
} catch (error) {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
}
},
keyupSubmit () {
document.onkeydown = e => {
let _key = window.event.keyCode;
if (_key === 13) {
this.featchData()
}
}
},
// 表格索引得问题
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()
}
}
}
export default mixin