From e266347d47a007a888f0fae230a462aff9ecbde3 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 11 May 2020 18:41:05 +0800 Subject: [PATCH] dict --- client/src/api/dict.js | 57 ++++ client/src/router/index.js | 6 + client/src/views/system/dict.vue | 275 ++++++++++++++++++ client/src/views/system/user.vue | 5 +- server/apps/system/migrations/0001_initial.py | 122 ++++++++ .../system/migrations/0002_dict_dicttype.py | 47 +++ server/apps/system/migrations/__init__.py | 0 server/apps/system/urls.py | 5 +- server/apps/system/views.py | 38 ++- 9 files changed, 549 insertions(+), 6 deletions(-) create mode 100644 client/src/api/dict.js create mode 100644 client/src/views/system/dict.vue create mode 100644 server/apps/system/migrations/0001_initial.py create mode 100644 server/apps/system/migrations/0002_dict_dicttype.py create mode 100644 server/apps/system/migrations/__init__.py diff --git a/client/src/api/dict.js b/client/src/api/dict.js new file mode 100644 index 0000000..df66187 --- /dev/null +++ b/client/src/api/dict.js @@ -0,0 +1,57 @@ +import request from '@/utils/request' + +export function getDictTypeList(query) { + return request({ + url: '/system/dicttype/', + method: 'get', + params:query + }) +} +export function createDictType(data) { + return request({ + url: '/system/dicttype/', + method: 'post', + data + }) +} +export function updateDictType(id, data) { + return request({ + url: `/system/dicttype/${id}/`, + method: 'put', + data + }) +} +export function deleteDictType(id) { + return request({ + url: `/system/dicttype/${id}/`, + method: 'delete' + }) +} + +export function getDictList(query) { + return request({ + url: '/system/dict/', + method: 'get', + params:query + }) +} +export function createDict(data) { + return request({ + url: '/system/dict/', + method: 'post', + data + }) +} +export function updateDict(id, data) { + return request({ + url: `/system/dict/${id}/`, + method: 'put', + data + }) +} +export function deleteDict(id) { + return request({ + url: `/system/dict/${id}/`, + method: 'delete' + }) +} \ No newline at end of file diff --git a/client/src/router/index.js b/client/src/router/index.js index 76ebd63..0348c12 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -91,6 +91,12 @@ export const asyncRoutes = [ name: 'Postion', component: () => import('@/views/system/position'), meta: { title: '岗位管理', icon: 'position', perms: ['position_manage'] } + }, + { + path: 'dict', + name: 'Dict', + component: () => import('@/views/system/dict'), + meta: { title: '数据字典', icon: 'example', perms: ['dict_manage'] } } ] }, diff --git a/client/src/views/system/dict.vue b/client/src/views/system/dict.vue new file mode 100644 index 0000000..895934c --- /dev/null +++ b/client/src/views/system/dict.vue @@ -0,0 +1,275 @@ + + diff --git a/client/src/views/system/user.vue b/client/src/views/system/user.vue index 8751536..79c483b 100644 --- a/client/src/views/system/user.vue +++ b/client/src/views/system/user.vue @@ -1,7 +1,8 @@