From 372dabad6f579d6d3580eb0601a3865093bf0ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=9D=E5=B7=9D?= Date: Mon, 6 Dec 2021 15:44:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A1=AB=E6=8A=A5=20=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=A1=8C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- input/InputForm.py | 16 ++++++++++++++++ input/routes.py | 25 ++++++++++++++++++++++++- input/scripts.py | 24 ++++++++++++++++++++++++ input/static/json/industry.json | 19 +++++++++++++++++++ 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 input/static/json/industry.json diff --git a/input/InputForm.py b/input/InputForm.py index a9ecedf..c54ab17 100644 --- a/input/InputForm.py +++ b/input/InputForm.py @@ -50,3 +50,19 @@ class InputForm: res: desc """ pass + + @staticmethod + def choose_industry_obj(): + """ + 选择行业 + Parameters: + - + Returns: + res: desc + """ + return choose_industry_script() + + @staticmethod + def questionnaire_obj(): + return questionnaire_script() + diff --git a/input/routes.py b/input/routes.py index 664625c..18faaae 100644 --- a/input/routes.py +++ b/input/routes.py @@ -68,4 +68,27 @@ def submit_general_rating_input(**kwargs): res: desc """ info = "提交成功" - return {"info": "info"} + return {"info": info} + + +@input_route.route('choose_industry', methods=['GET']) +@verify_token +def choose_industry_route(**kwargs): + """ + Notes + Parameters: + - + Returns: + res: desc + """ + input_form = InputForm() + result = input_form.choose_industry_obj() + return {"info": "查询成功", "result": result} + + +# @input_route.route('questionnaire', methods=['GET']) +# @verify_token +# def questionnaire(): +# input_form = InputForm() +# result = input_form.questionnaire_obj() +# return {"info": "题目", "result": result} \ No newline at end of file diff --git a/input/scripts.py b/input/scripts.py index b1fdc62..1f8de2f 100644 --- a/input/scripts.py +++ b/input/scripts.py @@ -138,3 +138,27 @@ def save_general_input_form(cid, input_form): """ rid = find_rating_records({"企业ID": cid, "进行状态": "进行"})[0]['评价ID'] update_general_input(rid, input_form) + + +def choose_industry_script(): + """ + 选择行业 + Parameters: + - + Returns: + res: desc + """ + data = read_json_file(file_path('/input/static/json/industry.json')) + return data + + +def questionnaire_script(): + """ + Notes + Parameters: + param: desc + Returns: + res: desc + """ + data = read_json_file(file_path('/input/static/json/制造业.json')) + return data diff --git a/input/static/json/industry.json b/input/static/json/industry.json new file mode 100644 index 0000000..d2d0b21 --- /dev/null +++ b/input/static/json/industry.json @@ -0,0 +1,19 @@ +[ + { + "value": "制造业", + "children": [ + {"value": "化学工业"}, + {"value": "森林工业"}, + {"value": "食品工业"}, + {"value": "烟草工业"}, + {"value": "纺织工业"}, + {"value": "医药工业"}, + {"value": "机械工业"}, + {"value": "电子工业"}, + {"value": "轻工业"}, + {"value": "石油加工及炼焦业"}, + {"value": "冶金工业"}, + {"value": "建材工业"} + ] + } +] \ No newline at end of file