最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Vue form 表單提交+ajax異步請求+分頁效果

 更新時間:2017年04月22日 08:43:38   作者:liuyinhe110808  
這篇文章主要介紹了Vue form 表單提交+ajax異步請求+分頁效果,需要的朋友可以參考下

廢話不多說了,直接給大家貼代碼了,具體代碼如下所示:

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width,initial-scale=1">
 <meta charset="UTF-8"/>
 <title>異步參數(shù)上傳</title>
 <link rel="stylesheet" type="text/css" href="${ctx }/css/bootstrap.min.css" rel="external nofollow" >
 <#--<link href="css/fileinput.css" rel="external nofollow" media="all" rel="stylesheet" type="text/css"/>-->
 <link href="${ctx }/css/fileinput.css" rel="external nofollow" media="all" rel="stylesheet" type="text/css"/>
 <link rel="stylesheet" type="text/css" href="${ctx }/css/css.css" rel="external nofollow" />
 <#--<link rel="stylesheet" type="text/css" href="${ctx }/css/style.css" rel="external nofollow" />-->
 <link rel="stylesheet" type="text/css" href="${ctx }/css/subwelcome.css" rel="external nofollow" />
 <script>var $context = {};
 $context.ctx = '${ctx}';
 $context.resources = '${ctx}/resources';
 </script>
</head>
<body>
<div id="app" class="htmleaf-container">
 <div class="container kv-main">
  <br>
  <div style="margin-left: 200px;" class="robot-b-name">
   <a class=".btn btn-primary" href="">返回上傳頁面</a>
  </div>
  <br>
  <form @submit.prevent="submit" class="well form-inline">
   <input type="text" class="input-big" style="width: 500px" v-model.trim="batchInforRequestVO.appkey"
     placeholder="請輸入appkey">
   <input type="text" class="input-group" style="width: 500px" v-model.trim="batchInforRequestVO.batchnum"
     placeholder="請輸入批次號">
   <input type="hidden" class="input-group" style="width: 500px"
     v-model.trim="batchInforRequestVO.currentPage">
   <button type="submit" class="btn btn-info">查詢</button>
  </form>
  <br>
  <!--提示框公共部分begining-->
  <div class="modal-mask" v-show="show">
   <div class="modal-confirm">
    <h4 class="confirm-header">
     <i class="iconfont icon-questioncircle"></i> {{ title }}
    </h4>
    <div class="confirm-content">
     {{ content }}
    </div>
    <div class="confirm-btns">
    <#--<button class="btn" v-on:click="opt(1)">取 消</button>-->
     <button class="btn btn-primary" v-on:click="opt(2)">確 定</button>
    </div>
   </div>
  </div>
  <br>
  <!--提示框公共部分ending-->
  <div class="modal-mask" v-show="showcontent">
   <div class="modal-confirm">
    <h4 class="confirm-header">
     <i class="iconfont icon-questioncircle"></i> {{ title }}
    </h4>
    <div class="confirm-content">
     {{ content }}
    </div>
    <div class="confirm-btns">
    <#--<button class="btn" v-on:click="opt(1)">取 消</button>-->
     <button class="btn btn-primary" v-on:click="opt(3)">確 定</button>
    </div>
   </div>
  </div>
  <div>查詢結(jié)果</div>
  <!-- TableBegining -->
  <div>
   <table class="table table-striped table-bordered table-condensed">
    <tr>
     <th>批次號</th>
     <th>處理進度</th>
     <th>文件名稱</th>
     <th>上傳時間</th>
     <th>請求方法</th>
     <th>操作</th>
    </tr>
    <tr v-for="(batchInforResponseVO, index) in BatchInforResponseVO ">
     <td>{{batchInforResponseVO.batchNum}}</td>
     <td>{{batchInforResponseVO.processPercentage}}</td>
     <td>{{batchInforResponseVO.channelName}}</td>
     <td>{{batchInforResponseVO.inserTime}}</td>
     <td>{{batchInforResponseVO.requestAddre}}</td>
     <td><a id="opreat" v-on:click="defaultExport(index)" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >導出 </a><a
       v-on:click="redirectTo(index)" id="opreat" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >自定義導出 </a></td>
    </tr>
   </table>
  </div>
  <!-- TableEnding -->
  <!-- 分頁部分Begining -->
  <div class="span6" style="width:25%;margin-right: 10px;float: right;">
   <div style="width: 500px;" id="DataTables_Table_0_length">
    <span> 每頁10條記錄 當前頁{{batchInforRequestVO.currentPage}}</span> &nbsp
    <span>共{{totalPage}}頁&nbsp<a id="previousPage" v-on:click="changePage(1)" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >←上一頁</a>&nbsp &nbsp<a
      id="nextPage" v-on:click="changePage(2)" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >下一頁 →</a></span>
   </div>
  </div>
  <!-- 分頁部分Ending -->
 </div>
</div>
</div>
</body>
<script type="text/javascript">
 window.history.go(1);
</script>
<script src="${ctx }/js/jquery/jquery-2.0.3.min.js"></script>
<script src="${ctx }/js/jquery.form.js"></script>
<script src="${ctx }/js/vue/vue.js"></script>
<script src="${ctx }/js/business/exportconfig.js" type="text/javascript"></script>
</html>
var vue = new Vue({
 el: '#app',
 data: {
  batchInforRequestVO: {
   currentPage: 1,
   appkey: '',
   batchnum: ''
  },
  show: false,
  showcontent: false,
  onCancel: false,
  onOk: false,
  totalPage: 0,
  title: '提示框',
  content: '加載......',
  message: '批量數(shù)據(jù)處理',
  BatchInforResponseVO: []
 },
 methods: {
  refreshTest: function () {
   location.reload(true)
  },
  //輸入框增加方法
  add: function () {
   this.user.names.push({
    text: ""
   })
  },
  //輸入框刪除方法
  decrease: function (index) {
   if (!index == 0) {
    this.user.names.splice(index, 1)
   }
  },
  changePage: function (type) {
   if (type == '1') {
    debugger
    if (this.batchInforRequestVO.currentPage == '1') {
     vue.showcontent = true;
     vue.content = '已經(jīng)是首頁啦!';
     return
    }
    this.batchInforRequestVO.currentPage--;
    this.submit();
   }
   else if (type == '2') {
    this.batchInforRequestVO.currentPage++;
    debugger
    if (this.batchInforRequestVO.currentPage > this.totalPage) {
     this.batchInforRequestVO.currentPage--;
     vue.showcontent = true;
     vue.content = '已經(jīng)是尾頁啦!';
     return
    }
    this.submit();
   }
  },
  checkparam: function () {
   if (this.batchInforRequestVO.appkey == '' && this.batchInforRequestVO.batchnum == '') {
    vue.showcontent = true;
    vue.content = '查詢參數(shù)不可以為空!';
    return false
   }
   else {
    return true
   }
  },
  opt(type){
   this.show = false
   if (type == '1') {
    if (this.onCancel) this.onCancel()
   }
   else if (type == '3') {
    this.showcontent = false
    if (this.onOk) this.onOk()
   }
   else {
    if (this.onOk) this.onOk()
    vue.refreshTest();
   }
   this.onCancel = false
   this.onOk = false
   document.body.style.overflow = ''
  },
  submit: function () {
   debugger
   var data = JSON.stringify(this.batchInforRequestVO); // 這里才是你的表單數(shù)據(jù)
   if (!vue.checkparam()) {
    return
   }
   ;
   //da.append("name", this.name)可以逐次添加多個參數(shù)
   $.ajax({
    url: '../interface/queryBatchInfor',
    data: data,
    type: 'POST',
    contentType: 'application/json',
    dataType: 'JSON',
    // cache: false,
    processData: false,// 告訴jQuery不要去處理發(fā)送的數(shù)據(jù)
    // contentType: false,// 告訴jQuery不要去設(shè)置Content-Type請求頭
    success: function (data) {
     debugger
     if (data.respCode == 'success') {
      vue.BatchInforResponseVO = data.batchInforResponseVOList;
      vue.totalPage = data.totalPage;
     } else {
      vue.show = true;
      vue.content = data.respMsg;
     }
     console.log(data)
    },
    error: function (data) {
     vue.show = true;
     vue.content = '系統(tǒng)內(nèi)部錯誤';
    }
   })
  },
  defaultExport: function ($index) {
   debugger
   var index = $index;
   window.location.href = $context.ctx + "../interface/defaultexcport?batchNum=" + this.BatchInforResponseVO[index].batchNum;
  },
  redirectTo: function ($index) {
   vue.showcontent = true;
   vue.content = '進行中......';
   debugger
   var index = $index;
   // window.location.href = $context.ctx + "../interface/to_autoconfig?batchNum="+ this.BatchInforResponseVO[index].batchNum;
  }
 }
})

以上所述是小編給大家介紹的Vue form 表單提交+ajax異步請求+分頁效果,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

  • Vue+ElementUI 中級聯(lián)選擇器Bug問題的解決

    Vue+ElementUI 中級聯(lián)選擇器Bug問題的解決

    這篇文章主要介紹了Vue+ElementUI 中級聯(lián)選擇器Bug問題的解決方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-07-07
  • Vue和relation-graph庫打造高質(zhì)量的關(guān)系圖應用程序

    Vue和relation-graph庫打造高質(zhì)量的關(guān)系圖應用程序

    這篇文章主要介紹了Vue和relation-graph庫打造高質(zhì)量的關(guān)系圖應用程序,在這篇文章中,我們深入探討了如何使用Vue和relation-graph高效打造關(guān)系圖,我們詳細介紹了數(shù)據(jù)準備、關(guān)系映射、點擊事件等關(guān)鍵步驟,需要的朋友可以參考下
    2023-09-09
  • Vue安裝與環(huán)境配置步驟詳解

    Vue安裝與環(huán)境配置步驟詳解

    在開始學習vue的時候,對于新手安裝這個環(huán)境是真的搞人心態(tài),不友好,下面這篇文章主要給大家介紹了關(guān)于Vue安裝與環(huán)境配置的相關(guān)資料,需要的朋友可以參考下
    2022-07-07
  • axios請求中斷的幾種方法

    axios請求中斷的幾種方法

    在實際應用場景中,假如有一個下載或者導出請求,數(shù)據(jù)量非常大的情況下,接口響應的會很慢,這時候我我們想中斷請求,該怎么做呢?本文給大家介紹了axios請求中斷的幾種方法,需要的朋友可以參考下
    2024-10-10
  • vue 項目中使用websocket的正確姿勢

    vue 項目中使用websocket的正確姿勢

    這篇文章主要介紹了vue 項目中使用websocket的實例代碼,通過實例代碼給大家介紹了在utils下新建websocket.js文件的方法,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-01-01
  • element中el-container容器與div布局區(qū)分詳解

    element中el-container容器與div布局區(qū)分詳解

    這篇文章主要介紹了element中el-container容器與div布局區(qū)分詳解,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2020-05-05
  • vue限制輸入框只能輸入8位整數(shù)和2位小數(shù)的代碼

    vue限制輸入框只能輸入8位整數(shù)和2位小數(shù)的代碼

    這篇文章主要介紹了vue限制輸入框只能輸入8位整數(shù)和2位小數(shù),文中我們使用v-model加watch 實現(xiàn)這一個功能,代碼簡單易懂,需要的朋友可以參考下
    2019-11-11
  • vue?parseHTML?函數(shù)源碼解析AST基本形成

    vue?parseHTML?函數(shù)源碼解析AST基本形成

    這篇文章主要為大家介紹了vue?parseHTML?函數(shù)源碼解析AST基本形成,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-07-07
  • vue 路由meta 設(shè)置導航隱藏與顯示功能的示例代碼

    vue 路由meta 設(shè)置導航隱藏與顯示功能的示例代碼

    這篇文章主要介紹了vue 路由meta 設(shè)置導航隱藏與顯示功能,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-09-09
  • Vue列表如何實現(xiàn)滾動到指定位置樣式改變效果

    Vue列表如何實現(xiàn)滾動到指定位置樣式改變效果

    這篇文章主要介紹了Vue列表實現(xiàn)滾動到指定位置樣式改變效果,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-05-05

最新評論

育儿| 灵台县| 乌拉特前旗| 陆丰市| 政和县| 麦盖提县| 双峰县| 图们市| 河北区| 宜兰县| 普定县| 闽侯县| 屏山县| 四子王旗| 新田县| 普洱| 宿州市| 普定县| 商河县| 拉萨市| 佳木斯市| 舞阳县| 兴文县| 余姚市| 淳安县| 溧水县| 桂林市| 旺苍县| 太康县| 金乡县| 萍乡市| 东台市| 邯郸市| 台南市| 延长县| 青川县| 杂多县| 区。| 遂昌县| 佛山市| 六安市|