diff --git a/package.json b/package.json
index 466dd6e..b63bc39 100644
--- a/package.json
+++ b/package.json
@@ -33,6 +33,7 @@
"mitt": "^3.0.1",
"nprogress": "0.2.0",
"pinia": "2.1.7",
+ "pinia-plugin-persistedstate": "^4.0.0",
"pinyin-pro": "^3.26.0",
"select2": "^4.1.0-rc.0",
"socket.io-client": "^4.8.1",
diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue
index f72ac82..a182fb1 100644
--- a/src/components/SelectTable/index.vue
+++ b/src/components/SelectTable/index.vue
@@ -19,7 +19,7 @@
+ :disabled="disabled" v-bind="$attrs">
@@ -61,7 +61,7 @@ const props = withDefaults(defineProps
(), {
width: "100%",
dictType: '',
clearable: true,
- objKey: ''
+ objKey: 'label'
});
diff --git a/src/store/index.js b/src/store/index.js
index f10f389..cbcd725 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,3 +1,5 @@
+import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const store = createPinia()
+store.use(piniaPluginPersistedstate) // 注册持久化插件
export default store
\ No newline at end of file
diff --git a/src/store/modules/commonStore.ts b/src/store/modules/commonStore.ts
index b8a0787..31951b9 100644
--- a/src/store/modules/commonStore.ts
+++ b/src/store/modules/commonStore.ts
@@ -1,10 +1,16 @@
//公共状态管理
import { defineStore } from 'pinia'
-
+// 定义配置对象接口
+interface DefaultConfig {
+ defaultinstr?: string //默认仪器
+ lisgroupid?: string //默认分组id
+ [key: string]: any // 允许其他属性
+}
export const useCommonStore = defineStore('commonStore', {
state: () => ({
lxsrs: [] as string[], // 存储项目模板名称
fingerprint: '',// 存储指纹信息
+ defaultConfig: {} as DefaultConfig, // 存储默认配置
}),
actions: {
setLxsrList(list: any[]) {
@@ -14,5 +20,18 @@ export const useCommonStore = defineStore('commonStore', {
setFingerprint(fingerprint: string) {
this.fingerprint = fingerprint
},
+
+ setDefaultConfig(config: DefaultConfig) {
+ this.defaultConfig = config
+ },
+ },
+ // 持久化配置
+ persist: {
+ // 指定要持久化的状态字段
+ paths: ['fingerprint', 'defaultConfig',],
+ // 可选配置:自定义存储键名(默认是store的id)
+ key: 'common_store',
+ // 可选配置:指定存储位置(默认是localStorage 也可以用sessionStorage)
+ storage: localStorage,
}
})
\ No newline at end of file
diff --git a/src/types/pinia.d.ts b/src/types/pinia.d.ts
new file mode 100644
index 0000000..59b8e57
--- /dev/null
+++ b/src/types/pinia.d.ts
@@ -0,0 +1,15 @@
+import 'pinia'
+
+declare module 'pinia' {
+ export interface DefineStoreOptionsBase {
+ // 允许在定义 store 时使用 persist 属性
+ persist?: boolean | PersistOptions
+ }
+}
+
+// 定义持久化配置的类型(根据插件实际参数调整)
+interface PersistOptions {
+ paths?: string[]
+ key?: string
+ storage?: Storage
+}
\ No newline at end of file
diff --git a/src/views/liswork/labItem/BatchInstrVs.vue b/src/views/liswork/labItem/BatchInstrVs.vue
index 6426d94..585058d 100644
--- a/src/views/liswork/labItem/BatchInstrVs.vue
+++ b/src/views/liswork/labItem/BatchInstrVs.vue
@@ -121,10 +121,6 @@ const handleOk = () => {
}
-
-onMounted(async () => {
- await getDictData('XMGL', 'ITEMCLASS', 'YQDL', 'YQ');
-})
diff --git a/src/views/liswork/labItem/index.vue b/src/views/liswork/labItem/index.vue
index 73c6a5a..5c8b72a 100644
--- a/src/views/liswork/labItem/index.vue
+++ b/src/views/liswork/labItem/index.vue
@@ -416,7 +416,7 @@ const rowChange = async (row: any) => {
{
confirmButtonText: '保存',
cancelButtonText: '不保存',
- type: 'warning'
+ type: 'warning',
}
).then(() => {
// 用户选择保存
@@ -434,6 +434,7 @@ const getInfo = async (row: any) => {
tableConfig.value.highlightCurrentRow = true
selectRow.value = row;
const res = await queryXmInfoNewDetailService(row.xmid, row.yq, row.xmdh)
+ res.data.xmInfoNew.xsws = res.data.xmInfoNew.xsws.toString()
selectDetailRow.value = res.data
changeActiveTab()
initialModelParam.value = _.cloneDeep(modelParam.value);
@@ -460,7 +461,7 @@ const changeActiveTab = () => {
}
onMounted(async () => {
- getDictData('XMGL', 'ITEMCLASS', 'YQDL');
+ getDictData('XMGL', 'ITEMCLASS', 'YQDL', 'UT', 'MD', 'GBDM', 'YQ');
getList()
getYqConfig();
})
diff --git a/src/views/liswork/labItem/tab/CommonlyValues.vue b/src/views/liswork/labItem/tab/CommonlyValues.vue
index 64f6107..363d424 100644
--- a/src/views/liswork/labItem/tab/CommonlyValues.vue
+++ b/src/views/liswork/labItem/tab/CommonlyValues.vue
@@ -37,7 +37,7 @@ const emit = defineEmits(['refreshTabData'])
const tableRef = ref();
const columns = ref([
{ prop: 'qz', label: '取值', visible: true, align: 'center', slot: 'qz', showOverflowTooltip: false },
- { prop: 'srm', label: '快速输入码', visible: true, align: 'center', slot: 'srm' },
+ { prop: 'srm', label: '快速输入码', visible: true, align: 'center', slot: 'srm', showOverflowTooltip: false },
{ prop: 'jgbz', label: '结果标志', visible: true, align: 'center', slot: 'jgbz', showOverflowTooltip: false }
]);
const tableConfig = ref({
diff --git a/src/views/liswork/labItem/tab/base/Basic.vue b/src/views/liswork/labItem/tab/base/Basic.vue
index 3622704..7933b9d 100644
--- a/src/views/liswork/labItem/tab/base/Basic.vue
+++ b/src/views/liswork/labItem/tab/base/Basic.vue
@@ -1,169 +1,170 @@
-
基本参数:
-
+
+
+
+
+
+
+ 停用
-
-
-
-
+
-
+
+
+
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
-
- 停用
-
结果参考值计算:
-
+
-
+
-
+
多行参考值向导...
-
- 向导...
+
+ 向导...
-
-
-
-
-
-
+
+
+
+
+
+
医学审核条件:
-
+
-
+
-
+
-
-
+
+
+ %
+
报警条件
-
-
+
+
特定条件
-
-
+
+
其他参数
-
+
-
+
-
+
-
+
-
+
-
-
-
+
@@ -178,10 +179,20 @@ import Condition from './child/Condition.vue';
import { getFirstLetter } from '@/utils/pinyin.js';
import { ElMessage } from 'element-plus';
-const modelParam = defineModel()
+
+
+const modelParam = defineModel();
+// 解构basicData 响应数据
+const basicData = computed({
+ get() {
+ return modelParam.value.basicData;
+ },
+ set(newVal) {
+ modelParam.value.basicData = newVal;
+ }
+});
const formRef = ref();
-
const mulitDialogTableVisible = ref(false)
const calcDialogTableVisible = ref(false)
const conditionTabVisible = ref(false)
@@ -218,75 +229,11 @@ const rules = ref({
xmdh: [{ required: true, message: '请输入英文缩写', trigger: 'blur' }],
xmmc: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
yqdl: [{ required: true, message: '请选择仪器大类', trigger: 'change' }],
-})
-
-computed(() => {
- switch (modelParam.value.basicData.jgbz) {
- case '1':
- modelParam.value.basicData.cp_jgz = modelParam.value.basicData.jgz;
- break;
- case '2':
- modelParam.value.basicData.cp_jgz = modelParam.value.basicData.jgz + '%';
- break;
- }
-});
-
-const jsxmCheck = computed({
- get() {
- return modelParam.value.basicData.jsxm === 'Y'
- },
- set(checked: boolean) {
- modelParam.value.basicData.jsxm = checked ? 'Y' : 'N';
- }
-})
-
-const ygzqCheck = computed({
- get() {
- return modelParam.value.basicData.ygzq === 'Y'
- },
- set(checked: boolean) {
- modelParam.value.basicData.ygzq = checked ? 'Y' : 'N';
- }
-})
-
-const ygzdCheck = computed({
- get() {
- return modelParam.value.basicData.ygzd === 'Y'
- },
- set(checked: boolean) {
- modelParam.value.basicData.ygzd = checked ? 'Y' : 'N';
- }
-})
-
-const ygbbCheck = computed({
- get() {
- return modelParam.value.basicData.ygbb === 'Y'
- },
- set(checked: boolean) {
- modelParam.value.basicData.ygbb = checked ? 'Y' : 'N';
- }
-})
-
-const ygnlCheck = computed({
- get() {
- return modelParam.value.basicData.ygnl === 'Y'
- },
- set(checked: boolean) {
- modelParam.value.basicData.ygnl = checked ? 'Y' : 'N';
- }
-})
-
-const ygxbCheck = computed({
- get() {
- return modelParam.value.basicData.ygxb === 'Y'
- },
- set(checked: boolean) {
- modelParam.value.basicData.ygxb = checked ? 'Y' : 'N';
- }
+ dylx: [{ required: true, message: '请选择仪打印方式', trigger: 'change' }],
})
const updatedyckz = () => {
- modelParam.value.basicData.dyckz = !modelParam.value.basicData.ckxx && !modelParam.value.basicData.cksx ? '' : `${modelParam.value.basicData.ckxx}--${modelParam.value.basicData.cksx}`;
+ basicData.value.dyckz = !basicData.value.ckxx && !basicData.value.cksx ? '' : `${basicData.value.ckxx}--${basicData.value.cksx}`;
}
@@ -296,47 +243,39 @@ const multiRefClick = () => {
}
const closeWithReturnMultiRef = (val: string) => {
- modelParam.value.basicData.dyckz = val;
+ basicData.value.dyckz = val;
mulitDialogTableVisible.value = false;
}
const handleDialogConfirm = (val: string) => {
- modelParam.value.basicData.jsgs = val;
+ basicData.value.jsgs = val;
calcDialogTableVisible.value = false
}
//计算向导
const calcGuildeClick = () => {
- if (modelParam.value.basicData.jsxm) {
+ if (basicData.value.jsxm) {
calcDialogTableVisible.value = true
}
}
//危急值特定条件
const conditionClick = () => {
- if (modelParam.value.basicData.xmid) {
+ if (basicData.value.xmid) {
conditionTabVisible.value = true
}
}
const xmdhInput = (val: string) => {
- modelParam.value.basicData.zhbdh = val;
- modelParam.value.basicData.bgdh = val;
+ basicData.value.zhbdh = val;
+ basicData.value.bgdh = val;
}
const xmmcChange = (val: string) => {
- modelParam.value.basicData.zjf = getFirstLetter(val);
-
+ basicData.value.zjf = getFirstLetter(val);
}
-onActivated(async () => {
- await getDictData('XMGL', 'UT', 'YQDL', 'MD', 'ITEMCLASS', 'GBDM');
-})
-
-
-
-
// 暴露验证方法(关键步骤)
defineExpose({
// 封装表单验证方法,返回 Promise
diff --git a/src/views/liswork/labItem/tab/useInstr.vue b/src/views/liswork/labItem/tab/useInstr.vue
index cfe4886..e328fa3 100644
--- a/src/views/liswork/labItem/tab/useInstr.vue
+++ b/src/views/liswork/labItem/tab/useInstr.vue
@@ -34,7 +34,7 @@
import CustomTable from '@/components/elTable/index.vue'
import { XmInfoVs } from '@/types';
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
-import { ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteXmInfoVs } from '@/api/liswork/labItem/labItemApi';
@@ -80,17 +80,17 @@ const onClickAdd = () => {
modelParam.value.userInstrData.push(newData)
}
-const onClickDel = async () => {
- if (selectRow.value) {
- await ElMessageBox.confirm('是否要删除选中的数据?', 'Warning',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- });
- await deleteXmInfoVs({ vsid: selectRow.value.vsid || 0 })
- emit('refreshTabData', modelParam.value.basicData)
- }
+const onClickDel = () => {
+ if (!selectRow.value.vsid) return ElMessage.warning('请选择要删除的行!')
+ ElMessageBox.confirm('是否要删除选中的数据?', '警告',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }).then(async () => {
+ await deleteXmInfoVs({ vsid: selectRow.value.vsid || 0 })
+ emit('refreshTabData', modelParam.value.basicData)
+ })
}
const onRowClick = (row: any) => {
diff --git a/src/views/liswork/micro/labresult/zbReport.vue b/src/views/liswork/micro/labresult/zbReport.vue
index 0e42e61..5896b59 100644
--- a/src/views/liswork/micro/labresult/zbReport.vue
+++ b/src/views/liswork/micro/labresult/zbReport.vue
@@ -273,10 +273,10 @@ const CellStyleHd = ({ row, column, rowIndex, columnIndex }: {
rowIndex: number;
columnIndex: number;
}) => {
- if (column.label == "细菌/结果" && (row.alarm_flag ?? "").trim().length > 0) {
+ if (column.label == "细菌/结果" && row.alarm_flag) {
return { background: '#f00 !important', color: '#FFF' };
}
- if (column.label == "危急值" && (row.alarm_flag ?? "").trim().length > 0) {
+ if (column.label == "危急值" && row.alarm_flag) {
return { background: '#f00 !important', color: '#FFF' };
}
diff --git a/src/views/liswork/work/index.vue b/src/views/liswork/work/index.vue
index e930c0f..1ba2083 100644
--- a/src/views/liswork/work/index.vue
+++ b/src/views/liswork/work/index.vue
@@ -147,17 +147,18 @@ import PatientQueryForm from '@/components/selectSearch/index.vue'
import BatchCode from './components/batchCode.vue';
// @ts-ignore
import { listUser } from '@/api/system/user.js'
-
+const mbStore = useCommonStore();
const aotuSize = classCom.useAutoSize();
import { initWebSocket, sendWebSocketMessage, closeWebSocket, getWebSocketState } from '@/utils/webSocket';
+import dayjs from 'dayjs';
const previewShow = ref(false);
const lbFlag = ref(false);
const queryParams = ref({
- jyrq: '2025-08-20',
- yq: '46',
+ jyrq: dayjs().format('YYYY-MM-DD'), //'2025-08-20'
ybh: '1',
- instrGroup: '02',
+ instrGroup: mbStore.defaultConfig.lisgroupid,
+ yq: mbStore.defaultConfig.defaultinstr,
problemId: 0,
days: 0,
yhdh: ''
@@ -302,13 +303,14 @@ const handleinstrGroupChange = (val: any) => {
// labPat.value = {}
getYqConfig()
}
-const mbStore = useCommonStore();
+
const yqHandleChange = (val: any) => {
labResuts.value = []
labPat.value = {}
mbStore.setLxsrList([]);
getSysList()
fetchlabPatList()
+ sendMessage()
}
const instrGroupFields = ref([
{ prop: 'zddh', label: '代号', width: 80, enablePinyinSearch: true },
@@ -320,8 +322,6 @@ const loadinstrGroupOptions = () => {
getComDicts({ zdlb: 'GROUP' }).then((res: any) => {
instrGroupOptions.value = res.data
instrGroupOptions.value.push({ zddh: 'ALL', zdmc: '所有仪器' })
- queryParams.value.instrGroup = '02'
- queryParams.value.yq = '46'
getYqConfig()
});
}
@@ -349,7 +349,6 @@ const resultsHandle = (flag: boolean) => {
}
fetchLabResults()
}
-
const highlightRowIndex = ref(-1)
const labPatListRef = ref()
//样本列表点击切换样本信息,同步载入左边样本信息表单和中间结果表单
@@ -604,6 +603,7 @@ const fetchlabPatList = () => {
selectJob(res.data[0])
getTotals()
} else {
+ handleCreate()
ybs.value = 0
ws.value = 0
wjs.value = 0
diff --git a/src/views/login.vue b/src/views/login.vue
index ca2e212..4e4750b 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -108,7 +108,8 @@ import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt";
import useUserStore from '@/store/modules/user';
import FloatingLines from '@/components/Ballpit/index.vue';
-
+import { useCommonStore } from '@/store/modules/commonStore'
+const mbStore = useCommonStore();
// 初始化响应式变量
const activeName = ref('first');
const userStore = useUserStore();
@@ -218,6 +219,7 @@ const Localconfig = (localid) => {
getLocalconfig({ localid }).then(res => {
if (res) {
const { localconfig, hosplist, oem: oemData } = res;
+ mbStore.setDefaultConfig(localconfig)
// 修复:赋值oem数据,显示动态标题
if (oemData) oem.value = oemData;
// console.log('oemData', oemData);
@@ -231,6 +233,8 @@ const Localconfig = (localid) => {
}
getCookie();
}
+
+
}
}).catch(err => {
console.error("获取本地配置失败:", err);