[2015-10-27]后台导出excel---前端部分----question
1.以下这种方法是ok的
//-jade部分
button.btn.btn-primary.btn-sm(type="button" style="width: 114px;margin-left: 30px" ng-click="exportcsv()") 导出Excel
//-coffee部分:加上表格的查询条件传到后台,然后进行导出
$scope.exportcsv=()-> $scope.page = 1 if !$scope.querytext $scope.querytext="" $scope.input=[$scope.querystyle,$scope.querytext] if $scope.belonged is undefined $scope.belonged = "" if $scope.operation is undefined $scope.operation = "" if $scope.firm is undefined $scope.firm = "" if $scope.statusplan is undefined $scope.statusplan = "" if $scope.station_name is undefined $scope.station_name = "所有站点" if $scope.locat is undefined $scope.locat = "" if $scope.alertcheck is undefined $scope.alertcheck = false location.href="/api/outRepair/?"+ "after="+$scope.after+'&'+ "before="+$scope.before+'&'+ "after_last="+$scope.aftertwo+'&'+ "before_last="+$scope.beforetwo+'&'+ "alertcheck="+$scope.alertcheck+'&'+ "belonged="+$scope.belonged+'&'+ "conditions="+$scope.input[0]+'&'+ "contents="+$scope.input[1]+'&'+ "firm="+$scope.firm+'&'+ "operation="+$scope.operation+'&'+ "page="+$scope.page+'&'+ "per_page="+$scope.per_page+'&'+ "plan_status="+$scope.statusplan+'&'+ "station_name="+$scope.station_name+'&'+ "locat="+$scope.locat
2.以下此种方法是不ok的,不知道为什么有问题,后台是python写,是不是导出必须要是链接形式?
//-jade部分
button.btn.btn-primary.btn-sm(type="button" style="width: 114px;margin-left: 30px" ng-click="exportcsv()") 导出Excel
//-coffee部分:加上表格的查询条件传到后台,然后进行导出
在这个上添加 jianxiuexceldata
module.exports=($scope,$rootScope,$modal,$http,locatdata,overhaulRegulatordata,allDatas,jianxiuexceldata,alertdata) ->
$scope.exportcsv=()-> jianxiuexceldata.excelport($scope.alertcheck,$scope.input,$scope.after,$scope.before,$scope.aftertwo,$scope.beforetwo,$scope.page,$scope.per_page,$scope.belonged,$scope.operation,$scope.firm,$scope.statusplan,$scope.station_name,$scope.locat).success (data)-> console.log "excel导出成功"
//-main.coffee部分---接口部分
app.factory "jianxiuexceldata", ($http) -> url = "api/outRepair/" return { excelport: (alertcheck,input,after,before,after_last,before_last,page,per_page,belonged,operation,firm,plan_status,station_name,locat)-> $http.get "#{url}",{ "params": "alertcheck": alertcheck "conditions": input[0] "contents": input[1] "after": after "before": before "after_last": after_last "before_last": moment(before_last).add(1,'days').format("YYYY-MM-DD") "page" : page "per_page" : per_page "belonged" : belonged "operation" : operation "firm" : firm "plan_status" : plan_status "locat": locat "station_name": station_name } }
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 大模型 Token 究竟是啥:图解大模型Token
· 35岁程序员的中年求职记:四次碰壁后的深度反思
· 继承的思维:从思维模式到架构设计的深度解析
· 如何在 .NET 中 使用 ANTLR4
· 后端思维之高并发处理方案
· 感觉程序员要被 AI 淘汰了?学什么才有机会?
· BotSharp + MCP 三步实现智能体开发
· AI团队比单打独斗强!CrewAI多智能体协作系统开发踩坑全解析
· 3. RabbitMQ 的(Hello World) 和 RabbitMQ 的(Work Queue
· 动物智能之数据标注员——狗篇