448 lines
14 KiB
JavaScript
448 lines
14 KiB
JavaScript
|
"use strict";
|
|||
|
const common_vendor = require("../../common/vendor.js");
|
|||
|
const common_assets = require("../../common/assets.js");
|
|||
|
if (!Array) {
|
|||
|
const _component_donghua = common_vendor.resolveComponent("donghua");
|
|||
|
const _component_arrowkeys = common_vendor.resolveComponent("arrowkeys");
|
|||
|
(_component_donghua + _component_arrowkeys)();
|
|||
|
}
|
|||
|
if (!Math) {
|
|||
|
(index + nurse)();
|
|||
|
}
|
|||
|
const index = () => "./component/index.js";
|
|||
|
const nurse = () => "./component/nurse/index.js";
|
|||
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|||
|
__name: "index",
|
|||
|
setup(__props) {
|
|||
|
common_vendor.onMounted(() => {
|
|||
|
menuIndex.value = -1;
|
|||
|
common_vendor.nextTick$1(() => menuIndex.value = 0);
|
|||
|
isOld.value = 2;
|
|||
|
common_vendor.index.getSystemInfoSync();
|
|||
|
common_vendor.index.pageScrollTo;
|
|||
|
name.value = common_vendor.index.getStorageSync("realname");
|
|||
|
});
|
|||
|
const name = common_vendor.ref("");
|
|||
|
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}`;
|
|||
|
});
|
|||
|
}
|
|||
|
const leftMenuArray = common_vendor.ref([
|
|||
|
{
|
|||
|
url: genPaths(
|
|||
|
"/static/index/newindex/curve",
|
|||
|
"home_",
|
|||
|
5,
|
|||
|
// 张数
|
|||
|
"png",
|
|||
|
1,
|
|||
|
// 起始索引为 1
|
|||
|
false
|
|||
|
// 不补零
|
|||
|
),
|
|||
|
name: "首页"
|
|||
|
},
|
|||
|
{
|
|||
|
url: genPaths(
|
|||
|
"/static/index/newindex/curve",
|
|||
|
"nurse_",
|
|||
|
8,
|
|||
|
// 张数
|
|||
|
"png",
|
|||
|
1,
|
|||
|
// 起始索引为 1
|
|||
|
false
|
|||
|
// 不补零
|
|||
|
),
|
|||
|
name: "护嘱"
|
|||
|
},
|
|||
|
{
|
|||
|
url: genPaths(
|
|||
|
"/static/index/newindex/curve",
|
|||
|
"doctor_",
|
|||
|
6,
|
|||
|
// 张数
|
|||
|
"png",
|
|||
|
1,
|
|||
|
// 起始索引为 1
|
|||
|
false
|
|||
|
// 不补零
|
|||
|
),
|
|||
|
name: "医嘱"
|
|||
|
},
|
|||
|
{
|
|||
|
url: genPaths(
|
|||
|
"/static/index/newindex/curve",
|
|||
|
"lead_",
|
|||
|
12,
|
|||
|
// 张数
|
|||
|
"png",
|
|||
|
1,
|
|||
|
// 起始索引为 1
|
|||
|
false
|
|||
|
// 不补零
|
|||
|
),
|
|||
|
name: "请领"
|
|||
|
},
|
|||
|
{
|
|||
|
url: genPaths(
|
|||
|
"/static/index/newindex/curve",
|
|||
|
"device_",
|
|||
|
7,
|
|||
|
// 张数
|
|||
|
"png",
|
|||
|
1,
|
|||
|
// 起始索引为 1
|
|||
|
false
|
|||
|
// 不补零
|
|||
|
),
|
|||
|
name: "设备"
|
|||
|
}
|
|||
|
// {
|
|||
|
// url: genPaths(
|
|||
|
// '/static/index/newindex/curve',
|
|||
|
// 'return_',
|
|||
|
// 8, // 张数
|
|||
|
// 'png',
|
|||
|
// 1, // 起始索引为 1
|
|||
|
// false // 不补零
|
|||
|
// ), name: '返回'
|
|||
|
// },
|
|||
|
]);
|
|||
|
common_vendor.ref([
|
|||
|
{ url: "/static/index/lefticon/index.png", name: "首页" },
|
|||
|
{ url: "/static/index/lefticon/nurse.png", name: "护嘱" },
|
|||
|
{ url: "/static/index/lefticon/doctor.png", name: "医嘱" },
|
|||
|
{ url: "/static/index/lefticon/give.png", name: "请领" },
|
|||
|
{ url: "/static/index/lefticon/wifi.png", name: "设备" },
|
|||
|
{ url: "/static/index/lefticon/back.png", name: "返回" }
|
|||
|
]);
|
|||
|
common_vendor.ref([
|
|||
|
{ url: "/static/index/lefticon/index.png", targetUrl: "/static/index/lefticontarget/blueindex.png" },
|
|||
|
{ url: "/static/index/lefticon/nurse.png", targetUrl: "/static/index/lefticontarget/bluenurse.png" },
|
|||
|
{ url: "/static/index/lefticon/doctor.png", targetUrl: "/static/index/lefticontarget/bluedoctor.png" },
|
|||
|
{ url: "/static/index/lefticon/give.png", targetUrl: "/static/index/lefticontarget/givedark.png" },
|
|||
|
{ url: "/static/index/lefticon/wifi.png", targetUrl: "/static/index/lefticontarget/bluewifi.png" },
|
|||
|
{ url: "/static/index/lefticon/back.png", targetUrl: "/static/index/lefticontarget/blueback.png" }
|
|||
|
]);
|
|||
|
const menuIndex = common_vendor.ref(-1);
|
|||
|
const menuIndexshow = common_vendor.ref(false);
|
|||
|
const menuIndexshowsecond = common_vendor.ref(false);
|
|||
|
const darkFans = common_vendor.ref(false);
|
|||
|
const isOld = common_vendor.ref(-1);
|
|||
|
common_vendor.ref([]);
|
|||
|
common_vendor.ref(0);
|
|||
|
common_vendor.ref(0);
|
|||
|
common_vendor.ref(0);
|
|||
|
common_vendor.ref(0);
|
|||
|
common_vendor.ref(0);
|
|||
|
const changesdonghua = (index2) => {
|
|||
|
if (menuIndex.value === index2) {
|
|||
|
return;
|
|||
|
}
|
|||
|
menuIndex.value = index2;
|
|||
|
menuIndexshow.value = false;
|
|||
|
menuIndexshowsecond.value = false;
|
|||
|
setTimeout(() => {
|
|||
|
switch (index2) {
|
|||
|
case 0:
|
|||
|
menuIndexshow.value = true;
|
|||
|
break;
|
|||
|
case 1:
|
|||
|
menuIndexshowsecond.value = true;
|
|||
|
break;
|
|||
|
}
|
|||
|
}, 50);
|
|||
|
};
|
|||
|
const changeMenu = (index2) => {
|
|||
|
isMain.value = true;
|
|||
|
targetIndex.value = index2;
|
|||
|
menuIndex.value = index2;
|
|||
|
menuIndexshow.value = false;
|
|||
|
menuIndexshowsecond.value = false;
|
|||
|
if (index2 === 5) {
|
|||
|
common_vendor.index.navigateBack();
|
|||
|
return;
|
|||
|
}
|
|||
|
setTimeout(() => {
|
|||
|
switch (index2) {
|
|||
|
case 0:
|
|||
|
menuIndexshow.value = true;
|
|||
|
break;
|
|||
|
case 1:
|
|||
|
menuIndexshowsecond.value = true;
|
|||
|
break;
|
|||
|
}
|
|||
|
}, 50);
|
|||
|
};
|
|||
|
const clientX = common_vendor.ref(0);
|
|||
|
const clientY = common_vendor.ref(0);
|
|||
|
const savename = common_vendor.ref("");
|
|||
|
const canmove = common_vendor.ref(true);
|
|||
|
const indexNumber = common_vendor.ref({
|
|||
|
index0: 999,
|
|||
|
index1: 999
|
|||
|
});
|
|||
|
const canTrigger = common_vendor.ref(true);
|
|||
|
const animation = common_vendor.index.createAnimation({
|
|||
|
duration: 0,
|
|||
|
timingFunction: "linear",
|
|||
|
delay: 0
|
|||
|
});
|
|||
|
const animationData = common_vendor.ref({});
|
|||
|
const getxyrel = (event) => {
|
|||
|
var _a;
|
|||
|
const touch = event.touches[0];
|
|||
|
clientX.value = 2 * (Math.floor(touch.clientX) - 100);
|
|||
|
clientY.value = 2 * (Math.floor(touch.clientY) - 55);
|
|||
|
animation.translate3d(clientX.value / 2, clientY.value / 2, 0).step({ duration: 0 });
|
|||
|
animationData.value = animation.export();
|
|||
|
const translateX = Math.floor(touch.clientX) - 50;
|
|||
|
const translateY = Math.floor(touch.clientY) - 25;
|
|||
|
const clickedItem = fangkuaiValue.value.find((item) => {
|
|||
|
return translateX >= Math.floor(item.left) && translateX <= Math.floor(item.right) && translateY >= Math.floor(item.top) && translateY <= Math.floor(item.bottom);
|
|||
|
});
|
|||
|
if (clickedItem) {
|
|||
|
const { index0, index1 } = clickedItem.dataset;
|
|||
|
indexNumber.value.index0 = index0;
|
|||
|
indexNumber.value.index1 = index1;
|
|||
|
if (clientX.value < 200 && canTrigger.value && !isOld.value) {
|
|||
|
(_a = ruler.value) == null ? void 0 : _a.nextItems();
|
|||
|
canTrigger.value = false;
|
|||
|
setTimeout(() => {
|
|||
|
canTrigger.value = true;
|
|||
|
}, 1e3);
|
|||
|
}
|
|||
|
} else {
|
|||
|
indexNumber.value.index0 = 999;
|
|||
|
indexNumber.value.index1 = 999;
|
|||
|
}
|
|||
|
};
|
|||
|
const getxy = throttle(getxyrel, 40);
|
|||
|
const fangkuaiValue = common_vendor.ref([]);
|
|||
|
const saveruler = common_vendor.ref({
|
|||
|
directiveName: "",
|
|||
|
cycleType: "",
|
|||
|
positioningLong: "0",
|
|||
|
typeName: "",
|
|||
|
startTime: "",
|
|||
|
id: "",
|
|||
|
endTime: "",
|
|||
|
tagName: null
|
|||
|
});
|
|||
|
const ruler = common_vendor.ref(null);
|
|||
|
const rulernew = common_vendor.ref(null);
|
|||
|
const cleanall = () => {
|
|||
|
var _a, _b, _c;
|
|||
|
clientX.value = 9999;
|
|||
|
clientY.value = 9999;
|
|||
|
animation.translate3d(clientX.value / 2, clientY.value / 2, 0).step({ duration: 0 });
|
|||
|
animationData.value = animation.export();
|
|||
|
canmove.value = true;
|
|||
|
indexNumber.value = {
|
|||
|
index0: 999,
|
|||
|
index1: 999
|
|||
|
};
|
|||
|
if (savename.value) {
|
|||
|
if (!isOld.value) {
|
|||
|
(_a = ruler.value) == null ? void 0 : _a.rulerEnd(savename.value);
|
|||
|
}
|
|||
|
} else if (saveruler.value.typeName) {
|
|||
|
if (isOld.value === 0) {
|
|||
|
(_b = ruler.value) == null ? void 0 : _b.rulerMoveEnd(saveruler.value);
|
|||
|
} else {
|
|||
|
(_c = rulernew.value) == null ? void 0 : _c.rulerMoveEnd(saveruler.value);
|
|||
|
}
|
|||
|
}
|
|||
|
savename.value = "";
|
|||
|
saveruler.value = {
|
|||
|
directiveName: "",
|
|||
|
cycleType: "",
|
|||
|
positioningLong: "0",
|
|||
|
typeName: "",
|
|||
|
startTime: "",
|
|||
|
id: "",
|
|||
|
endTime: "",
|
|||
|
tagName: null
|
|||
|
};
|
|||
|
};
|
|||
|
function throttle(fn, delay) {
|
|||
|
let lastExecutionTime = 0;
|
|||
|
return function(...args) {
|
|||
|
const now = Date.now();
|
|||
|
if (now - lastExecutionTime >= delay) {
|
|||
|
lastExecutionTime = now;
|
|||
|
fn.apply(this, args);
|
|||
|
}
|
|||
|
};
|
|||
|
}
|
|||
|
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;
|
|||
|
}
|
|||
|
common_vendor.onShow(() => {
|
|||
|
setTimeout(() => {
|
|||
|
changeMenu(menuIndex.value);
|
|||
|
}, 50);
|
|||
|
menuIndexshow.value = false;
|
|||
|
setTimeout(() => {
|
|||
|
menuIndexshow.value = true;
|
|||
|
}, 50);
|
|||
|
});
|
|||
|
const isMain = common_vendor.ref(true);
|
|||
|
const targetIndex = common_vendor.ref(0);
|
|||
|
const propsmove = common_vendor.ref(-1);
|
|||
|
const canback = common_vendor.ref(false);
|
|||
|
const canmoveit = (boolean) => {
|
|||
|
canback.value = boolean;
|
|||
|
};
|
|||
|
const movecard = (where) => {
|
|||
|
if (where === 5) {
|
|||
|
if (canback.value) {
|
|||
|
propsmove.value = -1;
|
|||
|
common_vendor.nextTick$1(() => propsmove.value = where);
|
|||
|
return;
|
|||
|
} else {
|
|||
|
if (!isMain.value) {
|
|||
|
isMain.value = true;
|
|||
|
targetIndex.value = menuIndex.value;
|
|||
|
} else {
|
|||
|
common_vendor.index.navigateBack();
|
|||
|
}
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
if (isMain.value) {
|
|||
|
switch (where) {
|
|||
|
case 0:
|
|||
|
if (targetIndex.value) {
|
|||
|
targetIndex.value--;
|
|||
|
changesdonghua(targetIndex.value);
|
|||
|
}
|
|||
|
break;
|
|||
|
case 1:
|
|||
|
isMain.value = false;
|
|||
|
targetIndex.value = -1;
|
|||
|
break;
|
|||
|
case 2:
|
|||
|
if (targetIndex.value < leftMenuArray.value.length - 1) {
|
|||
|
targetIndex.value++;
|
|||
|
changesdonghua(targetIndex.value);
|
|||
|
}
|
|||
|
break;
|
|||
|
case 3:
|
|||
|
break;
|
|||
|
case 4:
|
|||
|
if (targetIndex.value === 5) {
|
|||
|
common_vendor.index.navigateBack();
|
|||
|
}
|
|||
|
changesdonghua(targetIndex.value);
|
|||
|
break;
|
|||
|
}
|
|||
|
} else {
|
|||
|
propsmove.value = -1;
|
|||
|
common_vendor.nextTick$1(() => propsmove.value = where);
|
|||
|
}
|
|||
|
};
|
|||
|
return (_ctx, _cache) => {
|
|||
|
return common_vendor.e({
|
|||
|
a: common_vendor.t(savename.value),
|
|||
|
b: savename.value && clientX.value,
|
|||
|
c: animationData.value,
|
|||
|
d: common_vendor.t(saveruler.value.startTime + `-` + saveruler.value.endTime),
|
|||
|
e: saveruler.value.cycleType == "日常" ? `/static/index/yellowbian.png` : `/static/index/puoplebian.png`,
|
|||
|
f: common_vendor.t(saveruler.value.cycleType),
|
|||
|
g: saveruler.value.startTime,
|
|||
|
h: common_vendor.t(splitString(saveruler.value.directiveName)[0]),
|
|||
|
i: common_vendor.f(splitString(saveruler.value.directiveName).slice(1), (item, index2, i0) => {
|
|||
|
return {
|
|||
|
a: index2
|
|||
|
};
|
|||
|
}),
|
|||
|
j: common_vendor.t(splitString(saveruler.value.directiveName)[1]),
|
|||
|
k: common_vendor.s(saveruler.value.cycleType != "日常" ? {
|
|||
|
backgroundColor: `rgb(123,97,255)`
|
|||
|
} : {}),
|
|||
|
l: common_vendor.s(saveruler.value.cycleType != "日常" ? {
|
|||
|
backgroundColor: `rgb(212,203,255)`
|
|||
|
} : {}),
|
|||
|
m: splitString(saveruler.value.directiveName)[1],
|
|||
|
n: saveruler.value.cycleType,
|
|||
|
o: common_vendor.n(saveruler.value.cycleType == "日常" ? `title-time-border-yellow` : `title-time-border-pouple`),
|
|||
|
p: animationData.value,
|
|||
|
q: common_assets._imports_0$2,
|
|||
|
r: common_vendor.n(darkFans.value ? `left-head-font-dark` : `left-head-font`),
|
|||
|
s: common_vendor.f(leftMenuArray.value, (item, index2, i0) => {
|
|||
|
return {
|
|||
|
a: "0df9d5ac-0-" + i0,
|
|||
|
b: common_vendor.p({
|
|||
|
width: `65rpx`,
|
|||
|
height: `65rpx`,
|
|||
|
links: item.url,
|
|||
|
playing: index2 === menuIndex.value
|
|||
|
}),
|
|||
|
c: common_vendor.t(item.name),
|
|||
|
d: index2,
|
|||
|
e: common_vendor.n(targetIndex.value === index2 ? "target" : ""),
|
|||
|
f: common_vendor.s(targetIndex.value === index2 ? {
|
|||
|
backgroundColor: "#ddf0ff"
|
|||
|
} : index2 === menuIndex.value ? {
|
|||
|
backgroundColor: "#fff"
|
|||
|
} : {}),
|
|||
|
g: common_vendor.o(($event) => changeMenu(index2), index2)
|
|||
|
};
|
|||
|
}),
|
|||
|
t: !menuIndex.value
|
|||
|
}, !menuIndex.value ? {
|
|||
|
v: common_vendor.o(($event) => movecard(5)),
|
|||
|
w: common_vendor.p({
|
|||
|
isShow: menuIndexshow.value,
|
|||
|
propsmove: propsmove.value,
|
|||
|
isMain: isMain.value
|
|||
|
})
|
|||
|
} : {}, {
|
|||
|
x: menuIndex.value == 1 && isOld.value === 2
|
|||
|
}, menuIndex.value == 1 && isOld.value === 2 ? {
|
|||
|
y: common_vendor.o(canmoveit),
|
|||
|
z: common_vendor.p({
|
|||
|
isold: isOld.value === 2,
|
|||
|
liang: indexNumber.value,
|
|||
|
isshow: menuIndexshowsecond.value,
|
|||
|
propsmove: propsmove.value,
|
|||
|
isMain: isMain.value
|
|||
|
})
|
|||
|
} : {}, {
|
|||
|
A: common_vendor.o(movecard),
|
|||
|
B: common_vendor.n(darkFans.value ? `darkbackgroundContainer` : `backgroundContainer`),
|
|||
|
C: common_vendor.o(
|
|||
|
//@ts-ignore
|
|||
|
(...args) => common_vendor.unref(getxy) && common_vendor.unref(getxy)(...args)
|
|||
|
),
|
|||
|
D: common_vendor.o(cleanall)
|
|||
|
});
|
|||
|
};
|
|||
|
}
|
|||
|
});
|
|||
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0df9d5ac"]]);
|
|||
|
wx.createPage(MiniProgramPage);
|
|||
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/NursingNew/index.js.map
|