Browse Source

删除试管架图标,当前已预订项目计数

feature/user-0111
zhangjiming 7 months ago
parent
commit
e3cb827f00
  1. 3
      src/assets/icon_cross.svg
  2. 34
      src/pages/Index/Regular/TestTube.vue
  3. 4
      src/pages/Index/components/Running/EmergencyResultDialog.vue
  4. 14
      src/pages/Index/components/TestTube/TestTubeRack.vue

3
src/assets/icon_cross.svg

@ -0,0 +1,3 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3571 11L22 19.6429L19.6429 22L11 13.3571L2.35714 22L0 19.6429L8.64286 11L1.40497e-06 2.35714L2.35714 0L11 8.64286L19.6429 0L22 2.35714L13.3571 11Z" fill="#FA5151"/>
</svg>

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

@ -36,7 +36,9 @@
@click="clickProjectItem(proj)" @click="clickProjectItem(proj)"
> >
<span class="proj-name">{{ proj.projName }}</span> <span class="proj-name">{{ proj.projName }}</span>
<span class="proj-num">{{ proj.num }}</span>
<span class="proj-num">{{
`${projIdCntMap[proj.projId] || 0}/${proj.num}`
}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -159,6 +161,31 @@ const projectsAvailable = computed(() => {
return projArr return projArr
}) })
const projIdCntMap = computed(() => {
return R.reduce(
(acc, curr) => {
const projIdCntRack = R.reduce(
(ac, cur) => {
cur.projId.forEach((pId) => {
ac[pId] = (ac[pId] || 0) + 1
})
return ac
},
{},
curr.tubeSettings,
)
Object.keys(projIdCntRack).forEach((k) => {
acc[k] = (acc[k] || 0) + projIdCntRack[k]
})
return acc
},
{},
tubeRacks.value,
)
})
const getBloodTypeData = async () => { const getBloodTypeData = async () => {
loading.value = true loading.value = true
const res = await getBloodTypes() const res = await getBloodTypes()
@ -443,7 +470,7 @@ const updateTubeSettingsHandler = async (rackIdx, tubeIdx) => {
display: flex; display: flex;
.project-item { .project-item {
border-radius: 8px; border-radius: 8px;
padding: 6px 10px;
padding: 4px 10px;
margin-right: 8px; margin-right: 8px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -451,6 +478,7 @@ const updateTubeSettingsHandler = async (rackIdx, tubeIdx) => {
min-width: 50px; min-width: 50px;
.proj-name { .proj-name {
font-weight: 600; font-weight: 600;
font-size: 1.2rem;
} }
} }
} }
@ -466,6 +494,8 @@ const updateTubeSettingsHandler = async (rackIdx, tubeIdx) => {
padding: 10px; padding: 10px;
margin-right: 8px; margin-right: 8px;
color: @active-color; color: @active-color;
font-weight: 600;
font-size: 1.2rem;
&.active { &.active {
color: #fff; color: #fff;
background-color: @active-color; background-color: @active-color;

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

@ -42,11 +42,11 @@
defineProps({ defineProps({
result: { result: {
type: Object, type: Object,
required: true,
// required: true,
}, },
visible: { visible: {
type: Boolean, type: Boolean,
required: true,
// required: true,
}, },
}) })

14
src/pages/Index/components/TestTube/TestTubeRack.vue

@ -18,7 +18,10 @@
<div class="test-tube-rack-op"> <div class="test-tube-rack-op">
<div class="rack-op">修改试管架</div> <div class="rack-op">修改试管架</div>
<div class="rack-op">编辑患者信息</div> <div class="rack-op">编辑患者信息</div>
<div class="rack-op" @click="$emit('delete:rack', index)">删除试管架</div>
<div class="rack-op rack-del" @click="$emit('delete:rack', index)">
<img src="@/assets/icon_cross.svg" alt="del" />
<span>删除试管架</span>
</div>
</div> </div>
</template> </template>
@ -73,6 +76,15 @@ const onClickTubeItem = (idx) => {
.rack-op { .rack-op {
align-self: stretch; align-self: stretch;
line-height: @op-bar-height; line-height: @op-bar-height;
&.rack-del {
display: flex;
align-items: center;
img {
width: 20px;
margin-right: 8px;
}
color: red;
}
} }
} }
</style> </style>
Loading…
Cancel
Save