Compare commits
2 Commits
9cbc90cc37
...
26554c7f29
| Author | SHA1 | Date | |
|---|---|---|---|
| 26554c7f29 | |||
| 51286ae181 |
Binary file not shown.
Binary file not shown.
@@ -1,101 +1,101 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load custom_filters %}
|
{% load custom_filters %}
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="{% static 'huodong/output.css' %}">
|
<link rel="stylesheet" href="{% static 'huodong/output.css' %}">
|
||||||
<title>分支机构活动管理</title>
|
<title>分支机构活动管理</title>
|
||||||
<script src="https://unpkg.com/alpinejs@3.14.1/dist/cdn.min.js" defer></script>
|
<script src="https://unpkg.com/alpinejs@3.14.1/dist/cdn.min.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="font-sans text-gray-900">
|
<body class="font-sans text-gray-900">
|
||||||
|
|
||||||
<!-- 顶部标题 -->
|
<!-- 顶部标题 -->
|
||||||
<header class="bg-gray-50 dark:bg-gray-800 dark:border-gray-700 p-4 text-center text-xl font-bold">
|
<header class="bg-gray-50 dark:bg-gray-800 dark:border-gray-700 p-4 text-center text-xl font-bold">
|
||||||
分支机构活动管理
|
分支机构活动管理 {{ ''|get_current_year }}年
|
||||||
<br>
|
<br>
|
||||||
2025年
|
<small>统计周期:{{ ''|get_statistic_period }}</small>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- 主体内容:左右两侧栏布局 -->
|
<!-- 主体内容:左右两侧栏布局 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<!-- 左侧边栏 -->
|
<!-- 左侧边栏 -->
|
||||||
<aside class="w-27 bg-gray-300 p-4 ">
|
<aside class="w-27 bg-gray-300 p-4 ">
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
<ul class="flex flex-col space-y-8 text-lg">
|
<ul class="flex flex-col space-y-8 text-lg">
|
||||||
{% if request.resolver_match.view_name != 'branch-all' %}
|
{% if request.resolver_match.view_name != 'branch-all' %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'branch-all' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
<a href="{% url 'branch-all' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
||||||
返回首页
|
返回首页
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'branchinfo' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
<a href="{% url 'branchinfo' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
||||||
系统类型
|
系统类型
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'statistics' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
<a href="{% url 'statistics' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
||||||
活动的统计数据
|
活动的统计数据
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'contact-list' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
<a href="{% url 'contact-list' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
||||||
联系人信息
|
联系人信息
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'equipment-images' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
<a href="{% url 'equipment-images' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
||||||
设备间图片列表
|
设备间图片列表
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'public-screens' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
<a href="{% url 'public-screens' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
||||||
公共电子屏列表
|
公共电子屏列表
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'video-terminals' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
<a href="{% url 'video-terminals' %}" class="bg-transparent hover:bg-blue-900 hover:text-white p-2 rounded-md">
|
||||||
视频设备终端
|
视频设备终端
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/admin/" class="bg-gradient-to-r from-gray-700 to-gray-900 hover:from-gray-800 hover:to-black text-white p-3 rounded-md font-medium shadow-lg transition-all duration-300 flex items-center justify-between border-l-4 border-amber-500" target="_blank">
|
<a href="/admin/" class="bg-gradient-to-r from-gray-700 to-gray-900 hover:from-gray-800 hover:to-black text-white p-3 rounded-md font-medium shadow-lg transition-all duration-300 flex items-center justify-between border-l-4 border-amber-500" target="_blank">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-3 text-amber-400" viewBox="0 0 20 20" fill="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-3 text-amber-400" viewBox="0 0 20 20" fill="currentColor">
|
||||||
<path d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z" />
|
<path d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z" />
|
||||||
</svg>
|
</svg>
|
||||||
<span>后台管理</span>
|
<span>后台管理</span>
|
||||||
</div>
|
</div>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-amber-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-amber-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<!-- 主要内容区域 -->
|
<!-- 主要内容区域 -->
|
||||||
<main class="flex-1 bg-white p-4">
|
<main class="flex-1 bg-white p-4">
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- 右侧边栏 -->
|
<!-- 右侧边栏 -->
|
||||||
<!-- 注意:如果需要右侧边栏,请取消下方注释,并相应调整主内容区域的宽度 -->
|
<!-- 注意:如果需要右侧边栏,请取消下方注释,并相应调整主内容区域的宽度 -->
|
||||||
<!-- <aside class="w-1/3 bg-gray-300 p-4">
|
<!-- <aside class="w-1/3 bg-gray-300 p-4">
|
||||||
Right Sidebar
|
Right Sidebar
|
||||||
</aside> -->
|
</aside> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 页脚 -->
|
<!-- 页脚 -->
|
||||||
<footer class="bg-gray-200 p-4 text-center mt-4">
|
<footer class="bg-gray-200 p-4 text-center mt-4">
|
||||||
© 2025 My Website. All rights reserved.
|
© 2025 My Website. All rights reserved.
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Binary file not shown.
@@ -28,3 +28,47 @@ def format_chinese_full_date(value):
|
|||||||
weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
||||||
weekday = weekdays[date_obj.weekday()]
|
weekday = weekdays[date_obj.weekday()]
|
||||||
return f"{date_obj.year}年{date_obj.month}月{date_obj.day}日 {weekday}"
|
return f"{date_obj.year}年{date_obj.month}月{date_obj.day}日 {weekday}"
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def get_current_year(value=None):
|
||||||
|
"""
|
||||||
|
获取当前年份
|
||||||
|
"""
|
||||||
|
# 只有当value是datetime对象时才使用它,否则使用当前时间
|
||||||
|
if isinstance(value, datetime):
|
||||||
|
now = value
|
||||||
|
else:
|
||||||
|
now = datetime.now()
|
||||||
|
return now.year
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def get_statistic_period(value=None):
|
||||||
|
"""
|
||||||
|
计算统计周期
|
||||||
|
规则:
|
||||||
|
- 在2026年1月,实际统计的是2025年11月至2026年1月
|
||||||
|
- 在2026年2月,实际统计的是2025年12月至2026年2月
|
||||||
|
- 以此类推
|
||||||
|
"""
|
||||||
|
# 只有当value是datetime对象时才使用它,否则使用当前时间
|
||||||
|
if isinstance(value, datetime):
|
||||||
|
now = value
|
||||||
|
else:
|
||||||
|
now = datetime.now()
|
||||||
|
current_year = now.year
|
||||||
|
current_month = now.month
|
||||||
|
|
||||||
|
# 计算统计周期的开始月份和年份
|
||||||
|
if current_month <= 2:
|
||||||
|
start_year = current_year - 1
|
||||||
|
start_month = 11 + current_month
|
||||||
|
else:
|
||||||
|
start_year = current_year
|
||||||
|
start_month = current_month - 2
|
||||||
|
|
||||||
|
# 构建统计周期字符串
|
||||||
|
period = f"{start_year}年{start_month}月至{current_year}年{current_month}月"
|
||||||
|
|
||||||
|
return period
|
||||||
|
|||||||
Reference in New Issue
Block a user