feat(invoice): 完善发票管理权限控制和检验申请功能
- 超级管理员可以编辑操作员字段,普通用户不可编辑 - 修改权限判断逻辑,只有用户名等于 'admin' 的用户才是超级管理员 - 非超级管理员用户只能查询自己的发票数据 - 添加根据员工ID更新操作员名称功能 - 新增行时根据用户权限填充信息 - 严格检查权限,超级管理员可以删除所有记录,普通用户只能删除自己维护的记录 - 在 bargain 组件中验证患者选择 - 添加检验申请单相关API接口 - 在医生工作站中添加检验申请tab页 - 实现检验申请单的增删改查功能 - 添加公告通知已读记录相关功能 - 实现用户未读公告数量统计和标记已读功能
This commit is contained in:
@@ -0,0 +1,70 @@
|
|||||||
|
package com.core.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.core.system.domain.SysNoticeRead;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告/通知已读记录 Mapper接口
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
public interface SysNoticeReadMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公告/通知已读记录
|
||||||
|
*
|
||||||
|
* @param readId 阅读ID
|
||||||
|
* @return 公告/通知已读记录
|
||||||
|
*/
|
||||||
|
public SysNoticeRead selectNoticeReadById(Long readId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户的已读公告/通知ID列表
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 已读公告/通知ID列表
|
||||||
|
*/
|
||||||
|
public List<Long> selectReadNoticeIdsByUserId(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公告/通知的已读用户数量
|
||||||
|
*
|
||||||
|
* @param noticeId 公告/通知ID
|
||||||
|
* @return 已读用户数量
|
||||||
|
*/
|
||||||
|
public int countReadByNoticeId(Long noticeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公告/通知已读记录
|
||||||
|
*
|
||||||
|
* @param noticeRead 公告/通知已读记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertNoticeRead(SysNoticeRead noticeRead);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公告/通知已读记录
|
||||||
|
*
|
||||||
|
* @param readId 阅读ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteNoticeReadById(Long readId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除公告/通知已读记录
|
||||||
|
*
|
||||||
|
* @param readIds 需要删除的阅读ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteNoticeReadByIds(Long[] readIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查用户是否已阅读公告/通知
|
||||||
|
*
|
||||||
|
* @param noticeId 公告/通知ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 是否已阅读
|
||||||
|
*/
|
||||||
|
public boolean checkNoticeRead(Long noticeId, Long userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.core.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.AjaxResult;
|
||||||
|
import com.core.system.domain.SysNotice;
|
||||||
|
import com.core.system.domain.SysNoticeRead;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告/通知已读记录 服务层
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
public interface ISysNoticeReadService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户的未读公告/通知数量
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 未读数量
|
||||||
|
*/
|
||||||
|
public int getUnreadCount(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记公告/通知为已读
|
||||||
|
*
|
||||||
|
* @param noticeId 公告/通知ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public AjaxResult markAsRead(Long noticeId, Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量标记公告/通知为已读
|
||||||
|
*
|
||||||
|
* @param noticeIds 公告/通知ID列表
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public AjaxResult markAllAsRead(Long[] noticeIds, Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户的已读公告/通知ID列表
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 已读公告/通知ID列表
|
||||||
|
*/
|
||||||
|
public List<Long> selectReadNoticeIdsByUserId(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询带已读状态的公告列表
|
||||||
|
*
|
||||||
|
* @param notice 公告信息
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 公告集合
|
||||||
|
*/
|
||||||
|
public List<SysNotice> selectNoticeListWithReadStatus(SysNotice notice, Long userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
package com.core.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.AjaxResult;
|
||||||
|
import com.core.system.domain.SysNotice;
|
||||||
|
import com.core.system.domain.SysNoticeRead;
|
||||||
|
import com.core.system.mapper.SysNoticeMapper;
|
||||||
|
import com.core.system.mapper.SysNoticeReadMapper;
|
||||||
|
import com.core.system.service.ISysNoticeReadService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告/通知已读记录 服务层实现
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysNoticeReadServiceImpl implements ISysNoticeReadService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysNoticeReadMapper noticeReadMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysNoticeMapper noticeMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户的未读公告/通知数量
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 未读数量
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int getUnreadCount(Long userId) {
|
||||||
|
// 查询所有状态为正常(0)的公告/通知
|
||||||
|
SysNotice notice = new SysNotice();
|
||||||
|
notice.setStatus("0");
|
||||||
|
List<SysNotice> allNotices = noticeMapper.selectNoticeList(notice);
|
||||||
|
|
||||||
|
// 查询用户已读的公告/通知ID
|
||||||
|
List<Long> readNoticeIds = noticeReadMapper.selectReadNoticeIdsByUserId(userId);
|
||||||
|
|
||||||
|
// 计算未读数量
|
||||||
|
int unreadCount = 0;
|
||||||
|
for (SysNotice n : allNotices) {
|
||||||
|
if (!readNoticeIds.contains(n.getNoticeId())) {
|
||||||
|
unreadCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return unreadCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记公告/通知为已读
|
||||||
|
*
|
||||||
|
* @param noticeId 公告/通知ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult markAsRead(Long noticeId, Long userId) {
|
||||||
|
// 检查是否已读
|
||||||
|
boolean isRead = noticeReadMapper.checkNoticeRead(noticeId, userId);
|
||||||
|
if (isRead) {
|
||||||
|
return AjaxResult.success("已标记为已读");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 插入已读记录
|
||||||
|
SysNoticeRead noticeRead = new SysNoticeRead();
|
||||||
|
noticeRead.setNoticeId(noticeId);
|
||||||
|
noticeRead.setUserId(userId);
|
||||||
|
|
||||||
|
int result = noticeReadMapper.insertNoticeRead(noticeRead);
|
||||||
|
if (result > 0) {
|
||||||
|
return AjaxResult.success("标记成功");
|
||||||
|
}
|
||||||
|
return AjaxResult.error("标记失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量标记公告/通知为已读
|
||||||
|
*
|
||||||
|
* @param noticeIds 公告/通知ID列表
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult markAllAsRead(Long[] noticeIds, Long userId) {
|
||||||
|
int successCount = 0;
|
||||||
|
for (Long noticeId : noticeIds) {
|
||||||
|
boolean isRead = noticeReadMapper.checkNoticeRead(noticeId, userId);
|
||||||
|
if (!isRead) {
|
||||||
|
SysNoticeRead noticeRead = new SysNoticeRead();
|
||||||
|
noticeRead.setNoticeId(noticeId);
|
||||||
|
noticeRead.setUserId(userId);
|
||||||
|
noticeReadMapper.insertNoticeRead(noticeRead);
|
||||||
|
successCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success("成功标记" + successCount + "条记录为已读");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户的已读公告/通知ID列表
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 已读公告/通知ID列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Long> selectReadNoticeIdsByUserId(Long userId) {
|
||||||
|
return noticeReadMapper.selectReadNoticeIdsByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询带已读状态的公告列表
|
||||||
|
*
|
||||||
|
* @param notice 公告信息
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 公告集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysNotice> selectNoticeListWithReadStatus(SysNotice notice, Long userId) {
|
||||||
|
// 这里可以扩展为在查询结果中添加已读状态标记
|
||||||
|
// 暂时返回普通列表
|
||||||
|
return noticeMapper.selectNoticeList(notice);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.core.system.mapper.SysNoticeReadMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysNoticeRead" id="SysNoticeReadResult">
|
||||||
|
<result property="readId" column="read_id"/>
|
||||||
|
<result property="noticeId" column="notice_id"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="readTime" column="read_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectNoticeReadById" parameterType="Long" resultMap="SysNoticeReadResult">
|
||||||
|
select read_id, notice_id, user_id, read_time
|
||||||
|
from sys_notice_read
|
||||||
|
where read_id = #{readId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectReadNoticeIdsByUserId" parameterType="Long" resultType="Long">
|
||||||
|
select notice_id
|
||||||
|
from sys_notice_read
|
||||||
|
where user_id = #{userId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="countReadByNoticeId" parameterType="Long" resultType="int">
|
||||||
|
select count(1)
|
||||||
|
from sys_notice_read
|
||||||
|
where notice_id = #{noticeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="checkNoticeRead" resultType="boolean">
|
||||||
|
select count(1) > 0
|
||||||
|
from sys_notice_read
|
||||||
|
where notice_id = #{noticeId} and user_id = #{userId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertNoticeRead" parameterType="SysNoticeRead">
|
||||||
|
insert into sys_notice_read (
|
||||||
|
read_id,
|
||||||
|
notice_id,
|
||||||
|
user_id,
|
||||||
|
read_time
|
||||||
|
) values (
|
||||||
|
(SELECT COALESCE(MAX(read_id), 0) + 1 FROM sys_notice_read),
|
||||||
|
#{noticeId},
|
||||||
|
#{userId},
|
||||||
|
now()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="deleteNoticeReadById" parameterType="Long">
|
||||||
|
delete from sys_notice_read where read_id = #{readId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteNoticeReadByIds" parameterType="Long">
|
||||||
|
delete from sys_notice_read where read_id in
|
||||||
|
<foreach item="readId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{readId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -7,4 +7,6 @@ public interface CallNumberVoiceConfigAppService {
|
|||||||
R<?> addCallNumberVoiceConfig(CallNumberVoiceConfig callNumberVoiceConfig);
|
R<?> addCallNumberVoiceConfig(CallNumberVoiceConfig callNumberVoiceConfig);
|
||||||
|
|
||||||
R<?> updateCallNumberVoiceConfig(CallNumberVoiceConfig callNumberVoiceConfig);
|
R<?> updateCallNumberVoiceConfig(CallNumberVoiceConfig callNumberVoiceConfig);
|
||||||
|
|
||||||
|
R<?> getCallNumberVoiceConfig();
|
||||||
}
|
}
|
||||||
|
|||||||
249
openhis-ui-vue3/src/components/NoticePanel.vue
Normal file
249
openhis-ui-vue3/src/components/NoticePanel.vue
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
<template>
|
||||||
|
<el-drawer v-model="noticeVisible" title="公告" direction="rtl" size="400px" destroy-on-close>
|
||||||
|
<el-tabs v-model="activeTab">
|
||||||
|
<el-tab-pane label="公告" name="notice">
|
||||||
|
<el-empty v-if="noticeList.length === 0" description="暂无公告" />
|
||||||
|
<div v-else class="notice-list">
|
||||||
|
<div v-for="item in noticeList" :key="item.noticeId" class="notice-item" :class="{ 'is-read': isRead(item.noticeId) }" @click="viewDetail(item)">
|
||||||
|
<div class="notice-title">
|
||||||
|
<span v-if="!isRead(item.noticeId)" class="unread-dot"></span>
|
||||||
|
{{ item.noticeTitle }}
|
||||||
|
</div>
|
||||||
|
<div class="notice-info">
|
||||||
|
<span class="notice-type">
|
||||||
|
<dict-tag :options="sys_notice_type" :value="item.noticeType" />
|
||||||
|
</span>
|
||||||
|
<span class="notice-time">{{ parseTime(item.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="通知" name="notification">
|
||||||
|
<el-empty v-if="notificationList.length === 0" description="暂无通知" />
|
||||||
|
<div v-else class="notice-list">
|
||||||
|
<div v-for="item in notificationList" :key="item.noticeId" class="notice-item" :class="{ 'is-read': isRead(item.noticeId) }" @click="viewDetail(item)">
|
||||||
|
<div class="notice-title">
|
||||||
|
<span v-if="!isRead(item.noticeId)" class="unread-dot"></span>
|
||||||
|
{{ item.noticeTitle }}
|
||||||
|
</div>
|
||||||
|
<div class="notice-info">
|
||||||
|
<span class="notice-type">
|
||||||
|
<dict-tag :options="sys_notice_type" :value="item.noticeType" />
|
||||||
|
</span>
|
||||||
|
<span class="notice-time">{{ parseTime(item.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
|
<!-- 公告/通知详情对话框 -->
|
||||||
|
<el-dialog v-model="detailVisible" :title="currentNotice.noticeTitle" width="800px" append-to-body>
|
||||||
|
<div class="notice-detail">
|
||||||
|
<div class="detail-header">
|
||||||
|
<span class="detail-type">
|
||||||
|
<dict-tag :options="sys_notice_type" :value="currentNotice.noticeType" />
|
||||||
|
</span>
|
||||||
|
<span class="detail-time">{{ parseTime(currentNotice.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="detail-content" v-html="currentNotice.noticeContent"></div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="detailVisible = false">关闭</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import { getPublicNoticeList, getUserNotices, markAsRead, getReadNoticeIds } from '@/api/system/notice'
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const { sys_notice_type } = proxy.useDict('sys_notice_type')
|
||||||
|
const emit = defineEmits(['updateUnreadCount'])
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
const noticeVisible = ref(false)
|
||||||
|
const detailVisible = ref(false)
|
||||||
|
const activeTab = ref('notice')
|
||||||
|
const noticeList = ref([])
|
||||||
|
const notificationList = ref([])
|
||||||
|
const currentNotice = ref({})
|
||||||
|
const readNoticeIds = ref(new Set())
|
||||||
|
|
||||||
|
// 打开公告/通知面板
|
||||||
|
function open() {
|
||||||
|
noticeVisible.value = true
|
||||||
|
loadNotices()
|
||||||
|
loadReadNoticeIds()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载已读公告ID列表
|
||||||
|
function loadReadNoticeIds() {
|
||||||
|
getReadNoticeIds().then(response => {
|
||||||
|
const ids = response.data || []
|
||||||
|
readNoticeIds.value = new Set(ids)
|
||||||
|
// 同步到 localStorage
|
||||||
|
localStorage.setItem('readNoticeIds', JSON.stringify(ids))
|
||||||
|
}).catch(() => {
|
||||||
|
// 接口调用失败时从 localStorage 读取
|
||||||
|
const readIds = localStorage.getItem('readNoticeIds')
|
||||||
|
if (readIds) {
|
||||||
|
try {
|
||||||
|
const ids = JSON.parse(readIds)
|
||||||
|
readNoticeIds.value = new Set(ids)
|
||||||
|
} catch (e) {
|
||||||
|
console.error('解析已读ID失败', e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序:未读的排前面,已读的排后面,同类型按时间倒序
|
||||||
|
function sortNoticeList(list) {
|
||||||
|
return list.sort((a, b) => {
|
||||||
|
const aRead = isRead(a.noticeId)
|
||||||
|
const bRead = isRead(b.noticeId)
|
||||||
|
|
||||||
|
// 未读排在前面
|
||||||
|
if (aRead !== bRead) {
|
||||||
|
return aRead ? 1 : -1
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同类型按创建时间倒序(最新的在前)
|
||||||
|
return new Date(b.createTime) - new Date(a.createTime)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载公告和通知
|
||||||
|
function loadNotices() {
|
||||||
|
// 加载公告列表
|
||||||
|
getPublicNoticeList({ pageNum: 1, pageSize: 10 }).then(response => {
|
||||||
|
let list = response.rows || response.data || []
|
||||||
|
noticeList.value = sortNoticeList(list)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 加载通知列表
|
||||||
|
getUserNotices().then(response => {
|
||||||
|
let list = response.data || []
|
||||||
|
notificationList.value = sortNoticeList(list)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查看详情
|
||||||
|
function viewDetail(item) {
|
||||||
|
currentNotice.value = item
|
||||||
|
detailVisible.value = true
|
||||||
|
|
||||||
|
// 标记为已读
|
||||||
|
if (!readNoticeIds.value.has(item.noticeId)) {
|
||||||
|
markAsRead(item.noticeId).then(() => {
|
||||||
|
readNoticeIds.value.add(item.noticeId)
|
||||||
|
// 保存到 localStorage
|
||||||
|
saveReadNoticeIds()
|
||||||
|
emit('updateUnreadCount')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存已读公告ID列表
|
||||||
|
function saveReadNoticeIds() {
|
||||||
|
const ids = Array.from(readNoticeIds.value)
|
||||||
|
localStorage.setItem('readNoticeIds', JSON.stringify(ids))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否已读
|
||||||
|
function isRead(noticeId) {
|
||||||
|
return readNoticeIds.value.has(noticeId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴露方法给父组件
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
isRead,
|
||||||
|
readNoticeIds
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.notice-list {
|
||||||
|
max-height: calc(100vh - 200px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-item {
|
||||||
|
padding: 12px 0;
|
||||||
|
border-bottom: 1px solid #EBEEF5;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #F5F7FA;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-read {
|
||||||
|
.notice-title {
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-title {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #303133;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
line-height: 1.4;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.unread-dot {
|
||||||
|
display: inline-block;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background-color: #f56c6c;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 8px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-info {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
border-bottom: 1px solid #EBEEF5;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-time {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-content {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.8;
|
||||||
|
color: #303133;
|
||||||
|
max-height: 500px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-drawer__body) {
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -52,8 +52,23 @@
|
|||||||
<td class="sequence-number">{{ index + 1 }}</td>
|
<td class="sequence-number">{{ index + 1 }}</td>
|
||||||
<td class="employee-info">
|
<td class="employee-info">
|
||||||
<div class="input-container">
|
<div class="input-container">
|
||||||
<!-- 操作员字段始终不可编辑 -->
|
<!-- 超级管理员可以编辑操作员字段,普通用户不可编辑 -->
|
||||||
<span class="employee-name">{{ item.operator || '-' }}</span>
|
<select
|
||||||
|
v-if="item.isActive && isAdmin"
|
||||||
|
v-model="item.employeeId"
|
||||||
|
class="form-control"
|
||||||
|
@change="updateOperatorFromEmployeeId(item)"
|
||||||
|
>
|
||||||
|
<option value="">请选择操作员</option>
|
||||||
|
<option
|
||||||
|
v-for="user in userList"
|
||||||
|
:key="user.employeeId"
|
||||||
|
:value="user.employeeId"
|
||||||
|
>
|
||||||
|
{{ user.name }} ({{ user.employeeId }})
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<span v-else class="employee-name">{{ item.operator || '-' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="employee-id-cell">
|
<td class="employee-id-cell">
|
||||||
@@ -180,7 +195,7 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
nickName: '',
|
nickName: '',
|
||||||
employeeId: '',
|
employeeId: '',
|
||||||
status: '' // 0: 启用(管理员), 1: 禁用(普通人员)
|
status: '' // 0: 启用, 1: 禁用(仅用于显示,不再控制权限)
|
||||||
},
|
},
|
||||||
// 用户列表,用于操作员下拉选择(将在created中从后端获取)
|
// 用户列表,用于操作员下拉选择(将在created中从后端获取)
|
||||||
userList: [],
|
userList: [],
|
||||||
@@ -195,10 +210,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 计算属性:判断是否为管理员
|
// 计算属性:判断是否为超级管理员
|
||||||
isAdmin() {
|
isAdmin() {
|
||||||
// 管理员是指在用户管理界面中状态为启用的用户
|
// 只有用户名等于 'admin' 的用户才是超级管理员,可以查看所有数据
|
||||||
return this.currentUser.status === '0';
|
const userStore = useUserStore();
|
||||||
|
return userStore.name === 'admin';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -260,14 +276,25 @@ export default {
|
|||||||
},
|
},
|
||||||
// 从后端加载发票数据
|
// 从后端加载发票数据
|
||||||
loadInvoiceData() {
|
loadInvoiceData() {
|
||||||
|
// 准备查询参数
|
||||||
|
const queryParams = {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10000 // 进一步增大分页大小,确保能获取数据库中的所有记录
|
||||||
|
};
|
||||||
|
|
||||||
|
// 非超级管理员用户只能查询自己的发票数据
|
||||||
|
if (!this.isAdmin && this.currentUser.employeeId) {
|
||||||
|
queryParams.invoicingStaffId = this.currentUser.employeeId;
|
||||||
|
console.log('普通用户模式,只查询自己的发票数据,员工ID:', this.currentUser.employeeId);
|
||||||
|
} else {
|
||||||
|
console.log('超级管理员模式,查询所有发票数据');
|
||||||
|
}
|
||||||
|
|
||||||
// 使用request工具从后端API获取发票段数据
|
// 使用request工具从后端API获取发票段数据
|
||||||
request({
|
request({
|
||||||
url: '/basicmanage/invoice-segment/page', // 更新为发票段的API路径
|
url: '/basicmanage/invoice-segment/page', // 更新为发票段的API路径
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: queryParams
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10000 // 进一步增大分页大小,确保能获取数据库中的所有记录
|
|
||||||
}
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log('获取到的发票段数据响应:', res);
|
console.log('获取到的发票段数据响应:', res);
|
||||||
// 添加更多调试信息
|
// 添加更多调试信息
|
||||||
@@ -400,24 +427,24 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 根据用户权限过滤数据
|
// 根据用户权限过滤数据(作为后端过滤的补充保障)
|
||||||
filterDataByPermission() {
|
filterDataByPermission() {
|
||||||
console.log('开始过滤数据,当前用户状态:', this.currentUser.status);
|
console.log('开始过滤数据,当前用户:', this.currentUser.name, '是否超级管理员:', this.isAdmin);
|
||||||
console.log('过滤前数据总量:', this.invoiceData.length);
|
console.log('过滤前数据总量:', this.invoiceData.length);
|
||||||
|
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
// 管理员可以看到所有数据
|
// 超级管理员可以看到所有数据
|
||||||
console.log('管理员模式,显示所有数据');
|
console.log('超级管理员模式,显示所有数据');
|
||||||
this.filteredData = [...this.invoiceData];
|
this.filteredData = [...this.invoiceData];
|
||||||
} else {
|
} else {
|
||||||
// 普通操作员只能看到自己的数据,确保类型一致
|
// 普通用户只能看到自己的数据,确保类型一致
|
||||||
console.log('操作员模式,过滤条件:', this.currentUser.employeeId);
|
console.log('普通用户模式,过滤条件:', this.currentUser.employeeId);
|
||||||
const currentEmployeeId = String(this.currentUser.employeeId);
|
const currentEmployeeId = String(this.currentUser.employeeId);
|
||||||
this.filteredData = this.invoiceData.filter(item =>
|
this.filteredData = this.invoiceData.filter(item =>
|
||||||
String(item.employeeId) === currentEmployeeId
|
String(item.employeeId) === currentEmployeeId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('过滤后显示的数据量:', this.filteredData.length);
|
console.log('过滤后显示的数据量:', this.filteredData.length);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -440,6 +467,15 @@ export default {
|
|||||||
updateEmployeeId(item, employeeId) {
|
updateEmployeeId(item, employeeId) {
|
||||||
item.employeeId = employeeId;
|
item.employeeId = employeeId;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 根据员工ID更新操作员名称(超级管理员使用)
|
||||||
|
updateOperatorFromEmployeeId(item) {
|
||||||
|
if (item.employeeId) {
|
||||||
|
item.operator = this.getUserNameById(item.employeeId);
|
||||||
|
} else {
|
||||||
|
item.operator = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 根据员工ID获取用户名称
|
// 根据员工ID获取用户名称
|
||||||
getUserNameById(employeeId) {
|
getUserNameById(employeeId) {
|
||||||
@@ -449,7 +485,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
addNewRow() {
|
addNewRow() {
|
||||||
// 新增行时自动填充当前用户信息
|
// 新增行时根据用户权限填充信息
|
||||||
// 使用负数作为临时ID,避免与后端数据库ID冲突
|
// 使用负数作为临时ID,避免与后端数据库ID冲突
|
||||||
let maxId = 0;
|
let maxId = 0;
|
||||||
if (this.invoiceData.length > 0) {
|
if (this.invoiceData.length > 0) {
|
||||||
@@ -458,12 +494,12 @@ export default {
|
|||||||
const newId = -(maxId + 1);
|
const newId = -(maxId + 1);
|
||||||
const newSegmentId = Date.now(); // 生成唯一的segmentId
|
const newSegmentId = Date.now(); // 生成唯一的segmentId
|
||||||
const currentDate = new Date().toISOString().split('T')[0];
|
const currentDate = new Date().toISOString().split('T')[0];
|
||||||
|
|
||||||
const newRecord = {
|
const newRecord = {
|
||||||
id: newId,
|
id: newId,
|
||||||
segmentId: newSegmentId, // 为新记录设置segmentId
|
segmentId: newSegmentId, // 为新记录设置segmentId
|
||||||
operator: this.currentUser.name, // 自动使用当前用户名称
|
operator: this.isAdmin ? '' : this.currentUser.name, // 超级管理员可选择,普通用户自动填充
|
||||||
employeeId: this.currentUser.employeeId,
|
employeeId: this.isAdmin ? '' : this.currentUser.employeeId, // 超级管理员可选择,普通用户自动填充
|
||||||
date: currentDate, // 自动填充当日日期
|
date: currentDate, // 自动填充当日日期
|
||||||
startNum: '',
|
startNum: '',
|
||||||
endNum: '',
|
endNum: '',
|
||||||
@@ -472,8 +508,8 @@ export default {
|
|||||||
isActive: true, // 新增行默认处于编辑状态
|
isActive: true, // 新增行默认处于编辑状态
|
||||||
isNewRecord: true // 添加标记表示这是新记录
|
isNewRecord: true // 添加标记表示这是新记录
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('添加新行,自动填充领用日期为当日:', { newRecord });
|
console.log('添加新行:', this.isAdmin ? '超级管理员模式,可选择操作员' : '普通用户模式,自动填充当前用户信息', { newRecord });
|
||||||
this.invoiceData.push(newRecord);
|
this.invoiceData.push(newRecord);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -496,8 +532,8 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 严格检查权限:只能删除自己维护的发票号码段
|
// 严格检查权限:超级管理员可以删除所有记录,普通用户只能删除自己维护的发票号码段
|
||||||
if (record.operator !== this.currentUser.name) {
|
if (!this.isAdmin && record.operator !== this.currentUser.name) {
|
||||||
alert('您没有权限删除此记录!只能删除自己维护的发票号码段。');
|
alert('您没有权限删除此记录!只能删除自己维护的发票号码段。');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ watch(
|
|||||||
|
|
||||||
getList();
|
getList();
|
||||||
function getList() {
|
function getList() {
|
||||||
|
// 验证是否已选择患者
|
||||||
|
if (!props.patientInfo || Object.keys(props.patientInfo).length === 0) {
|
||||||
|
return; // 不执行API调用
|
||||||
|
}
|
||||||
|
|
||||||
queryParams.value.organizationId = props.patientInfo.orgId;
|
queryParams.value.organizationId = props.patientInfo.orgId;
|
||||||
getAdviceBaseInfo(queryParams.value).then((res) => {
|
getAdviceBaseInfo(queryParams.value).then((res) => {
|
||||||
adviceBaseList.value = res.data.records;
|
adviceBaseList.value = res.data.records;
|
||||||
|
|||||||
@@ -412,6 +412,12 @@ function getRowDisabled(row) {
|
|||||||
|
|
||||||
// 新增医嘱
|
// 新增医嘱
|
||||||
function handleAddPrescription() {
|
function handleAddPrescription() {
|
||||||
|
// 验证是否已选择患者
|
||||||
|
if (!props.patientInfo || Object.keys(props.patientInfo).length === 0) {
|
||||||
|
proxy.$modal.msgWarning('请先选择患者');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAdding.value) {
|
if (isAdding.value) {
|
||||||
proxy.$modal.msgWarning('请先保存当前医嘱');
|
proxy.$modal.msgWarning('请先保存当前医嘱');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -795,3 +795,35 @@ export function getTestResult(queryParams) {
|
|||||||
params: queryParams,
|
params: queryParams,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取检验申请单列表
|
||||||
|
*/
|
||||||
|
export function getInspectionApplicationList(queryParams) {
|
||||||
|
return request({
|
||||||
|
url: '/doctor-station/inspection/application-list',
|
||||||
|
method: 'get',
|
||||||
|
params: queryParams,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存检验申请单
|
||||||
|
*/
|
||||||
|
export function saveInspectionApplication(data) {
|
||||||
|
return request({
|
||||||
|
url: '/doctor-station/inspection/application',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除检验申请单
|
||||||
|
*/
|
||||||
|
export function deleteInspectionApplication(id) {
|
||||||
|
return request({
|
||||||
|
url: '/doctor-station/inspection/application/' + id,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -161,6 +161,9 @@
|
|||||||
<el-tab-pane label="中医" name="tcm">
|
<el-tab-pane label="中医" name="tcm">
|
||||||
<tcmAdvice :patientInfo="patientInfo" ref="tcmRef" />
|
<tcmAdvice :patientInfo="patientInfo" ref="tcmRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="检验" name="inspection">
|
||||||
|
<inspectionApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="inspectionRef" />
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane label="电子处方" name="eprescription">
|
<el-tab-pane label="电子处方" name="eprescription">
|
||||||
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -214,6 +217,7 @@ import PrescriptionInfo from './components/prescription/prescriptionInfo.vue';
|
|||||||
import eprescriptionlist from './components/eprescriptionlist.vue';
|
import eprescriptionlist from './components/eprescriptionlist.vue';
|
||||||
import HospitalizationDialog from './components/hospitalizationDialog.vue';
|
import HospitalizationDialog from './components/hospitalizationDialog.vue';
|
||||||
import tcmAdvice from './components/tcm/tcmAdvice.vue';
|
import tcmAdvice from './components/tcm/tcmAdvice.vue';
|
||||||
|
import inspectionApplication from './components/inspection/inspectionApplication.vue';
|
||||||
import { formatDate, formatDateStr } from '@/utils/index';
|
import { formatDate, formatDateStr } from '@/utils/index';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
@@ -263,6 +267,7 @@ const registerTime = ref(formatDate(new Date()));
|
|||||||
const patientDrawerRef = ref();
|
const patientDrawerRef = ref();
|
||||||
const prescriptionRef = ref();
|
const prescriptionRef = ref();
|
||||||
const tcmRef = ref();
|
const tcmRef = ref();
|
||||||
|
const inspectionRef = ref();
|
||||||
const emrRef = ref();
|
const emrRef = ref();
|
||||||
const diagnosisRef = ref();
|
const diagnosisRef = ref();
|
||||||
const waitCount = ref(0);
|
const waitCount = ref(0);
|
||||||
@@ -396,6 +401,9 @@ function handleClick(tab) {
|
|||||||
case 'tcm':
|
case 'tcm':
|
||||||
tcmRef.value.getDiagnosisInfo();
|
tcmRef.value.getDiagnosisInfo();
|
||||||
break;
|
break;
|
||||||
|
case 'inspection':
|
||||||
|
// 检验tab点击处理逻辑可以在这里添加
|
||||||
|
break;
|
||||||
case 'eprescription':
|
case 'eprescription':
|
||||||
eprescriptionRef.value.getList();
|
eprescriptionRef.value.getList();
|
||||||
break;
|
break;
|
||||||
@@ -453,6 +461,7 @@ function handleCardClick(item, index) {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
prescriptionRef.value.getListInfo();
|
prescriptionRef.value.getListInfo();
|
||||||
tcmRef.value.getListInfo();
|
tcmRef.value.getListInfo();
|
||||||
|
inspectionRef.value.getList();
|
||||||
diagnosisRef.value.getList();
|
diagnosisRef.value.getList();
|
||||||
eprescriptionRef.value.getList();
|
eprescriptionRef.value.getList();
|
||||||
// emrRef.value.getDetail(item.encounterId);
|
// emrRef.value.getDetail(item.encounterId);
|
||||||
|
|||||||
27
openhis-ui-vue3/src/views/triageandqueuemanage/api.js
Normal file
27
openhis-ui-vue3/src/views/triageandqueuemanage/api.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询叫号语音设置
|
||||||
|
export function getCallNumberVoiceConfig() {
|
||||||
|
return request({
|
||||||
|
url: '/CallNumberVoice/get',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增叫号语音设置
|
||||||
|
export function addCallNumberVoiceConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/CallNumberVoice/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改叫号语音设置
|
||||||
|
export function updateCallNumberVoiceConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/CallNumberVoice/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,754 @@
|
|||||||
|
<template>
|
||||||
|
<div class="call-voice-settings">
|
||||||
|
<!-- 标题区域 -->
|
||||||
|
<div class="title-section">
|
||||||
|
<h1>叫号语音设置</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 语音设置模块 -->
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2 class="card-title">科室叫号语音设置</h2>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn btn-primary" @click="saveSettings" :disabled="loading">
|
||||||
|
<span v-if="loading">保存中...</span>
|
||||||
|
<span v-else>保存设置</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-secondary" @click="cancelSettings" :disabled="loading">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-section">
|
||||||
|
<!-- 播放次数设置 -->
|
||||||
|
<div class="setting-item">
|
||||||
|
<div class="setting-title">
|
||||||
|
<div class="icon">🔢</div>
|
||||||
|
<div>播放次数</div>
|
||||||
|
</div>
|
||||||
|
<div class="setting-content">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label">播放次数</label>
|
||||||
|
<select v-model="settings.playCount" class="form-control" :disabled="loading">
|
||||||
|
<option value="1">1次</option>
|
||||||
|
<option value="2">2次</option>
|
||||||
|
<option value="3">3次</option>
|
||||||
|
<option value="4">4次</option>
|
||||||
|
<option value="5">5次</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="play-controls">
|
||||||
|
<div class="play-btn" @click="testPlay" :disabled="loading">
|
||||||
|
<svg v-if="!isPlaying" width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||||
|
<path d="M8 5V19L19 12L8 5Z" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
<svg v-else width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||||
|
<path d="M14 19H18V5H14V19ZM6 19H10V5H6V19Z" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<span v-if="loading">加载中...</span>
|
||||||
|
<span v-else-if="isPlaying">正在播放...</span>
|
||||||
|
<span v-else>点击测试播放效果</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 语音内容设置 -->
|
||||||
|
<div class="setting-item">
|
||||||
|
<div class="setting-title">
|
||||||
|
<div class="icon">🗣️</div>
|
||||||
|
<div>语音内容</div>
|
||||||
|
</div>
|
||||||
|
<div class="setting-content">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label">叫号前缀</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
placeholder="例如:请"
|
||||||
|
v-model="settings.prefix"
|
||||||
|
:disabled="loading"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label">叫号后缀</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
placeholder="例如:到诊室就诊"
|
||||||
|
v-model="settings.suffix"
|
||||||
|
:disabled="loading"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label">语音速度</label>
|
||||||
|
<select v-model="settings.voiceSpeed" class="form-control" :disabled="loading">
|
||||||
|
<option value="slow">较慢</option>
|
||||||
|
<option value="normal">正常</option>
|
||||||
|
<option value="fast">较快</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 其他设置 -->
|
||||||
|
<div class="setting-item">
|
||||||
|
<div class="setting-title">
|
||||||
|
<div class="icon">⚙️</div>
|
||||||
|
<div>其他设置</div>
|
||||||
|
</div>
|
||||||
|
<div class="setting-content">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label">音量设置</label>
|
||||||
|
<input
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
v-model="settings.volume"
|
||||||
|
class="form-control"
|
||||||
|
@input="updateVolume"
|
||||||
|
:disabled="loading"
|
||||||
|
>
|
||||||
|
<div style="text-align: center; margin-top: 5px; color: var(--text-light);">
|
||||||
|
{{ settings.volume }}%
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label">播放间隔</label>
|
||||||
|
<select v-model="settings.playInterval" class="form-control" :disabled="loading">
|
||||||
|
<option value="3">3秒</option>
|
||||||
|
<option value="5">5秒</option>
|
||||||
|
<option value="10">10秒</option>
|
||||||
|
<option value="15">15秒</option>
|
||||||
|
<option value="20">20秒</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="switch-label">
|
||||||
|
<div class="switch">
|
||||||
|
<input type="checkbox" v-model="settings.repeatPlay" :disabled="loading">
|
||||||
|
<span class="slider"></span>
|
||||||
|
</div>
|
||||||
|
<span>开启重复播放</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
|
import { ElSelect, ElMessage } from 'element-plus'
|
||||||
|
import {
|
||||||
|
getCallNumberVoiceConfig,
|
||||||
|
addCallNumberVoiceConfig,
|
||||||
|
updateCallNumberVoiceConfig
|
||||||
|
} from '../api'
|
||||||
|
|
||||||
|
// 响应式数据
|
||||||
|
const isPlaying = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
const settings = reactive({
|
||||||
|
playCount: 2,
|
||||||
|
prefix: '请',
|
||||||
|
suffix: '到诊室就诊',
|
||||||
|
voiceSpeed: 'normal',
|
||||||
|
volume: 80,
|
||||||
|
playInterval: 10,
|
||||||
|
repeatPlay: true
|
||||||
|
})
|
||||||
|
|
||||||
|
// 存储原始设置,用于取消时恢复
|
||||||
|
const originalSettings = reactive({ ...settings })
|
||||||
|
|
||||||
|
// 速度值映射函数 - 后端期望中文值
|
||||||
|
const mapSpeedToDatabase = (frontendSpeed) => {
|
||||||
|
const speedMap = {
|
||||||
|
'slow': '较慢',
|
||||||
|
'normal': '正常',
|
||||||
|
'fast': '较快'
|
||||||
|
}
|
||||||
|
const result = speedMap[frontendSpeed] || '正常'
|
||||||
|
console.log(`🔄 mapSpeedToDatabase: ${frontendSpeed} -> ${result}`)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSpeedToFrontend = (databaseSpeed) => {
|
||||||
|
console.log(`🔍 mapSpeedToFrontend 输入: ${databaseSpeed} (类型: ${typeof databaseSpeed})`)
|
||||||
|
|
||||||
|
const speedMap = {
|
||||||
|
'较慢': 'slow',
|
||||||
|
'正常': 'normal',
|
||||||
|
'较快': 'fast'
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = speedMap[databaseSpeed] || 'normal'
|
||||||
|
console.log(`✅ mapSpeedToFrontend 输出: ${databaseSpeed} -> ${result}`)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
// 方法
|
||||||
|
const saveSettings = async () => {
|
||||||
|
console.log('💾 开始保存设置...', settings)
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
// 验证必填数据
|
||||||
|
if (!settings.prefix || settings.prefix.trim() === '') {
|
||||||
|
throw new Error('请填写叫号前缀')
|
||||||
|
}
|
||||||
|
if (!settings.suffix || settings.suffix.trim() === '') {
|
||||||
|
throw new Error('请填写叫号后缀')
|
||||||
|
}
|
||||||
|
|
||||||
|
const configData = {
|
||||||
|
playCount: parseInt(settings.playCount),
|
||||||
|
callPrefix: settings.prefix.trim(),
|
||||||
|
callSuffix: settings.suffix.trim(),
|
||||||
|
speed: mapSpeedToDatabase(settings.voiceSpeed),
|
||||||
|
volume: parseInt(settings.volume),
|
||||||
|
intervalSeconds: parseInt(settings.playInterval),
|
||||||
|
cycleBroadcast: Boolean(settings.repeatPlay)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('📤 准备保存的数据:', configData)
|
||||||
|
|
||||||
|
// 验证ID是否存在
|
||||||
|
if (!originalSettings.id) {
|
||||||
|
console.log('⚠️ 未找到配置ID,尝试使用新增接口')
|
||||||
|
|
||||||
|
// 尝试新增配置
|
||||||
|
const response = await addCallNumberVoiceConfig(configData)
|
||||||
|
console.log('✅ 新增接口返回:', response)
|
||||||
|
|
||||||
|
if (response.data && response.data.id) {
|
||||||
|
configData.id = response.data.id
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('📝 使用更新接口,配置ID:', originalSettings.id)
|
||||||
|
configData.id = originalSettings.id
|
||||||
|
|
||||||
|
// 使用更新接口保存设置
|
||||||
|
const response = await updateCallNumberVoiceConfig(configData)
|
||||||
|
console.log('✅ 更新接口返回:', response)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新原始设置
|
||||||
|
Object.assign(originalSettings, {
|
||||||
|
id: configData.id,
|
||||||
|
playCount: configData.playCount,
|
||||||
|
callPrefix: configData.callPrefix,
|
||||||
|
callSuffix: configData.callSuffix,
|
||||||
|
speed: configData.speed,
|
||||||
|
volume: configData.volume,
|
||||||
|
intervalSeconds: configData.intervalSeconds,
|
||||||
|
cycleBroadcast: configData.cycleBroadcast
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log('✅ 原始设置已更新:', originalSettings)
|
||||||
|
ElMessage.success('设置保存成功!')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ 保存失败:', error)
|
||||||
|
ElMessage.error('保存失败:' + (error.message || '请稍后重试'))
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const cancelSettings = () => {
|
||||||
|
if (confirm('确定要取消所有更改吗?')) {
|
||||||
|
// 恢复到从服务器加载的原始数据
|
||||||
|
if (originalSettings.id) {
|
||||||
|
Object.assign(settings, {
|
||||||
|
playCount: originalSettings.playCount || 2,
|
||||||
|
prefix: originalSettings.callPrefix || '请',
|
||||||
|
suffix: originalSettings.callSuffix || '到诊室就诊',
|
||||||
|
voiceSpeed: originalSettings.speed || 'normal',
|
||||||
|
volume: originalSettings.volume || 80,
|
||||||
|
playInterval: originalSettings.intervalSeconds || 10,
|
||||||
|
repeatPlay: originalSettings.cycleBroadcast !== undefined ? originalSettings.cycleBroadcast : true
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 如果没有原始数据,恢复到默认值
|
||||||
|
Object.assign(settings, {
|
||||||
|
playCount: 2,
|
||||||
|
prefix: '请',
|
||||||
|
suffix: '到诊室就诊',
|
||||||
|
voiceSpeed: 'normal',
|
||||||
|
volume: 80,
|
||||||
|
playInterval: 10,
|
||||||
|
repeatPlay: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
ElMessage.info('已恢复到原始设置')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const loadSettings = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const response = await getCallNumberVoiceConfig()
|
||||||
|
|
||||||
|
// 处理后端返回的数据结构:response.data.data
|
||||||
|
let data = response.data
|
||||||
|
if (response.data && response.data.data) {
|
||||||
|
data = response.data.data
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证数据有效性
|
||||||
|
if (data && data.id) {
|
||||||
|
// 播放次数处理 - 转换为字符串类型以匹配select选项
|
||||||
|
const playCountParsed = parseInt(data.playCount)
|
||||||
|
const playCountFinal = isNaN(playCountParsed) ? "2" : String(playCountParsed)
|
||||||
|
settings.playCount = playCountFinal
|
||||||
|
|
||||||
|
// 音量处理
|
||||||
|
const volumeParsed = parseInt(data.volume)
|
||||||
|
const volumeFinal = isNaN(volumeParsed) ? 80 : volumeParsed
|
||||||
|
settings.volume = volumeFinal
|
||||||
|
|
||||||
|
// 播放间隔处理 - 转换为字符串类型以匹配select选项
|
||||||
|
const intervalParsed = parseInt(data.intervalSeconds)
|
||||||
|
const intervalFinal = isNaN(intervalParsed) ? "10" : String(intervalParsed)
|
||||||
|
settings.playInterval = intervalFinal
|
||||||
|
|
||||||
|
// 其他字段处理
|
||||||
|
settings.prefix = data.callPrefix || '请'
|
||||||
|
settings.suffix = data.callSuffix || '到诊室就诊'
|
||||||
|
settings.voiceSpeed = mapSpeedToFrontend(data.speed) || 'normal'
|
||||||
|
settings.repeatPlay = data.cycleBroadcast !== undefined ? Boolean(data.cycleBroadcast) : true
|
||||||
|
|
||||||
|
// 存储原始设置
|
||||||
|
Object.assign(originalSettings, {
|
||||||
|
id: data.id,
|
||||||
|
playCount: data.playCount,
|
||||||
|
callPrefix: data.callPrefix,
|
||||||
|
callSuffix: data.callSuffix,
|
||||||
|
speed: data.speed,
|
||||||
|
volume: data.volume,
|
||||||
|
intervalSeconds: data.intervalSeconds,
|
||||||
|
cycleBroadcast: data.cycleBroadcast
|
||||||
|
})
|
||||||
|
|
||||||
|
ElMessage.success('配置加载成功')
|
||||||
|
} else {
|
||||||
|
// 如果没有有效配置数据,使用默认设置
|
||||||
|
if (data && Object.keys(data).length > 0) {
|
||||||
|
ElMessage.info('未找到现有配置,使用默认设置')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning('未找到配置数据,将使用默认设置')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用默认配置
|
||||||
|
Object.assign(settings, {
|
||||||
|
playCount: "2",
|
||||||
|
prefix: '请',
|
||||||
|
suffix: '到诊室就诊',
|
||||||
|
voiceSpeed: 'normal',
|
||||||
|
volume: 80,
|
||||||
|
playInterval: "10",
|
||||||
|
repeatPlay: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error('获取设置失败:' + (error.message || '请稍后重试'))
|
||||||
|
|
||||||
|
// 错误时使用默认配置
|
||||||
|
Object.assign(settings, {
|
||||||
|
playCount: "2",
|
||||||
|
prefix: '请',
|
||||||
|
suffix: '到诊室就诊',
|
||||||
|
voiceSpeed: 'normal',
|
||||||
|
volume: 80,
|
||||||
|
playInterval: "10",
|
||||||
|
repeatPlay: true
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组件挂载时加载设置
|
||||||
|
onMounted(() => {
|
||||||
|
loadSettings()
|
||||||
|
})
|
||||||
|
|
||||||
|
const testPlay = () => {
|
||||||
|
if (isPlaying.value) return
|
||||||
|
|
||||||
|
isPlaying.value = true
|
||||||
|
const playCount = parseInt(settings.playCount)
|
||||||
|
|
||||||
|
// 播放语音
|
||||||
|
for (let i = 0; i < playCount; i++) {
|
||||||
|
setTimeout(() => {
|
||||||
|
speak(`${settings.prefix}1001号${settings.suffix}`)
|
||||||
|
}, i * 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 恢复按钮状态
|
||||||
|
setTimeout(() => {
|
||||||
|
isPlaying.value = false
|
||||||
|
}, playCount * 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
const speak = (text) => {
|
||||||
|
// 使用Web Speech API进行语音合成
|
||||||
|
if ('speechSynthesis' in window) {
|
||||||
|
const utterance = new SpeechSynthesisUtterance()
|
||||||
|
utterance.text = text
|
||||||
|
utterance.lang = 'zh-CN'
|
||||||
|
utterance.volume = settings.volume / 100
|
||||||
|
|
||||||
|
// 设置语音速度
|
||||||
|
const speedMap = {
|
||||||
|
slow: 0.8,
|
||||||
|
normal: 1,
|
||||||
|
fast: 1.2
|
||||||
|
}
|
||||||
|
utterance.rate = speedMap[settings.voiceSpeed] || 1
|
||||||
|
|
||||||
|
window.speechSynthesis.speak(utterance)
|
||||||
|
} else {
|
||||||
|
// 当前浏览器不支持语音合成功能
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateVolume = () => {
|
||||||
|
// 音量更新逻辑(显示在界面上)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 基础样式重置 */
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host {
|
||||||
|
/* CSS变量定义,适配项目主题 */
|
||||||
|
--primary-color: #409EFF; /* Element Plus 主色调 */
|
||||||
|
--secondary-color: #909399; /* 次要色 - 中性灰 */
|
||||||
|
--accent-color: #E6A23C; /* 强调色 - 警告色 */
|
||||||
|
--background-color: #f5f7fa; /* 背景色 - 浅灰 */
|
||||||
|
--card-color: #ffffff; /* 卡片背景色 */
|
||||||
|
--text-color: #303133; /* 主文本色 */
|
||||||
|
--text-light: #606266; /* 次要文本色 */
|
||||||
|
--border-color: #dcdfe6; /* 边框色 */
|
||||||
|
--success-color: #67C23A; /* 成功色 */
|
||||||
|
--shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); /* Element Plus 阴影 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.call-voice-settings {
|
||||||
|
background-color: var(--background-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
line-height: 1.6;
|
||||||
|
padding: 20px;
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标题区域 */
|
||||||
|
.title-section {
|
||||||
|
background: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 20px 30px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
box-shadow: 0 4px 15px rgba(64, 158, 255, 0.15);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-section h1 {
|
||||||
|
color: #000000;
|
||||||
|
margin: 0;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式 */
|
||||||
|
.btn-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
background-image: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
outline: none;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
background-color: #5b8fb9;
|
||||||
|
color: white;
|
||||||
|
border: 1px solid #5b8fb9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
background-color: #6c757d;
|
||||||
|
color: white;
|
||||||
|
border: 1px solid #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn:hover {
|
||||||
|
opacity: 0.9;
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
background-color: #4a7a9a;
|
||||||
|
border-color: #4a7a9a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary:hover {
|
||||||
|
background-color: #5a6268;
|
||||||
|
border-color: #5a6268;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 语音设置卡片 */
|
||||||
|
.card {
|
||||||
|
background: #f8f9fa;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 15px rgba(230, 162, 60, 0.15);
|
||||||
|
padding: 25px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--primary-color);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title::before {
|
||||||
|
content: "①";
|
||||||
|
margin-right: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 设置区域样式 */
|
||||||
|
.settings-section {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-item {
|
||||||
|
background-color: rgba(64, 158, 255, 0.05);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 20px;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-title {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-title .icon {
|
||||||
|
background-color: rgba(64, 158, 255, 0.1);
|
||||||
|
color: var(--primary-color);
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 6px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 12px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-content {
|
||||||
|
padding-left: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单控件样式 */
|
||||||
|
.form-group {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-color);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px 12px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: border-color 0.3s, box-shadow 0.3s;
|
||||||
|
box-sizing: border-box;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control:focus {
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
select.form-control {
|
||||||
|
appearance: none;
|
||||||
|
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: right 12px center;
|
||||||
|
background-size: 16px;
|
||||||
|
padding-right: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="range"].form-control {
|
||||||
|
height: 32px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 开关控件 */
|
||||||
|
.switch-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 44px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch input {
|
||||||
|
opacity: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: #ccc;
|
||||||
|
transition: .4s;
|
||||||
|
border-radius: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
height: 18px;
|
||||||
|
width: 18px;
|
||||||
|
left: 2px;
|
||||||
|
bottom: 2px;
|
||||||
|
background-color: white;
|
||||||
|
transition: .4s;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #4caf50;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(22px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 播放控制区域 */
|
||||||
|
.play-controls {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 15px;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.play-btn {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #f8a978;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.play-btn:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
|
||||||
|
background-color: #e69965;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 响应式布局 */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.title-section {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-section h1 {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-group {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-section {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-item {
|
||||||
|
min-width: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
发版记录/2025-12-24/~$ Microsoft Word 文档.docx
Normal file
BIN
发版记录/2025-12-24/~$ Microsoft Word 文档.docx
Normal file
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
-- 添加公告/通知发布状态字段
|
||||||
|
ALTER TABLE sys_notice ADD COLUMN publish_status VARCHAR(1) DEFAULT '0';
|
||||||
|
|
||||||
|
-- 添加字段注释
|
||||||
|
COMMENT ON COLUMN sys_notice.publish_status IS '发布状态(0未发布 1已发布)';
|
||||||
|
|
||||||
|
-- 更新现有数据为已发布状态
|
||||||
|
UPDATE sys_notice SET publish_status = '1' WHERE publish_status IS NULL;
|
||||||
26
迁移记录-DB变更记录/2025-12-30 add_table_sys_notice_read.sql
Normal file
26
迁移记录-DB变更记录/2025-12-30 add_table_sys_notice_read.sql
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
-- 公告/通知已读记录表
|
||||||
|
CREATE TABLE IF NOT EXISTS sys_notice_read (
|
||||||
|
read_id BIGINT PRIMARY KEY,
|
||||||
|
notice_id BIGINT NOT NULL,
|
||||||
|
user_id BIGINT NOT NULL,
|
||||||
|
read_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
CONSTRAINT uk_notice_user UNIQUE (notice_id, user_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE sys_notice_read IS '公告/通知已读记录表';
|
||||||
|
COMMENT ON COLUMN sys_notice_read.read_id IS '阅读ID';
|
||||||
|
COMMENT ON COLUMN sys_notice_read.notice_id IS '公告/通知ID';
|
||||||
|
COMMENT ON COLUMN sys_notice_read.user_id IS '用户ID';
|
||||||
|
COMMENT ON COLUMN sys_notice_read.read_time IS '阅读时间';
|
||||||
|
|
||||||
|
-- 创建序列
|
||||||
|
CREATE SEQUENCE IF NOT EXISTS sys_notice_read_read_id_seq
|
||||||
|
INCREMENT 1
|
||||||
|
MINVALUE 1
|
||||||
|
MAXVALUE 99999999
|
||||||
|
START 200
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
-- 索引
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_notice_read_notice_id ON sys_notice_read(notice_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_notice_read_user_id ON sys_notice_read(user_id);
|
||||||
50
迁移记录-DB变更记录/202512241430add_table_call_number_voice.sql
Normal file
50
迁移记录-DB变更记录/202512241430add_table_call_number_voice.sql
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
CREATE TABLE call_number_voice (
|
||||||
|
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||||
|
play_count INT NOT NULL CHECK (play_count BETWEEN 1 AND 5),
|
||||||
|
call_prefix VARCHAR(20),
|
||||||
|
call_suffix VARCHAR(50),
|
||||||
|
speed VARCHAR(10) NOT NULL CHECK (speed IN ('较慢', '正常', '较快')),
|
||||||
|
volume INT NOT NULL CHECK (volume BETWEEN 0 AND 100),
|
||||||
|
interval_seconds INT NOT NULL,
|
||||||
|
cycle_broadcast BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
-- 核心约束:循环播放与间隔的逻辑关联
|
||||||
|
CONSTRAINT chk_cycle_interval
|
||||||
|
CHECK (
|
||||||
|
(cycle_broadcast = false AND interval_seconds = 0)
|
||||||
|
OR
|
||||||
|
(cycle_broadcast = true AND interval_seconds > 0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 1. 添加表注释(PostgreSQL 语法)
|
||||||
|
COMMENT ON TABLE call_number_voice IS '叫号语音配置表';
|
||||||
|
|
||||||
|
-- 2. 逐个添加字段注释(PostgreSQL 语法)
|
||||||
|
COMMENT ON COLUMN call_number_voice.id IS '主键ID,自增';
|
||||||
|
COMMENT ON COLUMN call_number_voice.play_count IS '播放次数(1-5次)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.call_prefix IS '叫号前缀(如“请”)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.call_suffix IS '叫号后缀(如“到1号窗口就诊”)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.speed IS '语速(较慢/正常/较快)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.volume IS '音量(0-100%)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.interval_seconds IS '播报间隔(秒)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.cycle_broadcast IS '是否循环播报(默认关闭)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.create_time IS '创建时间(自动填充当前时间)';
|
||||||
|
COMMENT ON COLUMN call_number_voice.update_time IS '更新时间(自动更新)';
|
||||||
|
|
||||||
|
-- 实现update_time自动更新(PostgreSQL需通过触发器)
|
||||||
|
CREATE OR REPLACE FUNCTION update_call_number_voice_time()
|
||||||
|
RETURNS TRIGGER AS $$
|
||||||
|
BEGIN
|
||||||
|
NEW.update_time = CURRENT_TIMESTAMP;
|
||||||
|
RETURN NEW;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE TRIGGER trigger_call_number_voice_update
|
||||||
|
BEFORE UPDATE ON call_number_voice
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE FUNCTION update_call_number_voice_time();
|
||||||
|
|
||||||
|
INSERT INTO call_number_voice (play_count, call_prefix, call_suffix, speed, volume, interval_seconds, cycle_broadcast) VALUES (2,'请','到诊室就诊','正常',80,10,TRUE);
|
||||||
Reference in New Issue
Block a user