From 3f91f973b97e5f435c0ace9b9247c33e559dc83e Mon Sep 17 00:00:00 2001 From: H0nGzA1 <2505811377@qq.com> Date: Tue, 14 Mar 2023 21:15:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E2=9C=A8=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=9F=BA=E7=A1=80=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/package.json | 1 + web/src/utils/message.ts | 17 + web/src/views/system/config/api.ts | 53 ++ .../system/config/components/addContent.vue | 156 ++++++ .../system/config/components/addTabs.vue | 60 +++ .../components/associationTable.vue | 104 ++++ .../system/config/components/formContent.vue | 505 ++++++++++++++++++ web/src/views/system/config/index.vue | 82 +++ web/yarn.lock | 5 + 9 files changed, 983 insertions(+) create mode 100644 web/src/utils/message.ts create mode 100644 web/src/views/system/config/api.ts create mode 100644 web/src/views/system/config/components/addContent.vue create mode 100644 web/src/views/system/config/components/addTabs.vue create mode 100644 web/src/views/system/config/components/components/associationTable.vue create mode 100644 web/src/views/system/config/components/formContent.vue create mode 100644 web/src/views/system/config/index.vue diff --git a/web/package.json b/web/package.json index 011b00b..65f946d 100644 --- a/web/package.json +++ b/web/package.json @@ -44,6 +44,7 @@ "vue-grid-layout": "^3.0.0-beta1", "vue-i18n": "^9.2.2", "vue-router": "^4.1.6", + "vxe-table": "^4.3.10", "xe-utils": "^3.5.7" }, "devDependencies": { diff --git a/web/src/utils/message.ts b/web/src/utils/message.ts new file mode 100644 index 0000000..0e3bc4b --- /dev/null +++ b/web/src/utils/message.ts @@ -0,0 +1,17 @@ +import { ElMessage, MessageOptions } from 'element-plus'; + +export function message(message: string, option?: MessageOptions) { + ElMessage({ message, ...option }); +} +export function successMessage(message: string, option?: MessageOptions) { + ElMessage({ message, ...option, type: 'success' }); +} +export function warningMessage(message: string, option?: MessageOptions) { + ElMessage({ message, ...option, type: 'warning' }); +} +export function errorMessage(message: string, option?: MessageOptions) { + ElMessage({ message, ...option, type: 'error' }); +} +export function infoMessage(message: string, option?: MessageOptions) { + ElMessage({ message, ...option, type: 'info' }); +} diff --git a/web/src/views/system/config/api.ts b/web/src/views/system/config/api.ts new file mode 100644 index 0000000..e8909e6 --- /dev/null +++ b/web/src/views/system/config/api.ts @@ -0,0 +1,53 @@ +import { request } from '/@/utils/service'; +import { PageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud'; +import XEUtils from 'xe-utils'; + +export const apiPrefix = '/api/system/system_config/'; +export function GetList(query: PageQuery) { + return request({ + url: apiPrefix, + method: 'get', + params: query, + }); +} +export function GetObj(id: InfoReq) { + return request({ + url: apiPrefix + id, + method: 'get', + }); +} + +export function AddObj(obj: AddReq) { + return request({ + url: apiPrefix, + method: 'post', + data: obj, + }); +} + +export function UpdateObj(obj: EditReq) { + return request({ + url: apiPrefix + obj.id + '/', + method: 'put', + data: obj, + }); +} + +export function DelObj(id: DelReq) { + return request({ + url: apiPrefix + id + '/', + method: 'delete', + data: { id }, + }); +} + +/* +获取所有的model及字段信息 + */ +export function GetAssociationTable() { + return request({ + url: apiPrefix + 'get_association_table/', + method: 'get', + params: {}, + }); +} diff --git a/web/src/views/system/config/components/addContent.vue b/web/src/views/system/config/components/addContent.vue new file mode 100644 index 0000000..6284a18 --- /dev/null +++ b/web/src/views/system/config/components/addContent.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/web/src/views/system/config/components/addTabs.vue b/web/src/views/system/config/components/addTabs.vue new file mode 100644 index 0000000..024595d --- /dev/null +++ b/web/src/views/system/config/components/addTabs.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/web/src/views/system/config/components/components/associationTable.vue b/web/src/views/system/config/components/components/associationTable.vue new file mode 100644 index 0000000..32af76b --- /dev/null +++ b/web/src/views/system/config/components/components/associationTable.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/web/src/views/system/config/components/formContent.vue b/web/src/views/system/config/components/formContent.vue new file mode 100644 index 0000000..9ebc0e5 --- /dev/null +++ b/web/src/views/system/config/components/formContent.vue @@ -0,0 +1,505 @@ + + + + + diff --git a/web/src/views/system/config/index.vue b/web/src/views/system/config/index.vue new file mode 100644 index 0000000..cb66dc2 --- /dev/null +++ b/web/src/views/system/config/index.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/web/yarn.lock b/web/yarn.lock index 280c629..48cc723 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -3956,6 +3956,11 @@ vuedraggable-es@^4.1.1: dependencies: sortablejs "1.14.0" +vxe-table@^4.3.10: + version "4.3.10" + resolved "https://registry.npmjs.org/vxe-table/-/vxe-table-4.3.10.tgz#4156d9542d61997d07c29a06e89208a3adc4825a" + integrity sha512-qxLhA3hiAfxsm8+dbN1n7+FrRwMEzUB/676x67gEb3H63WFWulRvTc88LCe0itMcuYcpy7uZHn5ruRsz0KnorQ== + wangeditor@^4.7.5: version "4.7.15" resolved "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.15.tgz#38c5e279a79d0428e4fd77ae5be46367e9c819e5" From 8321276133098dc69d5df13bea13455c8ef2d5b9 Mon Sep 17 00:00:00 2001 From: H0nGzA1 <2505811377@qq.com> Date: Tue, 14 Mar 2023 21:38:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=F0=9F=93=9D=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 182 ++++++++++++++++++++++++++++++++++++++++++++------- README.md | 2 +- 2 files changed, 158 insertions(+), 26 deletions(-) diff --git a/README.en.md b/README.en.md index 77a0668..8b7cad7 100644 --- a/README.en.md +++ b/README.en.md @@ -1,36 +1,168 @@ -# django-vue3-admin +# Django-Vue3-Admin -#### Description -django-vue3-admin +[![img](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitee.com/liqianglog/django-vue-admin/blob/master/LICENSE) [![img](https://img.shields.io/badge/python-%3E=3.7.x-green.svg)](https://python.org/) [![PyPI - Django Version badge](https://img.shields.io/badge/django%20versions-3.2-blue)](https://docs.djangoproject.com/zh-hans/3.2/) [![img](https://img.shields.io/badge/node-%3E%3D%2012.0.0-brightgreen)](https://nodejs.org/zh-cn/) [![img](https://gitee.com/liqianglog/django-vue-admin/badge/star.svg?theme=dark)](https://gitee.com/liqianglog/django-vue-admin) -#### Software Architecture -Software architecture description +[preview](https://demo.django-vue-admin.com) | [Official website document](https://www.django-vue-admin.com) | [qq group](https://qm.qq.com/cgi-bin/qm/qr?k=fOdnHhC8DJlRHGYSnyhoB8P5rgogA6Vs&jump_from=webapi) | [community](https://bbs.django-vue-admin.com) | [plugins market](https://bbs.django-vue-admin.com/plugMarket.html) | [Github](https://github.com/liqianglog/django-vue-admin) -#### Installation +💡 **「About」** -1. xxxx -2. xxxx -3. xxxx +We are a group of young people who love Code. In this hot era, we hope to calm down and bring some of our colors and colors through code. -#### Instructions +Because of love, so embrace the future -1. xxxx -2. xxxx -3. xxxx +## framework introduction -#### Contribution +💡 [django-vue-admin](https://gitee.com/dvadmin/django-vue-admin) Is a set of all open source rapid development platform, no reservation for individuals and enterprises free use. -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request +* 🧑‍🤝‍🧑Front-end adoption[D2Admin](https://github.com/d2-projects/d2-admin) 、[Vue](https://cn.vuejs.org/)、[ElementUI](https://element.eleme.cn/)。 +* 👭The backend uses the Python language Django framework as well as the powerful[Django REST Framework](https://pypi.org/project/djangorestframework)。 +* 👫Permission authentication use[Django REST Framework SimpleJWT](https://pypi.org/project/djangorestframework-simplejwt),Supports the multi-terminal authentication system. +* 👬Support loading dynamic permission menu, multi - way easy permission control. +* 💏 Special thanks:[D2Admin](https://github.com/d2-projects/d2-admin) 、[Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin)。 +* 💡 💏 Special thanks:[jetbrains](https://www.jetbrains.com/) To provide a free IntelliJ IDEA license for this open source project. +## Online experience -#### Gitee Feature +👩‍👧‍👦👩‍👧‍👦 demo address:[http://demo.django-vue-admin.com](http://demo.django-vue-admin.com) -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +* demo account:superadmin + +* demo password:admin123456 + +👩‍👦‍👦docs:[https://django-vue-admin.com](https://django-vue-admin.com) + +## communication + +* Communication community:[click here](https://bbs.django-vue-admin.com)👩‍👦‍👦 + +* plugins market:[click here](https://bbs.django-vue-admin.com/plugMarket.html)👩‍👦‍👦 + +## source code url: + +gitee(Main push):[https://gitee.com/liqianglog/django-vue-admin](https://gitee.com/liqianglog/django-vue-admin)👩‍👦‍👦 + +github:[https://github.com/liqianglog/django-vue-admin](https://github.com/liqianglog/django-vue-admin)👩‍👦‍👦 + +## core function + +1. 👨‍⚕️ Menu management: Configure the system menu, operation permissions, button permissions, back-end interface permissions, etc. +2. 🧑‍⚕️ Department management: Configure the system organization (company, department, role). +3. 👩‍⚕️ Role management: role menu permission allocation, data permission allocation, set roles according to the department for data range permission division. +4. 🧑‍🎓 Rights Specifies the rights of the authorization role. +5. 👨‍🎓 User management: The user is the system operator, this function mainly completes the system user configuration. +6. 👬 Interface whitelist: specifies the interface that does not need permission verification. +7. 🧑‍🔧 Dictionary management: Maintenance of some fixed data frequently used in the system. +8. 🧑‍🔧 Regional management: to manage provinces, cities, counties and regions. +9. 📁 Attachment management: Unified management of all files and pictures on the platform. +10. 🗓 ️operation logs: log and query the system normal operation; Log and query system exception information. +11.🔌 [plugins market] () : based on the Django framework - Vue - Admin application and plug-in development. + +## plugins market 🔌 + +* Celery Asynchronous task:[dvadmin-celery](https://gitee.com/huge-dream/dvadmin-celery) +* Upgrade center backend:[dvadmin-upgrade-center](https://gitee.com/huge-dream/dvadmin-upgrade-center) +* Upgrade center front:[dvadmin-upgrade-center-web](https://gitee.com/huge-dream/dvadmin-upgrade-center-web) + +## before start project you need: + +~~~ +Python >= 3.8.0 +nodejs >= 14.0 +Mysql >= 5.7.0 (Optional. The default database is sqlite3. 8.0 is recommended) +Redis(Optional, the latest edition) +~~~ + +## frontend♝ + +```bash +# clone code +git clone https://gitee.com/liqianglog/django-vue-admin.git + +# enter code dir +cd web + +# install dependence +npm install --registry=https://registry.npm.taobao.org + +# Start service +npm run dev +# Visit http://localhost:8080 in your browser +# Parameters such as boot port can be configured in the #.env.development file +# Build the production environment +# npm run build +``` + +## backend💈 + +~~~bash +1. enter code dir cd backend +2. copy ./conf/env.example.py to ./conf dir,rename as env.py +3. in env.py configure database information + mysql database recommended version: 8.0 + mysql database character set: utf8mb4 +4. install pip dependence + pip3 install -r requirements.txt +5. Execute the migration command: + python3 manage.py makemigrations + python3 manage.py migrate +6. Initialization data + python3 manage.py init +7. Initialize provincial, municipal and county data: + python3 manage.py init_area +8. start backend + python3 manage.py runserver 0.0.0.0:8000 +or daphne : + daphne -b 0.0.0.0 -p 8000 application.asgi:application +~~~ + +### visit backend swagger + +* visit url:[http://localhost:8080](http://localhost:8080) (The default address is this one. If you want to change it, follow the configuration file) +* account:`superadmin` password:`admin123456` + +### docker-compose + +~~~shell +docker-compose up -d +# Initialize backend data (first execution only) +docker exec -ti dvadmin-django bash +python manage.py makemigrations +python manage.py migrate +python manage.py init_area +python manage.py init +exit + +frontend url:http://127.0.0.1:8080 +backend url:http://127.0.0.1:8080/api +# Change 127.0.0.1 to your own public ip address on the server +account:`superadmin` password:`admin123456` + +# docker-compose stop +docker-compose down +# docker-compose restart +docker-compose restart +# docker-compose on start build +docker-compose up -d --build +~~~ + +## Demo screenshot✅ + +![image-01](https://images.gitee.com/uploads/images/2022/0530/234137_b58c8f98_5074988.png) + +![image-02](https://images.gitee.com/uploads/images/2022/0530/234240_39834603_5074988.png) + +![image-03](https://images.gitee.com/uploads/images/2022/0530/234339_35e728a0_5074988.png) + +![image-04](https://images.gitee.com/uploads/images/2022/0530/234426_957036b0_5074988.png) + +![image-05](https://images.gitee.com/uploads/images/2022/0530/234458_898be492_5074988.png) + +![image-06](https://images.gitee.com/uploads/images/2022/0530/234521_35b40076_5074988.png) + +![image-07](https://images.gitee.com/uploads/images/2022/0530/234615_c2325639_5074988.png) + +![image-08](https://images.gitee.com/uploads/images/2022/0530/234639_1ed6cc93_5074988.png) + +![image-09](https://images.gitee.com/uploads/images/2022/0530/234815_cea2c53f_5074988.png) + +![image-10](https://images.gitee.com/uploads/images/2022/0530/234840_5f3e5f53_5074988.png) diff --git a/README.md b/README.md index f7b5000..b85221b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Django-Vue-Admin +# Django-Vue3-Admin [![img](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitee.com/liqianglog/django-vue-admin/blob/master/LICENSE) [![img](https://img.shields.io/badge/python-%3E=3.7.x-green.svg)](https://python.org/) [![PyPI - Django Version badge](https://img.shields.io/badge/django%20versions-3.2-blue)](https://docs.djangoproject.com/zh-hans/3.2/) [![img](https://img.shields.io/badge/node-%3E%3D%2012.0.0-brightgreen)](https://nodejs.org/zh-cn/) [![img](https://gitee.com/liqianglog/django-vue-admin/badge/star.svg?theme=dark)](https://gitee.com/liqianglog/django-vue-admin)