Parcourir la source

:tada: 增加excel导出例子

smallchill il y a 6 ans
Parent
commit
3e5342ec5b

+ 7 - 0
public/cdn/xlsx/FileSaver.min.js

@@ -0,0 +1,7 @@
+/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
+var saveAs=saveAs||"undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var k=a.document,n=k.createElementNS("http://www.w3.org/1999/xhtml","a"),w="download"in n,x=function(c){var e=k.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,a,0,0,0,0,0,!1,!1,!1,!1,0,null);c.dispatchEvent(e)},q=a.webkitRequestFileSystem,u=a.requestFileSystem||q||a.mozRequestFileSystem,
+  y=function(c){(a.setImmediate||a.setTimeout)(function(){throw c;},0)},r=0,s=function(c){var e=function(){"string"===typeof c?(a.URL||a.webkitURL||a).revokeObjectURL(c):c.remove()};a.chrome?e():setTimeout(e,500)},t=function(c,a,d){a=[].concat(a);for(var b=a.length;b--;){var l=c["on"+a[b]];if("function"===typeof l)try{l.call(c,d||c)}catch(f){y(f)}}},m=function(c,e){var d=this,b=c.type,l=!1,f,p,k=function(){t(d,["writestart","progress","write","writeend"])},g=function(){if(l||!f)f=(a.URL||a.webkitURL||
+    a).createObjectURL(c);p?p.location.href=f:void 0==a.open(f,"_blank")&&"undefined"!==typeof safari&&(a.location.href=f);d.readyState=d.DONE;k();s(f)},h=function(a){return function(){if(d.readyState!==d.DONE)return a.apply(this,arguments)}},m={create:!0,exclusive:!1},v;d.readyState=d.INIT;e||(e="download");if(w)f=(a.URL||a.webkitURL||a).createObjectURL(c),n.href=f,n.download=e,x(n),d.readyState=d.DONE,k(),s(f);else{a.chrome&&b&&"application/octet-stream"!==b&&(v=c.slice||c.webkitSlice,c=v.call(c,0,
+    c.size,"application/octet-stream"),l=!0);q&&"download"!==e&&(e+=".download");if("application/octet-stream"===b||q)p=a;u?(r+=c.size,u(a.TEMPORARY,r,h(function(a){a.root.getDirectory("saved",m,h(function(a){var b=function(){a.getFile(e,m,h(function(a){a.createWriter(h(function(b){b.onwriteend=function(b){p.location.href=a.toURL();d.readyState=d.DONE;t(d,"writeend",b);s(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&g()};["writestart","progress","write","abort"].forEach(function(a){b["on"+
+  a]=d["on"+a]});b.write(c);d.abort=function(){b.abort();d.readyState=d.DONE};d.readyState=d.WRITING}),g)}),g)};a.getFile(e,{create:!1},h(function(a){a.remove();b()}),h(function(a){a.code===a.NOT_FOUND_ERR?b():g()}))}),g)}),g)):g()}},b=m.prototype;b.abort=function(){this.readyState=this.DONE;t(this,"abort")};b.readyState=b.INIT=0;b.WRITING=1;b.DONE=2;b.error=b.onwritestart=b.onprogress=b.onwrite=b.onabort=b.onerror=b.onwriteend=null;return function(a,b){return new m(a,b)}}}("undefined"!==typeof self&&
+  self||"undefined"!==typeof window&&window||this.content);"undefined"!==typeof module&&null!==module?module.exports=saveAs:"undefined"!==typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs});

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
public/cdn/xlsx/xlsx.full.min.js


+ 93 - 91
public/index.html

@@ -2,108 +2,110 @@
 <html>
 
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
-    <meta name="apple-mobile-web-app-capable" content="yes">
-    <meta name="apple-mobile-web-app-status-bar-style" content="black">
-    <meta name="format-detection" content="telephone=no">
-    <meta http-equiv="X-UA-Compatible" content="chrome=1" />
-    <link rel="stylesheet" href="<%= BASE_URL %>cdn/element-ui/2.8.2/theme-chalk/index.css">
-    <link rel="stylesheet" href="<%= BASE_URL %>cdn/animate/3.5.2/animate.css">
-    <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/index.css">
-    <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.0.0/index.css">
-    <link rel="icon" href="<%= BASE_URL %>favicon.png">
-    <title>Saber企业级开发平台</title>
-    <style>
-        html,
-        body,
-        #app {
-            height: 100%;
-            margin: 0;
-            padding: 0;
-        }
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
+  <meta name="apple-mobile-web-app-capable" content="yes">
+  <meta name="apple-mobile-web-app-status-bar-style" content="black">
+  <meta name="format-detection" content="telephone=no">
+  <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
+  <link rel="stylesheet" href="<%= BASE_URL %>cdn/element-ui/2.8.2/theme-chalk/index.css">
+  <link rel="stylesheet" href="<%= BASE_URL %>cdn/animate/3.5.2/animate.css">
+  <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/index.css">
+  <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.0.0/index.css">
+  <script src="<%= BASE_URL %>cdn/xlsx/FileSaver.min.js"></script>
+  <script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script>
+  <link rel="icon" href="<%= BASE_URL %>favicon.png">
+  <title>Saber企业级开发平台</title>
+  <style>
+    html,
+    body,
+    #app {
+      height: 100%;
+      margin: 0;
+      padding: 0;
+    }
 
-        .avue-home {
-            background-color: #303133;
-            height: 100%;
-            display: flex;
-            flex-direction: column;
-        }
+    .avue-home {
+      background-color: #303133;
+      height: 100%;
+      display: flex;
+      flex-direction: column;
+    }
 
-        .avue-home__main {
-            user-select: none;
-            width: 100%;
-            flex-grow: 1;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-            flex-direction: column;
-        }
+    .avue-home__main {
+      user-select: none;
+      width: 100%;
+      flex-grow: 1;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      flex-direction: column;
+    }
 
-        .avue-home__footer {
-            width: 100%;
-            flex-grow: 0;
-            text-align: center;
-            padding: 1em 0;
-        }
+    .avue-home__footer {
+      width: 100%;
+      flex-grow: 0;
+      text-align: center;
+      padding: 1em 0;
+    }
 
-        .avue-home__footer>a {
-            font-size: 12px;
-            color: #ABABAB;
-            text-decoration: none;
-        }
+    .avue-home__footer > a {
+      font-size: 12px;
+      color: #ABABAB;
+      text-decoration: none;
+    }
 
-        .avue-home__loading {
-            height: 32px;
-            width: 32px;
-            margin-bottom: 20px;
-        }
+    .avue-home__loading {
+      height: 32px;
+      width: 32px;
+      margin-bottom: 20px;
+    }
 
-        .avue-home__title {
-            color: #FFF;
-            font-size: 14px;
-            margin-bottom: 10px;
-        }
+    .avue-home__title {
+      color: #FFF;
+      font-size: 14px;
+      margin-bottom: 10px;
+    }
 
-        .avue-home__sub-title {
-            color: #ABABAB;
-            font-size: 12px;
-        }
-    </style>
+    .avue-home__sub-title {
+      color: #ABABAB;
+      font-size: 12px;
+    }
+  </style>
 </head>
 
 <body>
-    <noscript>
-        <strong>
-            很抱歉,如果没有 JavaScript 支持,Saber 将不能正常工作。请启用浏览器的 JavaScript 然后继续。
-        </strong>
-    </noscript>
-    <div id="app">
-        <div class="avue-home">
-            <div class="avue-home__main">
-                <img class="avue-home__loading" src="./svg/loading-spin.svg" alt="loading">
-                <div class="avue-home__title">
-                    正在加载资源
-                </div>
-                <div class="avue-home__sub-title d">
-                    初次加载资源可能需要较多时间 请耐心等待
-                </div>
-            </div>
-            <div class="avue-home__footer">
-                <a href="https://bladex.vip" target="_blank">
-                  https://bladex.vip </a>
-            </div>
-        </div>
+<noscript>
+  <strong>
+    很抱歉,如果没有 JavaScript 支持,Saber 将不能正常工作。请启用浏览器的 JavaScript 然后继续。
+  </strong>
+</noscript>
+<div id="app">
+  <div class="avue-home">
+    <div class="avue-home__main">
+      <img class="avue-home__loading" src="./svg/loading-spin.svg" alt="loading">
+      <div class="avue-home__title">
+        正在加载资源
+      </div>
+      <div class="avue-home__sub-title d">
+        初次加载资源可能需要较多时间 请耐心等待
+      </div>
     </div>
-    <!-- built files will be auto injected -->
-    <script src="<%= BASE_URL %>util/aes.js" charset="utf-8"></script>
-    <script src="<%= BASE_URL %>cdn/vue/2.5.2/vue.min.js" charset="utf-8"></script>
-    <script src="<%= BASE_URL %>cdn/vuex/2.4.1/vuex.min.js" charset="utf-8"></script>
-    <script src="<%= BASE_URL %>cdn/vue-router/3.0.1/vue-router.min.js" charset="utf-8"></script>
-    <script src="<%= BASE_URL %>cdn/axios/1.0.0/axios.min.js" charset="utf-8"></script>
-    <script src="<%= BASE_URL %>cdn/element-ui/2.8.2/index.js" charset="utf-8"></script>
-    <script src="<%= BASE_URL %>cdn/avue/2.0.0/avue.min.js" charset="utf-8"></script>
+    <div class="avue-home__footer">
+      <a href="https://bladex.vip" target="_blank">
+        https://bladex.vip </a>
+    </div>
+  </div>
+</div>
+<!-- built files will be auto injected -->
+<script src="<%= BASE_URL %>util/aes.js" charset="utf-8"></script>
+<script src="<%= BASE_URL %>cdn/vue/2.5.2/vue.min.js" charset="utf-8"></script>
+<script src="<%= BASE_URL %>cdn/vuex/2.4.1/vuex.min.js" charset="utf-8"></script>
+<script src="<%= BASE_URL %>cdn/vue-router/3.0.1/vue-router.min.js" charset="utf-8"></script>
+<script src="<%= BASE_URL %>cdn/axios/1.0.0/axios.min.js" charset="utf-8"></script>
+<script src="<%= BASE_URL %>cdn/element-ui/2.8.2/index.js" charset="utf-8"></script>
+<script src="<%= BASE_URL %>cdn/avue/2.0.0/avue.min.js" charset="utf-8"></script>
 </body>
 
 </html>

+ 1 - 0
src/views/desk/notice.vue

@@ -53,6 +53,7 @@
           index: true,
           viewBtn: true,
           selection: true,
+          excelBtn: true,
           column: [
             {
               label: "通知标题",

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff