zoukankan      html  css  js  c++  java
  • element 导出功能

    导出按钮:

      <el-button type="primary" class="btns c-ff c-main-btn" @click="downLoadAllHand">批量导出</el-button>

    调函数:

          // 导出
          downLoadAllHand () {
            const url = `/manage/reader/stat/export`
            const params = {...this.searchForm}
            openForm(url, params, "POST")
          },
    

      

    打开文件:

    export const openForm = (url, params, method) => {
      const form = _createElement(({
        tag: 'form',
        attr: {
          id: 'newsForm',
          name: 'newsForm',
          target: '_blank',
          method: method,
          action: url
        }
      }))
      Object.keys(params).forEach(item=>{
        let input = document.createElement('input')
        input.type = 'text'
        input.name = item
        input.value = params[item]
        form.appendChild(input)
      })
      document.body.appendChild(form)
      form.submit()
      document.body.removeChild(form)
    }
    具体函数:
     
     export const openForm = (url, params, method) => {
      const form = _createElement(({
        tag: 'form',
        attr: {
          id: 'newsForm',
          name: 'newsForm',
          target: '_blank',
          method: method,
          action: url
        }
      }))
      Object.keys(params).forEach(item=>{
        let input = document.createElement('input')
        input.type = 'text'
        input.name = item
        input.value = params[item]
        form.appendChild(input)
      })
      document.body.appendChild(form)
      form.submit()
      document.body.removeChild(form)
    }
    调函数:
     
    downLoadAllHand () {
    const url = `/manage/reader/stat/export`
    const params = {...this.searchForm}
    openForm(url, params, "POST")
    },
     
    导出按钮:
     
    <template slot="moreBtns">
    <el-button type="primary" class="btns c-ff c-main-btn" @click="downLoadAllHand">批量导出</el-button>
    </template>
  • 相关阅读:
    删除commit(暂存区)中的文件(git)
    bower安装使用以及git安装
    compass模块----Utilities----Sprites精灵图合图
    compass模块----Utilities
    compass模块----Helpers
    compass模块
    compass安装
    Sass@规则
    Sass函数--颜色函数--Opacity函数
    Sass函数--颜色函数--HSL函数
  • 原文地址:https://www.cnblogs.com/guangzhou11/p/13959480.html
Copyright © 2011-2022 走看看