This commit is contained in:
XXAY
2021-09-24 16:05:56 +08:00
parent 04b4cbc2ed
commit 8908b88284
48 changed files with 2473 additions and 521 deletions

View File

@@ -6,13 +6,14 @@ import pandas as pd
from Simple_Drawing.settings import BASE_DIR
url_ = "127.0.0.1:8000"
tools_path = os.path.join(BASE_DIR, "tools_sofa")
url_ = "http://127.0.0.1:8000"
def random_color():
color_list = ["#009688", '#5FB878', '#393D49',
'#1E9FFF', '#FFB800', '#FF5722',
'#01AAED', '#2F4056']
'#1E9FFF', '#FFB800', '#FF5722',
'#01AAED', '#2F4056']
return random.choice(color_list)

View File

@@ -52,11 +52,16 @@ def up_file(request):
def download(request):
file_name = request.GET.get("name", None)
sort = request.GET.get("sort", "chart")
ee = request.GET.get("ee", None)
if sort == "tools":
file_id = request.GET.get("file_id") # 工作编号
name_path = os.path.join(BASE_DIR, "file_keep", "tools", "file", f"{file_id}")
in_file = f"out.txt"
elif ee == "1":
file_downlode_type = request.GET.get("file_downlode_type") # 文件类型
file_id = request.GET.get("file_id") # 工作编号
name_path = os.path.join(BASE_DIR, "file_keep", "chart", "file", f"{file_id}.{file_downlode_type}")
in_file = f"out.{file_downlode_type}"
elif file_name is None:
file_downlode_type = request.GET.get("file_downlode_type") # 文件类型
file_id = request.GET.get("file_id") # 工作编号