chore: remove archive dir; ignore archive and 归档
3
.gitignore
vendored
|
|
@ -27,6 +27,9 @@ dist/
|
||||||
**/build/
|
**/build/
|
||||||
**/dist/
|
**/dist/
|
||||||
|
|
||||||
|
archive/
|
||||||
|
归档/
|
||||||
|
|
||||||
# env
|
# env
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
|
|
||||||
19
archive/Zhibo/zhibo-1201/.gitignore
vendored
|
|
@ -1,19 +0,0 @@
|
||||||
.idea/
|
|
||||||
app/unpackage
|
|
||||||
Crmeb-2022-01-04.log
|
|
||||||
crmeb_front_log
|
|
||||||
crmeb/LOG_HOME_IS_UNDEFINED
|
|
||||||
*.
|
|
||||||
*.
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Large files
|
|
||||||
*.zip
|
|
||||||
*.sql
|
|
||||||
*.dump
|
|
||||||
*.tar.gz
|
|
||||||
*.rar
|
|
||||||
*.7z
|
|
||||||
|
|
||||||
# Working directories
|
|
||||||
.claude/
|
|
||||||
|
|
@ -1,201 +0,0 @@
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
@ -1,168 +0,0 @@
|
||||||
|
|
||||||
<div align="center" >
|
|
||||||
<img src="https://images.gitee.com/uploads/images/2021/1109/164354_0aafe3d2_892944.gif" />
|
|
||||||
</div>
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
CRMEB开源商城系统Java版
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div align="center" >
|
|
||||||
<a href="http://www.crmeb.com">
|
|
||||||
<img src="https://img.shields.io/badge/License-apache2.0-green.svg?style=flat" />
|
|
||||||
</a>
|
|
||||||
<a href='https://gitee.com/ZhongBangKeJi/crmeb_java/members'>
|
|
||||||
<img src='https://gitee.com/ZhongBangKeJi/crmeb_java/badge/fork.svg?theme=dark' alt='fork'></img>
|
|
||||||
</a>
|
|
||||||
<a href='https://gitee.com/ZhongBangKeJi/crmeb_java/stargazers'>
|
|
||||||
<img src='https://gitee.com/ZhongBangKeJi/crmeb_java/badge/star.svg?theme=dark' alt='star'></img>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
####
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
[官网](https://www.crmeb.com/) |
|
|
||||||
[在线体验](https://admin.java.crmeb.net) |
|
|
||||||
[帮助文档](https://doc.crmeb.com/java/crmeb_java) |
|
|
||||||
[技术社区](https://www.crmeb.com/ask/)
|
|
||||||
|
|
||||||
[comment]: <> ([宽屏预览](https://gitee.com/ZhongBangKeJi/crmeb_java/blob/master/README.md))
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div align="center" >
|
|
||||||
<a href="https://gitee.com/ZhongBangKeJi/crmeb_java/blob/master/README.md">宽 屏 预 览</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
如果对您有帮助,您可以点右上角 "Star" ❤️ 支持一下 谢谢!
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
### 📖 项目介绍:
|
|
||||||
|
|
||||||
CRMEB开源商城系统Java版,是一款基于Apache-2.0协议发布的开源电商解决方案。代码全开源无加密,可免费商用,适合各类企业及开发者快速构建多端一体化商城。
|
|
||||||
|
|
||||||
#### 技术架构
|
|
||||||
系统采用Java + Vue + uni-app技术栈,基于SpringBoot框架构建,前后端分离架构设计清晰。借助uni-app的跨端能力,轻松实现小程序、公众号、H5、APP、PC端全覆盖,数据统一、业务同步,极大提升开发与维护效率。同时,系统代码规范清晰,注释详尽,二次开发十分方便。
|
|
||||||
|
|
||||||
#### 核心功能
|
|
||||||
管理功能全面
|
|
||||||
系统核心管理功能完善,包含商品管理(支持SKU、属性、分类、评价)、订单管理、用户管理、购物车、物流管理、财务统计、多种支付方式等。
|
|
||||||
|
|
||||||
#### 丰富的营销工具
|
|
||||||
10余种营销功能能充分满足日常需求,包括拼团、砍价、秒杀、优惠券、签到、积分、等级会员、余额充值、分销裂变、活动边框、氛围图等,可灵活设置活动规则。
|
|
||||||
|
|
||||||
#### 可视化页面DIY装修
|
|
||||||
系统支持页面DIY设计,内置21种组件可自由拖拽设置,无需编码即可快速搭建个性化页面。<br>
|
|
||||||
图片热区:在一张图片中,为不同位置添加不同的跳转链接。<br>
|
|
||||||
图片魔方:一个组件,6种布局样式可选,能灵活满足使用需求。<br>
|
|
||||||
导航跳转:不仅能跳转商城内部页面,也能根据具体的运营环境跳转小程序、H5等。<br>
|
|
||||||
每种组件都有多种样式可选,组件细节支持自由调整。<br>
|
|
||||||
|
|
||||||
#### 社区共建计划
|
|
||||||
我们致力于打造开发者友好生态,开放源码、持续更新功能模块,并欢迎开发者提交优化建议或贡献代码。通过共享技术成果,降低行业重复造轮子成本,推动开源电商系统的可持续发展。
|
|
||||||
|
|
||||||
CRMEB开源商城PHP:https://gitee.com/ZhongBangKeJi/CRMEB
|
|
||||||
|
|
||||||
|
|
||||||
系统代码全开源无加密,独立部署、二开方便,适用于企业新零售、分销、拼团、砍价,秒杀等各种业务需求。
|
|
||||||
|
|
||||||
[](https://www.crmeb.com/index/java_merchant)
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
### 系统优势
|
|
||||||
#### 成熟稳定的架构
|
|
||||||
后端:SpringBoot + SpringSecurity,前端:Vue + ElementUI(PC管理端)与uni-app(移动端),多端并行开发,结构清晰。
|
|
||||||
#### 规范的接口设计
|
|
||||||
提供规范的RESTful API与数据结构,接口复用率高,逻辑层次清晰,便于二次开发与系统集成。
|
|
||||||
#### 数据与统计
|
|
||||||
集成ECharts实现多维数据看板,支持订单、用户、资金等多维度统计分析,数据可导出,助力运营决策。
|
|
||||||
#### 高效开发支持
|
|
||||||
支持Vue表单拖拽生成,大幅减少前端重复工作,提升开发效率。
|
|
||||||
#### 精细权限控制
|
|
||||||
基于Spring Security实现角色权限控制,可精确到按钮级别,保障系统安全。
|
|
||||||
#### 高可用设计
|
|
||||||
内置Redis队列,有效削峰解耦,提升系统并发能力与稳定性。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 技术特点
|
|
||||||
#### 💻 运行环境及框架:
|
|
||||||
~~~
|
|
||||||
1. 移动端uniapp开发框架 可生成H5 公众号 微信小程序
|
|
||||||
2. WEB Pc 管理后台使用Vue + Element UI 开发 兼容主流浏览器 ie11+
|
|
||||||
3. 后台服务 Java SpringBoot + Mybatis-plus + Mysql + redis
|
|
||||||
4. 运行环境 linux和windows等都支持,只要有Java环境和对应的数据库 redis
|
|
||||||
5. 运行条件 Java 1.8 Mysql5.7
|
|
||||||
~~~
|
|
||||||
|
|
||||||
#### 🔧 Java项目框架 和 WEB PC 项目运行环境
|
|
||||||
~~~
|
|
||||||
1. SpringBoot 2.2.6.RELEASE
|
|
||||||
2. Maven 3.6.1
|
|
||||||
3. swagger-bootstrap-ui 1.0
|
|
||||||
4. Mybatis Plus 3.3.1
|
|
||||||
5. npm 6
|
|
||||||
6. node 14
|
|
||||||
7. vue 2.x
|
|
||||||
8. element ui 2.13
|
|
||||||
~~~
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### 🧭 项目代码包介绍
|
|
||||||
~~~
|
|
||||||
1. admin WEB程序 PC端管理端 VUE + ElementUi
|
|
||||||
2. app 移动商城 UniApp标准开发(H5 + 微信小程序)
|
|
||||||
3. crmeb Api Java SpringBoot + mybatisPlus
|
|
||||||
4. 接口文档 Api对应的接口文档也可以部署项目后查看
|
|
||||||
5. 移动端 uniapp 开发 使用 HbuilderX 开发
|
|
||||||
~~~
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 系统演示
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
管理后台:https://admin.java.crmeb.net <br>
|
|
||||||
账号:demo<br>
|
|
||||||
密码:crmeb.com<br>
|
|
||||||
|
|
||||||
H5端:https://java.crmeb.net<br>
|
|
||||||
|
|
||||||
### 项目资料
|
|
||||||
资料支持<br>
|
|
||||||
使用文档:https://doc.crmeb.com/java/crmeb_java/1868<br>
|
|
||||||
接口文档:https://s.apifox.cn/f6079100-abee-40fe-959d-846e44f1a048<br>
|
|
||||||
数据字典:https://doc.crmeb.com/java/crmeb_java/5410<br>
|
|
||||||
二开文档:https://doc.crmeb.com/java<br>
|
|
||||||
技术社区:https://www.crmeb.com/ask/thread/list/152<br>
|
|
||||||
|
|
||||||
安装教程<br>
|
|
||||||
快速安装视频教程: [点击查看](https://www.bilibili.com/video/BV1MAiiY5EtP/?spm_id_from=333.1387.search.video_card.click&vd_source=9cea4dcdafd21c93762100c496e0f2a3)<br>
|
|
||||||
|
|
||||||
安装步骤详解:https://doc.crmeb.com/java/crmeb_java/2154<br>
|
|
||||||
|
|
||||||
---
|
|
||||||
### CRMEB开源技术交流
|
|
||||||
欢迎加入CRMEB开源技术交流群,扫码进群免费领取接口文档、功能清单、UI设计图、思维导图等资源!
|
|
||||||

|
|
||||||
|
|
||||||
您还可以在 [CRMEB技术社区](https://www.crmeb.com/ask/thread/list/152) 中提交Bug、交流解决方案、获取官方更新动态,CRMEB技术社区伴您一路前行。
|
|
||||||
|
|
||||||
|
|
||||||
[](https://www.crmeb.com/index/java_merchant)
|
|
||||||
|
|
||||||
[](https://www.crmeb.com/index/java_merchant)
|
|
||||||
|
|
||||||
[](https://www.crmeb.com/index/java_merchant)
|
|
||||||
|
|
||||||
[](https://www.crmeb.com/index/java_merchant)
|
|
||||||
|
|
@ -1,124 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import pymysql
|
|
||||||
|
|
||||||
# 数据库连接配置
|
|
||||||
db_config = {
|
|
||||||
'host': '1.15.149.240',
|
|
||||||
'user': 'zhibo',
|
|
||||||
'password': 'zCETFpGMwYN3CNeH',
|
|
||||||
'database': 'zhibo',
|
|
||||||
'charset': 'utf8mb4'
|
|
||||||
}
|
|
||||||
|
|
||||||
# 连接数据库
|
|
||||||
conn = pymysql.connect(**db_config)
|
|
||||||
cursor = conn.cursor(pymysql.cursors.DictCursor)
|
|
||||||
|
|
||||||
# 查询所有显示的菜单
|
|
||||||
sql = """
|
|
||||||
SELECT id, pid, name, component, menu_type, sort, is_show
|
|
||||||
FROM eb_system_menu
|
|
||||||
WHERE is_show = 1
|
|
||||||
ORDER BY pid, sort, id
|
|
||||||
"""
|
|
||||||
|
|
||||||
cursor.execute(sql)
|
|
||||||
all_menus = cursor.fetchall()
|
|
||||||
|
|
||||||
# 构建菜单树
|
|
||||||
menu_tree = {}
|
|
||||||
for menu in all_menus:
|
|
||||||
if menu['pid'] == 0:
|
|
||||||
if menu['id'] not in menu_tree:
|
|
||||||
menu_tree[menu['id']] = {'info': menu, 'children': []}
|
|
||||||
else:
|
|
||||||
menu_tree[menu['id']]['info'] = menu
|
|
||||||
|
|
||||||
# 添加子菜单
|
|
||||||
for menu in all_menus:
|
|
||||||
if menu['pid'] != 0:
|
|
||||||
parent_id = menu['pid']
|
|
||||||
if parent_id not in menu_tree:
|
|
||||||
menu_tree[parent_id] = {'info': None, 'children': []}
|
|
||||||
menu_tree[parent_id]['children'].append(menu)
|
|
||||||
|
|
||||||
# 生成Markdown文档
|
|
||||||
output = """# 系统完整菜单结构
|
|
||||||
|
|
||||||
> 生成时间:2024-12-04
|
|
||||||
> 说明:本文档记录了系统中所有一级菜单及其子菜单的完整层级结构
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📋 菜单统计
|
|
||||||
|
|
||||||
- **一级菜单总数**: {total_level1}
|
|
||||||
- **子菜单总数**: {total_children}
|
|
||||||
- **菜单总数**: {total_all}
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🗂️ 完整菜单结构
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
# 统计
|
|
||||||
total_level1 = len([m for m in all_menus if m['pid'] == 0])
|
|
||||||
total_children = len([m for m in all_menus if m['pid'] != 0])
|
|
||||||
total_all = len(all_menus)
|
|
||||||
|
|
||||||
output = output.format(
|
|
||||||
total_level1=total_level1,
|
|
||||||
total_children=total_children,
|
|
||||||
total_all=total_all
|
|
||||||
)
|
|
||||||
|
|
||||||
# 按sort排序一级菜单
|
|
||||||
sorted_level1 = sorted(
|
|
||||||
[(k, v) for k, v in menu_tree.items() if v['info'] is not None],
|
|
||||||
key=lambda x: (x[1]['info']['sort'], x[1]['info']['id'])
|
|
||||||
)
|
|
||||||
|
|
||||||
# 生成菜单列表
|
|
||||||
for idx, (menu_id, menu_data) in enumerate(sorted_level1, 1):
|
|
||||||
menu_info = menu_data['info']
|
|
||||||
children = menu_data['children']
|
|
||||||
|
|
||||||
# 一级菜单标题
|
|
||||||
output += f"\n### {idx}. {menu_info['name']}\n\n"
|
|
||||||
output += f"- **菜单ID**: {menu_info['id']}\n"
|
|
||||||
output += f"- **路由路径**: `{menu_info['component']}`\n"
|
|
||||||
output += f"- **菜单类型**: {menu_info['menu_type']}\n"
|
|
||||||
output += f"- **排序**: {menu_info['sort']}\n"
|
|
||||||
|
|
||||||
if children:
|
|
||||||
output += f"- **子菜单数量**: {len(children)}\n\n"
|
|
||||||
output += "#### 子菜单列表:\n\n"
|
|
||||||
# 按sort排序子菜单
|
|
||||||
sorted_children = sorted(children, key=lambda x: (x['sort'], x['id']))
|
|
||||||
for child_idx, child in enumerate(sorted_children, 1):
|
|
||||||
output += f"{child_idx}. **{child['name']}**\n"
|
|
||||||
output += f" - ID: {child['id']}\n"
|
|
||||||
output += f" - 路径: `{child['component']}`\n"
|
|
||||||
output += f" - 类型: {child['menu_type']}\n"
|
|
||||||
output += f" - 排序: {child['sort']}\n\n"
|
|
||||||
else:
|
|
||||||
output += f"- **子菜单数量**: 0(无子菜单)\n\n"
|
|
||||||
|
|
||||||
output += "---\n"
|
|
||||||
|
|
||||||
# 保存文件
|
|
||||||
output_file = r'小张\行动\完整菜单结构.md'
|
|
||||||
with open(output_file, 'w', encoding='utf-8') as f:
|
|
||||||
f.write(output)
|
|
||||||
|
|
||||||
print(f"✅ 菜单结构已生成到文件: {output_file}")
|
|
||||||
print(f"📊 统计信息:")
|
|
||||||
print(f" - 一级菜单: {total_level1} 个")
|
|
||||||
print(f" - 子菜单: {total_children} 个")
|
|
||||||
print(f" - 总计: {total_all} 个")
|
|
||||||
|
|
||||||
# 关闭连接
|
|
||||||
cursor.close()
|
|
||||||
conn.close()
|
|
||||||
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 93 KiB |