添加颜色信息 修改属性

This commit is contained in:
XXAY
2021-09-21 11:47:36 +08:00
parent fd86ceed02
commit 3cf5a291dd
5 changed files with 39 additions and 130 deletions
+1 -10
View File
@@ -46,21 +46,12 @@ def out_page(request, page):
# 处理上传文件 返回颜色列表
def up_file(request):
file = request.FILES.get("file")
col_name = request.POST.get("col_name", "color")
if col_name == "NO":
file_path, file_id = path_out("chart")
keep_file(file, file_path)
data = {"flag": file_id}
return JsonResponse(data)
file_path, file_id = path_out("chart")
keep_file(file, file_path)
col_list = pick_col(file_path, col_name)
data = {"flag": file_id}
data = {"flag": file_id, 'data': [{"title": f"color_{i}", 'name': i, } for i in col_list][:8]}
return JsonResponse(data)