修改表格的请求方式

This commit is contained in:
qq787203167
2022-02-22 10:11:52 +08:00
parent ba0ecd8359
commit e3a8997438
+10 -8
View File
@@ -6,6 +6,7 @@
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
:pagination="false"
:scroll="{x: 1400}"
:data-source="dataSource"
:loading="loading"
>
@@ -31,7 +32,7 @@
<script>
import eventBUs from '../../common/event'
import { getAction } from '@/api/manage'
import { getAction, postAction } from '@/api/manage'
export default {
name: 'index',
@@ -51,10 +52,10 @@
default: ''
},
//是否显示操作;默认不显示
showAction:{
showAction: {
type: Boolean,
default: false
},
}
},
data() {
return {
@@ -69,7 +70,7 @@
pageSize: 10,
total: 0,
searchParmes: {},
loading:false,
loading: false
}
},
mounted() {
@@ -96,10 +97,11 @@
this.columns.push({
title: res.db_field_txt,
dataIndex: res.db_field_name,
align: 'center'
align: 'center',
ellipsis: true
})
})
if (this.showAction){
if (this.showAction) {
this.columns.push({
title: '操作',
align: 'center',
@@ -117,7 +119,7 @@
pageSize: this.pageSize
}
this.loading = true
getAction(this.url.tableList, params).then((res) => {
postAction(this.url.tableList, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records
this.total = res.result.total
@@ -138,7 +140,7 @@
},
OperationClick(ol, item) {
this.$emit(ol.ClickEvent, item)
},
}
}
}
</script>