修改表格的请求方式

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