From 93e3e859cfa6737e48dd95dedf38c0b16928959d Mon Sep 17 00:00:00 2001 From: gaofy <1014893517@qq.com> Date: Wed, 27 Dec 2023 16:49:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E6=B7=BB=E5=8A=A0table=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/global.scss | 5 +- src/components/page-tabs.vue | 4 +- src/components/table-ability.vue | 38 +++++++++ src/main.ts | 2 + src/router/index.ts | 1 - src/views/index.vue | 16 +++- src/views/logs-manage/chart/login-chart.vue | 1 - src/views/logs-manage/logs-manage.vue | 33 ++++---- src/views/logs-manage/message-manage.vue | 63 ++++++++------- .../patients-manage/form/patients-form.vue | 22 ++++-- src/views/patients-manage/patients-manage.vue | 60 +++++++------- .../permissions-manage/doctor-manage.vue | 55 +++++++------ .../form/empower-dialog.vue | 6 +- src/views/permissions-manage/menu-manage.vue | 78 +++++++++++-------- src/views/permissions-manage/role-manage.vue | 45 ++++++----- src/views/remote-manage/remote-control.vue | 50 +++++++++--- src/views/system-manage/hospitals.vue | 52 +++++++------ src/views/system-manage/user-list.vue | 56 ++++++++----- 18 files changed, 373 insertions(+), 214 deletions(-) create mode 100644 src/components/table-ability.vue diff --git a/src/assets/css/global.scss b/src/assets/css/global.scss index ca06ab2..551b55a 100644 --- a/src/assets/css/global.scss +++ b/src/assets/css/global.scss @@ -178,6 +178,8 @@ body { .table-page { width: 100%; height: 100%; + display: flex; + flex-direction: column; .search-part { width: 100%; height: 40px; @@ -208,6 +210,7 @@ body { .table-part { width: 100%; height: calc(100% - 170px); + flex-grow: 1; margin-top: 10px; .el-table { color: $text1-color; @@ -218,7 +221,7 @@ body { font-size: 16px; } th { - background: rgba($main-color, .05); + background: #f2f3f5; } } .el-table__row.disable { diff --git a/src/components/page-tabs.vue b/src/components/page-tabs.vue index 6b7c274..f9bd307 100644 --- a/src/components/page-tabs.vue +++ b/src/components/page-tabs.vue @@ -51,12 +51,12 @@ const tabClick = (e: MenuItem) => { transition: background .6s; &:hover { color: $main-color; - background: rgba($main-color, .05); + background: #f2f3f5; transition: background .6s; } &.active { color: $main-color; - background: rgba($main-color, .1); + background: #f2f3f5; font-weight: 600; transition: background .6s; } diff --git a/src/components/table-ability.vue b/src/components/table-ability.vue new file mode 100644 index 0000000..0717fb2 --- /dev/null +++ b/src/components/table-ability.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/main.ts b/src/main.ts index 14b3253..45e4705 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,6 +5,7 @@ import router from './router' import { createPinia } from 'pinia' import ElementPlus from 'element-plus'; import * as ElementPlusIconsVue from '@element-plus/icons-vue' +import TableAbility from '@/components/table-ability.vue' import SliderVerify from 'slider-verify-v3' import 'slider-verify-v3/lib/SliderVerify.css' @@ -26,6 +27,7 @@ app.use(SliderVerify) app.use(router) .use(ElementPlus) // ElementPlus 全局引入 +app.component('TableAbility', TableAbility) for (const [key, component] of Object.entries(ElementPlusIconsVue)) { app.component(key, component) } diff --git a/src/router/index.ts b/src/router/index.ts index be9d82c..5862a06 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -134,7 +134,6 @@ const router = createRouter({ router.beforeEach((to, from, next) => { const loginInfo = useLoginStore().getlogin() const isLogin = loginInfo.isLogin - console.log(from) // 普通用户 const commonUser = [ '/login', diff --git a/src/views/index.vue b/src/views/index.vue index 3833b48..9e66b9b 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -102,8 +102,6 @@ switch (userInfo.permissions) { break; } - - const isShowUserInfoDrawer = ref(false) const menuActive = ref('/') @@ -166,6 +164,7 @@ const userCommand = (e: string) => { height: 100%; .head-box { + position: relative; width: 100%; height: 70px; padding: 0 24px; @@ -173,6 +172,7 @@ const userCommand = (e: string) => { display: flex; justify-content: space-between; align-items: center; + padding-right: 460px; .logo-box { height: 50px; @@ -185,6 +185,7 @@ const userCommand = (e: string) => { .menu-box { display: flex; align-items: center; + flex-shrink: 0; .menu-item { cursor: pointer; @@ -200,13 +201,13 @@ const userCommand = (e: string) => { -webkit-transition: all .5s; &:hover { - background: #F5F7FA; + background: #f2f3f5; transition: all .5s; -webkit-transition: all .5s; } &.active { - background: rgba($main-color, .1); + background: #f2f3f5; transition: all .5s; -webkit-transition: all .5s; } @@ -218,8 +219,15 @@ const userCommand = (e: string) => { } .user-box { + position: absolute; + width: 440px; + height: 100%; + top: 0; + right: 20px; display: flex; + justify-content: flex-end; align-items: center; + background: white; .select-hospital { margin-right: 20px; diff --git a/src/views/logs-manage/chart/login-chart.vue b/src/views/logs-manage/chart/login-chart.vue index 3b4e8ed..e3a3c7b 100644 --- a/src/views/logs-manage/chart/login-chart.vue +++ b/src/views/logs-manage/chart/login-chart.vue @@ -27,7 +27,6 @@ function initChart(chartData: any) { tooltip: { trigger: 'axis', formatter: (params: any) => { - console.log(params) return dateFormater('yyyy-MM-dd', params[0].axisValue) + '
登录记录:' + params[0].value + '条' } }, diff --git a/src/views/logs-manage/logs-manage.vue b/src/views/logs-manage/logs-manage.vue index 1d41029..42312f2 100644 --- a/src/views/logs-manage/logs-manage.vue +++ b/src/views/logs-manage/logs-manage.vue @@ -4,7 +4,7 @@
-
+
类型 @@ -21,10 +21,10 @@
删除 - 下载 +
- @@ -71,6 +71,8 @@ const route = useRoute() const tableRef = ref() const logFormRef = ref() +const isSearch = ref(true) +const loading = ref(true) const isFormDialog = ref(false) const formDialogTitle = ref('') const queryParams = ref({} as any) @@ -79,18 +81,21 @@ const tableData = ref([] as any) queryData({ type: '正常' }) function queryData(e: any) { - console.log(e) + loading.value = true tableData.value = [] - while (tableData.value.length < 10) { - tableData.value.push({ - type: e.type, - title: e.title, - ip: '127.0.0.1', - requestMethod: 'post', - requestTime: new Date(), - operator: 'admin' - }) - } + setTimeout(() => { + while (tableData.value.length < 10) { + tableData.value.push({ + type: e.type || '正常', + title: e.title || '测试', + ip: '127.0.0.1', + requestMethod: 'post', + requestTime: new Date(), + operator: 'admin' + }) + } + loading.value = false + }, 200); } const viewData = (e: any) => { diff --git a/src/views/logs-manage/message-manage.vue b/src/views/logs-manage/message-manage.vue index de4a6ae..4f5e86b 100644 --- a/src/views/logs-manage/message-manage.vue +++ b/src/views/logs-manage/message-manage.vue @@ -1,12 +1,11 @@ - + diff --git a/src/views/permissions-manage/doctor-manage.vue b/src/views/permissions-manage/doctor-manage.vue index 96920c0..1adcd7b 100644 --- a/src/views/permissions-manage/doctor-manage.vue +++ b/src/views/permissions-manage/doctor-manage.vue @@ -1,6 +1,6 @@ @@ -62,6 +68,8 @@ import ImportDialog from '@/components/import-dialog.vue' const tableRef = ref() const doctorFormRef = ref() const importDialogRef = ref() +const isSearch = ref(true) +const loading = ref(true) const isFormDialog = ref(false) const formDialogTitle = ref('') const queryParams = ref({ @@ -69,19 +77,23 @@ const queryParams = ref({ } as any) const tableData = ref([] as any) -queryData({userName: '测试'}) +queryData({ userName: '测试' }) -function queryData (e: any) { +function queryData(e: any) { + loading.value = true tableData.value = [] - while (tableData.value.length < 10) { - tableData.value.push({ - userName: 'cscs', - name: e.userName, - phone: '12312345678', - role: '高级管理员', - enable: true, - }) - } + setTimeout(() => { + while (tableData.value.length < 10) { + tableData.value.push({ + userName: 'cscs', + name: e.userName || '测试', + phone: '12312345678', + role: '高级管理员', + enable: true, + }) + } + loading.value = false + }, 200); } const addData = () => { isFormDialog.value = true @@ -127,7 +139,4 @@ const paginationChange = (page: number, size: number) => { } - + diff --git a/src/views/permissions-manage/form/empower-dialog.vue b/src/views/permissions-manage/form/empower-dialog.vue index f939f8a..e8565fa 100644 --- a/src/views/permissions-manage/form/empower-dialog.vue +++ b/src/views/permissions-manage/form/empower-dialog.vue @@ -5,8 +5,10 @@ 展开 / 折叠 全选 / 全不选 - +
+ +
取消 更新 diff --git a/src/views/permissions-manage/menu-manage.vue b/src/views/permissions-manage/menu-manage.vue index dcf641f..8fcecaa 100644 --- a/src/views/permissions-manage/menu-manage.vue +++ b/src/views/permissions-manage/menu-manage.vue @@ -1,6 +1,6 @@ - + diff --git a/src/views/permissions-manage/role-manage.vue b/src/views/permissions-manage/role-manage.vue index aaf5383..afa5f8b 100644 --- a/src/views/permissions-manage/role-manage.vue +++ b/src/views/permissions-manage/role-manage.vue @@ -1,6 +1,6 @@ +
@@ -138,6 +139,7 @@ import { dateFormater } from '@/utils/date-util'; import { post } from "@/axios/index"; import chartLine from './chart/chart-line.vue'; import chartEcg from './chart/chart-ecg.vue'; +import PatientsForm from '@/views/patients-manage/form/patients-form.vue' import imgLung from '@/assets/imgs/lung.png'; import imgHeart from '@/assets/imgs/heart.png'; import imgLungAlarm from '@/assets/imgs/lung_alarm.png'; @@ -170,8 +172,10 @@ const chartDom1 = ref(), chartDom4 = ref(), liveVideo = ref(), msgLog = ref(), - unusualMsg = ref(); + unusualMsg = ref(), + patientsFormRef = ref(); +const isPatientDialog = ref(false) const database = ref(''); const databaseOptions = ref([] as { value: string, label: string }[]); const messageSum = ref(10); @@ -415,11 +419,13 @@ function getTableData(e: boolean) { } function keepFit(designWidth: number, designHeight: number, renderDomId: string) { let width = designWidth || 1920, - height = designHeight || 1030; + height = designHeight || 1010; let clientHeight = document.documentElement.clientHeight - 50; let clientWidth = document.documentElement.clientWidth; let scale = 1; - scale = clientHeight / height; + scale = (clientHeight / clientWidth) < (height / width) ? clientHeight / height : clientWidth / width; + // scale = clientHeight / height; + // scale = clientWidth / width; const renderDom = document.getElementById(renderDomId); if (renderDom) { renderDom.style.height = clientHeight / scale + 'px'; @@ -429,7 +435,7 @@ function keepFit(designWidth: number, designHeight: number, renderDomId: string) } function initScale() { let w = 1920, - h = 1030; + h = 1010; keepFit(w, h, 'screenBox'); window.addEventListener('resize', () => { keepFit(w, h, 'screenBox'); @@ -443,6 +449,27 @@ const setDatabase = () => { initData(); setDatabaseDialog.value = false; }; +const viewPatientInfo = () => { + isPatientDialog.value = true; + setTimeout(() => { + patientsFormRef.value.resetData() + patientsFormRef.value.formData = JSON.parse(JSON.stringify({ + id: '', + name: '测试', + code: 'afasf', + sex: '男', + dept: '测试', + bodyHeight: '170', + isMedicalHistory: '无', + bodyWeight: '80', + medicalHistoryName: '无', + age: '22', + allergyHistoryName: '无', + phone: '123456', + hospitalTime: new Date() + })) + }, 0) +} const backRemote = () => { router.back() } @@ -525,9 +552,9 @@ const tableItemCancel = (e: any) => { + diff --git a/src/views/system-manage/user-list.vue b/src/views/system-manage/user-list.vue index 1f69e73..a039742 100644 --- a/src/views/system-manage/user-list.vue +++ b/src/views/system-manage/user-list.vue @@ -1,6 +1,6 @@