Compare commits

23 Commits

Author SHA1 Message Date
Auora
7805c26f4a Merge remote-tracking branch 'origin/develop' into develop 2025-10-29 09:33:01 +08:00
Auora
b7d34537c2 修改login 2025-10-29 09:32:29 +08:00
wzk
a64edace55 Merge remote-tracking branch 'origin/develop' into develop 2025-10-29 09:04:25 +08:00
wzk
4afe0d107c 修复医嘱请选择项目选完选项框不消失 2025-10-29 09:04:01 +08:00
Auora
d8af11412f 修改格式 2025-10-29 08:55:14 +08:00
Auora
00816c9834 修改位置:applicationFormBottomBtn.vue 中的 import 语句。 2025-10-28 17:28:25 +08:00
Auora
4fb7bea80a 修改位置:prescriptionlist.vue 中的 import 语句 2025-10-28 17:21:20 +08:00
Auora
0fc72cb270 修改位置:prescriptionlist.vue 中的 import 语句 2025-10-28 17:14:23 +08:00
Auora
eadf521903 Merge branch 'develop' of https://gitea.gentronhealth.com/wangjunping/his into develop 2025-10-28 17:04:08 +08:00
f786fdbc3f 更新 openhis-ui-vue3/.env.spug
删除NODE_ENV=spug
2025-10-28 09:03:17 +00:00
92c4c938a3 更新 openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionMedicineList.vue 2025-10-28 08:57:06 +00:00
Auora
a94a1b7b69 Merge branch 'develop' of https://gitea.gentronhealth.com/wangjunping/his into develop 2025-10-28 16:34:06 +08:00
Auora
48755c2d9e 删掉多余逗号 2025-10-28 16:32:42 +08:00
叶锦涛
f99f8eb560 系统登入界面的设计 2025-10-28 16:27:42 +08:00
Auora
ddc7ce2fe7 spug测试 2025-10-28 15:56:24 +08:00
Auora
c9899c62d2 Merge branch 'develop' of https://gitea.gentronhealth.com/wangjunping/his 2025-10-28 15:55:04 +08:00
wzk
8b9837d7dc Merge remote-tracking branch 'origin/develop' into develop 2025-10-28 13:35:22 +08:00
wzk
2cba41331a 诊断类别:字典管理中找不到对应的字典数据,字典类别在显示出来的数据和医生开立诊断的数据不一致。 2025-10-28 13:34:56 +08:00
4da5ca427b 在租户管理-》所属用户界面的关闭按钮改为关闭当前的界面,并返回上一级界面, 2025-10-28 13:33:50 +08:00
wzk
f4605b1af7 下拉列表的刷选功能失效,按照下拉选中的医嘱类型能过滤出对应收费项目医生进行开单 2025-10-27 15:08:28 +08:00
叶锦涛
d2babdc9ed 修复已保存病例模板无数据的显示的问题 2025-10-27 14:02:01 +08:00
4d0599eac1 将历史病例中对病例选择的bug修复,现在是单选选中 2025-10-27 13:22:25 +08:00
Auora
35d99df274 test 2025-10-24 17:17:31 +08:00
15 changed files with 371 additions and 115 deletions

View File

@@ -8,7 +8,7 @@
天天开源的前⾝是新致开源最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉新致开源品牌更新为天天开源我们始终秉持开源、专业、协作的理念致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。 天天开源的前⾝是新致开源最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉新致开源品牌更新为天天开源我们始终秉持开源、专业、协作的理念致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。
了解我们https://open.tntlinking.com/about?site=gitee 了解我们ahttps://open.tntlinking.com/about?site=gitee
## 💾【部署包下载】 ## 💾【部署包下载】

View File

@@ -85,33 +85,33 @@
</dependencies> </dependencies>
<build> <!-- <build>-->
<plugins> <!-- <plugins>-->
<plugin> <!-- <plugin>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-maven-plugin</artifactId> <!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<configuration> <!-- <configuration>-->
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 --> <!-- <fork>true</fork> &lt;!&ndash; 如果没有该配置devtools不会生效 &ndash;&gt;-->
</configuration> <!-- </configuration>-->
<executions> <!-- <executions>-->
<execution> <!-- <execution>-->
<goals> <!-- <goals>-->
<goal>repackage</goal> <!-- <goal>repackage</goal>-->
</goals> <!-- </goals>-->
</execution> <!-- </execution>-->
</executions> <!-- </executions>-->
</plugin> <!-- </plugin>-->
<plugin> <!-- <plugin>-->
<groupId>org.apache.maven.plugins</groupId> <!-- <groupId>org.apache.maven.plugins</groupId>-->
<artifactId>maven-war-plugin</artifactId> <!-- <artifactId>maven-war-plugin</artifactId>-->
<version>${maven-war-plugin.version}</version> <!-- <version>${maven-war-plugin.version}</version>-->
<configuration> <!-- <configuration>-->
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- <failOnMissingWebXml>false</failOnMissingWebXml>-->
<warName>${project.artifactId}</warName> <!-- <warName>${project.artifactId}</warName>-->
</configuration> <!-- </configuration>-->
</plugin> <!-- </plugin>-->
</plugins> <!-- </plugins>-->
<finalName>${project.artifactId}</finalName> <!-- <finalName>${project.artifactId}</finalName>-->
</build> <!-- </build>-->
</project> </project>

37
openhis-ui-vue3/.env.spug Normal file
View File

@@ -0,0 +1,37 @@
# 开发环境本地只启动前端项目依赖开发环境后端、APP
VITE_DEV=true
# 请求路径
VITE_BASE_URL='http://192.168.110.252'
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server
# 接口地址
VITE_API_URL=/admin-api
# 是否删除debugger
VITE_DROP_DEBUGGER=false
# 是否删除console.log
VITE_DROP_CONSOLE=false
# 是否sourcemap
VITE_SOURCEMAP=true
# 打包路径
VITE_BASE_PATH=/
# 输出路径
VITE_OUT_DIR=dist-spug
# 商城H5会员端域名
VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'
# 验证码的开关
VITE_APP_CAPTCHA_ENABLE=false
# GoView域名
VITE_GOVIEW_URL='http://127.0.0.1:3000'

View File

@@ -9,7 +9,8 @@
"dev": "vite", "dev": "vite",
"build:prod": "vite build", "build:prod": "vite build",
"build:stage": "vite build --mode staging", "build:stage": "vite build --mode staging",
"preview": "vite preview" "preview": "vite preview",
"build:spug": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode spug"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -3,6 +3,10 @@ export default {
* 网页标题 * 网页标题
*/ */
title: import.meta.env.VITE_APP_TITLE, title: import.meta.env.VITE_APP_TITLE,
/**
* 系统名称
*/
systemName: import.meta.env.VITE_APP_SYSTEM_NAME || 'XXX医院信息管理系统',
/** /**
* 侧边栏主题 深色主题theme-dark浅色主题theme-light * 侧边栏主题 深色主题theme-dark浅色主题theme-light
*/ */

View File

@@ -67,7 +67,7 @@ import { throttle } from 'lodash-es';
const props = defineProps({ const props = defineProps({
adviceQueryParams: { adviceQueryParams: {
type: Object, type: Object,
default: '', required: true
}, },
patientInfo: { patientInfo: {
type: Object, type: Object,
@@ -97,39 +97,25 @@ const throttledGetList = throttle(
watch( watch(
() => props.adviceQueryParams, () => props.adviceQueryParams,
(newValue) => { (newValue) => {
queryParams.value.searchKey = newValue.searchKey; console.log('adviceBaseList 接收到参数变化:', newValue);
// queryParams.value.adviceType = newValue.adviceType;
// 直接更新查询参数
queryParams.value.searchKey = newValue.searchKey || '';
// 处理类型筛选
if (newValue.adviceType) { if (newValue.adviceType) {
queryParams.value.adviceTypes = [newValue.adviceType].join(','); // 单个类型
queryParams.value.adviceTypes = newValue.adviceType.toString();
} else { } else {
// 全部类型
queryParams.value.adviceTypes = '1,2,3'; queryParams.value.adviceTypes = '1,2,3';
} }
throttledGetList();
},
{ deep: true }
);
getList(); console.log('发送请求参数:', queryParams.value);
function getList() { getList();
queryParams.value.organizationId = props.patientInfo.orgId; },
getAdviceBaseInfo(queryParams.value).then((res) => { { deep: true, immediate: true }
console.log('ssssssssss', res.data.records); );
if (res.data.records.length > 0) {
adviceBaseList.value = res.data.records.filter((item) => {
if (item.adviceType == 1 || item.adviceType == 2) {
return handleQuantity(item) != 0;
} else {
return true;
}
});
total.value = res.data.total;
nextTick(() => {
currentIndex.value = 0;
adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]);
});
}
});
}
// 从priceList列表中获取价格 // 从priceList列表中获取价格
function getPriceFromInventory(row) { function getPriceFromInventory(row) {
if (row.priceList && row.priceList.length > 0) { if (row.priceList && row.priceList.length > 0) {
@@ -138,6 +124,38 @@ function getPriceFromInventory(row) {
} }
return '-'; return '-';
} }
function getList() {
queryParams.value.organizationId = props.patientInfo.orgId;
console.log('发送API请求:', queryParams.value);
getAdviceBaseInfo(queryParams.value).then((res) => {
if (res.data.records && res.data.records.length > 0) {
adviceBaseList.value = res.data.records.filter((item) => {
if (item.adviceType == 1 || item.adviceType == 2) {
return handleQuantity(item) != 0;
} else {
return true;
}
});
console.log('过滤后数据显示:', adviceBaseList.value.length, '条');
total.value = res.data.total;
nextTick(() => {
currentIndex.value = 0;
if (adviceBaseList.value.length > 0) {
adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]);
}
});
} else {
adviceBaseList.value = [];
}
}).catch(error => {
console.error('获取数据失败:', error);
adviceBaseList.value = [];
});
}
// 处理键盘事件 // 处理键盘事件
const handleKeyDown = (event) => { const handleKeyDown = (event) => {
const key = event.key; const key = event.key;

View File

@@ -99,7 +99,7 @@
> >
<el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px"> <el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px">
<el-option <el-option
v-for="item in med_type" v-for="item in diag_type"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@@ -235,7 +235,7 @@ const props = defineProps({
const emits = defineEmits(['diagnosisSave']); const emits = defineEmits(['diagnosisSave']);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const userStore = useUserStore(); const userStore = useUserStore();
const { med_type } = proxy.useDict('med_type'); const { diag_type } = proxy.useDict('diag_type');
const rules = ref({ const rules = ref({
name: [{ required: true, message: '请选择诊断', trigger: 'change' }], name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }], medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],

View File

@@ -10,23 +10,15 @@
<el-table <el-table
ref="emrHistoryRef" ref="emrHistoryRef"
:data="emrHistory" :data="emrHistory"
row-key="patientId" row-key="id"
highlight-current-row
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<!-- @cell-click="clickRow" -->
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column label="主诉" align="left" prop="name" :show-overflow-tooltip="true"/> <el-table-column label="主诉" align="left" prop="name" :show-overflow-tooltip="true"/>
<el-table-column label="时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true"/> <el-table-column label="时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="80"> <el-table-column label="操作" align="center" width="80">
<template #default="scope"> <template #default="scope">
<!-- <el-button <el-button link type="primary" @click.stop="clickRow(scope.row)">复用</el-button>
link
type="primary"
@click.stop="handelDetail(scope.row)"
>详情
</el-button> -->
<el-button link type="primary" @click.stop="clickRow(scope.row)">复用 </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -43,6 +35,7 @@
<script setup> <script setup>
import { formatDate, formatDateymd } from '@/utils/index'; import { formatDate, formatDateymd } from '@/utils/index';
import { getEmrHistoryList } from '../api'; import { getEmrHistoryList } from '../api';
const queryParams = ref({ const queryParams = ref({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
@@ -51,13 +44,19 @@ const queryParams = ref({
const selectRow = ref({}); const selectRow = ref({});
const emrHistory = ref([]); const emrHistory = ref([]);
const emits = defineEmits(['selectRow']); const emits = defineEmits(['selectRow']);
const emrHistoryRef = ref(null);
const selectedRows = ref([]);
const total = ref(0);
getList(); getList();
function getList() { function getList() {
if (sessionStorage.getItem('patientId')) { if (sessionStorage.getItem('patientId')) {
queryParams.value.patientId = sessionStorage.getItem('patientId'); queryParams.value.patientId = sessionStorage.getItem('patientId');
getEmrHistoryList(queryParams.value).then((res) => { getEmrHistoryList(queryParams.value).then((res) => {
emrHistory.value = res.data.records; emrHistory.value = res.data.records;
total.value = res.data.total;
emrHistory.value.map((k) => { emrHistory.value.map((k) => {
k.name = JSON.parse(k.contextJson).chiefComplaint; k.name = JSON.parse(k.contextJson).chiefComplaint;
k.createTime = formatDate(k.createTime); k.createTime = formatDate(k.createTime);
@@ -66,6 +65,20 @@ function getList() {
} }
} }
function handleSelectionChange(selection) {
selectedRows.value = selection;
// 如果选择的行数大于1只保留最后一行
if (selection.length > 1) {
// 清除所有选择
emrHistoryRef.value?.clearSelection();
// 只选择最后一行
const lastSelected = selection[selection.length - 1];
emrHistoryRef.value?.toggleRowSelection(lastSelected, true);
selectedRows.value = [lastSelected];
}
}
function clickRow(row) { function clickRow(row) {
selectRow.value = JSON.parse(row.contextJson); selectRow.value = JSON.parse(row.contextJson);
emits('selectRow', selectRow.value); emits('selectRow', selectRow.value);

View File

@@ -43,7 +43,7 @@ const props = defineProps({
required: true, required: true,
}, },
}); });
// getList(); getList();
function getList() { function getList() {
queryParams.value.useScopeCode = 1; queryParams.value.useScopeCode = 1;
getEmrTemplateList(queryParams.value).then((res) => { getEmrTemplateList(queryParams.value).then((res) => {

View File

@@ -561,7 +561,18 @@
(value) => { (value) => {
expandOrder = []; expandOrder = [];
prescriptionList[scope.$index].adviceName = undefined; prescriptionList[scope.$index].adviceName = undefined;
adviceQueryParams.adviceType = value;
// 直接更新查询参数
adviceQueryParams.value.adviceType = value;
adviceQueryParams.value.searchKey = '';
console.log('医嘱类型改变为:', value, '查询参数:', adviceQueryParams.value);
// 确保弹窗重新打开
nextTick(() => {
row.showPopover = true;
handleFocus(scope.row, scope.$index);
});
} }
" "
> >
@@ -735,7 +746,7 @@ import {
getAdviceBaseInfo, getAdviceBaseInfo,
getActivityBindDevice, getActivityBindDevice,
} from '../api'; } from '../api';
import adviceBaseList from '../advicebaselist'; import adviceBaseList from '../adviceBaseList.vue';
import { computed, getCurrentInstance, nextTick, watch } from 'vue'; import { computed, getCurrentInstance, nextTick, watch } from 'vue';
import { calculateQuantityByDays, formatNumber } from '@/utils/his'; import { calculateQuantityByDays, formatNumber } from '@/utils/his';
import OrderGroupDrawer from './orderGroupDrawer'; import OrderGroupDrawer from './orderGroupDrawer';
@@ -751,7 +762,10 @@ const prescriptionList = ref([]);
const form = ref({ const form = ref({
prescriptionList: prescriptionList.value, prescriptionList: prescriptionList.value,
}); });
const adviceQueryParams = ref({}); const adviceQueryParams = ref({
searchKey: '',
adviceType: ''
});
const rowIndex = ref(-1); const rowIndex = ref(-1);
const groupIndex = ref(1); const groupIndex = ref(1);
const groupIndexList = ref([]); const groupIndexList = ref([]);
@@ -933,6 +947,9 @@ function handleAddPrescription() {
return; return;
} }
isAdding.value = true; isAdding.value = true;
// 重置查询参数
adviceQueryParams.value = {};
// 在数组最前方添加一行,让新增行显示在最上边 // 在数组最前方添加一行,让新增行显示在最上边
prescriptionList.value.unshift({ prescriptionList.value.unshift({
uniqueKey: nextId.value++, uniqueKey: nextId.value++,
@@ -979,10 +996,17 @@ function handleDiagnosisChange(item) {
function handleFocus(row, index) { function handleFocus(row, index) {
rowIndex.value = index; rowIndex.value = index;
row.showPopover = true; row.showPopover = true;
// 确保查询参数与当前行类型一致
adviceQueryParams.value = {
adviceType: row.adviceType || '',
searchKey: adviceQueryParams.value.searchKey || ''
};
} }
function handleBlur(row) { function handleBlur(row) {
setTimeout(() => {
row.showPopover = false; row.showPopover = false;
}, 200);
} }
function handleChange(value) { function handleChange(value) {
@@ -993,6 +1017,8 @@ function handleChange(value) {
* 选择药品回调 * 选择药品回调
*/ */
function selectAdviceBase(key, row) { function selectAdviceBase(key, row) {
// 立即关闭当前弹窗
prescriptionList.value[rowIndex.value].showPopover = false;
if (row.adviceType == 3) { if (row.adviceType == 3) {
getActivityBindDevice({ activityId: row.adviceDefinitionId }).then((res) => { getActivityBindDevice({ activityId: row.adviceDefinitionId }).then((res) => {
if (res.data.activityBindDeviceInfos?.length > 0) { if (res.data.activityBindDeviceInfos?.length > 0) {
@@ -1108,6 +1134,7 @@ function selectAdviceBase(key, row) {
inputRefs.value['quantity']?.focus(); inputRefs.value['quantity']?.focus();
} }
}); });
} }
function getOrgList() { function getOrgList() {

View File

@@ -55,10 +55,10 @@
</template> </template>
<script setup> <script setup>
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref, computed } from 'vue'; import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref, computed } from 'vue';
import BloodTransfusion from './bloodTransfusion.vue'; import BloodTransfusion from './bloodTransfusion';
import { patientInfo } from '../../../store/patient.js'; import { patientInfo } from '../../../store/patient.js';
import Surgery from './surgery.vue'; import Surgery from './surgery.vue';
import LaboratoryTests from './LaboratoryTests.vue'; import laboratoryTests from './laboratoryTests.vue';
import MedicalExaminations from './medicalExaminations.vue'; import MedicalExaminations from './medicalExaminations.vue';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const emits = defineEmits([]); const emits = defineEmits([]);

View File

@@ -1,12 +1,14 @@
<template> <template>
<div class="login"> <div class="login">
<!-- 顶部 --> <!-- 顶部 -->
<!-- <div class="el-login-top">
<el-image :src="logoNew"></el-image>
</div> -->
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
<h1 class="title">医院信息管理系统</h1> <div class="el-login-top">
<el-image :src="logoNew"></el-image>
</div>
<h1 class="title">{{ currentTenantName || settings.systemName }}</h1>
<p class="login-subtitle">请使用您的账号密码安全登录系统</p>
<el-form-item prop="username"> <el-form-item prop="username">
<p class="label">用户名</p>
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
type="text" type="text"
@@ -21,25 +23,35 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<p class="label">密码</p>
<el-input <el-input
v-model="loginForm.password" v-model="loginForm.password"
type="password" :type="passwordVisible ? 'text' : 'password'"
size="large" size="large"
auto-complete="off" auto-complete="off"
placeholder="密码" placeholder="密码"
@keyup.enter="handleLogin" @keyup.enter="handleLogin"
show-password
> >
<template #prefix <template #prefix
><svg-icon icon-class="password" class="el-input__icon input-icon" ><svg-icon icon-class="password" class="el-input__icon input-icon"
/></template> /></template>
<template #suffix>
<span
class="password-toggle"
@click="togglePasswordVisibility"
style="cursor: pointer; color: #606266; font-size: 14px; padding: 0 10px;"
>
{{ passwordVisible ? '隐藏' : '显示' }}
</span>
</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="tenantId"> <el-form-item prop="tenantId">
<p class="label">医疗机构</p>
<el-select <el-select
v-model="loginForm.tenantId" v-model="loginForm.tenantId"
size="large" size="large"
placeholder="所属医院" placeholder="请选择医疗机构"
clearable clearable
filterable filterable
> >
@@ -51,6 +63,11 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="login-options">
<el-checkbox v-model="loginForm.rememberMe" class="remember-me">记住我</el-checkbox>
<el-link type="primary" class="forgot-password" @click="handleForgotPassword">忘记密码</el-link>
</el-form-item>
<!-- <el-form-item prop="tenantId"> --> <!-- <el-form-item prop="tenantId"> -->
<!-- <span class="descriptions-item-label" style="margin: 0 10px 0 0">连接医保</span> --> <!-- <span class="descriptions-item-label" style="margin: 0 10px 0 0">连接医保</span> -->
<!-- <el-switch v-model="loginForm.invokeYb" @change="topNavChange" size="large"/> --> <!-- <el-switch v-model="loginForm.invokeYb" @change="topNavChange" size="large"/> -->
@@ -87,8 +104,17 @@
<router-link class="link-type" :to="'/register'">立即注册</router-link> <router-link class="link-type" :to="'/register'">立即注册</router-link>
</div> </div>
</el-form-item> </el-form-item>
<div class="footer">
© 2025 {{ currentTenantName || settings.systemName }} | 版本 v2.5.1
<!-- 公司版权信息新增 -->
<div class="company-copyright">
技术支持上海经创贺联信息技术有限公司
</div>
</div>
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<div class="el-login-footer-link"> <div class="el-login-footer-link">
<span><el-link :underline="false">his账号用户协议</el-link></span> <span><el-link :underline="false">his账号用户协议</el-link></span>
@@ -109,12 +135,15 @@
</template> </template>
<script setup> <script setup>
import { getCurrentInstance, ref, reactive, computed, onMounted, watch } from 'vue';
import settings from '@/settings';
import { getCodeImg, sign, getUserBindTenantList } from '@/api/login'; import { getCodeImg, sign, getUserBindTenantList } from '@/api/login';
import { invokeYbPlugin } from '@/api/public'; import { invokeYbPlugin } from '@/api/public';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { encrypt, decrypt } from '@/utils/jsencrypt'; import { encrypt, decrypt } from '@/utils/jsencrypt';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import logoNew from '@/assets/logo/logoBlack.png'; import { ElMessage } from 'element-plus';
import logoNew from '@/assets/logo/LOGO.jpg';
const userStore = useUserStore(); const userStore = useUserStore();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
@@ -131,6 +160,7 @@ const loginForm = ref({
}); });
const tenantOptions = ref([]); const tenantOptions = ref([]);
const currentTenantName = ref('');
const loginRules = { const loginRules = {
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }], username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
@@ -146,6 +176,21 @@ const captchaEnabled = ref(true);
// 注册开关 // 注册开关
const register = ref(false); const register = ref(false);
const redirect = ref(undefined); const redirect = ref(undefined);
const passwordVisible = ref(false);
function togglePasswordVisibility() {
passwordVisible.value = !passwordVisible.value;
}
// 处理忘记密码功能
function handleForgotPassword() {
// 这里可以添加忘记密码的逻辑,例如跳转到忘记密码页面或显示忘记密码弹窗
// 目前先显示一个提示
ElMessage({
message: '忘记密码功能正在开发中',
type: 'info'
});
}
watch( watch(
route, route,
@@ -155,7 +200,7 @@ watch(
{ immediate: true } { immediate: true }
); );
// 页面加载时从 localStorage 获取 invokeYb 的值 // 页面加载时从 localStorage 获取 invokeYb 的值和从 Cookies 获取记住的登录信息
onMounted(() => { onMounted(() => {
const storedInvokeYb = localStorage.getItem('invokeYb'); const storedInvokeYb = localStorage.getItem('invokeYb');
if (storedInvokeYb !== null) { if (storedInvokeYb !== null) {
@@ -164,6 +209,38 @@ onMounted(() => {
// 如果 localStorage 中没有值,则设置默认值并保存 // 如果 localStorage 中没有值,则设置默认值并保存
localStorage.setItem('invokeYb', 'true'); localStorage.setItem('invokeYb', 'true');
} }
// 从 Cookies 中恢复记住的登录信息
const rememberMe = Cookies.get('rememberMe');
if (rememberMe && rememberMe === 'true') {
const username = Cookies.get('username');
const password = Cookies.get('password');
if (username) {
loginForm.value.username = username;
loginForm.value.rememberMe = true;
// 解密密码
if (password) {
try {
loginForm.value.password = decrypt(password);
} catch (e) {
console.error('密码解密失败:', e);
}
}
}
}
// 获取医疗机构列表
getUserBindTenantList().then((res) => {
tenantOptions.value = res.data.map(item => ({
label: item.tenantName,
value: item.id
}));
// 如果只有一个医疗机构,自动选中
if (tenantOptions.value.length === 1) {
loginForm.value.tenantId = tenantOptions.value[0].value;
currentTenantName.value = tenantOptions.value[0].label;
}
});
}); });
function handleLogin() { function handleLogin() {
@@ -279,6 +356,14 @@ function getCode() {
}); });
} }
// 监听租户选择变化
watch(() => loginForm.value.tenantId, (newTenantId) => {
const selectedTenant = tenantOptions.value.find(item => item.value === newTenantId);
if (selectedTenant) {
currentTenantName.value = selectedTenant.label;
}
});
// 切换医保连接开关时更新 localStorage // 切换医保连接开关时更新 localStorage
function topNavChange(value) { function topNavChange(value) {
localStorage.setItem('invokeYb', value.toString()); localStorage.setItem('invokeYb', value.toString());
@@ -303,6 +388,7 @@ function getTenantList(username) {
label: item.tenantName, label: item.tenantName,
})); }));
loginForm.value.tenantId = tenantOptions.value[0].value; //默认选中第一个 loginForm.value.tenantId = tenantOptions.value[0].value; //默认选中第一个
currentTenantName.value = tenantOptions.value[0].label;
} }
} }
}); });
@@ -389,27 +475,81 @@ getCookie();
getTenantList(loginForm.value.username); getTenantList(loginForm.value.username);
</script> </script>
<style>
html, body {
height: auto;
min-height: 100vh;
overflow-y: auto;
margin: 0;
padding: 0;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.login { .login {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; background: #f8f9fa;
height: 100%; min-height: 100vh;
padding-bottom: 100px; /* 为底部固定footer留出空间 */
//background-image: url("../assets/images/login-background.jpg"); //background-image: url("../assets/images/login-background.jpg");
background-size: cover; background-size: cover;
} }
.title { .title {
margin: 0px auto 30px auto; margin: 10px auto 15px auto;
text-align: center; text-align: center;
color: #000; color: #000;
font-family: 'Microsoft Yahei,STHeiti,Simsun,STSong,Helvetica Neue,Helvetica,Arial,sans-serif'; font-family: 'Microsoft Yahei,STHeiti,Simsun,STSong,Helvetica Neue,Helvetica,Arial,sans-serif';
} }
.label{
display: block;
margin-bottom: 6px;
font-size: 14px;
font-weight: 500;
color: var(--text);
}
.login-options {
display: flex;
justify-content: space-between;
align-items: center;
margin: 8px 0 10px 0;
width: 100%; /* 确保容器占满宽度 */
}
.remember-me {
margin: 0;
color: var(--text);
}
.forgot-password {
font-size: 14px;
color: var(--primary);
cursor: pointer;
text-align: right; /* 确保文本右对齐 */
margin-left: auto; /* 确保元素右对齐 */
}
.footer {
margin-top: 32px;
font-size: 12px;
color: var(--text-secondary);
}
.login-subtitle {
font-size: 14px;
color: var(--text-secondary);
margin-bottom: 20px;
}
.login-form { .login-form {
border-radius: 6px; border-radius: 16px;
box-shadow: 0 4px 12px var(--shadow);
border: 1px solid var(--border);
background: #ffffff; background: #ffffff;
width: 400px; width: 100%;
max-width: 400px;
padding: 40px;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
text-align: center;
.el-input { .el-input {
height: 50px; // 修改输入框高度 height: 50px; // 修改输入框高度
input { input {
@@ -438,24 +578,20 @@ getTenantList(loginForm.value.username);
} }
} }
.el-login-top { .el-login-top {
height: 80px; text-align: center;
line-height: 40px; margin: 0 auto 10px;
position: fixed; .el-image {
top: 0; max-width: 120px;
width: 100%; max-height: 120px;
text-align: left; }
color: #000;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
background-color: #f1f1f1;
padding: 20px;
} }
.el-login-footer { .el-login-footer {
height: 100px; height: 80px;
line-height: 40px; line-height: 30px;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0;
right: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
color: #000; color: #000;
@@ -463,8 +599,7 @@ getTenantList(loginForm.value.username);
font-size: 12px; font-size: 12px;
letter-spacing: 1px; letter-spacing: 1px;
background-color: #f1f1f1; background-color: #f1f1f1;
z-index: 100; /* 确保footer在最上层 */
color: #000;
span { span {
margin: 0 10px; margin: 0 10px;
} }
@@ -490,6 +625,13 @@ getTenantList(loginForm.value.username);
width: 24px !important; // 调整图标的宽度 width: 24px !important; // 调整图标的宽度
height: 24px !important; // 调整图标的高度 height: 24px !important; // 调整图标的高度
font-size: 24px !important; // 调整图标的字体大小 font-size: 24px !important; // 调整图标的字体大小
color: #606266 !important; // 确保图标颜色可见
cursor: pointer !important; // 确保鼠标悬停时显示指针
}
:deep(.password-toggle) {
line-height: 50px !important; // 确保文字垂直居中
user-select: none; // 禁止选中文字
} }
:deep(.el-select__wrapper) { :deep(.el-select__wrapper) {
background-color: #f5f7fa !important; background-color: #f5f7fa !important;
@@ -498,4 +640,8 @@ getTenantList(loginForm.value.username);
font-size: 18px !important; font-size: 18px !important;
height: 50px !important; // 修改输入框高度 height: 50px !important; // 修改输入框高度
} }
:deep(.el-form-item) {
margin-bottom: 15px !important; // 减小输入框之间的距离
}
</style> </style>

View File

@@ -69,7 +69,11 @@ import bindUser from "./bindUser";
import { getTenantUserPage, unbindTenantUser } from "@/api/system/tenant"; import { getTenantUserPage, unbindTenantUser } from "@/api/system/tenant";
// 在 <script setup> 顶部添加导入 // 在 <script setup> 顶部添加导入
import { ref, reactive, onMounted } from "vue"; // 补充 onMounted 导入 import { ref, reactive, onMounted } from "vue"; // 补充 onMounted 导入
import { useRoute, useRouter } from "vue-router"; // 添加 useRouter 导入
const route = useRoute(); const route = useRoute();
const router = useRouter(); // 创建 router 实例
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
@@ -100,8 +104,14 @@ function getList() {
} }
// 返回按钮 // 返回按钮
function handleClose() { function handleClose() {
const obj = { path: "/system/basicmanage/tenant" }; /* const obj = { path: "/system/basicmanage/tenant" };
proxy.$tab.closeOpenPage(obj); proxy.$tab.closeOpenPage(obj); 目前先注释掉改成返回上一级页面*/
// 先关闭当前标签页
const obj={ path: "/system/basicmanage/tenant" };
proxy.$tab.closeOpenPage(route).then(() => {
// 然后返回上一个页面
router.go(-1);
});
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
function handleQuery() { function handleQuery() {