提交
This commit is contained in:
0
backend/plugins/code_info/fixtures/__init__.py
Normal file
0
backend/plugins/code_info/fixtures/__init__.py
Normal file
1
backend/plugins/code_info/fixtures/init_dictionary.json
Normal file
1
backend/plugins/code_info/fixtures/init_dictionary.json
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
49
backend/plugins/code_info/fixtures/init_menu.json
Normal file
49
backend/plugins/code_info/fixtures/init_menu.json
Normal file
@@ -0,0 +1,49 @@
|
||||
[ {
|
||||
"name": "扫码信息",
|
||||
"icon": "ele-Bell",
|
||||
"sort": 8,
|
||||
"is_link": false,
|
||||
"is_catalog": true,
|
||||
"web_path": "/releaseInfo",
|
||||
"component": "",
|
||||
"component_name": "",
|
||||
"status": true,
|
||||
"cache": true,
|
||||
"visible": true,
|
||||
"parent": null,
|
||||
"children": [
|
||||
{
|
||||
"name": "扫码数据",
|
||||
"icon": "ele-Bell",
|
||||
"sort": 1,
|
||||
"is_link": false,
|
||||
"is_catalog": false,
|
||||
"web_path": "/scanData",
|
||||
"component": "plugins/scanInfo/src/scanData/index",
|
||||
"component_name": "scanData",
|
||||
"status": true,
|
||||
"cache": false,
|
||||
"visible": true,
|
||||
"children": [],
|
||||
"menu_button": [],
|
||||
"menu_field": []
|
||||
},{
|
||||
"name": "异常扫码记录",
|
||||
"icon": "ele-Bell",
|
||||
"sort": 2,
|
||||
"is_link": false,
|
||||
"is_catalog": false,
|
||||
"web_path": "/scanRecord",
|
||||
"component": "plugins/scanInfo/src/scanRecord/index",
|
||||
"component_name": "scanRecord",
|
||||
"status": true,
|
||||
"cache": false,
|
||||
"visible": true,
|
||||
"children": [],
|
||||
"menu_button": [],
|
||||
"menu_field": []
|
||||
}
|
||||
],
|
||||
"menu_button": [],
|
||||
"menu_field": []
|
||||
}]
|
||||
33
backend/plugins/code_info/fixtures/initialize.py
Normal file
33
backend/plugins/code_info/fixtures/initialize.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# 初始化
|
||||
import os
|
||||
|
||||
import django
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "application.settings")
|
||||
django.setup()
|
||||
|
||||
from dvadmin.system.fixtures.initSerializer import MenuInitSerializer, SystemConfigInitSerializer, \
|
||||
DictionaryInitSerializer
|
||||
|
||||
from dvadmin.utils.core_initialize import CoreInitialize
|
||||
|
||||
|
||||
class Initialize(CoreInitialize):
|
||||
|
||||
def init_menu(self):
|
||||
"""
|
||||
初始化菜单信息
|
||||
"""
|
||||
self.init_base(MenuInitSerializer, unique_fields=['name', 'web_path', 'component', 'component_name'])
|
||||
def init_dictionary(self):
|
||||
"""
|
||||
初始化字典表
|
||||
"""
|
||||
self.init_base(DictionaryInitSerializer, unique_fields=['value', 'parent', ])
|
||||
|
||||
def run(self):
|
||||
self.init_menu()
|
||||
self.init_dictionary()
|
||||
print(22)
|
||||
if __name__ == '__main__':
|
||||
Initialize(app='release_info').run()
|
||||
Reference in New Issue
Block a user