码迷,mamicode.com
首页 > 其他好文 > 详细

ANTVUE项目实战二

时间:2020-04-29 18:03:28      阅读:49      评论:0      收藏:0      [点我收藏+]

标签:war   总数   ota   load   res   style   filter   size   show   

1.  .env文件变量获取
process.env.VUE_APP_ProjectName
2.
getDataList() {
      this.selectedRowKeys = []

      this.loading = true
      this.$http
        .post(‘/BaseWarehouse/T_Warehouse/GetDataList‘, {
          PageIndex: this.pagination.current,
          PageRows: this.pagination.pageSize,
          SortField: this.sorter.field || ‘Id‘,
          SortType: this.sorter.order,
          ...this.queryParam,
          ...this.filters
        })
        .then(resJson => {
          this.loading = false
          this.data = resJson.Data
          const pagination = { ...this.pagination }
          pagination.total = resJson.Total
          this.pagination = pagination
        })
    },

查询参数:
{"PageIndex":1,"PageRows":10,"SortField":"Id","SortType":"asc"}





去掉
          PageIndex: this.pagination.current,
          PageRows: this.pagination.pageSize,    
查询参数为:
{"SortField":"Id","SortType":"asc"}


采用展开符号:
...this.pagination,
查询参数为:
{"current":1,"pageSize":10,"SortField":"Id","SortType":"asc"}


为了用好参数可以用展开符号修改些:
pagination: {
        PageIndex: 1,
        PageRows: 10,
        showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}`
      },
发送参数为:
{"PageIndex":1,"PageRows":10,"SortField":"Id","SortType":"asc"}

 

ANTVUE项目实战二

标签:war   总数   ota   load   res   style   filter   size   show   

原文地址:https://www.cnblogs.com/wangchuang/p/12803554.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!