From 3475acae6387462c39696414502509be868d38a9 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 12 Mar 2021 15:06:43 +0800 Subject: [PATCH] =?UTF-8?q?task=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.vue | 17 +- client/src/router/index.js | 8 +- client/src/store/modules/user.js | 28 +- client/src/styles/index.scss | 16 ++ client/src/views/supervision/content.vue | 182 ++++++------ client/src/views/supervision/task.vue | 259 ++++++++++++++++++ .../migrations/0004_auto_20210312_1125.py | 18 ++ .../migrations/0005_auto_20210312_1126.py | 18 ++ .../migrations/0006_auto_20210312_1440.py | 103 +++++++ server/apps/supervision/models.py | 39 ++- server/apps/supervision/serializers.py | 12 +- server/apps/supervision/views.py | 18 +- server/apps/system/mixins.py | 45 ++- server/apps/system/views.py | 3 +- 14 files changed, 596 insertions(+), 170 deletions(-) create mode 100644 client/src/views/supervision/task.vue create mode 100644 server/apps/supervision/migrations/0004_auto_20210312_1125.py create mode 100644 server/apps/supervision/migrations/0005_auto_20210312_1126.py create mode 100644 server/apps/supervision/migrations/0006_auto_20210312_1440.py diff --git a/client/src/App.vue b/client/src/App.vue index 2d9191c..878a0d1 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -8,19 +8,4 @@ export default { name: 'App' } - - \ No newline at end of file + \ No newline at end of file diff --git a/client/src/router/index.js b/client/src/router/index.js index a6d8836..932914c 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -121,10 +121,10 @@ export const asyncRoutes = [ meta: { title: '资料清单', icon: 'documentation', perms: ['content_manage'] } }, { - path: 'organization', - name: 'Organization', - component: () => import('@/views/system/organization'), - meta: { title: '上报计划', icon: 'tree', perms: ['org_manage'] } + path: 'task', + name: 'STask', + component: () => import('@/views/supervision/task.vue'), + meta: { title: '报送任务', icon: 'guide', perms: ['task_manage'] } }] }, diff --git a/client/src/store/modules/user.js b/client/src/store/modules/user.js index c755f77..440887b 100644 --- a/client/src/store/modules/user.js +++ b/client/src/store/modules/user.js @@ -95,31 +95,7 @@ const actions = { return new Promise((resolve, reject) => { getInfo(state.token).then(response => { const { data } = response - - if (!data) { - getInfo(state.token).then(response => { - const { data } = response - - if (!data) { - reject('验证失败,重新登录.') - } - - const { perms, name, avatar } = data - - // perms must be a non-empty array - if (!perms || perms.length <= 0) { - reject('没有任何权限!') - } - - commit('SET_PERMS', perms) - commit('SET_NAME', name) - commit('SET_AVATAR', avatar) - resolve(data) - }).catch(error => { - reject(error)}) - }else{ - const { perms, name, avatar } = data - + const { perms, name, avatar } = data // perms must be a non-empty array if (!perms || perms.length <= 0) { reject('没有任何权限!') @@ -129,7 +105,7 @@ const actions = { commit('SET_NAME', name) commit('SET_AVATAR', avatar) resolve(data) - } + }).catch(error => { diff --git a/client/src/styles/index.scss b/client/src/styles/index.scss index 3136ad5..5a9eff0 100644 --- a/client/src/styles/index.scss +++ b/client/src/styles/index.scss @@ -10,6 +10,7 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; + background-color: #f0f2f5; } label { @@ -101,3 +102,18 @@ div:focus { .el-button { border-radius: 0px; } + + +.el-table--medium td,   .el-table--medium th { + padding: 2px 0; +} +.el-form-item { + margin-bottom: 16px; +} + +.el-card__body { + padding: 10px; +} +.el-card__header { + padding: 10px; +} diff --git a/client/src/views/supervision/content.vue b/client/src/views/supervision/content.vue index 54d513c..d8a4dd6 100644 --- a/client/src/views/supervision/content.vue +++ b/client/src/views/supervision/content.vue @@ -1,69 +1,63 @@