This commit is contained in:
Teng 2025-12-26 17:31:07 +08:00
parent 0ad5232f24
commit 4279049add
6 changed files with 23 additions and 433 deletions

View File

@ -1,5 +1,5 @@
<template>
<view class="index-content-other" :style="transition?{opacity: `1`}:{opacity: `0`}">
<view class="index-content-other" :style="transition?{opacity: `1`}:{opacity: `0`}" v-if="!closeit" >
<view class="zhezhao"
v-show="openqingling || openlahzha || openbaoxiu || openhehzha || openchaobiao ||openrizhi"
@click="closeall()">
@ -560,7 +560,7 @@
waterwaterReset, waterwaterControl, waterbaoxiu, waterwaterRead, humidDevicebaoxiu, updateDeviceRealTime, cameraInfobaoxiu,
electricityMeterListArray, requestLogList, humidDevicejgList, humidDevicejgwarn
} from "./api.js"
import { movedirection, queryPadPageList } from '@/pages/watch/api/lunpan.js'
import { movedirection } from '@/pages/watch/api/lunpan.js'
import joysticknew from '@/component/public/newgame/joysticknew.vue';
const props = defineProps({
@ -568,12 +568,6 @@
type: Boolean,
required: true,
},
// propsmove: {
// type: Number
// },
isMain: {
type: Boolean
}
});
const movetype = ref(-1);
@ -672,32 +666,7 @@
const scrollLeft = ref(0)
// isMain isShow true
watch(
() => props.isMain,
(newVal, oldVal) => {
// undefined ->
if (typeof oldVal !== 'boolean') return
if (!props.isShow) return
if (lanjie.value) {
lanjie.value = false
return
}
if (oldVal === true && newVal === false) {
movetype.value = 0;
zeroIndex.value = 0;
typeNowtarget.value = zeroIndex.value;
changeallmessage()
} else if (oldVal === false && newVal === true) {
movetype.value = -1
zeroIndex.value = -1
typeNowtarget.value = 0;
changeallmessage()
}
// console.log("?????",typeNowtarget.value)
}
)
const zeroIndex = ref(-1)
const emit = defineEmits(['back', 'cleanmain', `canback`])
const savetopindex = ref(0)
@ -1392,7 +1361,7 @@
const changeallmessage = () => {
uni.$emit('smallmonitor:isshow', false)
typeNow.value = allArray.value[typeNowtarget.value].typeNumber;
typeNow.value = allArray.value[typeNowtarget.value]?.typeNumber ;
if (typeNow.value === 1) {
indexmessage.value = allArray.value[typeNowtarget.value]
const firstTarget = indexmessage.value.eleValue;
@ -1441,12 +1410,17 @@
changeallmessage()
}, 500)
}
const closeit = ref(false)
const init = () => {
allArray.value = [];
// console.log("????", uni.getStorageSync('serverUrl'), uni.getStorageSync('nuId'))
electricityMeterlist().then((res : any) => {
// console.log("!!!", res.result)
if (res.result.cameraInfoEntityList.length && res.result.cameraInfoEntityList != null) {
if(!res.result.cameraInfoEntityList.length){
closeit.value = true
return
}
if ( res.result.cameraInfoEntityList != null) {
res.result.cameraInfoEntityList.forEach((element : any, index : number) => {
element.typeNumber = 0
element.lookName = "摄像头" + (index+1) ;
@ -1454,7 +1428,7 @@
allArray.value.push(element)
})
}
if (res.result.electricityMeterEntityList.length && res.result.electricityMeterEntityList != null) {
if ( res.result.electricityMeterEntityList != null) {
res.result.electricityMeterEntityList.forEach((element : any, index : number) => {
element.typeNumber = 1
element.lookName = "电表" + (index+1)
@ -1462,7 +1436,7 @@
allArray.value.push(element)
})
}
if (res.result.waterMeterEntityList.length && res.result.waterMeterEntityList != null) {
if ( res.result.waterMeterEntityList != null) {
res.result.waterMeterEntityList.forEach((element : any, index : number) => {
element.typeNumber = 2
element.lookName = "水表" + (index+1)
@ -1470,7 +1444,7 @@
allArray.value.push(element)
})
}
if (res.result.humidDeviceEntityList.length && res.result.humidDeviceEntityList != null) {
if ( res.result.humidDeviceEntityList != null) {
res.result.humidDeviceEntityList.forEach((element : any, index : number) => {
element.typeNumber = 3
element.lookName = "温度计" + (index+1)

View File

@ -376,7 +376,7 @@
// console.log("????",transition.value)
setTimeout(() => {
transition.value = true;
console.log("看看", uni.getStorageSync('NUall'))
// console.log("", uni.getStorageSync('NUall'))
}, 50)
} else {
transition.value = false;

View File

@ -781,51 +781,6 @@
repeating-linear-gradient(0deg, var(--color) 0 var(--dash), transparent 0 calc(var(--dash) + var(--gap))) top right / var(--thick) 100% no-repeat;
}
.time-button-black-spe {
transition: all 1s;
position: absolute;
width: 360rpx;
height: 100rpx;
/* padding-left: 3rpx; */
padding: 0 20rpx;
border-radius: 20rpx;
border-top-right-radius: 0;
border: 2rpx solid #e8e9eb;
color: #545569;
/* background-color: rgb(77, 77, 77); */
bottom: -100rpx;
left: -220rpx;
/* color: #fff; */
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
/* box-shadow: 0 2px 6px rgba(0, 131, 250, 0.2); */
}
.time-button-black {
transition: all 1s;
position: absolute;
width: 360rpx;
height: 100rpx;
padding: 0 20rpx;
border-radius: 20rpx;
border-bottom-right-radius: 0;
background-color: #fff;
top: -100rpx;
left: -220rpx;
border: 2rpx solid #e8e9eb;
color: #545569;
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
box-shadow: 0 2px 6px rgba(0, 131, 250, 0.2);
}
.time-button-orange-spe {
transition: all 1s;

View File

@ -1,7 +0,0 @@
// 定义 Link 类型
export type roomBtttonType = {
url : string;
targetUrl : string;
name : string
}

View File

@ -113,12 +113,6 @@
</view>
</view>
</view>
<!-- <view class="boom" :style="{ transform: transformStyle }" ref="leftLabels">
<view v-for="(item, index) in timearr[0].children" :key="index" class="boom-son"
v-show="item.tagName">
<text class="boom-text">{{ item.tagName }}</text>
</view>
</view> -->
</view>
<view class="super-card-container">
@ -159,18 +153,6 @@
请选择服务指令迁移的目标单元格
</view>
<!-- <view class="time-button-black-spe"
:style="{left:saveEditIndex.index0?`-220rpx`:`0`}"
v-if="saveEditIndex.index0 == index0 && saveEditIndex.index1 == index1 && index1==0 && isDelete">
是否确认删除该服务指令
</view>
<view class="time-button-black"
:style="{left:saveEditIndex.index0?`-220rpx`:`0`}"
v-if="saveEditIndex.index0 == index0 && saveEditIndex.index1 == index1 && index1 && isDelete">
是否确认删除该服务指令
</view> -->
<view class="title-time-blue"
v-show="saveEditIndex.index0 == index0 && saveEditIndex.index1 == index1 && isRule">
</view>
@ -407,13 +389,10 @@
监控
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
@ -566,19 +545,15 @@
</view>
</view>
<!-- <view class="card-font">
确定要删除指令吗
</view> -->
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch } from 'vue';
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch } from 'vue';
import { onShow, onHide } from '@dcloudio/uni-app';
import type { roomBtttonType } from "./index";
import { getNclist, addBatch, addDirective, addInstant, addElderTag, deleteDirective, deleteInstant, deleteElderTag, editDirective } from "./api.js";
import { getNclist, addBatch, addDirective, addInstant, deleteDirective, deleteInstant, editDirective } from "./api.js";
import { myArray } from './yaoshandiao.js';
const props = defineProps({
@ -586,19 +561,7 @@
type: Boolean,
required: true,
},
darkFans: {
type: Boolean,
},
canmove: {
type: Boolean,
},
});
watch(
() => props.canmove,
() => {
bottomisShaking.value = false;
})
watch(
() => props.isshow,
(newVal, oldVal) => {
@ -619,7 +582,6 @@
})
}
upmenuIndex.value = 0
getblue.value = !getblue.value
}
}
)
@ -628,7 +590,6 @@
const facestatus = ref(false);
const facestatustarget = ref(-1);
/* ---- transform ----
注意虽然这是响应式但我们只在 rAF 里更新它受控更新避免频繁触发 Vue 渲染 */
const transformStyle = ref('translate3d(0, 0, 0)');
@ -644,7 +605,6 @@
() => {
setTimeout(() => {
bodydonghua.value = openbody.value
emit('vip', bodydonghua.value)
}, 50)
}
)
@ -654,7 +614,6 @@
() => {
setTimeout(() => {
facedonghua.value = openface.value
emit('vip', facedonghua.value)
}, 50)
}
)
@ -663,9 +622,7 @@
const facetarget = ref([]);
const addbody = (index : number) => {
if (bodyTagList.value[index].izSelected == 'Y') {
bodyTagList.value[index].izSelected = 'N';
} else {
let targetNumber = 0;
bodyTagList.value.forEach((element : any) => {
@ -713,7 +670,6 @@
}
const open = ref(false);
const getblue = ref(false);
const bottomItems = ref([])
const nameArray = [
@ -807,8 +763,6 @@
} else {
doChangeNew()
}
}
const doChangeNew = () => {
let object = JSON.parse(JSON.stringify(timearr.value[flyNumber.value.index0].children[flyNumber.value.index1]))
@ -824,7 +778,6 @@
let endTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime;
let positioning = timearr.value[indexsave.value[0]].positioning;
// trim
const parseTime = (t) => {
const parts = String(t || '').split(':').map(s => s.trim());
@ -871,15 +824,6 @@
timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime =
`${String(newEndHour)}:${pad2(newEndMin)}`;
// const rest = startTime.split(":")[1]; // ":20"
// const rest0 = endTime.split(":")[1];; // ":20"
// let many = Number(rest0) - Number(rest);
// let start = newtagName
// 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;
let data = {
@ -887,16 +831,13 @@
index1: saveEditIndex.value.index1
}
whereEvent(data);
// saveAll()
let infoValue = timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1]
infoValue.positioning = saveEditIndex.value.index0;
infoValue.positioningLong = saveEditIndex.value.index1;
// console.log("issuccess",saveEditIndex.value.index0,saveEditIndex.value.index1)
editDirective(infoValue).then((res : any) => {
if (res.success) {
geteverything()
}
})
}
//
@ -912,8 +853,8 @@
monthIndex.value = -1;
weekValue.value = "";
monthValue.value = "";
secondtop.value = 1
firsttop.value = 1
secondtop.value = 0.01
firsttop.value = 0.01
//西downmenuIndex西
downdonghua.value = -1;
@ -948,113 +889,9 @@
}
}
function dosomesave() {
cardsumit.value.op.name = secondopenValue.value[cardsumit.value.op.index[2]].relName
switch (secondopenValue.value[cardsumit.value.op.index[2]].cycleTypeId) {
case `1`:
openOp.value = 0
break;
case `2`:
openOp.value = 1
break;
case `3`:
openOp.value = 2
break;
default:
break;
}
}
const selectType = ref(true);
const deleteButton = ref(false);
const isRule = ref(false);
const savemoved = ref(-1);
const movecard = (where : number) => {
// isDelete.value = false;
// switch (where) {
// case 0:
// if (saveEditIndex.value.index1) {
// saveEditIndex.value.index1--
// centerCell();
// isopen.value = false;
// if (open.value) {
// setTimeout(() => {
// rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
// }, 50)
// }
// } else {
// topindex.value = 0
// savemoved.value = saveEditIndex.value.index0
// isRule.value = false;
// }
// break
// case 1:
// if (saveEditIndex.value.index0 == 23) {
// return
// }
// saveEditIndex.value.index0++
// centerCell();
// isopen.value = false;
// if (open.value) {
// setTimeout(() => {
// rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
// }, 50)
// }
// break
// case 2:
// if (saveEditIndex.value.index1 == 11) {
// return
// }
// saveEditIndex.value.index1++
// centerCell();
// isopen.value = false;
// if (open.value) {
// setTimeout(() => {
// rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
// }, 50)
// }
// break
// case 3:
// if (saveEditIndex.value.index0 == 0) {
// return
// }
// saveEditIndex.value.index0--
// centerCell();
// isopen.value = false;
// if (open.value) {
// setTimeout(() => {
// rulerTouchClick(timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1], saveEditIndex.value.index0, saveEditIndex.value.index1)
// }, 50)
// }
// break
// }
}
const topindex = ref(-1)
const movetop = (where : number) => {
isDelete.value = false;
switch (where) {
case 0:
break
case 1:
if (topindex.value < 3) {
topindex.value++
}
break
case 2:
openbody.value = false
openface.value = false
topindex.value = -1
saveEditIndex.value.index0 = savemoved.value
isRule.value = true;
break
case 3:
if (topindex.value) {
topindex.value--
}
break
}
}
const weekValue = ref("");
const weekIndex = ref(-1);
const monthValue = ref("");
@ -1114,14 +951,7 @@
}
}
const haveName = ref(false);
const isHave = () => {
if (timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].directiveName) {
haveName.value = true;
} else {
haveName.value = false;
}
}
//
function pseudoRandom(index0, index1) {
const seed = index0 * 55.9898 + index1 * 78.233;
@ -1135,17 +965,12 @@
//
let throttleTimer = null;
//
// const dragOffset = ref(0);
// const moveDownNumber = ref(0)
/* 兼容:如果不支持 requestAnimationFrame就用 setTimeout */
const requestAnimationFrame =
typeof window !== 'undefined' && window.requestAnimationFrame
? window.requestAnimationFrame
: (cb) => setTimeout(cb, 16);
function handleScrolltime(e) {
// let num = e.detail.scrollTop
// let formattedNum = parseFloat(num.toFixed(2));
// moveDownNumber.value = formattedNum
// uni-app scroll e.detail.scrollTop
//
const scrollTop = (e && e.detail && (e.detail.scrollTop ?? e.detail.scrollY)) || 0;
@ -1166,8 +991,6 @@
function handleTop(e) {
leftIn.value = e.detail.scrollLeft
}
const changeBug = ref(true);
//
const getClass = (item, index0, index1) => {
if (item.startTime) {
@ -1271,18 +1094,11 @@
lastTap.value = now
}
}
//
const underFans = ref<boolean>(false);
//
const roomTar = ref<number[]>([]);
const emit = defineEmits(['vip', 'changeold']);
const isEdit = ref(false);
const saveEditIndex = ref({
index0: -1,
index1: -1
})
const clickstauts = ref(0)
const secondopenValue = ref([]);
const secondContant = (index : number) => {
iszhouqi.value = false;
@ -1293,16 +1109,12 @@
downmenuIndex.value = index;
downdonghua.value = index;
thirdmenuIndex.value = 0;
firsttop.value = 1;
firsttop.value = 0.01;
nextTick(() => {
firsttop.value = 0;
})
}
const newchange = (type : number) => {
emit('changeold', type)
}
const timer = ref(null);//
const elementsInfo = ref({})//
const moveX = ref(0)
@ -1314,26 +1126,13 @@
index1: 999,
tagName: ''
})
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 touchindex1 = ref(-1);
//
const shareShow = ref(false);
const shareToWeixin = () => {
shareShow.value = true;
deletedownisopacity.value = false;
setTimeout(() => {
@ -1414,42 +1213,15 @@
const shakyTable = ref(false);
const reldata = ref([]);
const deleteRuler = (index0 : number, index1 : number) => {
console.log("?????", timearr.value[index0].children[index1])
deleteDirective(timearr.value[index0].children[index1]).then((res : any) => {
if (res.success) {
geteverything()
}
})
}
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);
@ -1481,45 +1253,8 @@
bottomTimer.value = null
}
}
const openValue = ref({
time: "",
minute: "",
array: []
})
const cardsumit = ref({
op: {
name: "",
index: [-1, -1, -1],
},
startTime: "",
weekTimeNumber: -1,
monthTimeNumber: -1,
monthTime: "",
weekTime: ""
})
const openOp = ref(0);
const clickOp = (index : number, item : any) => {
saveId.value = item.id;
cardsumit.value.op.index[2] = index
cardsumit.value.op.name = item.relName
switch (item.cycleTypeId) {
case 0:
openOp.value = 0
break;
case 1:
openOp.value = 1
break;
case 2:
openOp.value = 2
break;
default:
break;
}
}
const indexsave = ref([-1, -1]);
const scrollContainer = ref(null)
const opensay = () => {
sayisopacity.value = false;
sayisopen.value = true;
@ -1552,9 +1287,7 @@
}
const doaddDirective = (element : any) => {
// console.log("", element)
addDirective(element).then((res) => {
console.log("添加后返回了啥1", res)
if (res.success) {
geteverything()
}
@ -1563,7 +1296,6 @@
const killjishi = (id : string) => {
deleteInstant({ id: id }).then((res) => {
// console.log("1", res)
if (res.success) {
geteverything()
}
@ -1571,7 +1303,6 @@
}
const addnew = () => {
// console.log("9999", timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1])
if (isDelete.value) {
isDelete.value = false;
@ -1590,7 +1321,6 @@
if (iszhiling.value) {
let allobject = savePackagelist.value[forthmenuIndex.value];
// console.log("special",allobject)
if (saveEditIndex.value.index1 === -1 && saveEditIndex.value.index0 === -1) {
return
@ -1659,14 +1389,11 @@
index1: saveEditIndex.value.index1
}
whereEvent(data);
console.log("zou", haveValue)
if (haveValue) {
editDirective(param).then((res : any) => {
if (res.success) {
geteverything()
}
})
} else {
doaddDirective(param);
@ -1758,7 +1485,6 @@
cycleType = monthValue.value + "号";
cycleValue = monthValue.value
}
console.log("重要", cycleValue)
iszhouqi.value = false;
weekIndex.value = -1;
monthIndex.value = -1;
@ -1771,7 +1497,6 @@
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')}`
console.log("allobject", allobject)
let param = {
id: haveValue ? timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].id : "",
nuId: uni.getStorageSync('nuId'),
@ -1815,17 +1540,14 @@
index1: saveEditIndex.value.index1
}
whereEvent(data);
console.log("日常指令看看进入了啥", param)
if (haveValue) {
editDirective(param).then((res : any) => {
if (res.success) {
geteverything()
}
})
} else {
doaddDirective(param);
}
}
@ -1835,7 +1557,6 @@
if (!cansumit.value) {
return
}
let info = []
bodyTagList.value.forEach((element : any) => {
@ -1849,21 +1570,14 @@
}
})
// bottomItems.value.forEach((element : any, index : number) => {
// element.sort = index
// })
let allvalue = {
nuId: uni.getStorageSync('nuId'),
nuName: uni.getStorageSync('nuName'),
elderId: uni.getStorageSync('elderId'),
elderName: uni.getStorageSync('NUall').elderInfo.name,
// serverList: postArray,
// instantList: bottomItems.value,
tagList: info
}
// console.log("", allvalue)
addBatch(allvalue).then(() => {
geteverything()
})
@ -1934,13 +1648,10 @@
directiveName: '' // directiveName
}))
}))
// console.log("wtf", res)
res.result.serviceList.forEach((res : any) => {
timearr.value[res.positioning].children[res.positioningLong] = res;
})
// console.log("", res.result)
bottomItems.value = res.result.instantList
// console.log("",bottomItems.value)
cansumit.value = true;
emotionTagList.value = res.result.emotionTagList;
emotionTagListLook.value = []
@ -1951,13 +1662,11 @@
}
})
bodyTagList.value = res.result.bodyTagList
// console.log("zzzz",res.result.bodyTagList)
res.result.bodyTagList.forEach((res : any) => {
if (res.izSelected == 'Y') {
bodyTagListLook.value.push(res.netPic)
}
})
// console.log("res11111",res)
})
}
}
@ -1975,7 +1684,6 @@
})
})
secondtemp.value = goodArray
if (res.result) {
res.result.forEach((element : any) => {
if (element.netFlag == '0') {
@ -2001,7 +1709,6 @@
})
})
bigArray.value = res.result;
// console.log("",bigArray.value)
}
downList.value = bigArray.value[0].children
upmenuIndex.value = -1;
@ -2013,8 +1720,6 @@
uni.$on('where', findback);
downdonghua.value = 0;
geteverything()
})
const bodyTagListLook = ref([]);
@ -2031,43 +1736,6 @@
solveWatch.value = 3;
whereEvent(data)
}
const moveNumber = ref({
index0: 999,
index1: 999
})
const moBan = ref({
directiveId: "",
directiveName: "",
typeId: "",
typeName: "",
categoryId: "",
categoryName: "",
cycleTypeId: "",
cycleType: "",
cycleValue: "",
startTime: "",
endTime: "",
positioning: "",
positioningLong: "",
izPackage: 'N',
previewFile: "",
previewFileSmall: "",
serviceDuration: "",
immediateFile: "",
immediateFileFocus: "",
netImmediateFileFocus:"",
netImmediateFile: "",
tagName: "",
netPreviewFile:"",
netPreviewFileSmall:"",
mp3File:"",
netMp3File:"",
mp4File:"",
netMp4File:"",
serviceContent:"",
})
// bigArray
function splitString(str) {
// 使

View File

@ -176,7 +176,7 @@
item.zk = false;
item.scrollleft = 0;
})
console.log("?????",form,res.result.records)
// console.log("?????",form,res.result.records)
listarr.value.push(...res.result.records)
status.value = (res.result.total == listarr.value.length ? 'nomore' : 'loadmore')
})