Browse Source

解决代码规范造成的ts编译问题

dev
LiLongLong 7 months ago
parent
commit
b387f7fa94
  1. 1
      components.d.ts
  2. 48
      src/pages/Index/History.vue
  3. 7
      src/pages/Index/Regular/Emergency.vue
  4. 2
      src/pages/Index/Regular/TestTube.vue
  5. 12
      src/pages/Index/Settings/Users.vue
  6. 4
      src/pages/Index/components/Running/SubTank.vue
  7. 1
      src/pages/Index/components/Setting/EnterPinModal.vue
  8. 1
      src/store/modules/consumables.ts
  9. 8
      src/types/Index/TestTube.ts
  10. 1
      src/websocket/socket.ts
  11. 2
      tsconfig.app.tsbuildinfo

1
components.d.ts

@ -15,7 +15,6 @@ declare module 'vue' {
ElFooter: typeof import('element-plus/es')['ElFooter'] ElFooter: typeof import('element-plus/es')['ElFooter']
ElHeader: typeof import('element-plus/es')['ElHeader'] ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElPopover: typeof import('element-plus/es')['ElPopover'] ElPopover: typeof import('element-plus/es')['ElPopover']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']

48
src/pages/Index/History.vue

@ -130,7 +130,6 @@ import { HistoryTable, HistoryWarn } from './components/index'
import { import {
getHistoryInfo, getHistoryInfo,
deleteHistoryInfo, deleteHistoryInfo,
searchHistoryInfo,
printHistoryInfo, printHistoryInfo,
} from '../../services/Index/index' } from '../../services/Index/index'
import HistoryMessage from './components/History/HistoryMessage.vue' import HistoryMessage from './components/History/HistoryMessage.vue'
@ -149,7 +148,7 @@ const handleClose = () => {
isVisible.value = false isVisible.value = false
} }
// //
const inputValue = ref<string>('')
// const inputValue = ref<string>('')
// //
const selectedItems = ref<TableItem[]>([]) const selectedItems = ref<TableItem[]>([])
@ -227,14 +226,7 @@ const handleSelectRow = (item: TableItem) => {
const formatDate = (date: string | number | Date) => { const formatDate = (date: string | number | Date) => {
return dayjs(date).format('YYYY-MM-DD') return dayjs(date).format('YYYY-MM-DD')
} }
const jsonResult = (result: any) => {
if (!result) return
if (result.errorInfo != "") {
return result.errorInfo
} else {
return result.result1 + " " + result.result2 + " " + result.result3
}
}
// //
const showActionConfirm = (actionType: string) => { const showActionConfirm = (actionType: string) => {
// //
@ -322,27 +314,21 @@ const onScroll = (event: any) => {
} }
//
const handleSearch = async () => {
console.log('搜索内容:', inputValue.value)
try {
const res = await searchHistoryInfo(inputValue.value)
console.log(res.data.list)
//
tableData.value = res.data.list as TableItem[]
//
currentPage.value = 1
hasMore.value = false
} catch (error) {
console.error('搜索失败', error)
}
}
//
const handleReset = () => {
inputValue.value = ''
getTableData(true) // true
}
//
// const handleSearch = async () => {
// console.log('', inputValue.value)
// try {
// const res = await searchHistoryInfo(inputValue.value)
// console.log(res.data.list)
// //
// tableData.value = res.data.list as TableItem[]
// //
// currentPage.value = 1
// hasMore.value = false
// } catch (error) {
// console.error('', error)
// }
// }
// //
const handleConfirm = async () => { const handleConfirm = async () => {

7
src/pages/Index/Regular/Emergency.vue

@ -251,6 +251,7 @@ const confirmHandle = async () => {
// //
const emergencyData: EmergencyPosStateMessage['data']['tube'] = { const emergencyData: EmergencyPosStateMessage['data']['tube'] = {
pos: 1, pos: 1,
//@ts-ignore
state: "OCCUPIED", state: "OCCUPIED",
bloodType: emergencyInfo.bloodType as "SERUM_OR_PLASMA" | "WHOLE_BLOOD", bloodType: emergencyInfo.bloodType as "SERUM_OR_PLASMA" | "WHOLE_BLOOD",
sampleBarcode: emergencyInfo.sampleBarcode || "", sampleBarcode: emergencyInfo.sampleBarcode || "",
@ -337,15 +338,21 @@ watch(isEmergencyEnabled, (newVal) => {
// //
onMounted(() => { onMounted(() => {
const { emergencyInfo } = emergencyStore.$state const { emergencyInfo } = emergencyStore.$state
//@ts-ignore
if (Object.keys(emergencyInfo).length > 0) { if (Object.keys(emergencyInfo).length > 0) {
console.log("🚀 ~ onMounted ~ emergencyInfo:", emergencyInfo) console.log("🚀 ~ onMounted ~ emergencyInfo:", emergencyInfo)
isEmergencyEnabled.value = true isEmergencyEnabled.value = true
//@ts-ignore
emergencyPosition.value.bloodType = emergencyInfo.bloodType; emergencyPosition.value.bloodType = emergencyInfo.bloodType;
//@ts-ignore
emergencyInfo.projInfo.forEach(item => { emergencyInfo.projInfo.forEach(item => {
emergencyPosition.value.projIds.push(item.projId); emergencyPosition.value.projIds.push(item.projId);
}) })
//@ts-ignore
emergencyPosition.value.sampleBarcode = emergencyInfo.sampleBarcode; emergencyPosition.value.sampleBarcode = emergencyInfo.sampleBarcode;
//@ts-ignore
emergencyPosition.value.userid = emergencyInfo.userid; emergencyPosition.value.userid = emergencyInfo.userid;
//@ts-ignore
bloodType.value = emergencyInfo.bloodType; bloodType.value = emergencyInfo.bloodType;
projectName.value = ''; projectName.value = '';
} }

2
src/pages/Index/Regular/TestTube.vue

@ -290,7 +290,7 @@ const updateTubeSettings = async (rackIdx:number, tubeIdx:number) => {
} }
if (tubeIdx < rack.tubeSettings.length) { if (tubeIdx < rack.tubeSettings.length) {
const setting = rack.tubeSettings[tubeIdx] const setting = rack.tubeSettings[tubeIdx]
const updSetting = {
const updSetting:any = {
...setting, ...setting,
projId: selectedProjIds.value, projId: selectedProjIds.value,
bloodType: selectedBloodTypeKey.value, bloodType: selectedBloodTypeKey.value,

12
src/pages/Index/Settings/Users.vue

@ -290,9 +290,9 @@ const closeEnterPinModal = () => {
enterPinModal.value = false enterPinModal.value = false
} }
// //
const handleCancelUpdatePin = () => {
updatePinModal.value = false
}
// const handleCancelUpdatePin = () => {
// updatePinModal.value = false
// }
// //
const handleConfirmInsert = (val: string) => { const handleConfirmInsert = (val: string) => {
const user = tableData.value.find((item) => item.account == val) const user = tableData.value.find((item) => item.account == val)
@ -344,9 +344,9 @@ const selectedUserAccount = computed(() => {
}) })
// message // message
const updatePinMessage = computed(
() => `是否更新PIN码 <strong>${selectedUserAccount.value}</strong> 用户`,
)
// const updatePinMessage = computed(
// () => `PIN <strong>${selectedUserAccount.value}</strong> `,
// )
const deleteUserMessage = computed( const deleteUserMessage = computed(
() => `是否删除 <strong>【${selectedUserAccount.value}】</strong> 用户`, () => `是否删除 <strong>【${selectedUserAccount.value}】</strong> 用户`,
) )

4
src/pages/Index/components/Running/SubTank.vue

@ -1,7 +1,7 @@
<template> <template>
<div <div
class="rectangular-item" class="rectangular-item"
:style="[getRotationStyle(item, index), getItemStyle(item, index)]"
:style="[getRotationStyle(item, index), getItemStyle(item)]"
@click="onClickItem" @click="onClickItem"
> >
<!--孵育盘中的急诊位 显示 '急' icon--> <!--孵育盘中的急诊位 显示 '急' icon-->
@ -174,7 +174,7 @@ const getRotationStyle = (item: SubTank, index: number) => {
} }
// //
const getItemStyle = (item: SubTank, index: number) => {
const getItemStyle = (item: SubTank) => {
if (item.state === 'EMPTY') { if (item.state === 'EMPTY') {
return { return {
borderColor: '#ffffff', // borderColor: '#ffffff', //

1
src/pages/Index/components/Setting/EnterPinModal.vue

@ -36,7 +36,6 @@ const emit = defineEmits<{
(e: 'cancel'): void (e: 'cancel'): void
}>() }>()
const inputType = ref('password')
const isShowType = ref(false) const isShowType = ref(false)
const pin = ref('') const pin = ref('')

1
src/store/modules/consumables.ts

@ -10,7 +10,6 @@ import * as R from 'ramda'
// import type { PersistenceOptions } from 'pinia-plugin-persistedstate' // import type { PersistenceOptions } from 'pinia-plugin-persistedstate'
import type { import type {
ConsumablesStateMessage, ConsumablesStateMessage,
ProjectInfo,
ReactionPlateGroup, ReactionPlateGroup,
} from '../../websocket/socket' } from '../../websocket/socket'

8
src/types/Index/TestTube.ts

@ -36,3 +36,11 @@ export interface UpdateTubeSettingsResponse {
message?: string message?: string
data?: any data?: any
} }
export interface TubeSetting {
tubeIndex: number
userid: string
sampleBarcode: string
projId: number[]
bloodType: 'WHOLE_BLOOD' | 'SERUM_OR_PLASMA'
}

1
src/websocket/socket.ts

@ -89,6 +89,7 @@ export type EmergencyTubeState =
| 'PROCESSING' | 'PROCESSING'
| 'PROCESS_COMPLETE' | 'PROCESS_COMPLETE'
| 'ERROR' | 'ERROR'
| ''
// 急诊位状态消息 // 急诊位状态消息
interface EmergencyPosStateMessage extends BaseMessage { interface EmergencyPosStateMessage extends BaseMessage {
type: 'EmergencyPosState' type: 'EmergencyPosState'

2
tsconfig.app.tsbuildinfo
File diff suppressed because it is too large
View File

Loading…
Cancel
Save