diff --git a/package.json b/package.json index 080dcce..768ba63 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "axios": "0.30.3", "clipboard": "2.0.8", "core-js": "3.37.1", + "crypto-js": "^4.2.0", + "dayjs": "^1.11.21", "echarts": "5.4.0", "element-ui": "2.15.14", "file-saver": "2.0.5", diff --git a/src/api/cases/index.js b/src/api/cases/index.js index 46c2322..a6366b4 100644 --- a/src/api/cases/index.js +++ b/src/api/cases/index.js @@ -1,44 +1,70 @@ import request from '@/utils/request' -// 查询病例列表 -export function listCase(query) { + +// 检查类型 +// 检查诊室 +export function postReportExamRoomList(data) { return request({ - url: '/business/case/list', - method: 'get', - params: query + url: '/report/exam_room_list', + method: 'post', + data: data }) } - -// 查询病例详情 -export function getCase(id) { +// 检查部位 +export function postReportTemplateTree(data) { return request({ - url: '/business/case/' + id, - method: 'get' + url: '/report/template_tree', + method: 'post', + data: data + }) +} +// 检查设备 +export function postReportEquipmentList(data) { + return request({ + url: '/report/equipment_list', + method: 'post', + data: data + }) +} +// 预约时间 +export function postReportTimeSections(data) { + return request({ + url: '/report/time_sections', + method: 'post', + data: data + }) +} +// 病例类型 +// 检查结果 +// 病例库-列表 +export function postReportList(data) { + return request({ + url: '/report/list', + method: 'post', + data: data }) } - // 新增病例 -export function addCase(data) { +export function postReportCreate(data) { return request({ - url: '/business/case', + url: '/report/create', method: 'post', data: data }) } - -// 修改病例 -export function updateCase(data) { +// 病例库-详情 +export function postReportInfo(data) { return request({ - url: '/business/case', - method: 'put', + url: '/report/info', + method: 'post', data: data }) } - -// 删除病例 -export function delCase(id) { +// 修改病例 +export function postReportEdit(data) { return request({ - url: '/business/case/' + id, - method: 'delete' + url: '/report/edit', + method: 'post', + data: data }) } \ No newline at end of file diff --git a/src/main.js b/src/main.js index 50a1c5f..b7fc26d 100644 --- a/src/main.js +++ b/src/main.js @@ -1,6 +1,7 @@ import Vue from 'vue' import Cookies from 'js-cookie' +import dayjs from 'dayjs' import Element from 'element-ui' import './assets/styles/element-variables.scss' @@ -20,7 +21,7 @@ import './assets/icons' // icon import './permission' // permission control import { getDicts } from "@/api/system/dict/data" import { getConfigKey } from "@/api/system/config" -import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi" +import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, desensitize } from "@/utils/ruoyi" // 分页组件 import Pagination from "@/components/Pagination" // 自定义表格工具组件 @@ -48,6 +49,8 @@ Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree +Vue.prototype.desensitize = desensitize +Vue.prototype.$dayjs = dayjs // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 0ccbd62..054a265 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,8 +1,8 @@ import store from '@/store' import router from '@/router' import cache from '@/plugins/cache' -import { MessageBox, } from 'element-ui' -import { login, logout, getInfo } from '@/api/login' +import { MessageBox } from 'element-ui' +import { login, logout, getInfo, getCommonConfigOptions } from '@/api/login' import { getToken, setToken, removeToken } from '@/utils/auth' import { isHttp, isEmpty } from "@/utils/validate" import defAva from '@/assets/images/profile.jpg' @@ -17,7 +17,12 @@ const user = { roles: [], permissions: [], dept: '', - status: '' + status: '', + netConfig: { + httpProtocol: 'http', + ipAddress: '', + port: '' + } }, mutations: { @@ -47,9 +52,11 @@ const user = { }, SET_STATUS: (state, status) => { state.status = status - } + }, + SET_NET_CONFIG: (state, netConfig) => { + state.netConfig = netConfig + }, }, - actions: { // 登录 Login({ commit }, userInfo) { @@ -105,7 +112,18 @@ const user = { }) }) }, - + // 获取网络配置 + GetNetConfig({ commit }) { + return new Promise((resolve, reject) => { + getCommonConfigOptions().then(res => { + const data = res.data + commit('SET_NET_CONFIG', data) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, // 退出系统 LogOut({ commit, state }) { return new Promise((resolve, reject) => { diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js index 3de2d98..8f4cc22 100644 --- a/src/utils/ruoyi.js +++ b/src/utils/ruoyi.js @@ -226,3 +226,29 @@ export function getNormalPath(p) { export function blobValidate(data) { return data.type !== 'application/json' } +// +/** + * 通用信息脱敏工具方法 + * @param {String} str - 需要脱敏的原始字符串 + * @param {Number} prefixLen - 前面保留几位 + * @param {Number} suffixLen - 后面保留几位 + * @param {Number} maskLen - 脱敏显示多少位 *(不传则自动计算) + * @returns {String} 脱敏后的字符串 + */ +export function desensitize(str, prefixLen, suffixLen, maskLen) { + if (!str) return ''; + str = String(str); + const length = str.length; + + // 边界:长度不足,直接返回原文 + if (length <= prefixLen + suffixLen) { + return str; + } + + // 前缀 + 脱敏符号 + 后缀 + const prefix = str.substring(0, prefixLen); + const suffix = str.substring(length - suffixLen); + const mask = maskLen ? '*'.repeat(maskLen) : '***'; // 默认显示3个* + + return prefix + mask + suffix; +} \ No newline at end of file diff --git a/src/views/cases/index.vue b/src/views/cases/index.vue index 605b86b..206b9c1 100644 --- a/src/views/cases/index.vue +++ b/src/views/cases/index.vue @@ -4,17 +4,17 @@ - - 创建时间 - 审核时间 - 预约时间 + + 创建时间 + 审核时间 + 预约时间 - + - + - + - + @@ -91,22 +104,26 @@ - + - + - + - + - + - + + > + + @@ -288,108 +317,100 @@ > + + > + + - - @@ -427,9 +448,9 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +