Compare commits
19 Commits
wangjunpin
...
d8af11412f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8af11412f | ||
|
|
00816c9834 | ||
|
|
4fb7bea80a | ||
|
|
0fc72cb270 | ||
|
|
eadf521903 | ||
| f786fdbc3f | |||
| 92c4c938a3 | |||
|
|
a94a1b7b69 | ||
|
|
48755c2d9e | ||
|
|
f99f8eb560 | ||
|
|
ddc7ce2fe7 | ||
|
|
c9899c62d2 | ||
| 8b9837d7dc | |||
| 2cba41331a | |||
| 4da5ca427b | |||
| f4605b1af7 | |||
|
|
d2babdc9ed | ||
| 4d0599eac1 | |||
|
|
35d99df274 |
@@ -8,7 +8,7 @@
|
||||
|
||||
天天开源的前⾝是新致开源,最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn,于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉,新致开源品牌更新为天天开源,我们始终秉持开源、专业、协作的理念,致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。
|
||||
|
||||
了解我们:https://open.tntlinking.com/about?site=gitee
|
||||
了解我们a:https://open.tntlinking.com/about?site=gitee
|
||||
|
||||
## 💾【部署包下载】
|
||||
|
||||
|
||||
@@ -85,33 +85,33 @@
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>${maven-war-plugin.version}</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
<!-- <build>-->
|
||||
<!-- <plugins>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <fork>true</fork> <!– 如果没有该配置,devtools不会生效 –>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>repackage</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- </execution>-->
|
||||
<!-- </executions>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-war-plugin</artifactId>-->
|
||||
<!-- <version>${maven-war-plugin.version}</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <failOnMissingWebXml>false</failOnMissingWebXml>-->
|
||||
<!-- <warName>${project.artifactId}</warName>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- </plugins>-->
|
||||
<!-- <finalName>${project.artifactId}</finalName>-->
|
||||
<!-- </build>-->
|
||||
|
||||
</project>
|
||||
37
openhis-ui-vue3/.env.spug
Normal file
37
openhis-ui-vue3/.env.spug
Normal 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'
|
||||
@@ -9,7 +9,8 @@
|
||||
"dev": "vite",
|
||||
"build:prod": "vite build",
|
||||
"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": {
|
||||
"type": "git",
|
||||
|
||||
BIN
openhis-ui-vue3/src/assets/logo/LOGO.jpg
Normal file
BIN
openhis-ui-vue3/src/assets/logo/LOGO.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -3,6 +3,10 @@ export default {
|
||||
* 网页标题
|
||||
*/
|
||||
title: import.meta.env.VITE_APP_TITLE,
|
||||
/**
|
||||
* 系统名称
|
||||
*/
|
||||
systemName: import.meta.env.VITE_APP_SYSTEM_NAME || 'XXX医院信息管理系统',
|
||||
/**
|
||||
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
|
||||
*/
|
||||
|
||||
@@ -67,7 +67,7 @@ import { throttle } from 'lodash-es';
|
||||
const props = defineProps({
|
||||
adviceQueryParams: {
|
||||
type: Object,
|
||||
default: '',
|
||||
required: true
|
||||
},
|
||||
patientInfo: {
|
||||
type: Object,
|
||||
@@ -97,39 +97,25 @@ const throttledGetList = throttle(
|
||||
watch(
|
||||
() => props.adviceQueryParams,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue.searchKey;
|
||||
// queryParams.value.adviceType = newValue.adviceType;
|
||||
console.log('adviceBaseList 接收到参数变化:', newValue);
|
||||
|
||||
// 直接更新查询参数
|
||||
queryParams.value.searchKey = newValue.searchKey || '';
|
||||
|
||||
// 处理类型筛选
|
||||
if (newValue.adviceType) {
|
||||
queryParams.value.adviceTypes = [newValue.adviceType].join(',');
|
||||
// 单个类型
|
||||
queryParams.value.adviceTypes = newValue.adviceType.toString();
|
||||
} else {
|
||||
// 全部类型
|
||||
queryParams.value.adviceTypes = '1,2,3';
|
||||
}
|
||||
throttledGetList();
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
queryParams.value.organizationId = props.patientInfo.orgId;
|
||||
getAdviceBaseInfo(queryParams.value).then((res) => {
|
||||
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]);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log('发送请求参数:', queryParams.value);
|
||||
getList();
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
// 从priceList列表中获取价格
|
||||
function getPriceFromInventory(row) {
|
||||
if (row.priceList && row.priceList.length > 0) {
|
||||
@@ -138,6 +124,38 @@ function getPriceFromInventory(row) {
|
||||
}
|
||||
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 key = event.key;
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
>
|
||||
<el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in med_type"
|
||||
v-for="item in diag_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -235,7 +235,7 @@ const props = defineProps({
|
||||
const emits = defineEmits(['diagnosisSave']);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore();
|
||||
const { med_type } = proxy.useDict('med_type');
|
||||
const { diag_type } = proxy.useDict('diag_type');
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
|
||||
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
|
||||
|
||||
@@ -10,23 +10,15 @@
|
||||
<el-table
|
||||
ref="emrHistoryRef"
|
||||
:data="emrHistory"
|
||||
row-key="patientId"
|
||||
highlight-current-row
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- @cell-click="clickRow" -->
|
||||
<el-table-column type="selection" width="55" />
|
||||
<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="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" width="80">
|
||||
<template #default="scope">
|
||||
<!-- <el-button
|
||||
link
|
||||
type="primary"
|
||||
@click.stop="handelDetail(scope.row)"
|
||||
>详情
|
||||
</el-button> -->
|
||||
<el-button link type="primary" @click.stop="clickRow(scope.row)">复用 </el-button>
|
||||
<el-button link type="primary" @click.stop="clickRow(scope.row)">复用</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -43,6 +35,7 @@
|
||||
<script setup>
|
||||
import { formatDate, formatDateymd } from '@/utils/index';
|
||||
import { getEmrHistoryList } from '../api';
|
||||
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -51,13 +44,19 @@ const queryParams = ref({
|
||||
const selectRow = ref({});
|
||||
const emrHistory = ref([]);
|
||||
const emits = defineEmits(['selectRow']);
|
||||
const emrHistoryRef = ref(null);
|
||||
const selectedRows = ref([]);
|
||||
|
||||
const total = ref(0);
|
||||
|
||||
getList();
|
||||
|
||||
function getList() {
|
||||
if (sessionStorage.getItem('patientId')) {
|
||||
queryParams.value.patientId = sessionStorage.getItem('patientId');
|
||||
getEmrHistoryList(queryParams.value).then((res) => {
|
||||
emrHistory.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
emrHistory.value.map((k) => {
|
||||
k.name = JSON.parse(k.contextJson).chiefComplaint;
|
||||
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) {
|
||||
selectRow.value = JSON.parse(row.contextJson);
|
||||
emits('selectRow', selectRow.value);
|
||||
|
||||
@@ -43,7 +43,7 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
// getList();
|
||||
getList();
|
||||
function getList() {
|
||||
queryParams.value.useScopeCode = 1;
|
||||
getEmrTemplateList(queryParams.value).then((res) => {
|
||||
|
||||
@@ -561,9 +561,20 @@
|
||||
(value) => {
|
||||
expandOrder = [];
|
||||
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);
|
||||
});
|
||||
}
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in adviceTypeList"
|
||||
@@ -735,7 +746,7 @@ import {
|
||||
getAdviceBaseInfo,
|
||||
getActivityBindDevice,
|
||||
} from '../api';
|
||||
import adviceBaseList from '../advicebaselist';
|
||||
import adviceBaseList from '../adviceBaseList.vue';
|
||||
import { computed, getCurrentInstance, nextTick, watch } from 'vue';
|
||||
import { calculateQuantityByDays, formatNumber } from '@/utils/his';
|
||||
import OrderGroupDrawer from './orderGroupDrawer';
|
||||
@@ -751,7 +762,10 @@ const prescriptionList = ref([]);
|
||||
const form = ref({
|
||||
prescriptionList: prescriptionList.value,
|
||||
});
|
||||
const adviceQueryParams = ref({});
|
||||
const adviceQueryParams = ref({
|
||||
searchKey: '',
|
||||
adviceType: ''
|
||||
});
|
||||
const rowIndex = ref(-1);
|
||||
const groupIndex = ref(1);
|
||||
const groupIndexList = ref([]);
|
||||
@@ -933,6 +947,9 @@ function handleAddPrescription() {
|
||||
return;
|
||||
}
|
||||
isAdding.value = true;
|
||||
// 重置查询参数
|
||||
adviceQueryParams.value = {};
|
||||
|
||||
// 在数组最前方添加一行,让新增行显示在最上边
|
||||
prescriptionList.value.unshift({
|
||||
uniqueKey: nextId.value++,
|
||||
@@ -979,10 +996,17 @@ function handleDiagnosisChange(item) {
|
||||
function handleFocus(row, index) {
|
||||
rowIndex.value = index;
|
||||
row.showPopover = true;
|
||||
// 确保查询参数与当前行类型一致
|
||||
adviceQueryParams.value = {
|
||||
adviceType: row.adviceType || '',
|
||||
searchKey: adviceQueryParams.value.searchKey || ''
|
||||
};
|
||||
}
|
||||
|
||||
function handleBlur(row) {
|
||||
row.showPopover = false;
|
||||
setTimeout(() => {
|
||||
row.showPopover = false;
|
||||
}, 200);
|
||||
}
|
||||
|
||||
function handleChange(value) {
|
||||
@@ -1096,7 +1120,7 @@ function selectAdviceBase(key, row) {
|
||||
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId;
|
||||
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
|
||||
}
|
||||
expandOrder.value = [key];
|
||||
expandOrder.value = [key];
|
||||
nextTick(() => {
|
||||
if (row.adviceType == 1) {
|
||||
if (row.injectFlag == 1) {
|
||||
@@ -1108,6 +1132,7 @@ function selectAdviceBase(key, row) {
|
||||
inputRefs.value['quantity']?.focus();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getOrgList() {
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
</template>
|
||||
<script setup>
|
||||
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 Surgery from './surgery.vue';
|
||||
import LaboratoryTests from './LaboratoryTests.vue';
|
||||
import laboratoryTests from './laboratoryTests.vue';
|
||||
import MedicalExaminations from './medicalExaminations.vue';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits([]);
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<template>
|
||||
<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">
|
||||
<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">
|
||||
<p class="label">用户名</p>
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
type="text"
|
||||
@@ -21,25 +23,35 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<p class="label">密码</p>
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
type="password"
|
||||
:type="passwordVisible ? 'text' : 'password'"
|
||||
size="large"
|
||||
auto-complete="off"
|
||||
placeholder="密码"
|
||||
@keyup.enter="handleLogin"
|
||||
show-password
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="password" class="el-input__icon input-icon"
|
||||
/></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-form-item>
|
||||
<el-form-item prop="tenantId">
|
||||
<p class="label">医疗机构</p>
|
||||
<el-select
|
||||
v-model="loginForm.tenantId"
|
||||
size="large"
|
||||
placeholder="所属医院"
|
||||
placeholder="请选择医疗机构"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
@@ -51,6 +63,11 @@
|
||||
/>
|
||||
</el-select>
|
||||
</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"> -->
|
||||
<!-- <span class="descriptions-item-label" style="margin: 0 10px 0 0">连接医保</span> -->
|
||||
<!-- <el-switch v-model="loginForm.invokeYb" @change="topNavChange" size="large"/> -->
|
||||
@@ -87,8 +104,17 @@
|
||||
<router-link class="link-type" :to="'/register'">立即注册</router-link>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<div class="footer">
|
||||
© 2025 XXX医院信息系统 | 版本 v2.5.1
|
||||
<!-- 公司版权信息(新增) -->
|
||||
<div class="company-copyright">
|
||||
技术支持:上海经创贺联信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 底部 -->
|
||||
|
||||
<div class="el-login-footer">
|
||||
<div class="el-login-footer-link">
|
||||
<span><el-link :underline="false">his账号用户协议</el-link></span>
|
||||
@@ -109,12 +135,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref, reactive, computed, onMounted, watch } from 'vue';
|
||||
import settings from '@/settings';
|
||||
import { getCodeImg, sign, getUserBindTenantList } from '@/api/login';
|
||||
import { invokeYbPlugin } from '@/api/public';
|
||||
import Cookies from 'js-cookie';
|
||||
import { encrypt, decrypt } from '@/utils/jsencrypt';
|
||||
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 route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -131,6 +160,7 @@ const loginForm = ref({
|
||||
});
|
||||
|
||||
const tenantOptions = ref([]);
|
||||
const currentTenantName = ref('');
|
||||
|
||||
const loginRules = {
|
||||
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
|
||||
@@ -146,6 +176,21 @@ const captchaEnabled = ref(true);
|
||||
// 注册开关
|
||||
const register = ref(false);
|
||||
const redirect = ref(undefined);
|
||||
const passwordVisible = ref(false);
|
||||
|
||||
function togglePasswordVisibility() {
|
||||
passwordVisible.value = !passwordVisible.value;
|
||||
}
|
||||
|
||||
// 处理忘记密码功能
|
||||
function handleForgotPassword() {
|
||||
// 这里可以添加忘记密码的逻辑,例如跳转到忘记密码页面或显示忘记密码弹窗
|
||||
// 目前先显示一个提示
|
||||
ElMessage({
|
||||
message: '忘记密码功能正在开发中',
|
||||
type: 'info'
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
route,
|
||||
@@ -155,7 +200,7 @@ watch(
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 页面加载时从 localStorage 获取 invokeYb 的值
|
||||
// 页面加载时从 localStorage 获取 invokeYb 的值和从 Cookies 获取记住的登录信息
|
||||
onMounted(() => {
|
||||
const storedInvokeYb = localStorage.getItem('invokeYb');
|
||||
if (storedInvokeYb !== null) {
|
||||
@@ -164,6 +209,38 @@ onMounted(() => {
|
||||
// 如果 localStorage 中没有值,则设置默认值并保存
|
||||
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() {
|
||||
@@ -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
|
||||
function topNavChange(value) {
|
||||
localStorage.setItem('invokeYb', value.toString());
|
||||
@@ -303,6 +388,7 @@ function getTenantList(username) {
|
||||
label: item.tenantName,
|
||||
}));
|
||||
loginForm.value.tenantId = tenantOptions.value[0].value; //默认选中第一个
|
||||
currentTenantName.value = tenantOptions.value[0].label;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -389,27 +475,81 @@ getCookie();
|
||||
getTenantList(loginForm.value.username);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: auto;
|
||||
min-height: 100vh;
|
||||
overflow-y: auto;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
background: #f8f9fa;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 100px; /* 为底部固定footer留出空间 */
|
||||
//background-image: url("../assets/images/login-background.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
.title {
|
||||
margin: 0px auto 30px auto;
|
||||
margin: 10px auto 15px auto;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
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 {
|
||||
border-radius: 6px;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 12px var(--shadow);
|
||||
border: 1px solid var(--border);
|
||||
background: #ffffff;
|
||||
width: 400px;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
padding: 40px;
|
||||
padding: 25px 25px 5px 25px;
|
||||
text-align: center;
|
||||
.el-input {
|
||||
height: 50px; // 修改输入框高度
|
||||
input {
|
||||
@@ -438,24 +578,20 @@ getTenantList(loginForm.value.username);
|
||||
}
|
||||
}
|
||||
.el-login-top {
|
||||
height: 80px;
|
||||
line-height: 40px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
color: #000;
|
||||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
background-color: #f1f1f1;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
margin: 0 auto 10px;
|
||||
.el-image {
|
||||
max-width: 120px;
|
||||
max-height: 120px;
|
||||
}
|
||||
}
|
||||
.el-login-footer {
|
||||
height: 100px;
|
||||
line-height: 40px;
|
||||
height: 80px;
|
||||
line-height: 30px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
@@ -463,8 +599,7 @@ getTenantList(loginForm.value.username);
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
background-color: #f1f1f1;
|
||||
|
||||
color: #000;
|
||||
z-index: 100; /* 确保footer在最上层 */
|
||||
span {
|
||||
margin: 0 10px;
|
||||
}
|
||||
@@ -490,6 +625,13 @@ getTenantList(loginForm.value.username);
|
||||
width: 24px !important; // 调整图标的宽度
|
||||
height: 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) {
|
||||
background-color: #f5f7fa !important;
|
||||
@@ -498,4 +640,8 @@ getTenantList(loginForm.value.username);
|
||||
font-size: 18px !important;
|
||||
height: 50px !important; // 修改输入框高度
|
||||
}
|
||||
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 15px !important; // 减小输入框之间的距离
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -69,7 +69,11 @@ import bindUser from "./bindUser";
|
||||
import { getTenantUserPage, unbindTenantUser } from "@/api/system/tenant";
|
||||
// 在 <script setup> 顶部添加导入
|
||||
import { ref, reactive, onMounted } from "vue"; // 补充 onMounted 导入
|
||||
import { useRoute, useRouter } from "vue-router"; // 添加 useRouter 导入
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter(); // 创建 router 实例
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
@@ -100,8 +104,14 @@ function getList() {
|
||||
}
|
||||
// 返回按钮
|
||||
function handleClose() {
|
||||
const obj = { path: "/system/basicmanage/tenant" };
|
||||
proxy.$tab.closeOpenPage(obj);
|
||||
/* const obj = { path: "/system/basicmanage/tenant" };
|
||||
proxy.$tab.closeOpenPage(obj); 目前先注释掉改成返回上一级页面*/
|
||||
// 先关闭当前标签页
|
||||
const obj={ path: "/system/basicmanage/tenant" };
|
||||
proxy.$tab.closeOpenPage(route).then(() => {
|
||||
// 然后返回上一个页面
|
||||
router.go(-1);
|
||||
});
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
|
||||
Reference in New Issue
Block a user