日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Table 表格导出功能

發布時間:2023/12/13 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Table 表格导出功能 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

<Card class="clearfix"><p slot="title"><Icon type="ios-list"></Icon>收入信息</p><!-- 導出1 --><div class="daochu1"><!-- 導出按鈕 --><div class="search"><Buttontype="warning"icon="ios-download-outline"@click="exportExcel1"class="searchButton">導出</Button></div><!-- 詳細列表 --><Tableref="table"border:row-class-name="rowClassName":columns="queryColumns1":data="queryinfoList1"style="width: 100%; top: 10px"@on-sort-change="sortTime"></Table></div><!-- 分頁 --><div style="margin-top: 20px; overflow: hidden"><div style="float: right"><Page:total="count"show-elevator@on-change="onchangePage"></Page></div></div></Card> // 導出列表頭 1queryColumns11: [{title: "項目名稱",key: "projectName",align: "center",width: 200,},{title: "收入類型",key: "revenueType",align: "center",width: 150,},{title: "年度",key: "year",align: "center",width: 150,},{title: "1月",key: "monthAmount1",align: "center",width: 150,},{title: "2月",key: "monthAmount2",align: "center",width: 150,},{title: "3月",key: "monthAmount3",align: "center",width: 150,},{title: "4月",key: "monthAmount4",align: "center",width: 150,},{title: "5月",key: "monthAmount5",align: "center",width: 150,},{title: "6月",key: "monthAmount6",align: "center",width: 150,},{title: "7月",key: "monthAmount7",align: "center",width: 150,},{title: "8月",key: "monthAmount8",align: "center",width: 150,},{title: "9月",key: "monthAmount9",align: "center",width: 150,},{title: "10月",key: "monthAmount10",align: "center",width: 150,},{title: "11月",key: "monthAmount11",align: "center",width: 150,},{title: "12月",key: "monthAmount12",align: "center",width: 150,},{title: "年度累計",key: "monthAmount13",align: "center",width: 200,},{title: "更新時間",key: "updateTime",align: "center",width: 200,},], //導出收入信息exportExcel1() {this.$Spin.show({render: (h) => {return h("div", [h("Icon", {class: "demo-spin-icon-load",props: {type: "load-c",size: 50,},}),h("div", "努力記載中...."),]);},});this.excell = [];new Promise((resolve, reject) => {ApiDrug.exportincomeExport({}).then((response) => {let res = response.result;res.forEach((item, index) => {item.monthAmount1 = item.monthAmount["1"];item.monthAmount2 = item.monthAmount["2"];item.monthAmount3 = item.monthAmount["3"];item.monthAmount4 = item.monthAmount["4"];item.monthAmount5 = item.monthAmount["5"];item.monthAmount6 = item.monthAmount["6"];item.monthAmount7 = item.monthAmount["7"];item.monthAmount8 = item.monthAmount["8"];item.monthAmount9 = item.monthAmount["9"];item.monthAmount10 = item.monthAmount["10"];item.monthAmount11 = item.monthAmount["11"];item.monthAmount12 = item.monthAmount["12"];item.monthAmount13 = 0;if (item.revenueType == "2") {item.revenueType = "藥品服務費收入";}if (item.revenueType == "3") {item.revenueType = "特藥服務費收入";}if (item.revenueType == "4") {item.revenueType = "直保經紀費";}if (item.revenueType == "5") {item.revenueType = "再保經紀費";}if (item.revenueType == "6") {item.revenueType = "廣告費";}for (const key in item.monthAmount) {item.monthAmount13 += item.monthAmount[key];}});this.excel = response.result;this.excell = this.excel;// 導出方法 利用Vue 的 ref 獲取所需的dom節點進行方法設置this.$refs.table.exportCsv({//導出文件標題filename: "收入信息",//導出文件集合(內容)columns: this.queryColumns11.filter((col, index) => index < 100000),data: this.excel.filter((data, index) => index < 100000),});this.$Spin.hide();resolve();}).catch((error) => {this.$Spin.hide();reject(error);});});},

總結

以上是生活随笔為你收集整理的Table 表格导出功能的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。