2025-04-16 17:32:42 +08:00
|
|
|
|
<!-- 护嘱 -->
|
|
|
|
|
<template>
|
|
|
|
|
<!-- click是让抖动停止 -->
|
|
|
|
|
<view class="right-container" :style="isshow?{opacity: `1`}:{opacity: `0`}"
|
|
|
|
|
@click="bottomisShaking=false;shakyTable = false">
|
|
|
|
|
<!-- 轮盘 -->
|
|
|
|
|
<joystick v-show="isEdit" @movecard="movecard" />
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<!-- <joysticknew v-show="isLunpan" @movecard="movecard" /> -->
|
|
|
|
|
<!-- 测试 -->
|
|
|
|
|
<!-- <ceshi /> -->
|
|
|
|
|
<!-- 新增后的按钮 -->
|
|
|
|
|
<skill v-show="isEdit && songisopen && !isMove && !deleteisopen" @clickcircle="clickcircle" />
|
2025-04-16 17:32:42 +08:00
|
|
|
|
<!-- 新增 -->
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<skilladd v-show="!haveName && isEdit && !songisopen && !isMove&& !deleteisopen" @getDownListIndex="openAdd" />
|
2025-04-17 17:18:37 +08:00
|
|
|
|
<!-- 移动 -->
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<skillmove v-show="((haveName && isEdit && !songisopen) ||(isEdit && !songisopen && isMove)) && !deleteisopen"
|
|
|
|
|
:ismove="isMove" @clickcard="changecard" />
|
2025-04-17 17:18:37 +08:00
|
|
|
|
<!-- 删除 -->
|
|
|
|
|
<skilmovedelete v-show="deleteisopen" @clickdelete="clickdelete" />
|
2025-04-16 17:32:42 +08:00
|
|
|
|
<view class="right-container-title-nav">
|
|
|
|
|
<text :class="darkFans?`right-container-title-no-dark`:`right-container-title-no`">
|
|
|
|
|
ID:12345678
|
|
|
|
|
</text>
|
|
|
|
|
<text :class="darkFans?`right-container-title-no-dark`:`right-container-title-no`">
|
|
|
|
|
名称:未命名01
|
|
|
|
|
</text>
|
|
|
|
|
|
|
|
|
|
<view class="right-icons">
|
|
|
|
|
<image class="right-icons-img" :src="`/static/index/undericons/man.png`" />
|
|
|
|
|
<view :class="darkFans?`right-icons-font-dark`: `right-icons-font` ">王金福</view>
|
|
|
|
|
<image class="right-icons-img-icon"
|
|
|
|
|
:src="darkFans?`/static/index/undericons/face.png`:`/static/index/undericons/facelight.png`" />
|
|
|
|
|
<image class="right-icons-img-icon"
|
|
|
|
|
:src="darkFans?`/static/index/undericons/hand.png`:`/static/index/undericons/handlight.png`" />
|
|
|
|
|
<image class="right-icons-img-icon"
|
|
|
|
|
:src="darkFans?`/static/index/undericons/out.png`:`/static/index/undericons/outlight.png`" />
|
|
|
|
|
</view>
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<view class="right-container-title-class-anhei-button-wrong" @click="newchange(0)">
|
2025-04-16 17:32:42 +08:00
|
|
|
|
<text class="right-container-title-class-anhei">
|
|
|
|
|
拖动模式
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
2025-04-29 17:00:07 +08:00
|
|
|
|
<!-- <view class="right-container-title-class-anhei-button">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<text class="right-container-title-class-anhei">
|
|
|
|
|
手柄模式1
|
|
|
|
|
</text>
|
2025-04-29 17:00:07 +08:00
|
|
|
|
</view> -->
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<view class="right-container-title-class-anhei-button-wrong" @click="newchange(2)">
|
|
|
|
|
<text class="right-container-title-class-anhei">
|
2025-04-29 17:00:07 +08:00
|
|
|
|
手柄模式
|
2025-04-28 17:33:10 +08:00
|
|
|
|
</text>
|
|
|
|
|
</view>
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="doctorsay-container-view">
|
|
|
|
|
<view class="doctorsay-container-container">
|
|
|
|
|
<view class="doctorsay-container-title">
|
|
|
|
|
<view class="doctorsay-container-left">
|
|
|
|
|
<view class="doctorsay-container-left-gun"></view>
|
|
|
|
|
<view class="doctorsay-container-left-font">时间矩阵</view>
|
|
|
|
|
<view class="doctorsay-container-share" @click="shareToWeixin">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
分享
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="doctorsay-container-right">
|
|
|
|
|
<view class="doctorsay-container-right-kuai-cheng"></view>
|
|
|
|
|
<view class="doctorsay-container-kuai-font">日常</view>
|
|
|
|
|
<view class="doctorsay-container-right-kuai-zi"></view>
|
|
|
|
|
<view class="doctorsay-container-kuai-font">周期</view>
|
|
|
|
|
<view class="doctorsay-container-juzhen" @click="routerPush">
|
|
|
|
|
预览
|
|
|
|
|
</view>
|
|
|
|
|
<view class="doctorsay-container-juzhen" @click="openEdit">
|
|
|
|
|
{{isEdit?"取消编辑":"编辑"}}
|
|
|
|
|
</view>
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<!-- <view v-show="isEdit" class="doctorsay-container-juzhen" @click="openLunpan">
|
|
|
|
|
{{isLunpan?"取消轮盘":"开启轮盘"}}
|
|
|
|
|
</view> -->
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="super-card">
|
|
|
|
|
<view class="boom-title">
|
|
|
|
|
<view class="boom-title-left">
|
|
|
|
|
分钟
|
|
|
|
|
</view>
|
|
|
|
|
<view class="boom-title-right">
|
|
|
|
|
小时
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="boom">
|
|
|
|
|
<view :style="{ marginTop: `-${2 *moveDownNumber}rpx` }">
|
|
|
|
|
<view v-for="(item,index) in timearr[0].children" :key="index">
|
|
|
|
|
<view
|
|
|
|
|
:class="touchindex1 === index ||(liang.index1 === index && !canmove) || (flyNumber.index1 === index && shakyTable) ? `boom-son-target`: `boom-son`"
|
|
|
|
|
v-show="item.typeName">
|
|
|
|
|
{{item.typeName}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="super-card-container">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<!-- <swiper :disable-touch="!canmove || shakyTable" :current="currentNumber" class="scroll-x"
|
2025-04-16 17:32:42 +08:00
|
|
|
|
circular :indicator-dots="false" @change="changecurrentNumber" :interval="4000"
|
|
|
|
|
:duration="500">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<swiper-item v-for="(item,index) in [1,2,3]" :key="index"> -->
|
|
|
|
|
<scroll-view style="height: 100%;width: 100%;" :scroll-left="cardLeft" scroll-x
|
|
|
|
|
@scroll="handleTop" :show-scrollbar="false">
|
|
|
|
|
<view
|
|
|
|
|
style="display: flex;box-shadow: 10rpx 10rpx 20rpx rgba(0, 0, 0, 0.1);width:5420rpx;background: linear-gradient(to right, #c4dbf4,#c9c2ef, #c6dcf3);">
|
|
|
|
|
<view v-for="(item0,index0) in timearr" :key="index0">
|
|
|
|
|
<view class="super-card-time" style="width:226rpx">
|
|
|
|
|
{{(item0.positioning.length == 1 ? ('0' + item0.positioning) : item0.positioning) + ":00"}}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-04-28 17:33:10 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view style="display: flex;height: calc(100% - 80rpx);">
|
2025-04-16 17:32:42 +08:00
|
|
|
|
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<scroll-view style="height: 100%;width:5800rpx" :scroll-top="scrollTop"
|
|
|
|
|
:scroll-y="canmove && !shakyTable" @scroll="handleScrolltime"
|
|
|
|
|
:show-scrollbar="false">
|
|
|
|
|
<view style="display: flex;height: 100%;">
|
|
|
|
|
<view v-for="(item0,index0) in timearr" :key="index0">
|
|
|
|
|
<view class="super-card-time-und" style="width:226rpx">
|
|
|
|
|
<view v-for="(item1,index1) in item0.children" style="width: 100%;"
|
|
|
|
|
:key="index1">
|
|
|
|
|
<view
|
|
|
|
|
:class=" targetRuler.index0 === index0 && targetRuler.index1 === index1 ? targetRuler.index1 ?`title-time-border-big`:`title-time-border-big-top` : `super-card-time-card` "
|
|
|
|
|
:style="!targetRuler.bordershow && saveRulerTime.index0 === index0 && saveRulerTime.index1 === index1 ? {zIndex:999} : {borderTop: '1rpx solid transparent'}"
|
|
|
|
|
:id="`a${index0}_${index1}`" style="position: relative;"
|
|
|
|
|
@click="rulerTouchClick(item1,index0,index1,$event)"
|
|
|
|
|
@touchstart="rulerTouchStart(item1,index0,index1,$event)"
|
|
|
|
|
@touchmove="rulerTouchMove" @touchend="rulerTouchEnd()"
|
|
|
|
|
:data-index0="index0" :data-index1="index1">
|
2025-04-16 17:32:42 +08:00
|
|
|
|
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<view class="title-time-delete"
|
|
|
|
|
v-show="liang.index0 !== index0 || liang.index1 !== index1 || canmove"
|
|
|
|
|
v-if="item1.directiveName&&shakyTable "
|
|
|
|
|
@click.stop="deleteItems(item1,index0,index1)">
|
|
|
|
|
-
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title-time-blue"
|
|
|
|
|
v-show="saveEditIndex.index0 == index0 && saveEditIndex.index1 == index1">
|
|
|
|
|
<image class="title-time-blue-img"
|
|
|
|
|
:src="isMove?`/static/index/movemode/targetcheng.png`: `/static/index/movemode/target.png`" />
|
|
|
|
|
</view>
|
|
|
|
|
<view :class="getClass(item1,index0,index1)"
|
|
|
|
|
style="font-size: 30rpx;overflow: hidden;"
|
|
|
|
|
:style="{ animationDelay:`-${computeDelay(index0, index1).toFixed(2)}s` }">
|
|
|
|
|
<view class="title-time" v-if="item1.startTime"
|
|
|
|
|
v-show=" liang.index0 !== index0 || liang.index1 !== index1 || canmove"
|
|
|
|
|
style="margin-top: 5rpx;">
|
|
|
|
|
<view class="title-time-time" style="font-size: 25rpx;">
|
|
|
|
|
{{item1.startTime + `-` + item1.endTime}}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<image class="title-time-button"
|
|
|
|
|
:src="item1.cycleType=='日常'?`/static/index/yellowbian.png`:`/static/index/puoplebian.png`" />
|
|
|
|
|
<view class="title-time-font">
|
|
|
|
|
{{item1.cycleType}}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
2025-04-28 17:33:10 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view style="margin-top: 20rpx;font-weight: 700;"
|
|
|
|
|
v-show=" liang.index0 !== index0 || liang.index1 !== index1 || canmove">
|
|
|
|
|
{{splitString(item1.directiveName)[0]}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="down-icons"
|
|
|
|
|
v-show=" liang.index0 !== index0 || liang.index1 !== index1 || canmove"
|
|
|
|
|
:style="item1.cycleType!='日常'?{backgroundColor:`rgb(212,203,255)`}:{}"
|
|
|
|
|
v-if="splitString(item1.directiveName)[1]">
|
|
|
|
|
<view class=""
|
|
|
|
|
v-for="(item,index) in splitString(item1.directiveName).slice(1)"
|
|
|
|
|
:key="index">
|
|
|
|
|
<view class="icon"
|
|
|
|
|
:style="item1.cycleType!='日常'?{backgroundColor:`rgb(123,97,255)`}:{}">
|
|
|
|
|
{{splitString(item1.directiveName)[index + 1]}}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-04-28 17:33:10 +08:00
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
<!-- </swiper-item>
|
|
|
|
|
</swiper> -->
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="super-card-end">
|
|
|
|
|
<view class="super-end-father">
|
|
|
|
|
<view class="super-end-font-father">
|
|
|
|
|
<view class="super-end-font-gun"></view>
|
|
|
|
|
<view class="super-end-font-font">即时指令</view>
|
|
|
|
|
</view>
|
|
|
|
|
<scroll-view scroll-x class="super-end-items-all" :scroll-left="scrollLeft">
|
|
|
|
|
<view class="super-end-items">
|
|
|
|
|
<view v-for="(item,index) in bottomItems" :key="index">
|
|
|
|
|
<view @touchstart="bottomTouchStart" @touchmove="bottomTouchMove"
|
|
|
|
|
@touchend="bottomTouchEnd"
|
|
|
|
|
:style="item.target?{background: item.target,transition:`all 1.5s ease-in-out`}:{transition:`all 1.5s ease-in-out`}"
|
|
|
|
|
class="super-end-items-father">
|
|
|
|
|
<view class="super-end-items-father-close-father" v-show="bottomisShaking"
|
|
|
|
|
@click.stop="deletebottom(index,item.name)">
|
|
|
|
|
-
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view :style="{ animationDelay:`-${index * 0.1}s` }"
|
|
|
|
|
:class="bottomisShaking?`super-end-items-img-father-active`:`super-end-items-img-father`">
|
|
|
|
|
<image class="super-end-items-img" :src="item.url" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="super-end-items-font">{{item.name}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 点击的弹出层 -->
|
|
|
|
|
<view v-show="isopen" class="popup-overlay" @click="isopen=false;flyNumber.index0=999;touchindex1=-1">
|
|
|
|
|
<view class="popup-overlay-content"
|
|
|
|
|
:style="{ top: (2*openY - 350) + 'rpx',left: (2*openX - 780) + 'rpx',opacity: isopacity ? 1 : 0,backgroundColor:timearr[flyNumber.index0]?.children[flyNumber.index1]?.type==='日常'? '#fffcf6':'rgb(246, 244, 254)' }"
|
|
|
|
|
@click.stop>
|
|
|
|
|
<view class="popup-overlay-content-left">
|
|
|
|
|
<image class="popup-overlay-content-left-img" :src="`/static/index/teeth.png`" />
|
|
|
|
|
<text class="popup-overlay-content-left-font">
|
|
|
|
|
{{ timearr[flyNumber.index0]?.children[flyNumber.index1]?.value }}
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="popup-overlay-content-right">
|
|
|
|
|
<view class="time-font">
|
|
|
|
|
10:00 - 10:10
|
|
|
|
|
</view>
|
|
|
|
|
<view class="time-text">
|
|
|
|
|
为老人提供口腔清洁器具,牙膏、牙刷及水杯,看护完成
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-04-17 17:18:37 +08:00
|
|
|
|
<!-- 选择的弹出层 -->
|
|
|
|
|
<view v-if="songisopen" class="popup-song">
|
2025-04-16 17:32:42 +08:00
|
|
|
|
<view class="popup-song-contain" :style="{opacity: songisopacity ? 1 : 0}" @click.stop>
|
|
|
|
|
<view class="popup-song-father">
|
|
|
|
|
<image class="shu-up-img" src="/static/index/cheng.png" />
|
|
|
|
|
<view class="shu-up-font">
|
|
|
|
|
<view class="">
|
|
|
|
|
服务时段:{{ openValue.time + ":" + openValue.minute}}
|
|
|
|
|
</view>
|
|
|
|
|
<view style="margin-left: 30rpx;">
|
|
|
|
|
护理时长:10分钟
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="shu-container-left" v-show="!clickstauts">
|
|
|
|
|
<view class="shu-container-left-gun"></view>
|
|
|
|
|
<view class="shu-container-left-font">服务类型</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="arrayindex" v-show="!clickstauts">
|
|
|
|
|
<view v-for="(item,index) in openValue.array" :key="index">
|
|
|
|
|
<view style="position: relative;box-shadow: 10rpx 10rpx 20rpx rgba(105, 129, 178, 0.4)"
|
2025-04-28 17:33:10 +08:00
|
|
|
|
:class="cardsumit.op.index[1]===index?`arrayindex-one-target`:`arrayindex-one`"
|
|
|
|
|
@click="cardsumit.op.index[1]=index">
|
2025-04-16 17:32:42 +08:00
|
|
|
|
{{item.title}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="shu-container-left" v-show="clickstauts===1">
|
|
|
|
|
<view class="shu-container-left-gun"></view>
|
|
|
|
|
<view class="shu-container-left-font">服务指令</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="secondarrayindex" v-show="clickstauts===1">
|
|
|
|
|
<view v-for="(item,index) in secondopenValue" :key="index">
|
|
|
|
|
<view style="position: relative;box-shadow: 10rpx 10rpx 20rpx rgba(105, 129, 178, 0.4)"
|
|
|
|
|
:class="cardsumit.op.index[2]===index?`arrayindex-one-target`:`arrayindex-one`"
|
|
|
|
|
@click="clickOp(index,item)">
|
|
|
|
|
<image class="ri-img" v-show="item.cycleType ==='日常护理'"
|
|
|
|
|
:src="cardsumit.op.index[2]!==index? `/static/index/ridark.png`:`/static/index/ri.png`" />
|
|
|
|
|
<image class="ri-img" v-show="item.cycleType ==='周期护理'"
|
|
|
|
|
:src="cardsumit.op.index[2]==index? `/static/index/zhoudark.png`:`/static/index/zhou.png`" />
|
|
|
|
|
<image class="ri-img" v-show="item.cycleType ==='即时护理'"
|
|
|
|
|
:src="cardsumit.op.index[2]==index? `/static/index/jidark.png`:`/static/index/ji.png`" />
|
|
|
|
|
{{ item.relName }}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-04-17 17:18:37 +08:00
|
|
|
|
<view class="shu-container-left" v-show="clickstauts===2">
|
|
|
|
|
<view class="shu-container-left-gun"></view>
|
|
|
|
|
<view class="shu-container-left-font">周期类型</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="radio-father" v-show="clickstauts===2">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<view :class="isweek?`radio-circle-target`: `radio-circle`" @click="clickWeek"></view>
|
|
|
|
|
<view :class="isweek&&selectType? `radio-font-target` : `radio-font`" @click="clickWeek">每周
|
|
|
|
|
</view>
|
|
|
|
|
<view :class="!isweek?`radio-circle-target`: `radio-circle`" @click="clickMonth"></view>
|
|
|
|
|
<view :class="!isweek&&selectType? `radio-font-target` : `radio-font`" @click="clickMonth">每月
|
|
|
|
|
</view>
|
2025-04-17 17:18:37 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="week-father" v-show="isweek&&clickstauts===2">
|
|
|
|
|
<view v-for="(item,index) in weekDays" :key="index">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<view :class="cardsumit.weekTimeNumber===index?`week-one-target`:`week-one`"
|
|
|
|
|
@click="cardsumit.weekTime=item;cardsumit.weekTimeNumber=index;selectType=false">
|
2025-04-17 17:18:37 +08:00
|
|
|
|
{{item}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="month-father" v-show="!isweek&&clickstauts===2">
|
|
|
|
|
<view v-for="(item,index) in days" :key="index">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<view :class="cardsumit.monthTimeNumber===index?`month-one-target`:`month-one`"
|
|
|
|
|
@click="cardsumit.monthTime=item;cardsumit.monthTimeNumber=index;selectType=false">
|
2025-04-17 17:18:37 +08:00
|
|
|
|
{{item}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 删除表格的的弹出层 -->
|
|
|
|
|
<view v-show="deleteisopen" class="popup-delete" @click="deleteisopen=false">
|
2025-04-17 17:18:37 +08:00
|
|
|
|
<view class="popup-delete-content" style="padding-top: 30rpx;" :style="{ opacity: deleteisopacity ? 1 : 0 }"
|
|
|
|
|
@click.stop>
|
2025-04-16 17:32:42 +08:00
|
|
|
|
<image class="popup-delete-img" src="/static/index/deleteicon.png" />
|
2025-04-17 17:18:37 +08:00
|
|
|
|
<view style="margin-top: 30rpx;" class="popup-delete-text">
|
2025-04-16 17:32:42 +08:00
|
|
|
|
确定要删除 {{deletename}} 吗?
|
|
|
|
|
</view>
|
2025-04-17 17:18:37 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 替换表格的的弹出层 -->
|
|
|
|
|
<view v-show="replacementisopen" class="popup-delete" @click="replacementisopen=false">
|
2025-04-28 17:33:10 +08:00
|
|
|
|
<view class="popup-delete-content" style="padding-top: 30rpx;"
|
|
|
|
|
:style="{ opacity: replacementisopacity ? 1 : 0 }" @click.stop>
|
2025-04-17 17:18:37 +08:00
|
|
|
|
<image class="popup-delete-img" src="/static/index/deleteicon.png" />
|
|
|
|
|
<view style="margin-top: 30rpx;" class="popup-delete-text">
|
|
|
|
|
该单元格已有服务指令,是否替换旧服务指令
|
2025-04-16 17:32:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 删除下方菜单的的弹出层 -->
|
|
|
|
|
<view v-show="deletedownisopen" class="popup-delete" @click="deletedownisopen=false">
|
|
|
|
|
<view class="popup-delete-content" :style="{ opacity: deletedownisopacity ? 1 : 0 }" @click.stop>
|
|
|
|
|
<image class="popup-delete-img" src="/static/index/deleteicon.png" />
|
|
|
|
|
<view class="popup-delete-text">
|
|
|
|
|
确定要删除 {{deletename}} 吗?
|
|
|
|
|
</view>
|
|
|
|
|
<view class="popup-delete-button">
|
|
|
|
|
<view class="popup-delete-button-right" @click="deletedownisopen=false">
|
|
|
|
|
取消
|
|
|
|
|
</view>
|
|
|
|
|
<view class="popup-delete-button-left"
|
|
|
|
|
@click="bottomItems.splice(deletebottomindex, 1);deletedownisopen=false">
|
|
|
|
|
确定
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 分享的弹出层 -->
|
|
|
|
|
<view v-show="shareShow" class="popup-share" @click="shareShow=false">
|
|
|
|
|
<view class="popup-share-content" :style="{ opacity: deletedownisopacity ? 1 : 0 }" @click.stop>
|
|
|
|
|
<view class="popup-share-title">
|
|
|
|
|
护理日程分享
|
|
|
|
|
<image class="popup-share-img" src="/static/index/NU.png" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="popup-share-upcontent">
|
|
|
|
|
<view class="popup-share-font">久泰护理日程分享测试</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view class="popup-share-gray"></view>
|
|
|
|
|
<view class="popup-share-downcontent">
|
|
|
|
|
<view class="popup-share-downcontent-left">
|
|
|
|
|
<image class="popup-downcontent-img" src="/static/index/NU.png" />
|
|
|
|
|
<view class="popup-downcontent-font">久泰护理</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="popup-share-downcontent-button" @click="clickshare">
|
|
|
|
|
分享
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, defineEmits, watch } from 'vue';
|
|
|
|
|
import { onShow, onHide } from '@dcloudio/uni-app';
|
|
|
|
|
import type { roomBtttonType } from "./index";
|
|
|
|
|
import { getServiceTree, getNclist, addBatch } from "./api.js";
|
|
|
|
|
import index from '../../request';
|
|
|
|
|
import { myArray } from './yaoshandiao.js';
|
|
|
|
|
import joystick from '@/component/public/game/joystick.vue';
|
2025-04-28 17:33:10 +08:00
|
|
|
|
import joysticknew from '@/component/public/game/joysticknew.vue';
|
2025-04-16 17:32:42 +08:00
|
|
|
|
import skill from '@/component/public/game/skill.vue';
|
|
|
|
|
import skilladd from '@/component/public/game/skilladd.vue'
|
2025-04-17 17:18:37 +08:00
|
|
|
|
import skillmove from '@/component/public/game/skilmove.vue'
|
|
|
|
|
import skilmovedelete from '@/component/public/game/skilmovedelete.vue'
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// import ceshi from '@/component/public/game/ceshi.vue'
|
2025-04-16 17:32:42 +08:00
|
|
|
|
const props = defineProps({
|
|
|
|
|
isshow: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
darkFans: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
canmove: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
liang: {
|
|
|
|
|
type: Object,
|
2025-04-28 17:33:10 +08:00
|
|
|
|
},
|
|
|
|
|
isold:{
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: true,
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
watch(
|
|
|
|
|
() => props.canmove,
|
|
|
|
|
() => {
|
|
|
|
|
bottomisShaking.value = false;
|
|
|
|
|
})
|
2025-04-28 17:33:10 +08:00
|
|
|
|
watch(
|
|
|
|
|
() => props.isold,
|
|
|
|
|
() => {
|
|
|
|
|
if(props.isold){
|
|
|
|
|
cardLeft.value = 1;
|
|
|
|
|
scrollTop.value = 1;
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
scrollTop.value = 0;
|
|
|
|
|
cardLeft.value = saveleft.value * 113;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-04-16 17:32:42 +08:00
|
|
|
|
watch(
|
|
|
|
|
() => props.isshow,
|
|
|
|
|
() => {
|
|
|
|
|
bottomisShaking.value = false
|
|
|
|
|
shakyTable.value = false
|
|
|
|
|
})
|
|
|
|
|
const bottomItems = ref([
|
|
|
|
|
{
|
|
|
|
|
name: '纸尿裤',
|
|
|
|
|
url: "/static/index/niao.png"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '呕吐',
|
|
|
|
|
url: "/static/index/tu.png"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '吸痰',
|
|
|
|
|
url: "/static/index/ou.png"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '大便',
|
|
|
|
|
url: "/static/index/baba.png"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
])
|
|
|
|
|
const timeArray = [
|
|
|
|
|
`00`, `05`, `10`, `15`, `20`, `25`, `30`, `35`, `40`, `45`, `50`, `55`
|
|
|
|
|
];
|
|
|
|
|
const weekDays = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"];
|
|
|
|
|
const days = Array.from({ length: 31 }, (_, i) => (i + 1).toString().padStart(2, "0"));
|
|
|
|
|
const isweek = ref(true);
|
|
|
|
|
//弹窗
|
|
|
|
|
// const containerRef = ref(null);
|
|
|
|
|
const scrollLeft = ref(0);
|
2025-04-28 17:33:10 +08:00
|
|
|
|
const cardLeft = ref(678);
|
2025-04-16 17:32:42 +08:00
|
|
|
|
//移动表格
|
|
|
|
|
const scrollTop = ref(0)
|
|
|
|
|
//左下的数组
|
|
|
|
|
const downList = ref<any>()
|
|
|
|
|
//左下的数组
|
|
|
|
|
const rightList = ref<String[]>([
|
|
|
|
|
// "三分段",
|
|
|
|
|
// "四分段",
|
|
|
|
|
])
|
|
|
|
|
const bigArray = ref([]);
|
|
|
|
|
const isopen = ref(false)
|
|
|
|
|
const songisopen = ref(false)
|
|
|
|
|
const isopacity = ref(false)
|
|
|
|
|
const songisopacity = ref(false)
|
|
|
|
|
// 删除表格弹窗
|
|
|
|
|
const deleteisopen = ref(false);
|
|
|
|
|
const deletename = ref("")
|
|
|
|
|
const deleteisopacity = ref(false)
|
2025-04-17 17:18:37 +08:00
|
|
|
|
// 替换表格弹窗
|
|
|
|
|
const replacementisopen = ref(false);
|
|
|
|
|
const replacementname = ref("")
|
|
|
|
|
const replacementisopacity = ref(false)
|
2025-04-16 17:32:42 +08:00
|
|
|
|
//第几套表格
|
2025-04-28 17:33:10 +08:00
|
|
|
|
const currentNumber = ref(0);
|
2025-04-16 17:32:42 +08:00
|
|
|
|
const scrollKey = ref(0);
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// const updo = ref(0);
|
|
|
|
|
// const rightdo = ref(0);
|
|
|
|
|
// const leftdo = ref(0);
|
|
|
|
|
// const downdo = ref(0);
|
|
|
|
|
const saveleft = ref(6);
|
|
|
|
|
const saveright = ref(13);
|
|
|
|
|
const savetop = ref(0);
|
|
|
|
|
const savebottom = ref(3);
|
2025-04-17 17:18:37 +08:00
|
|
|
|
const isMove = ref(false);
|
|
|
|
|
// 替换新的
|
2025-04-28 17:33:10 +08:00
|
|
|
|
const getNew = () => {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
let object = JSON.parse(JSON.stringify(timearr.value[flyNumber.value.index0].children[flyNumber.value.index1]))
|
2025-04-28 17:33:10 +08:00
|
|
|
|
indexsave.value = [saveEditIndex.value.index0, saveEditIndex.value.index1]
|
2025-04-17 17:18:37 +08:00
|
|
|
|
// 旧的typeName保存了
|
|
|
|
|
let typeName = timearr.value[flyNumber.value.index0].children[flyNumber.value.index1].typeName
|
|
|
|
|
timearr.value[flyNumber.value.index0].children[flyNumber.value.index1] = { directiveName: '', typeName: typeName }
|
|
|
|
|
//然后保存新的
|
|
|
|
|
let newtypeName = timearr.value[indexsave.value[0]].children[indexsave.value[1]].typeName
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]] = object
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].typeName = newtypeName
|
|
|
|
|
let startTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime;
|
|
|
|
|
let endTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime;
|
|
|
|
|
let positioning = timearr.value[indexsave.value[0]].positioning
|
|
|
|
|
const rest = startTime.split(":")[1]; // ":20"
|
|
|
|
|
const rest0 = endTime.split(":")[1];; // ":20"
|
|
|
|
|
let many = Number(rest0) - Number(rest);
|
|
|
|
|
let start = newtypeName
|
|
|
|
|
let end = Number(start) + many
|
|
|
|
|
// 用 positioning 替换原来的小时部分
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime = positioning + ":" + start.padStart(2, '0'); // "9:20"
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime = positioning + ":" + String(end % 60).padStart(2, '0'); // "9:20"
|
|
|
|
|
flyNumber.value.index0 = -1;
|
|
|
|
|
flyNumber.value.index1 = -1;
|
|
|
|
|
isMove.value = false;
|
|
|
|
|
isHave()
|
|
|
|
|
}
|
|
|
|
|
const changecard = (type : number) => {
|
|
|
|
|
//1是删除,0是移动
|
|
|
|
|
if (isMove.value) {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (replacementisopen.value) {
|
|
|
|
|
if (type) {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
flyNumber.value.index0 = -1;
|
|
|
|
|
flyNumber.value.index1 = -1;
|
|
|
|
|
isMove.value = false;
|
2025-04-28 17:33:10 +08:00
|
|
|
|
} else {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
getNew()
|
2025-04-28 17:33:10 +08:00
|
|
|
|
|
2025-04-17 17:18:37 +08:00
|
|
|
|
}
|
|
|
|
|
replacementisopen.value = false;
|
2025-04-28 17:33:10 +08:00
|
|
|
|
} else {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
if (type) {
|
|
|
|
|
flyNumber.value.index0 = -1;
|
|
|
|
|
flyNumber.value.index1 = -1;
|
|
|
|
|
isMove.value = false
|
|
|
|
|
} else {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].directiveName) {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
replacementisopacity.value = false;
|
|
|
|
|
replacementisopen.value = true;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
replacementisopacity.value = true
|
|
|
|
|
}, 100)
|
2025-04-28 17:33:10 +08:00
|
|
|
|
} else {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
getNew()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (type) {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
deleteItems(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
|
2025-04-17 17:18:37 +08:00
|
|
|
|
} else {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
flyNumber.value.index0 = saveEditIndex.value.index0;
|
2025-04-17 17:18:37 +08:00
|
|
|
|
flyNumber.value.index1 = saveEditIndex.value.index1;
|
|
|
|
|
isMove.value = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
const openAdd = (index : number) => {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
selectType.value = true;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
cardsumit.value = {
|
|
|
|
|
op: {
|
|
|
|
|
name: "",
|
|
|
|
|
index: [-1, -1, -1],
|
|
|
|
|
},
|
|
|
|
|
startTime: "",
|
2025-04-17 17:18:37 +08:00
|
|
|
|
monthTimeNumber: -1,
|
2025-04-16 17:32:42 +08:00
|
|
|
|
monthTime: "",
|
2025-04-17 17:18:37 +08:00
|
|
|
|
weekTime: "",
|
|
|
|
|
weekTimeNumber: -1,
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
//虚化的动画
|
|
|
|
|
songisopen.value = true;
|
2025-04-28 17:33:10 +08:00
|
|
|
|
songisopacity.value = false;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
songisopacity.value = true
|
|
|
|
|
}, 100)
|
|
|
|
|
// 存储 两个index
|
|
|
|
|
cardsumit.value.op.index[0] = index
|
|
|
|
|
cardsumit.value.op.index[1] = 0
|
|
|
|
|
// 存储时间和二级数组
|
2025-04-28 17:33:10 +08:00
|
|
|
|
openValue.value.time = timearr.value[saveEditIndex.value.index0].positioning;
|
|
|
|
|
openValue.value.minute = timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].typeName
|
2025-04-16 17:32:42 +08:00
|
|
|
|
openValue.value.array = bigArray.value[index].children;
|
|
|
|
|
//存储选中表格的坐标
|
2025-04-28 17:33:10 +08:00
|
|
|
|
indexsave.value = [saveEditIndex.value.index0, saveEditIndex.value.index1]
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
function dosomesave() {
|
|
|
|
|
cardsumit.value.op.name = secondopenValue.value[cardsumit.value.op.index[2]].relName
|
|
|
|
|
switch (secondopenValue.value[cardsumit.value.op.index[2]].cycleType) {
|
|
|
|
|
case `日常护理`:
|
|
|
|
|
openOp.value = 0
|
|
|
|
|
break;
|
|
|
|
|
case `周期护理`:
|
|
|
|
|
openOp.value = 1
|
|
|
|
|
break;
|
|
|
|
|
case `即时护理`:
|
|
|
|
|
openOp.value = 2
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-17 17:18:37 +08:00
|
|
|
|
const selectType = ref(true);
|
|
|
|
|
const deleteButton = ref(false);
|
2025-04-16 17:32:42 +08:00
|
|
|
|
// 给摇杆用的
|
2025-04-17 17:18:37 +08:00
|
|
|
|
//看完迷糊不,我都迷糊了
|
|
|
|
|
//0上1右2下3左
|
|
|
|
|
// songisopen.value是弹窗打没打开
|
|
|
|
|
// clickstauts.value是弹窗的第几步
|
|
|
|
|
// selectType.value是选择周和月的状态
|
2025-04-16 17:32:42 +08:00
|
|
|
|
const movecard = (where : number) => {
|
|
|
|
|
if (songisopen.value) {
|
|
|
|
|
if (!clickstauts.value) {
|
|
|
|
|
switch (where) {
|
|
|
|
|
case 0:
|
2025-04-17 17:18:37 +08:00
|
|
|
|
if (cardsumit.value.op.index[1] > 3) {
|
|
|
|
|
cardsumit.value.op.index[1] = cardsumit.value.op.index[1] - 4
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
if (openValue.value.array.length - 1 == cardsumit.value.op.index[1]) {
|
|
|
|
|
cardsumit.value.op.index[1] = 0;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.op.index[1]++;
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
2025-04-17 17:18:37 +08:00
|
|
|
|
if (openValue.value.array.length > cardsumit.value.op.index[1] + 4) {
|
|
|
|
|
cardsumit.value.op.index[1] = cardsumit.value.op.index[1] + 4
|
2025-04-16 17:32:42 +08:00
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.op.index[1] = openValue.value.array.length - 1
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
if (cardsumit.value.op.index[1]) {
|
|
|
|
|
cardsumit.value.op.index[1]--;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.op.index[1] = openValue.value.array.length - 1
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
} else if (clickstauts.value === 1) {
|
|
|
|
|
switch (where) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (cardsumit.value.op.index[2] > 2) {
|
|
|
|
|
cardsumit.value.op.index[2] = cardsumit.value.op.index[2] - 3
|
|
|
|
|
dosomesave()
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
if (secondopenValue.value.length - 1 == cardsumit.value.op.index[2]) {
|
|
|
|
|
cardsumit.value.op.index[2] = 0;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.op.index[2]++;
|
|
|
|
|
}
|
|
|
|
|
dosomesave()
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
if (secondopenValue.value.length > cardsumit.value.op.index[2] + 3) {
|
|
|
|
|
cardsumit.value.op.index[2] = cardsumit.value.op.index[2] + 3
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.op.index[2] = secondopenValue.value.length - 1
|
|
|
|
|
}
|
|
|
|
|
dosomesave()
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
if (cardsumit.value.op.index[2]) {
|
|
|
|
|
cardsumit.value.op.index[2]--;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.op.index[2] = secondopenValue.value.length - 1
|
|
|
|
|
}
|
|
|
|
|
dosomesave()
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-17 17:18:37 +08:00
|
|
|
|
} else if (clickstauts.value === 2) {
|
|
|
|
|
if (selectType.value) {
|
|
|
|
|
if (where === 1 || where === 3) {
|
|
|
|
|
isweek.value = !isweek.value
|
|
|
|
|
if (isweek.value) {
|
|
|
|
|
cardsumit.value.monthTime = '';
|
|
|
|
|
cardsumit.value.monthTimeNumber = -1;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.weekTime = '';
|
|
|
|
|
cardsumit.value.weekTimeNumber = -1;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
2025-04-17 17:18:37 +08:00
|
|
|
|
} else if (where === 2) {
|
2025-04-16 17:32:42 +08:00
|
|
|
|
|
2025-04-17 17:18:37 +08:00
|
|
|
|
if (isweek.value) {
|
|
|
|
|
cardsumit.value.weekTime = '周一';
|
|
|
|
|
cardsumit.value.weekTimeNumber = 0
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.monthTime = '01';
|
|
|
|
|
cardsumit.value.monthTimeNumber = 0
|
|
|
|
|
}
|
|
|
|
|
selectType.value = false;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
2025-04-17 17:18:37 +08:00
|
|
|
|
} else {
|
|
|
|
|
if (isweek.value) {
|
|
|
|
|
switch (where) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (cardsumit.value.weekTimeNumber > 4) {
|
|
|
|
|
cardsumit.value.weekTimeNumber = cardsumit.value.weekTimeNumber - 5;
|
|
|
|
|
cardsumit.value.weekTime = weekDays[cardsumit.value.weekTimeNumber]
|
|
|
|
|
} else {
|
|
|
|
|
selectType.value = true;
|
|
|
|
|
cardsumit.value.weekTime = ""
|
|
|
|
|
cardsumit.value.weekTimeNumber = -1
|
|
|
|
|
}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
|
2025-04-17 17:18:37 +08:00
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
if (weekDays.length - 1 == cardsumit.value.weekTimeNumber) {
|
|
|
|
|
cardsumit.value.weekTimeNumber = 0;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.weekTimeNumber++;
|
|
|
|
|
}
|
|
|
|
|
cardsumit.value.weekTime = weekDays[cardsumit.value.weekTimeNumber]
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
if (weekDays.length > cardsumit.value.weekTimeNumber + 5) {
|
|
|
|
|
cardsumit.value.weekTimeNumber = cardsumit.value.weekTimeNumber + 5
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.weekTimeNumber = weekDays.length - 1
|
|
|
|
|
}
|
|
|
|
|
cardsumit.value.weekTime = weekDays[cardsumit.value.weekTimeNumber]
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
if (cardsumit.value.weekTimeNumber) {
|
|
|
|
|
cardsumit.value.weekTimeNumber--;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.weekTimeNumber = weekDays.length - 1
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
} else {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
switch (where) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (cardsumit.value.monthTimeNumber > 11) {
|
|
|
|
|
cardsumit.value.monthTimeNumber = cardsumit.value.monthTimeNumber - 12;
|
|
|
|
|
cardsumit.value.monthTime = days[cardsumit.value.monthTimeNumber]
|
|
|
|
|
} else {
|
|
|
|
|
selectType.value = true;
|
|
|
|
|
cardsumit.value.monthTime = ""
|
|
|
|
|
cardsumit.value.monthTimeNumber = -1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
if (days.length - 1 == cardsumit.value.monthTimeNumber) {
|
|
|
|
|
cardsumit.value.monthTimeNumber = 0;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.monthTimeNumber++;
|
|
|
|
|
}
|
|
|
|
|
cardsumit.value.monthTime = days[cardsumit.value.monthTimeNumber]
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
if (days.length > cardsumit.value.monthTimeNumber + 12) {
|
|
|
|
|
cardsumit.value.monthTimeNumber = cardsumit.value.monthTimeNumber + 12
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.monthTimeNumber = days.length - 1
|
|
|
|
|
}
|
|
|
|
|
cardsumit.value.monthTime = days[cardsumit.value.monthTimeNumber]
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
if (cardsumit.value.monthTimeNumber) {
|
|
|
|
|
cardsumit.value.monthTimeNumber--;
|
|
|
|
|
} else {
|
|
|
|
|
cardsumit.value.monthTimeNumber = days.length - 1
|
|
|
|
|
}
|
|
|
|
|
break
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-17 17:18:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (deleteisopen.value) {
|
|
|
|
|
deleteButton.value = !deleteButton.value
|
|
|
|
|
} else {
|
|
|
|
|
switch (where) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (saveEditIndex.value.index1) {
|
|
|
|
|
saveEditIndex.value.index1--
|
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (saveEditIndex.value.index1 < savetop.value) {
|
|
|
|
|
savetop.value = saveEditIndex.value.index1;
|
|
|
|
|
savebottom.value = saveEditIndex.value.index1 + 3
|
|
|
|
|
scrollTop.value = saveEditIndex.value.index1 * 104.5;
|
2025-04-17 17:18:37 +08:00
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// downdo.value = 2
|
|
|
|
|
// if (updo.value) {
|
|
|
|
|
// updo.value--
|
|
|
|
|
// } else {
|
|
|
|
|
// if (saveEditIndex.value.index1 < 12) {
|
|
|
|
|
// scrollTop.value = (saveEditIndex.value.index1) * 104.5
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
2025-04-17 17:18:37 +08:00
|
|
|
|
isHave()
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (saveEditIndex.value.index0 == 23) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-04-17 17:18:37 +08:00
|
|
|
|
saveEditIndex.value.index0++
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (saveEditIndex.value.index0 > saveright.value) {
|
|
|
|
|
saveleft.value = saveEditIndex.value.index0 - 7;
|
|
|
|
|
saveright.value = saveEditIndex.value.index0
|
|
|
|
|
cardLeft.value = saveleft.value * 113;
|
2025-04-17 17:18:37 +08:00
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// rightdo.value = 6
|
|
|
|
|
// if (leftdo.value) {
|
|
|
|
|
// leftdo.value--
|
|
|
|
|
// if (saveEditIndex.value.index0 > saveright.value && saveright.value != -1) {
|
|
|
|
|
// cardLeft.value = (saveEditIndex.value.index0 - 7) * 113;
|
|
|
|
|
// console.log("222",saveEditIndex.value.index0,saveright.value)
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (saveEditIndex.value.index0 > 1) {
|
|
|
|
|
// cardLeft.value = (saveEditIndex.value.index0 - 7) * 113
|
|
|
|
|
// saveleft.value = saveEditIndex.value.index0 - 7;
|
|
|
|
|
// saveright.value = saveEditIndex.value.index0
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// saveEditIndex.value.index0++
|
|
|
|
|
// if (saveEditIndex.value.index0 > 7) {
|
|
|
|
|
// if (currentNumber.value == 2) {
|
|
|
|
|
// currentNumber.value = 0
|
|
|
|
|
// } else {
|
|
|
|
|
// currentNumber.value++
|
|
|
|
|
// }
|
|
|
|
|
// // currentNumber.value++
|
|
|
|
|
// saveEditIndex.value.index0 = 0;
|
|
|
|
|
// }
|
2025-04-17 17:18:37 +08:00
|
|
|
|
isHave()
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
if (saveEditIndex.value.index1 == 11) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
saveEditIndex.value.index1++
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (saveEditIndex.value.index1 > savebottom.value) {
|
|
|
|
|
savetop.value = saveEditIndex.value.index1 - 3;
|
|
|
|
|
savebottom.value = saveEditIndex.value.index1;
|
|
|
|
|
scrollTop.value = savetop.value * 104.5;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// updo.value = 2
|
|
|
|
|
// if (downdo.value) {
|
|
|
|
|
// downdo.value--
|
|
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
// if (saveEditIndex.value.index1 > 1) {
|
|
|
|
|
// scrollTop.value = (saveEditIndex.value.index1 - 3) * 104.5
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2025-04-17 17:18:37 +08:00
|
|
|
|
isHave()
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// saveEditIndex.value.index0--
|
|
|
|
|
// if (saveEditIndex.value.index0 < 0) {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// if (currentNumber.value) {
|
|
|
|
|
// currentNumber.value--
|
|
|
|
|
// } else {
|
|
|
|
|
// currentNumber.value = 2
|
|
|
|
|
// }
|
|
|
|
|
// saveEditIndex.value.index0 = 7;
|
|
|
|
|
// }
|
|
|
|
|
// if (saveEditIndex.value.index1) {
|
|
|
|
|
// saveEditIndex.value.index1--
|
|
|
|
|
// }
|
|
|
|
|
if (saveEditIndex.value.index0 == 0) {
|
|
|
|
|
return
|
2025-04-17 17:18:37 +08:00
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
saveEditIndex.value.index0--
|
|
|
|
|
if (saveEditIndex.value.index0 < saveleft.value) {
|
|
|
|
|
saveleft.value = saveEditIndex.value.index0;
|
|
|
|
|
saveright.value = saveEditIndex.value.index0 + 7;
|
|
|
|
|
cardLeft.value = saveleft.value * 113;
|
|
|
|
|
}
|
|
|
|
|
// leftdo.value = 6
|
|
|
|
|
// if (rightdo.value) {
|
|
|
|
|
// rightdo.value--
|
|
|
|
|
// if (saveEditIndex.value.index0 < saveleft.value && saveleft.value != -1) {
|
|
|
|
|
// cardLeft.value = (saveEditIndex.value.index0) * 113
|
|
|
|
|
// console.log("111",saveEditIndex.value.index0,saveleft.value)
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (saveEditIndex.value.index0 < 23) {
|
|
|
|
|
// // scrollTop.value = (saveEditIndex.value.index1) * 104.5
|
|
|
|
|
// cardLeft.value = (saveEditIndex.value.index0) * 113;
|
|
|
|
|
// saveleft.value = saveEditIndex.value.index0;
|
|
|
|
|
// saveright.value = saveEditIndex.value.index0 + 7
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
2025-04-17 17:18:37 +08:00
|
|
|
|
isHave()
|
|
|
|
|
break
|
|
|
|
|
}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
}
|
|
|
|
|
const clickWeek = () => {
|
|
|
|
|
selectType.value = true;
|
|
|
|
|
isweek.value = true;
|
|
|
|
|
cardsumit.value.monthTime = '';
|
|
|
|
|
cardsumit.value.monthTimeNumber = -1;
|
|
|
|
|
}
|
|
|
|
|
const clickMonth = () => {
|
|
|
|
|
selectType.value = true;
|
|
|
|
|
isweek.value = false;
|
|
|
|
|
cardsumit.value.weekTime = '';
|
|
|
|
|
cardsumit.value.weekTimeNumber = -1;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
2025-04-17 17:18:37 +08:00
|
|
|
|
const haveName = ref(false);
|
|
|
|
|
const isHave = () => {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].directiveName) {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
haveName.value = true;
|
|
|
|
|
} else {
|
|
|
|
|
haveName.value = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const clickdelete = (type : number) => {
|
|
|
|
|
if (type) {
|
|
|
|
|
deleteisopen.value = false;
|
|
|
|
|
deleteButton.value = false;
|
|
|
|
|
} else {
|
|
|
|
|
deleteRuler(deleteindex.value[0], deleteindex.value[1]);
|
|
|
|
|
isHave()
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
// 给抖动用的
|
|
|
|
|
function pseudoRandom(index0, index1) {
|
|
|
|
|
const seed = index0 * 55.9898 + index1 * 78.233;
|
|
|
|
|
// 产生一个伪随机数,取小数部分
|
|
|
|
|
return Math.abs(Math.sin(seed) * 43758.5453) % 1;
|
|
|
|
|
}
|
|
|
|
|
function computeDelay(index0, index1) {
|
|
|
|
|
const range = 2; // 延迟范围 0 ~ 2 秒
|
|
|
|
|
return pseudoRandom(index0, index1) * range;
|
|
|
|
|
}
|
|
|
|
|
// 在作用域中声明一个定时器变量
|
|
|
|
|
let throttleTimer = null;
|
|
|
|
|
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// const changecurrentNumber = (event : any) => {
|
|
|
|
|
// // 进行你想要的操作
|
|
|
|
|
// currentNumber.value = event.detail.current;
|
|
|
|
|
// nextTick(() => {
|
|
|
|
|
// scrollTop.value = moveDownNumber.value;
|
|
|
|
|
// });
|
|
|
|
|
// };
|
2025-04-16 17:32:42 +08:00
|
|
|
|
//监听拖拽
|
|
|
|
|
const dragOffset = ref(0);
|
|
|
|
|
const moveDownNumber = ref(0)
|
|
|
|
|
function handleScrolltime(e) {
|
|
|
|
|
let num = e.detail.scrollTop
|
|
|
|
|
let formattedNum = parseFloat(num.toFixed(2));
|
|
|
|
|
moveDownNumber.value = formattedNum
|
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
function handleTop(e) {
|
|
|
|
|
// console.log(e.detail.scrollLeft)
|
|
|
|
|
// if(e.detail.scrollLeft>7000){
|
|
|
|
|
// cardLeft.value = 0;
|
|
|
|
|
|
|
|
|
|
// }else if(e.detail.scrollLeft<1000){
|
|
|
|
|
// // cardLeft.value = 7234;
|
|
|
|
|
// cardLeft.value = 7000;
|
|
|
|
|
// }
|
|
|
|
|
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
|
|
|
|
|
const changeBug = ref(true);
|
|
|
|
|
// const nextItems = () => {
|
|
|
|
|
// if (!isEdit.value) {
|
|
|
|
|
// if (currentNumber.value) {
|
|
|
|
|
// currentNumber.value--
|
|
|
|
|
// } else {
|
|
|
|
|
// currentNumber.value = 2
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2025-04-16 17:32:42 +08:00
|
|
|
|
// 方法:根据条件返回不同的类名
|
|
|
|
|
const getClass = (item, index0, index1) => {
|
2025-04-17 17:18:37 +08:00
|
|
|
|
// if (saveEditIndex.value.index0 == index0 && saveEditIndex.value.index1 == index1) {
|
|
|
|
|
// return 'title-time-border-blue';
|
|
|
|
|
// }
|
2025-04-16 17:32:42 +08:00
|
|
|
|
// else if (!props.canmove && props.liang.index0 === index0 && props.liang.index1 === index1 && (redNameindex0.value.includes(index0 + (currentNumber.value * 6)) || (redNameindex1.value != index1))) {
|
|
|
|
|
// return 'title-time-border-red';
|
|
|
|
|
// }
|
2025-04-17 17:18:37 +08:00
|
|
|
|
// else if (!props.canmove && props.liang.index0 === index0 && props.liang.index1 === index1) {
|
|
|
|
|
// return 'title-time-border-blue';
|
|
|
|
|
// }
|
|
|
|
|
if (item.cycleType === '日常') {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (flyNumber.value.index0 === (index0) && flyNumber.value.index1 === index1) {
|
2025-04-16 17:32:42 +08:00
|
|
|
|
return 'title-time-border-yellow-active-transparent';
|
|
|
|
|
} else if (shakyTable.value) {
|
|
|
|
|
return 'title-time-border-yellow-active';
|
|
|
|
|
} else {
|
|
|
|
|
return 'title-time-border-yellow';
|
|
|
|
|
}
|
|
|
|
|
} else if (item.cycleType) {
|
|
|
|
|
//为啥这么写,是因为动画写行内无效!!!
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (flyNumber.value.index0 === (index0) && flyNumber.value.index1 === index1) {
|
2025-04-16 17:32:42 +08:00
|
|
|
|
return 'title-time-border-pouple-active-transparent';
|
|
|
|
|
}
|
|
|
|
|
else if (shakyTable.value) {
|
|
|
|
|
return 'title-time-border-pouple-active';
|
|
|
|
|
} else {
|
|
|
|
|
return 'title-time-border-pouple';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 'title-time-border';
|
|
|
|
|
}
|
|
|
|
|
// 初始化下面侧单列表
|
|
|
|
|
const doctorsayList = ref<roomBtttonType[]>([
|
|
|
|
|
{ url: '/static/index/doctorsay/light/clean.png', targetUrl: '/static/index/doctorsay/dark/clean.png', name: '清洁' },
|
|
|
|
|
{ url: '/static/index/doctorsay/light/drink.png', targetUrl: '/static/index/doctorsay/dark/drink.png', name: '饮食' },
|
|
|
|
|
{ url: '/static/index/doctorsay/light/bed.png', targetUrl: '/static/index/doctorsay/dark/bed.png', name: '睡眠' },
|
|
|
|
|
{ url: '/static/index/doctorsay/light/shi.png', targetUrl: '/static/index/doctorsay/dark/shi.png', name: '排泻' },
|
|
|
|
|
{ url: '/static/index/doctorsay/light/use.png', targetUrl: '/static/index/doctorsay/dark/use.png', name: '日常' },
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
// 当前选中的菜单索引
|
|
|
|
|
const upmenuIndex = ref<number>(0);
|
|
|
|
|
const downmenuIndex = ref<number>(999);
|
|
|
|
|
// 暗黑模式
|
|
|
|
|
const underFans = ref<boolean>(false);
|
|
|
|
|
// 当前选中的菜单索引
|
|
|
|
|
const roomTar = ref<number[]>([]);
|
|
|
|
|
const emit = defineEmits(['darkchange', 'savename', 'saveruler', 'closename', 'changefangkuang', 'changeold']);
|
|
|
|
|
const isEdit = ref(false);
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// const isLunpan = ref(false);
|
2025-04-16 17:32:42 +08:00
|
|
|
|
const saveEditIndex = ref({
|
|
|
|
|
index0: -1,
|
|
|
|
|
index1: -1
|
|
|
|
|
})
|
|
|
|
|
const clickstauts = ref(0)
|
|
|
|
|
const secondopenValue = ref([]);
|
|
|
|
|
const clickcircle = (index : number) => {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
if (clickstauts.value === 2 && selectType.value) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-04-16 17:32:42 +08:00
|
|
|
|
if (!index) {
|
|
|
|
|
clickstauts.value++
|
|
|
|
|
} else {
|
|
|
|
|
if (clickstauts.value) {
|
|
|
|
|
clickstauts.value--
|
|
|
|
|
} else {
|
|
|
|
|
songisopen.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (clickstauts.value === 1) {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
|
2025-04-17 17:18:37 +08:00
|
|
|
|
cardsumit.value.op.index[2] = 1
|
2025-04-16 17:32:42 +08:00
|
|
|
|
secondopenValue.value = []
|
|
|
|
|
secondopenValue.value = openValue.value.array[cardsumit.value.op.index[1]].children
|
|
|
|
|
secondopenValue.value.forEach((element : any) => {
|
|
|
|
|
element.relName = element.title + (element.tagName ? element.tagName.split(",").map(item => `(${item})`).join("") : "")
|
|
|
|
|
})
|
|
|
|
|
clickOp(0, secondopenValue.value[0])
|
|
|
|
|
}
|
2025-04-17 17:18:37 +08:00
|
|
|
|
else if (clickstauts.value === 2) {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
|
2025-04-17 17:18:37 +08:00
|
|
|
|
if (openOp.value == 1) {
|
|
|
|
|
cardsumit.value.weekTime = "";
|
|
|
|
|
cardsumit.value.monthTime = "";
|
|
|
|
|
isweek.value = true
|
|
|
|
|
// clickstauts.value =
|
|
|
|
|
} else {
|
|
|
|
|
clickstauts.value = 0
|
|
|
|
|
movetoruler()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (clickstauts.value === 3) {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
|
2025-04-16 17:32:42 +08:00
|
|
|
|
clickstauts.value = 0
|
|
|
|
|
movetoruler()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const openEdit = () => {
|
|
|
|
|
isEdit.value = !isEdit.value;
|
|
|
|
|
if (isEdit.value) {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
saveEditIndex.value.index0 = saveleft.value;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
saveEditIndex.value.index1 = 0;
|
2025-04-28 17:33:10 +08:00
|
|
|
|
cardLeft.value = 1;
|
|
|
|
|
scrollTop.value = 1;
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
scrollTop.value = 0;
|
|
|
|
|
cardLeft.value = saveleft.value * 113;
|
|
|
|
|
})
|
2025-04-17 17:18:37 +08:00
|
|
|
|
isHave()
|
2025-04-16 17:32:42 +08:00
|
|
|
|
} else {
|
|
|
|
|
saveEditIndex.value.index0 = -1;
|
|
|
|
|
saveEditIndex.value.index1 = -1;
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// const openLunpan = () => {
|
|
|
|
|
// isLunpan.value = !isLunpan.value;
|
|
|
|
|
// isEdit.value = false;
|
|
|
|
|
// // nnd必须这样写
|
|
|
|
|
// if (isLunpan.value) {
|
|
|
|
|
// scrollTop.value = 1;
|
|
|
|
|
// nextTick(() => {
|
|
|
|
|
// scrollTop.value = 0;
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// if (isLunpan.value) {
|
|
|
|
|
// saveEditIndex.value.index0 = saveleft.value;
|
|
|
|
|
// saveEditIndex.value.index1 = 0;
|
|
|
|
|
// isHave()
|
|
|
|
|
// } else {
|
|
|
|
|
// saveEditIndex.value.index0 = -1;
|
|
|
|
|
// saveEditIndex.value.index1 = -1;
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
const newchange = (type:number) => {
|
|
|
|
|
emit('changeold', type)
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const timer = ref(null);//计时器
|
|
|
|
|
const elementsInfo = ref({})//所有表格的信息
|
|
|
|
|
const moveX = ref(0)
|
|
|
|
|
const moveY = ref(0)
|
|
|
|
|
const openX = ref(0)
|
|
|
|
|
const openY = ref(0)
|
|
|
|
|
const flyNumber = ref({
|
|
|
|
|
index0: 999,
|
|
|
|
|
index1: 999,
|
|
|
|
|
typeName: ''
|
|
|
|
|
})
|
|
|
|
|
const deletebottomindex = ref(-1);
|
|
|
|
|
const deletedownisopen = ref(false);
|
|
|
|
|
const deletedownisopacity = ref(false);
|
|
|
|
|
const deletebottom = (index : number, name : string) => {
|
|
|
|
|
bottomisShaking.value = false;
|
|
|
|
|
deletebottomindex.value = index;
|
|
|
|
|
shakyTable.value = false;
|
|
|
|
|
deletedownisopacity.value = false;
|
|
|
|
|
deletedownisopen.value = true;
|
|
|
|
|
deletename.value = name;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
deletedownisopacity.value = true
|
|
|
|
|
}, 100)
|
|
|
|
|
}
|
|
|
|
|
const deleteindex = ref([-1, -1])
|
|
|
|
|
const deleteId = ref("");
|
|
|
|
|
const deleteItems = (item : any, index0 : number, index1 : number) => {
|
|
|
|
|
deleteindex.value = [-1, -1];
|
|
|
|
|
shakyTable.value = false;
|
|
|
|
|
bottomisShaking.value = false;
|
|
|
|
|
deleteisopacity.value = false;
|
|
|
|
|
deleteisopen.value = true;
|
2025-04-28 17:33:10 +08:00
|
|
|
|
deleteindex.value = [index0, index1]
|
2025-04-16 17:32:42 +08:00
|
|
|
|
deletename.value = item.directiveName;
|
|
|
|
|
deleteId.value = item.id
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
deleteisopacity.value = true
|
|
|
|
|
}, 100)
|
|
|
|
|
}
|
|
|
|
|
const touchindex1 = ref(-1);
|
|
|
|
|
// 分享矩阵到微信
|
|
|
|
|
const shareShow = ref(false);
|
|
|
|
|
const shareToWeixin = () => {
|
|
|
|
|
|
|
|
|
|
shareShow.value = true;
|
|
|
|
|
deletedownisopacity.value = false;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
deletedownisopacity.value = true
|
|
|
|
|
}, 100)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const clickshare = () => {
|
|
|
|
|
uni.share({
|
|
|
|
|
provider: "weixin",
|
|
|
|
|
scene: "WXSceneSession",
|
|
|
|
|
type: 0,
|
|
|
|
|
href: "http://192.168.2.31:3101/daytoday",
|
|
|
|
|
title: "护理日程分享",
|
|
|
|
|
summary: "九泰护理日程测试",
|
|
|
|
|
imageUrl: "https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
console.log("success:");
|
|
|
|
|
},
|
|
|
|
|
fail: function (err) {
|
|
|
|
|
console.log("fail:");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//表格点击开始
|
|
|
|
|
const rulerTouchClick = (item : any, index0 : number, index1 : number, e : any) => {
|
|
|
|
|
if (item.directiveName) {
|
|
|
|
|
touchindex1.value = index1;
|
|
|
|
|
const query = uni.createSelectorQuery()
|
|
|
|
|
query
|
|
|
|
|
.selectAll('.super-card-time-card')
|
|
|
|
|
.boundingClientRect((data : any) => {
|
|
|
|
|
data.forEach(async (res : any) => {
|
|
|
|
|
// 根据你的条件筛选元素
|
|
|
|
|
if (res.left > 200 && res.left < 1067 && res.top < 570 && res.top > 140 && res.dataset.index0 == index0 && res.dataset.index1 == index1) {
|
|
|
|
|
if (res.left > 200 && res.left < 500) {
|
|
|
|
|
// 表格太靠左侧,修改到右面
|
|
|
|
|
openX.value = Math.floor(res.left) + 520;
|
|
|
|
|
} else {
|
|
|
|
|
openX.value = Math.floor(res.left)
|
|
|
|
|
}
|
|
|
|
|
if (res.top > 140 && res.top < 300) {
|
|
|
|
|
// 表格太靠上侧,修改到下面
|
|
|
|
|
openY.value = Math.floor(res.top) + 250;
|
|
|
|
|
} else {
|
|
|
|
|
openY.value = Math.floor(res.top)
|
|
|
|
|
}
|
|
|
|
|
// openY.value = Math.floor(res.top);
|
|
|
|
|
await nextTick()
|
|
|
|
|
isopen.value = true;
|
|
|
|
|
isopacity.value = false;
|
|
|
|
|
//加动画
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
isopacity.value = true;
|
|
|
|
|
}, 100)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.exec()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const shakyTable = ref(false);
|
|
|
|
|
const reldata = ref([]);
|
|
|
|
|
//表格长按开始
|
|
|
|
|
const rulerTouchStart = (item : any, index0 : number, index1 : number, e : any) => {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// scrollTop.value = moveDownNumber.value;
|
|
|
|
|
// moveX.value = Math.floor(e.touches[0].pageX);
|
|
|
|
|
// moveY.value = Math.floor(e.touches[0].pageY);
|
|
|
|
|
// timer.value = setTimeout(() => {
|
|
|
|
|
// if (item.directiveName) {
|
|
|
|
|
// flyNumber.value.typeName = item.typeName
|
|
|
|
|
// flyNumber.value.index0 = index0;
|
|
|
|
|
// flyNumber.value.index1 = index1;
|
|
|
|
|
// indexsave.value = [-1, -1]
|
|
|
|
|
// reldata.value = []
|
|
|
|
|
// isTuoing.value = true;
|
|
|
|
|
// const query = uni.createSelectorQuery()
|
|
|
|
|
// query
|
|
|
|
|
// .selectAll('.super-card-time-card')
|
|
|
|
|
// .boundingClientRect((data : any) => {
|
|
|
|
|
// data.forEach(async (res : any) => {
|
|
|
|
|
// // 根据你的条件筛选元素
|
|
|
|
|
// if (res.left > 200 && res.left < 1067 && res.top < 570 && res.top > 140) {
|
|
|
|
|
// shakyTable.value = true;
|
|
|
|
|
// reldata.value.push(res)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// .exec()
|
|
|
|
|
// emit('saveruler', item, reldata.value);
|
|
|
|
|
// }
|
|
|
|
|
// }, 100); // 2秒后触发
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
const rulerTouchMove = (e : any) => {
|
|
|
|
|
const moveXa = Math.floor(e.touches[0].pageX);
|
|
|
|
|
const moveYa = Math.floor(e.touches[0].pageY);
|
|
|
|
|
// 计算移动距离
|
|
|
|
|
if (
|
|
|
|
|
Math.abs(moveXa - moveX.value) > 0 ||
|
|
|
|
|
Math.abs(moveYa - moveY.value) > 0
|
|
|
|
|
) {
|
|
|
|
|
// 移动时取消长按计时器
|
|
|
|
|
if (timer.value) {
|
|
|
|
|
clearTimeout(timer.value);
|
|
|
|
|
timer.value = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//表格长按结束
|
|
|
|
|
const rulerTouchEnd = () => {
|
|
|
|
|
isTuoing.value = false;
|
|
|
|
|
if (timer.value) {
|
|
|
|
|
clearTimeout(timer.value);
|
|
|
|
|
timer.value = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const deleteRuler = (index0 : number, index1 : number) => {
|
|
|
|
|
let typeName = timearr.value[index0].children[index1].typeName
|
|
|
|
|
timearr.value[index0].children[index1] = { directiveName: "", typeName: typeName };
|
|
|
|
|
isopen.value = false;
|
|
|
|
|
deleteisopen.value = false;
|
|
|
|
|
}
|
|
|
|
|
const longPressTimer = ref(null);
|
|
|
|
|
const isScrolling = ref(false)
|
|
|
|
|
//长按计时器
|
|
|
|
|
let scrollTimeout = null
|
|
|
|
|
function handleScroll(e) {
|
|
|
|
|
isScrolling.value = true
|
|
|
|
|
// 清除之前的定时器
|
|
|
|
|
if (scrollTimeout) clearTimeout(scrollTimeout)
|
|
|
|
|
// 设置新的定时器
|
|
|
|
|
scrollTimeout = setTimeout(() => {
|
|
|
|
|
isScrolling.value = false;
|
|
|
|
|
}, 400)
|
|
|
|
|
}
|
|
|
|
|
const isBack = ref(false)
|
|
|
|
|
const saveX = ref(0);
|
|
|
|
|
const saveY = ref(0);
|
|
|
|
|
const isTuoing = ref(false);
|
|
|
|
|
|
|
|
|
|
// 存储菜单的id
|
|
|
|
|
const saveId = ref("");
|
|
|
|
|
const saveTagName = ref("");
|
|
|
|
|
function isblue() {
|
|
|
|
|
if (openOp.value !== -1) {
|
|
|
|
|
return true
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bottomTimer = ref(null);
|
|
|
|
|
const bottomisShaking = ref(false);
|
|
|
|
|
const bottomTouchStart = (e) => {
|
|
|
|
|
saveX.value = Math.floor(e.touches[0].pageX);
|
|
|
|
|
saveY.value = Math.floor(e.touches[0].pageY);
|
|
|
|
|
// 2秒后触发抖动效果
|
|
|
|
|
bottomTimer.value = setTimeout(() => {
|
|
|
|
|
bottomisShaking.value = true
|
|
|
|
|
}, 500)
|
|
|
|
|
}
|
|
|
|
|
const bottomTouchMove = (e) => {
|
|
|
|
|
const moveX = Math.floor(e.touches[0].pageX);
|
|
|
|
|
const moveY = Math.floor(e.touches[0].pageY);
|
|
|
|
|
// 计算移动距离
|
|
|
|
|
if (
|
|
|
|
|
Math.abs(moveX - saveX.value) > 0 ||
|
|
|
|
|
Math.abs(moveY - saveY.value) > 0
|
|
|
|
|
) {
|
|
|
|
|
if (bottomTimer.value) {
|
|
|
|
|
clearTimeout(bottomTimer.value)
|
|
|
|
|
bottomTimer.value = null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const bottomTouchEnd = () => {
|
|
|
|
|
if (bottomTimer.value) {
|
|
|
|
|
clearTimeout(bottomTimer.value)
|
|
|
|
|
bottomTimer.value = null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const openValue = ref({
|
|
|
|
|
time: "",
|
|
|
|
|
minute: "",
|
|
|
|
|
array: []
|
|
|
|
|
})
|
|
|
|
|
const cardsumit = ref({
|
|
|
|
|
op: {
|
|
|
|
|
name: "",
|
|
|
|
|
index: [-1, -1, -1],
|
|
|
|
|
},
|
|
|
|
|
startTime: "",
|
2025-04-17 17:18:37 +08:00
|
|
|
|
weekTimeNumber: -1,
|
|
|
|
|
monthTimeNumber: -1,
|
2025-04-16 17:32:42 +08:00
|
|
|
|
monthTime: "",
|
|
|
|
|
weekTime: ""
|
|
|
|
|
})
|
|
|
|
|
const openOp = ref(0);
|
|
|
|
|
const clickOp = (index : number, item : any) => {
|
|
|
|
|
saveId.value = item.id;
|
|
|
|
|
saveTagName.value = item.tagName
|
2025-04-28 17:33:10 +08:00
|
|
|
|
cardsumit.value.op.index[2] = index
|
|
|
|
|
cardsumit.value.op.name = item.relName
|
|
|
|
|
switch (item.cycleType) {
|
|
|
|
|
case `日常护理`:
|
|
|
|
|
openOp.value = 0
|
|
|
|
|
break;
|
|
|
|
|
case `周期护理`:
|
|
|
|
|
openOp.value = 1
|
|
|
|
|
break;
|
|
|
|
|
case `即时护理`:
|
|
|
|
|
openOp.value = 2
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// if (cardsumit.value.op.index[2] === index) {
|
|
|
|
|
// cardsumit.value.op.index[2] = -1;
|
|
|
|
|
// cardsumit.value.op.name = ""
|
|
|
|
|
// openOp.value = -1
|
|
|
|
|
// } else {
|
|
|
|
|
// cardsumit.value.op.index[2] = index
|
|
|
|
|
// cardsumit.value.op.name = item.relName
|
|
|
|
|
// switch (item.cycleType) {
|
|
|
|
|
// case `日常护理`:
|
|
|
|
|
// openOp.value = 0
|
|
|
|
|
// break;
|
|
|
|
|
// case `周期护理`:
|
|
|
|
|
// openOp.value = 1
|
|
|
|
|
// break;
|
|
|
|
|
// case `即时护理`:
|
|
|
|
|
// openOp.value = 2
|
|
|
|
|
// break;
|
|
|
|
|
// default:
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// const clickweek = (index : string) => {
|
|
|
|
|
// cardsumit.value.weekTime = index
|
|
|
|
|
// }
|
|
|
|
|
// const clickmonth = (index : string) => {
|
|
|
|
|
// cardsumit.value.monthTime = index
|
2025-04-17 17:18:37 +08:00
|
|
|
|
// }
|
2025-04-16 17:32:42 +08:00
|
|
|
|
const indexsave = ref([-1, -1]);
|
|
|
|
|
// (长按表格后)表格拖动结束
|
|
|
|
|
const rulerMoveEnd = (object : any) => {
|
|
|
|
|
if (props.liang.index0 !== 999 && object.cycleType) {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
indexsave.value = [props.liang.index0, props.liang.index1]
|
2025-04-16 17:32:42 +08:00
|
|
|
|
// 旧的typeName保存了
|
|
|
|
|
let typeName = timearr.value[flyNumber.value.index0].children[flyNumber.value.index1].typeName
|
|
|
|
|
timearr.value[flyNumber.value.index0].children[flyNumber.value.index1] = { directiveName: '', typeName: typeName }
|
|
|
|
|
//然后保存新的
|
|
|
|
|
let newtypeName = timearr.value[indexsave.value[0]].children[indexsave.value[1]].typeName
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]] = object
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].typeName = newtypeName
|
|
|
|
|
let startTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime;
|
|
|
|
|
let endTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime;
|
|
|
|
|
let positioning = timearr.value[indexsave.value[0]].positioning
|
|
|
|
|
const rest = startTime.split(":")[1]; // ":20"
|
|
|
|
|
const rest0 = endTime.split(":")[1];; // ":20"
|
|
|
|
|
let many = Number(rest0) - Number(rest);
|
|
|
|
|
let start = newtypeName
|
|
|
|
|
let end = Number(start) + many
|
|
|
|
|
// 用 positioning 替换原来的小时部分
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime = positioning + ":" + start.padStart(2, '0'); // "9:20"
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime = positioning + ":" + String(end % 60).padStart(2, '0'); // "9:20"
|
|
|
|
|
// 检查是否有任意一个对象的 children 数组最后一个对象的 value 有值
|
|
|
|
|
// saveAll()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const scrollContainer = ref(null)
|
|
|
|
|
const movetoruler = async () => {
|
|
|
|
|
//关闭弹窗
|
|
|
|
|
songisopen.value = false;
|
|
|
|
|
// 还原成默认选项
|
|
|
|
|
isweek.value = true;
|
|
|
|
|
let savaIndex = -1;
|
|
|
|
|
//如果是即时指令直接干掉
|
|
|
|
|
if (openOp.value === 2) {
|
2025-04-29 17:00:07 +08:00
|
|
|
|
console.log("????")
|
2025-04-16 17:32:42 +08:00
|
|
|
|
scrollLeft.value = 1;
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
scrollLeft.value = 0;
|
|
|
|
|
bottomItems.value.unshift({
|
|
|
|
|
name: cardsumit.value.op.name,
|
|
|
|
|
url: "/static/index/ou.png",
|
|
|
|
|
target: `#00a8ff`
|
|
|
|
|
})
|
|
|
|
|
// 实现即时指令动画
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
bottomItems.value[0].target = `#fff`;
|
|
|
|
|
}, 1500)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
bottomItems.value[0].target = "";
|
|
|
|
|
}, 3000)
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let cycleType = ""
|
|
|
|
|
//看看是啥指令
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// openOp.value点击最后一项时修改
|
2025-04-16 17:32:42 +08:00
|
|
|
|
if (!openOp.value) {
|
|
|
|
|
cycleType = "日常";
|
|
|
|
|
} else if (openOp.value === 1) {
|
|
|
|
|
cycleType = cardsumit.value.weekTime || (cardsumit.value.monthTime + '号');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const startHour = Number(openValue.value.time)
|
|
|
|
|
const startMinute = Number(openValue.value.minute)
|
|
|
|
|
const endMinute = startMinute + 10
|
|
|
|
|
|
|
|
|
|
const endHour = startHour + Math.floor(endMinute / 60)
|
|
|
|
|
const formattedStart = `${String(startHour)}:${String(startMinute).padStart(2, '0')}`
|
|
|
|
|
const formattedEnd = `${String(endHour)}:${String(endMinute % 60).padStart(2, '0')}`
|
|
|
|
|
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime = formattedStart
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime = formattedEnd
|
|
|
|
|
|
|
|
|
|
let param = {
|
|
|
|
|
directiveId: saveId.value,
|
|
|
|
|
directiveName: cardsumit.value.op.name,
|
|
|
|
|
startTime: formattedStart,
|
|
|
|
|
endTime: formattedEnd,
|
|
|
|
|
positioning: indexsave.value[0].toString(),
|
|
|
|
|
positioningLong: indexsave.value[1].toString(),
|
|
|
|
|
tagName: saveTagName.value,
|
|
|
|
|
cycleType: cycleType,
|
|
|
|
|
nuId: "1",
|
|
|
|
|
customerId: "1",
|
|
|
|
|
id: "",
|
|
|
|
|
typeName: timearr.value[indexsave.value[0]].children[indexsave.value[1]].typeName,
|
|
|
|
|
}
|
|
|
|
|
//给表格赋值
|
|
|
|
|
timearr.value[indexsave.value[0]].children[indexsave.value[1]] = param;
|
2025-04-28 17:33:10 +08:00
|
|
|
|
movecard(1)
|
2025-04-17 17:18:37 +08:00
|
|
|
|
isHave()
|
2025-04-28 17:33:10 +08:00
|
|
|
|
let allArray = [];
|
|
|
|
|
timearr.value.forEach((element : any) => {
|
|
|
|
|
element.children.forEach((res : any) => {
|
|
|
|
|
allArray.push(res)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
saveAll()
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
const saveAll = () => {
|
|
|
|
|
//给后端编译一下
|
|
|
|
|
let postArray = [];
|
|
|
|
|
timearr.value.forEach((element0, index0) => {
|
|
|
|
|
element0.children.forEach((element1, index1) => {
|
|
|
|
|
let saveTypeName = ""
|
|
|
|
|
if (!element1.directiveName && !element1.id) {
|
|
|
|
|
let array = {};
|
|
|
|
|
if (element1.typeName) {
|
|
|
|
|
saveTypeName = element1.typeName
|
|
|
|
|
}
|
|
|
|
|
array = JSON.parse(JSON.stringify(moBan.value))
|
|
|
|
|
saveTypeName ? array.typeName = saveTypeName : ""
|
|
|
|
|
array.positioning = index0
|
|
|
|
|
array.positioningLong = index1
|
|
|
|
|
postArray.push(array)
|
|
|
|
|
} else {
|
|
|
|
|
element1.positioning = index0;
|
|
|
|
|
element1.positioningLong = index1;
|
|
|
|
|
postArray.push(element1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
2025-04-28 17:33:10 +08:00
|
|
|
|
console.log("!!!!!!!!",postArray)
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
const routerPush = () => {
|
|
|
|
|
uni.setStorage({
|
|
|
|
|
key: 'myArray',
|
|
|
|
|
data: timearr.value,
|
|
|
|
|
success: function () {
|
|
|
|
|
uni.navigateTo({
|
2025-04-28 17:33:10 +08:00
|
|
|
|
url: `/pages/timeMatrix/indexnew`
|
2025-04-16 17:32:42 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 暂存器
|
|
|
|
|
const saveRulerTime = ref({
|
|
|
|
|
index0: -1,
|
|
|
|
|
index1: -1
|
|
|
|
|
})
|
|
|
|
|
const targetRuler = ref({
|
|
|
|
|
index0: -1,
|
|
|
|
|
index1: -1,
|
|
|
|
|
current: -1,
|
|
|
|
|
bordershow: true
|
|
|
|
|
})
|
|
|
|
|
const whereEvent = (data : any) => {
|
2025-04-28 17:33:10 +08:00
|
|
|
|
scrollTop.value = 0;
|
|
|
|
|
scrollTop.value = data.index1 * 104;
|
|
|
|
|
cardLeft.value = 0;
|
|
|
|
|
cardLeft.value = data.index0 * 113;
|
2025-04-16 17:32:42 +08:00
|
|
|
|
|
2025-04-28 17:33:10 +08:00
|
|
|
|
targetRuler.value.index0 = data.index0;
|
|
|
|
|
targetRuler.value.index1 = data.index1;
|
|
|
|
|
saveRulerTime.value.index0 = targetRuler.value.index0;
|
|
|
|
|
saveRulerTime.value.index1 = targetRuler.value.index1;
|
|
|
|
|
// targetRuler.value.current = currentNumber.value
|
|
|
|
|
targetRuler.value.bordershow = false;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
targetRuler.value.index0 = -1;
|
|
|
|
|
targetRuler.value.index1 = -1;
|
|
|
|
|
targetRuler.value.current = -1
|
|
|
|
|
}, 400)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
targetRuler.value.bordershow = true;
|
|
|
|
|
saveRulerTime.value.index0 = -1;
|
|
|
|
|
saveRulerTime.value.index1 = -1;
|
|
|
|
|
}, 1000)
|
|
|
|
|
// if (currentNumber.value === Math.floor(data.index0 / 8)) {
|
|
|
|
|
// targetRuler.value.index0 = data.index0 - currentNumber.value * 8;
|
|
|
|
|
// targetRuler.value.index1 = data.index1;
|
|
|
|
|
// saveRulerTime.value.index0 = targetRuler.value.index0;
|
|
|
|
|
// saveRulerTime.value.index1 = targetRuler.value.index1;
|
|
|
|
|
// targetRuler.value.current = currentNumber.value
|
|
|
|
|
// targetRuler.value.bordershow = false;
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// targetRuler.value.index0 = -1;
|
|
|
|
|
// targetRuler.value.index1 = -1;
|
|
|
|
|
// targetRuler.value.current = -1
|
|
|
|
|
// }, 400)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// targetRuler.value.bordershow = true;
|
|
|
|
|
// saveRulerTime.value.index0 = -1;
|
|
|
|
|
// saveRulerTime.value.index1 = -1;
|
|
|
|
|
// }, 1000)
|
|
|
|
|
// } else {
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// currentNumber.value = Math.floor(data.index0 / 8);
|
|
|
|
|
// }, 100)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// targetRuler.value.index0 = data.index0 - currentNumber.value * 8;
|
|
|
|
|
// targetRuler.value.index1 = data.index1;
|
|
|
|
|
// saveRulerTime.value.index0 = targetRuler.value.index0;
|
|
|
|
|
// saveRulerTime.value.index1 = targetRuler.value.index1;
|
|
|
|
|
// targetRuler.value.current = currentNumber.value
|
|
|
|
|
// targetRuler.value.bordershow = false;
|
|
|
|
|
// }, 800)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// targetRuler.value.index0 = -1;
|
|
|
|
|
// targetRuler.value.index1 = -1;
|
|
|
|
|
// targetRuler.value.current = -1
|
|
|
|
|
// }, 1400)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// targetRuler.value.bordershow = true;
|
|
|
|
|
// saveRulerTime.value.index0 = -1;
|
|
|
|
|
// saveRulerTime.value.index1 = -1;
|
|
|
|
|
// }, 2200)
|
|
|
|
|
// }
|
2025-04-16 17:32:42 +08:00
|
|
|
|
}
|
|
|
|
|
// 定义每小时中的分钟数组,表示每 5 分钟一个时间段,总共 12 个
|
|
|
|
|
const minuteArr = ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55']
|
|
|
|
|
const timearr = ref(
|
|
|
|
|
Array.from({ length: 24 }, (_, hour) => ({
|
|
|
|
|
positioning: hour.toString(),
|
|
|
|
|
children: minuteArr.map(time => ({
|
|
|
|
|
typeName: time, // 表示分钟,如 '00', '05' 等
|
|
|
|
|
directiveName: '' // 默认的 directiveName
|
|
|
|
|
}))
|
|
|
|
|
}))
|
|
|
|
|
)
|
|
|
|
|
onShow(() => {
|
|
|
|
|
// console.log("QQQQ", myArray)
|
|
|
|
|
bigArray.value = myArray
|
|
|
|
|
downList.value = bigArray.value[0].children
|
2025-04-28 17:33:10 +08:00
|
|
|
|
cardLeft.value = 678
|
2025-04-16 17:32:42 +08:00
|
|
|
|
// console.log("aaaaa", timearr.value)
|
|
|
|
|
//暂时注释
|
|
|
|
|
// getServiceTree().then((res : any) => {
|
|
|
|
|
// console.log("!!!!!!!",res.result)
|
|
|
|
|
// bigArray.value = res.result
|
|
|
|
|
// downList.value = bigArray.value[0].children
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// getNclist().then((res : any) => {
|
|
|
|
|
// console.log("!!!!!!!!!!!!!!!!!!!",res.result)
|
|
|
|
|
// timearr.value = res.result
|
|
|
|
|
// })
|
|
|
|
|
// timearr.value = saveArray
|
|
|
|
|
uni.$on('where', whereEvent);
|
|
|
|
|
})
|
|
|
|
|
onHide(() => {
|
|
|
|
|
uni.$off('where', whereEvent);
|
|
|
|
|
});
|
|
|
|
|
defineExpose({
|
2025-04-17 17:18:37 +08:00
|
|
|
|
// rulerEnd,
|
2025-04-16 17:32:42 +08:00
|
|
|
|
rulerMoveEnd,
|
2025-04-28 17:33:10 +08:00
|
|
|
|
// nextItems,
|
2025-04-16 17:32:42 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const moveNumber = ref({
|
|
|
|
|
index0: 999,
|
|
|
|
|
index1: 999
|
|
|
|
|
})
|
|
|
|
|
const moBan = ref({
|
|
|
|
|
directiveId: "",
|
|
|
|
|
directiveName: "",
|
|
|
|
|
startTime: "",
|
|
|
|
|
endTime: "",
|
|
|
|
|
positioning: "",
|
|
|
|
|
positioningLong: "",
|
|
|
|
|
tagName: "",
|
|
|
|
|
cycleType: "",
|
|
|
|
|
nuId: "1",
|
|
|
|
|
customerId: "1",
|
|
|
|
|
id: "",
|
|
|
|
|
typeName: ""
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 切割bigArray
|
|
|
|
|
function splitString(str) {
|
|
|
|
|
// 使用正则表达式找到所有括号的内容
|
|
|
|
|
let result = [];
|
|
|
|
|
let remainingStr = str;
|
|
|
|
|
// 正则匹配最外层括号(支持全角和半角)
|
|
|
|
|
let regex = /([^((]*)[((]([^))]+)[))]/;
|
|
|
|
|
while (regex.test(remainingStr)) {
|
|
|
|
|
let match = remainingStr.match(regex);
|
|
|
|
|
if (match) {
|
|
|
|
|
// 添加括号前的部分(去掉空白)
|
|
|
|
|
if (match[1].trim()) {
|
|
|
|
|
result.push(match[1].trim());
|
|
|
|
|
}
|
|
|
|
|
// 添加括号内的内容
|
|
|
|
|
if (match[2].trim()) {
|
|
|
|
|
result.push(match[2].trim());
|
|
|
|
|
}
|
|
|
|
|
// 更新剩余的字符串
|
|
|
|
|
remainingStr = remainingStr.replace(match[0], '').trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 如果最后还有剩余部分,也加入结果
|
|
|
|
|
if (remainingStr.trim()) {
|
|
|
|
|
result.push(remainingStr.trim());
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
// 主页的css
|
|
|
|
|
@import './index';
|
|
|
|
|
</style>
|