ANTVUE项目实战二

情到浓时终转凉″ 提交于 2020-04-30 13:47:34
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"}

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!