v1.8.0 — 任务checkbox+删除线 + 拖拽排序 + 抽屉删除按钮
This commit is contained in:
@@ -395,7 +395,7 @@ def bootstrap():
|
||||
"recent": rows(conn, "SELECT * FROM follow_up_records ORDER BY id DESC LIMIT 8"),
|
||||
"risks": [{"title": "执行提醒", "content": x["next_action"]} for x in operations if x["next_action"]][:5],
|
||||
}
|
||||
return jsonify({"summary": summary, "sales": sales, "proposals": proposals, "operations": operations, "products": products, "finance": finance, "financeMonthly": monthly_finance(conn), "tasks": rows(conn, "SELECT * FROM project_tasks ORDER BY phase, id")})
|
||||
return jsonify({"summary": summary, "sales": sales, "proposals": proposals, "operations": operations, "products": products, "finance": finance, "financeMonthly": monthly_finance(conn), "tasks": rows(conn, "SELECT * FROM project_tasks ORDER BY phase, sort_order, id")})
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
@@ -406,7 +406,7 @@ TABLES = {
|
||||
"operations": ("operation_projects", ["project_name", "project_version", "project_type", "project_status", "current_stage", "owner", "target_customer", "customer_need", "expected_contract_amount", "expected_sign_date", "sign_probability", "next_action", "sop_stage", "execution_progress", "current_deliverable", "risks", "notes"]),
|
||||
"products": ("product_versions", ["product_name", "version", "version_goal", "feature_list", "launch_date", "status", "platform", "notes"]),
|
||||
"finance": ("finance_records", ["month", "project_name", "record_type", "category", "amount", "occurred_date", "notes"]),
|
||||
"tasks": ("project_tasks", ["project_id", "phase", "milestone", "task", "owner", "due_date", "blockers", "notes"]),
|
||||
"tasks": ("project_tasks", ["project_id", "phase", "milestone", "task", "owner", "due_date", "blockers", "notes", "status", "sort_order"]),
|
||||
}
|
||||
|
||||
|
||||
@@ -489,6 +489,19 @@ def delete_followup(followup_id):
|
||||
conn.close()
|
||||
|
||||
|
||||
@app.route("/api/tasks/batch-sort", methods=["POST"])
|
||||
def batch_sort_tasks():
|
||||
conn = db()
|
||||
try:
|
||||
items = request.get_json(force=True).get("items", [])
|
||||
for item in items:
|
||||
conn.execute("UPDATE project_tasks SET sort_order=? WHERE id=?", (item["sort_order"], item["id"]))
|
||||
conn.commit()
|
||||
return jsonify({"ok": True})
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
|
||||
@app.route("/api/files/upload", methods=["POST"])
|
||||
def upload_file():
|
||||
file = request.files["file"]
|
||||
|
||||
Reference in New Issue
Block a user