forked from kidgrow-microservices-platform

er
2020-04-03 a447a4f4e85fc8aff5632de92026fe7caa03335e
kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/dataNeed.html
@@ -161,12 +161,37 @@
                }
            }
        }
         // 导出
         $('#app-btn-export').click(function () {
            var url = config.base_server + 'api-opration/dataneed/export';
            var xhr = new XMLHttpRequest();
            xhr.open('POST', url, true);
            xhr.responseType = "blob";
            xhr.setRequestHeader("client_type", "DESKTOP_WEB");
            xhr.setRequestHeader("Authorization", "Bearer " + config.getToken().access_token);
            xhr.onload = function() {
                if (this.status == 200) {
                    var fileName = "user.xlsx";
                    var blob = this.response;
                    var a = document.createElement('a');
                    a.innerHTML = fileName;
                    // 指定生成的文件名
                    a.download = fileName;
                    a.href = URL.createObjectURL(blob);
                    document.body.appendChild(a);
                    var evt = document.createEvent("MouseEvents");
                    evt.initEvent("click", false, false);
                    a.dispatchEvent(evt);
                    document.body.removeChild(a);
                }
            }
            xhr.send();
        });
        // 添加按钮点击事件
        $('#app-btn-add').click(function () {
            showEditModel();
        });
        // $('#app-btn-add').click(function () {
        //     showEditModel();
        // });
        // // 显示编辑弹窗
        // var showEditModel = function (data) {