Commit 8e0c9cd0 by dong

fix

parent aacfe3b9
...@@ -428,10 +428,9 @@ def list(): ...@@ -428,10 +428,9 @@ def list():
# 导出数据 # 导出数据
@api_import.route("/keyproject/keyproject/export", methods=["POST"]) @api_import.route("/keyproject/keyproject/export", methods=["POST"])
def export(): def export():
req_dic = request.get_json()
token = request.headers['token'] token = request.headers['token']
# path = './apps/statics/project_file/' # path = 'D:/中研项目代码/mancheng/apps/statics/project_files/'
# pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'D:/中研项目代码/mancheng/apps/statics/project_files/' # 项目路径
path = '/root/code/dist_mancheng/aaa_statics/project_file/' path = '/root/code/dist_mancheng/aaa_statics/project_file/'
pro_path = 'https://mancheng.industrychain.online' + '/aaa_statics/project_file/' # 项目路径 pro_path = 'https://mancheng.industrychain.online' + '/aaa_statics/project_file/' # 项目路径
...@@ -487,7 +486,8 @@ def export(): ...@@ -487,7 +486,8 @@ def export():
for i in range(rows): for i in range(rows):
for j in range(cols): for j in range(cols):
sheet.write(i + 1, j, target_data_list[i][j]) sheet.write(i + 1, j, target_data_list[i][j])
file_name = "重点项目.xlsx" time_stamp = '{0:%Y%m%d%H%M%S}'.format(datetime.now())
file_name = "重点项目{}.xlsx".format(time_stamp)
excel.save(path + file_name) excel.save(path + file_name)
record_log(token, "导出了项目台账") record_log(token, "导出了项目台账")
return jsonify(code=RET.OK, url=pro_path + file_name, msg="导出/下载成功!") return jsonify(code=RET.OK, url=pro_path + file_name, msg="导出/下载成功!")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment