This commit is contained in:
parent
b189b282d3
commit
a1d3bc7c7e
29
app.py
29
app.py
|
|
@ -117,6 +117,35 @@ def view_customer(index):
|
||||||
is_first=is_first,
|
is_first=is_first,
|
||||||
is_last=is_last)
|
is_last=is_last)
|
||||||
|
|
||||||
|
# @app.route('/customer/<int:index>')
|
||||||
|
# def view_customer(index):
|
||||||
|
# # 判断是否有数据
|
||||||
|
# if not customer_data:
|
||||||
|
# return "No customer data provided.", 400
|
||||||
|
|
||||||
|
# # 确保 index 在合法范围内
|
||||||
|
# if index < 0 or index >= len(customer_data):
|
||||||
|
# return "Index out of range.", 400
|
||||||
|
|
||||||
|
# customer = customer_data[index]
|
||||||
|
|
||||||
|
# # 为每个 email addresses 列表中的项添加唯一的索引
|
||||||
|
# for domain, info in customer.items():
|
||||||
|
# print(f"..........domain={domain}")
|
||||||
|
# print(f"..........info={info}")
|
||||||
|
# if 'email addresses' in info and isinstance(info['email addresses'], list):
|
||||||
|
# for email_idx, email in enumerate(info['email addresses']):
|
||||||
|
# email['idx'] = email_idx # 给每个 email 项添加唯一的索引
|
||||||
|
|
||||||
|
# is_first = index == 0
|
||||||
|
# is_last = index == len(customer_data) - 1
|
||||||
|
|
||||||
|
# return render_template('edit_customers.html',
|
||||||
|
# customer=customer,
|
||||||
|
# index=index,
|
||||||
|
# is_first=is_first,
|
||||||
|
# is_last=is_last)
|
||||||
|
|
||||||
@app.route('/update/<int:index>', methods=['POST'])
|
@app.route('/update/<int:index>', methods=['POST'])
|
||||||
def update_customers(index):
|
def update_customers(index):
|
||||||
updated_data = request.form.to_dict(flat=False)
|
updated_data = request.form.to_dict(flat=False)
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,11 @@
|
||||||
window.location.href = "/customer/bottom"; // 跳转到后端“Bottom”路由
|
window.location.href = "/customer/bottom"; // 跳转到后端“Bottom”路由
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到指定页面
|
// 跳转到指定记录
|
||||||
function goToPage() {
|
function goToPage() {
|
||||||
const pageIndex = document.getElementById('pageIndex').value;
|
const pageIndex = document.getElementById('pageIndex').value;
|
||||||
if (pageIndex !== '') {
|
if (pageIndex !== '') {
|
||||||
window.location.href = `/customer/${pageIndex}`;
|
window.location.href = `/customer/${pageIndex}`; // 跳转到指定记录的路由
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue