2025-11-05 15:59:48 +08:00
|
|
|
<template>
|
2025-12-26 15:15:35 +08:00
|
|
|
<view class="backgroundContainer">
|
2025-12-30 08:40:09 +08:00
|
|
|
<!-- 左侧菜单 -->
|
2025-12-25 13:27:31 +08:00
|
|
|
<leftcontent :list="tabbrarr" @navurl="navurl"></leftcontent>
|
2025-11-05 15:59:48 +08:00
|
|
|
<!-- 主页 -->
|
2025-12-25 14:37:43 +08:00
|
|
|
<index :isShow="menuIndexshow" v-if="!menuIndex" />
|
2025-11-05 15:59:48 +08:00
|
|
|
<!-- 设备页 -->
|
2025-12-30 08:40:09 +08:00
|
|
|
<equipment :isShow="menuIndexshowfifth" v-if="menuIndex==4" />
|
|
|
|
|
<!-- 医嘱页 -->
|
2025-11-27 15:02:08 +08:00
|
|
|
<requestform :isShow="menuIndexshowfourth" v-if="menuIndex==3" />
|
2025-11-05 15:59:48 +08:00
|
|
|
<!-- 户嘱页 -->
|
2025-12-26 15:15:35 +08:00
|
|
|
<nurse :isshow="menuIndexshowsecond"
|
2025-12-30 08:40:09 +08:00
|
|
|
v-if="menuIndex==1&&uni.getStorageSync('elderId')&&uni.getStorageSync('nuId')" />
|
2025-12-16 16:54:29 +08:00
|
|
|
<!-- 医嘱 -->
|
2025-12-30 08:40:09 +08:00
|
|
|
<doctorask v-if="menuIndex==2&&uni.getStorageSync('elderId')&&uni.getStorageSync('nuId')" />
|
|
|
|
|
<!-- 没有数据 -->
|
|
|
|
|
<view class="nomessageclass" :style="messageopit?{opacity: `1`}:{opacity: `0`}"
|
|
|
|
|
v-if="(menuIndex == 1 || menuIndex == 2) && (!uni.getStorageSync('elderId') ||!uni.getStorageSync('nuId'))">
|
|
|
|
|
<defaultr cont="暂无老人入住"></defaultr>
|
|
|
|
|
</view>
|
2025-11-05 15:59:48 +08:00
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
|
|
|
|
import index from "./component/index.vue"
|
|
|
|
|
import equipment from "./component/equipment.vue"
|
2025-11-27 14:47:04 +08:00
|
|
|
import requestform from "./component/pleasetake/takehome.vue"
|
2025-12-16 16:54:29 +08:00
|
|
|
import doctorask from "./component/doctorask/doctorask.vue"
|
2025-11-05 15:59:48 +08:00
|
|
|
import nurse from "./component/nurse/index.vue"
|
|
|
|
|
import { onShow } from '@dcloudio/uni-app';
|
2025-11-26 13:26:22 +08:00
|
|
|
import { getServiceTree, getNcPackagelist } from './component/nurse/api.js'
|
2025-12-25 13:27:31 +08:00
|
|
|
import leftcontent from "./component/leftcontent/leftcontent.vue"
|
2025-12-30 08:40:09 +08:00
|
|
|
import defaultr from '@/pages/procurement/components/default.vue';
|
|
|
|
|
|
2025-11-05 15:59:48 +08:00
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
menuIndex.value = -1;
|
2025-12-17 15:48:36 +08:00
|
|
|
nextTick(() => menuIndex.value = 0)
|
2025-11-05 15:59:48 +08:00
|
|
|
|
|
|
|
|
getServiceTree().then((res : any) => {
|
2025-12-26 15:15:35 +08:00
|
|
|
//缓存护嘱菜单
|
2025-11-05 15:59:48 +08:00
|
|
|
uni.setStorageSync("saveTree", res)
|
|
|
|
|
})
|
|
|
|
|
getNcPackagelist().then((res : any) => {
|
|
|
|
|
//缓存指令包
|
|
|
|
|
uni.setStorageSync("Packagelist", res.result)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 通用的生成函数
|
|
|
|
|
function genPaths(base, prefix, count, ext = 'png', startIndex = 0, pad = false) {
|
|
|
|
|
return Array.from({ length: count }, (_, i) => {
|
|
|
|
|
const idx = pad
|
|
|
|
|
? String(i + startIndex).padStart(2, '0')
|
|
|
|
|
: i + startIndex
|
|
|
|
|
return `${base}/${prefix}${idx}.${ext}`
|
|
|
|
|
})
|
|
|
|
|
}
|
2025-12-25 13:27:31 +08:00
|
|
|
const tabbrarr = ref([
|
2025-12-30 08:40:09 +08:00
|
|
|
{ name: '首页', url: '/static/shouye/sy/h0.png', urls: '/static/shouye/sy/h1.png' },
|
|
|
|
|
{ name: '护嘱', url: '/static/shouye/sy/n0.png', urls: '/static/shouye/sy/n1.png' },
|
|
|
|
|
{ name: '医嘱', url: '/static/shouye/sy/y0.png', urls: '/static/shouye/sy/y1.png' },
|
|
|
|
|
{ name: '后勤', url: '/static/shouye/sy/l0.png', urls: '/static/shouye/sy/l1.png' },
|
|
|
|
|
{ name: '物联', url: '/static/shouye/sy/g0.png', urls: '/static/shouye/sy/g1.png' },
|
|
|
|
|
{ name: '返回', url: '/static/shouye/sy/f0.png', urls: '/static/shouye/sy/f1.png' },
|
2025-12-25 13:27:31 +08:00
|
|
|
])
|
2025-12-30 08:40:09 +08:00
|
|
|
const navurl = (e) => {
|
2025-12-25 13:40:02 +08:00
|
|
|
changeMenu(e)
|
2025-12-25 13:27:31 +08:00
|
|
|
}
|
2025-12-26 15:15:35 +08:00
|
|
|
|
2025-11-05 15:59:48 +08:00
|
|
|
// 当前选中的菜单索引
|
|
|
|
|
const menuIndex = ref<number>(-1);
|
|
|
|
|
const menuIndexshow = ref<boolean>(false);
|
|
|
|
|
const menuIndexshowsecond = ref<boolean>(false);
|
2025-11-26 13:26:22 +08:00
|
|
|
const menuIndexshowfourth = ref<boolean>(false);
|
2025-11-05 15:59:48 +08:00
|
|
|
const menuIndexshowfifth = ref<boolean>(false);
|
2025-12-30 08:40:09 +08:00
|
|
|
const messageopit = ref<boolean>(false);
|
2025-11-05 15:59:48 +08:00
|
|
|
|
|
|
|
|
// 变更菜单
|
|
|
|
|
const changeMenu = (index : number) => {
|
2025-12-30 08:40:09 +08:00
|
|
|
if (index === menuIndex.value) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-11-05 15:59:48 +08:00
|
|
|
menuIndex.value = index;
|
|
|
|
|
menuIndexshow.value = false
|
|
|
|
|
menuIndexshowsecond.value = false
|
2025-11-26 13:26:22 +08:00
|
|
|
menuIndexshowfourth.value = false;
|
2025-11-05 15:59:48 +08:00
|
|
|
menuIndexshowfifth.value = false
|
|
|
|
|
if (index === 5) {
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
menuIndexshow.value = true
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
menuIndexshowsecond.value = true
|
2025-12-30 08:40:09 +08:00
|
|
|
nomesssageshow()
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2025-11-05 15:59:48 +08:00
|
|
|
|
2025-12-30 08:40:09 +08:00
|
|
|
nomesssageshow()
|
2025-11-26 13:26:22 +08:00
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
menuIndexshowfourth.value = true
|
2025-11-05 15:59:48 +08:00
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
menuIndexshowfifth.value = true;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
}
|
|
|
|
|
}, 50)
|
|
|
|
|
};
|
|
|
|
|
const clientX = ref(0);
|
|
|
|
|
const clientY = ref(0);
|
|
|
|
|
const savename = ref("")
|
|
|
|
|
const canmove = ref(true)
|
|
|
|
|
|
|
|
|
|
// 生命周期钩子
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
|
|
|
|
//首次加载和跳转回来需要重新做个动画
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
changeMenu(menuIndex.value)
|
|
|
|
|
}, 50)
|
|
|
|
|
|
|
|
|
|
menuIndexshow.value = false
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
menuIndexshow.value = true
|
|
|
|
|
}, 50)
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
2025-12-30 08:40:09 +08:00
|
|
|
const nomesssageshow = () => {
|
|
|
|
|
messageopit.value = false;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
messageopit.value = true;
|
|
|
|
|
}, 200)
|
|
|
|
|
}
|
2025-11-05 15:59:48 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.backgroundContainer {
|
|
|
|
|
display: flex;
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-color: #eff0f4;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
z-index: 12;
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-30 08:40:09 +08:00
|
|
|
.nomessageclass {
|
|
|
|
|
width: 100vw;
|
|
|
|
|
transition: opacity 1s ease;
|
|
|
|
|
}
|
2025-11-05 15:59:48 +08:00
|
|
|
</style>
|