From fbe8ca6b6c2133fe7ce6be56637ce04252ca83f0 Mon Sep 17 00:00:00 2001 From: 13507605001 Date: Mon, 12 Dec 2022 11:26:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A2=84=E8=AD=A6=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/reagent/overView.js | 9 ++ src/components/WaringForm/index.vue | 171 +++++++++++++++++++++++ src/layout/components/Navbar.vue | 13 +- src/store/getters.js | 1 + src/store/modules/app.js | 6 +- src/views/login/index.vue | 10 ++ src/views/reagent/mainoverview/index.vue | 15 +- 7 files changed, 210 insertions(+), 15 deletions(-) create mode 100644 src/components/WaringForm/index.vue diff --git a/src/api/reagent/overView.js b/src/api/reagent/overView.js index 706e2f6..a2e203b 100644 --- a/src/api/reagent/overView.js +++ b/src/api/reagent/overView.js @@ -43,3 +43,12 @@ export function update_warning_tp(data) { data }) } + +// /api/home/home_warning_num +export function home_warning_num(data) { + return request({ + url: '/api/home/home_warning_num', + method: 'post', + data + }) +} diff --git a/src/components/WaringForm/index.vue b/src/components/WaringForm/index.vue new file mode 100644 index 0000000..034e68f --- /dev/null +++ b/src/components/WaringForm/index.vue @@ -0,0 +1,171 @@ + + + + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index ca34fe9..d7151fe 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -4,9 +4,12 @@
- - + + + + + import('@/components/WaringForm/index') // Breadcrumb // Hamburger }, @@ -51,14 +54,14 @@ export default { 'background-size': '100%' }, local_ops: [], + dialogTableVisible: false, } }, created() { this.local_ops_func() - }, methods: { - local_ops_func : function() { + local_ops_func: function() { this.local_ops = this.$store.getters.opts.filter(item => item.name !='user') }, toggleSideBar() { diff --git a/src/store/getters.js b/src/store/getters.js index bb7912b..e2c4dcd 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -11,6 +11,7 @@ const getters = { isMain: state => state.settings.isMain, roleData: state => state.permission.roleData, opts: state => state.permission.opts, + warning_number: state => state.app.warning_number, clientOptions: state => state.app.clientOptions, currentOptions: state => state.app.clientOptions[state.user.classification] } diff --git a/src/store/modules/app.js b/src/store/modules/app.js index d43747c..90cd775 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -8,7 +8,8 @@ const state = { }, device: 'desktop', title: '', - clientOptions: {} + clientOptions: {}, + warning_number: 0 } const mutations = { @@ -35,6 +36,9 @@ const mutations = { }, SET_TITLE: (state, opt) => { state.title = opt + }, + SET_WARNING_NUM: (state, num) => { + state.warning_number = num } } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 852175b..914be64 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -105,6 +105,7 @@ // import { validUsername } from '@/utils/validate' import stringify from '@/utils/stringify' import { faceStart, faceStop, login, get_user_manage_auth } from '@/api/user/user' +import { home_warning_num } from '@/api/reagent/overView' import { client_list } from '@/api/common' // import { throttle } from '@/utils' import { func_map } from '@/utils' @@ -161,6 +162,13 @@ export default { this.handleClose() }, methods: { + set_warning_num_func: function() { + home_warning_num({}).then( rsp => { + if (rsp.status === 0) { + this.$store.commit('app/SET_WARNING_NUM', rsp.data) + } + }) + }, user_manage_auth: function () { get_user_manage_auth({}).then(rsp => { this.$store.commit('user/SET_USERMANAGE_AUTH', rsp.data) @@ -192,6 +200,7 @@ export default { this.$store.dispatch('permission/generateRoutes') this.$router.replace('/home') this.user_manage_auth() + this.set_warning_num_func() // 登录后立刻获取client数据供后续使用 console.log('func_type:', func_map) Object.keys(func_map).forEach( @@ -246,6 +255,7 @@ export default { this.$store.dispatch('permission/generateRoutes') this.$router.replace('/home') this.user_manage_auth() + this.set_warning_num_func() // 登录后立刻获取client数据供后续使用 // 登录后立刻获取client数据供后续使用 console.log('func_type:', func_map) diff --git a/src/views/reagent/mainoverview/index.vue b/src/views/reagent/mainoverview/index.vue index 22360f9..8876d59 100644 --- a/src/views/reagent/mainoverview/index.vue +++ b/src/views/reagent/mainoverview/index.vue @@ -195,7 +195,8 @@
-
+ + - - - {{ rowData.warning_user_name }}
- 确认
- + -->
@@ -298,10 +294,11 @@ import Detail from '@/components/Detail/index' import { home_info, home_warning_list, home_drug_remaining, get_monitoring_info} from '@/api/reagent/overView' import stringify from '@/utils/stringify' +import WaringListView from '@/components/WaringForm/index' export default { name: 'MainOverview', - components: { Detail }, + components: { Detail, WaringListView}, data() { return { headerStyle: { 'background': '#E6E6E6' }, @@ -496,7 +493,7 @@ export default { warnAll() { this.dialogTableVisible = true // 拉去数据 - this.getWarnList() + // this.getWarnList() }, getLoadEcharts() { this.myChart = this.$echarts.init(