12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112 |
- <template>
- <view style="overflow: auto; height: 100%">
- <!-- 建议放在外层 -->
- <u-navbar
- :title="name"
- @leftClick="backPage"
- :bgImage="backPic"
- :bgStatusImage="backPic0"
- >
- <view class="u-nav-slot" slot="left">
- <u-icon name="arrow-left" size="20"> </u-icon>
- </view>
- </u-navbar>
- <view class="main">
- <view class="u-page container">
- <div class="button-grid flcard" v-if="this.TabCur == 'gate'">
- <u-button
- type="primary"
- text="打开前门"
- @click="showPasswordDialog('frontGateOpen_S')"
- ></u-button>
- <u-button
- type="primary"
- text="关闭前门"
- @click="showPasswordDialog('frontGateClose_S')"
- ></u-button>
- <u-button
- type="primary"
- text="打开后门"
- @click="showPasswordDialog('rearGateOpen_S')"
- ></u-button>
- <u-button
- type="primary"
- text="关闭后门"
- @click="showPasswordDialog('rearGateClose_S')"
- ></u-button>
- <u-button
- type="primary"
- text="打开前后门"
- @click="showPasswordDialog('sameTimeOpen')"
- ></u-button>
- <u-button
- type="primary"
- text="关闭前后门"
- @click="showPasswordDialog('sameTimeClose')"
- ></u-button>
- </div>
- <div
- class="button-grid flcard"
- v-if="this.TabCur == 'window' && this.nwindownum == 1"
- >
- <u-button
- type="primary"
- text="设定面积"
- @click="showPasswordDialog('frontSetValue')"
- ></u-button>
- </div>
- <div
- class="button-grid flcard"
- v-if="this.TabCur == 'window' && this.nwindownum == 2"
- >
- <u-button
- type="primary"
- text="设定前窗面积"
- @click="showPasswordDialog('frontSetValue')"
- ></u-button>
- <u-button
- type="primary"
- text="设定后窗面积"
- @click="showPasswordDialog('rearSetValue')"
- ></u-button>
- </div>
- <div class="flcard" v-if="this.TabCur == 'gate'">
- <doorAnimate
- :gatestate1="frontGateStatus"
- :gatestate2="midGateStatus"
- :gatestate3="rearGateStatus"
- :cameralist="cameralist"
- :height="height"
- :doorcount="ndoorcount"
- ></doorAnimate>
- </div>
- <div class="flcard" v-if="this.TabCur == 'windrect'">
- <windrectAnimate
- :state="state"
- :title="title"
- :videoURL="viedeoUrl"
- :height="height"
- :type="deviceType"
- ></windrectAnimate>
- </div>
- <div class="flcard" v-if="this.TabCur == 'fanlocal'">
- <fanlocalAnimate
- :fan1State="fan1State"
- :fan2State="fan2State"
- :title="title"
- :videoURL="viedeoUrl"
- :height="height"
- ></fanlocalAnimate>
- </div>
- <div class="flcard" v-if="this.TabCur == 'fanmain'">
- <fanmainAnimate
- ref="fanpage"
- style="width: 100%"
- :door1="door1"
- :topdoor1="topdoor1"
- :fundoor1="fundoor1"
- :door2="door2"
- :topdoor2="topdoor2"
- :fundoor2="fundoor2"
- :nowfengji="qidongfengji"
- ></fanmainAnimate>
- </div>
- <div
- class="flcard"
- v-if="this.TabCur == 'window' && this.nwindownum == 1"
- >
- <windowAnimate
- :windowAngle="windowAngle"
- :height="height"
- :windowcount="nwindownum"
- ></windowAnimate>
- </div>
- <div
- class="flcard"
- v-if="this.TabCur == 'window' && this.nwindownum == 2"
- >
- <windowAnimate
- :windowAngle="windowAngle"
- :windowAngle1="windowAngle1"
- :height="height"
- :windowcount="nwindownum"
- ></windowAnimate>
- </div>
- <div class="flcard">
- <div
- class="flex-container"
- v-if="TabCur != 'fanlocal' && TabCur != 'fanmain'"
- >
- <div
- class="itemback"
- v-for="(item, index) in showColum[TabCur + '_detail']"
- :key="index"
- v-show="item.appShow == 1"
- >
- <div
- class="datacardtime"
- v-if="item.monitorcode == 'readTime' && item.datatype == 1"
- >
- <view
- class="demo-layout bg-purple-light"
- style="padding: 20rpx; color: #3787fe"
- >
- {{ readTime }}
- </view>
- </div>
- <div class="datacard" v-if="item.monitorcode !== 'readTime'">
- <div class="left-content">
- <view
- v-if="item.monitorcode == 'ndoortype' && item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData[item.monitorcode] == "1"
- ? "行人"
- : tableData[item.monitorcode] == "2"
- ? "行车"
- : "--"
- }}
- </view>
- <view
- v-else-if="
- item.monitorcode == 'netStatus' && item.datatype == 1
- "
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{ doorNetStatus == "1" ? "正常" : "异常" }}
- </view>
- <view
- v-else-if="
- item.monitorcode == 'warnFlag' && item.datatype == 1
- "
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{ warnFlag == "1" ? "正常" : "异常" }}
- </view>
- <view
- v-else-if="item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData[item.monitorcode] == null ||
- tableData[item.monitorcode] == ""
- ? "--"
- : tableData[item.monitorcode]
- }}
- </view>
- <view
- v-else-if="item.datatype == 2"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData.readData[item.monitorcode] == null ||
- tableData.readData[item.monitorcode] == ""
- ? "--"
- : tableData.readData[item.monitorcode]
- }}
- </view>
- <div class="spacer"></div>
- <!-- 间距 -->
- <view
- class="demo-layout bg-purple-light"
- style="color: #677799"
- >
- {{ item.des }}
- </view>
- </div>
- </div>
- </div>
- </div>
- <div class="flex-container" v-else-if="TabCur == 'fanmain'">
- <div>主机</div>
- <div
- class="itemback"
- v-for="(item, index) in showColum[TabCur + '_monitor_left']"
- :key="index"
- v-show="item.appShow == 1"
- >
- <div
- class="datacardtime"
- v-if="item.monitorcode == 'readTime' && item.datatype == 1"
- >
- <view
- class="demo-layout bg-purple-light"
- style="padding: 20rpx; color: #3787fe"
- >
- {{ readTime }}
- </view>
- </div>
- <div class="datacard" v-if="item.monitorcode !== 'readTime'">
- <div class="left-content">
- <view
- v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{ doorNetStatus == "1" ? "正常" : "异常" }}
- </view>
- <view
- v-else-if="item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== undefined &&
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== null
- ? tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <view
- v-else-if="item.datatype == 2"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== undefined &&
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== null
- ? tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <div class="spacer"></div>
- <!-- 间距 -->
- <view
- class="demo-layout bg-purple-light"
- style="color: #677799"
- >
- {{ item.des }}
- </view>
- </div>
- </div>
- </div>
- <div>备机</div>
- <div
- class="itemback"
- v-for="(item, index) in showColum[TabCur + '_monitor_left']"
- :key="index"
- v-show="item.appShow == 1"
- >
- <div
- class="datacardtime"
- v-if="item.monitorcode == 'readTime' && item.datatype == 1"
- >
- <view
- class="demo-layout bg-purple-light"
- style="padding: 20rpx; color: #3787fe"
- >
- {{ readTime }}
- </view>
- </div>
- <div class="datacard" v-if="item.monitorcode !== 'readTime'">
- <div class="left-content">
- <view
- v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{ doorNetStatus == "1" ? "正常" : "异常" }}
- </view>
- <view
- v-else-if="item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== undefined &&
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== null
- ? tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <view
- v-else-if="item.datatype == 2"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== undefined &&
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== null
- ? tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <div class="spacer"></div>
- <!-- 间距 -->
- <view
- class="demo-layout bg-purple-light"
- style="color: #677799"
- >
- {{ item.des }}
- </view>
- </div>
- </div>
- </div>
- </div>
- <div class="flex-container" v-else-if="TabCur == 'fanlocal'">
- <div>主机</div>
- <div
- class="itemback"
- v-for="(item, index) in showColum[TabCur + '_monitor_right']"
- :key="index"
- v-show="item.appShow == 1"
- >
- <div
- class="datacardtime"
- v-if="item.monitorcode == 'readTime' && item.datatype == 1"
- >
- <view
- class="demo-layout bg-purple-light"
- style="padding: 20rpx; color: #3787fe"
- >
- {{ readTime }}
- </view>
- </div>
- <div class="datacard" v-if="item.monitorcode !== 'readTime'">
- <div class="left-content">
- <view
- v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{ doorNetStatus == "1" ? "正常" : "异常" }}
- </view>
- <view
- v-else-if="item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== undefined &&
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== null
- ? tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <view
- v-else-if="item.datatype == 2"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== undefined &&
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ] !== null
- ? tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan1")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <div class="spacer"></div>
- <!-- 间距 -->
- <view
- class="demo-layout bg-purple-light"
- style="color: #677799"
- >
- {{ item.des }}
- </view>
- </div>
- </div>
- </div>
- <div>备机</div>
- <div
- class="itemback"
- v-for="(item, index) in showColum[TabCur + '_monitor_right']"
- :key="index"
- v-show="item.appShow == 1"
- >
- <div
- class="datacardtime"
- v-if="item.monitorcode == 'readTime' && item.datatype == 1"
- >
- <view
- class="demo-layout bg-purple-light"
- style="padding: 20rpx; color: #3787fe"
- >
- {{ readTime }}
- </view>
- </div>
- <div class="datacard" v-if="item.monitorcode !== 'readTime'">
- <div class="left-content">
- <view
- v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{ doorNetStatus == "1" ? "正常" : "异常" }}
- </view>
- <view
- v-else-if="item.datatype == 1"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== undefined &&
- tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== null
- ? tableData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <view
- v-else-if="item.datatype == 2"
- class="demo-layout bg-purple-light"
- style="margin-top: 60rpx; color: #3787fe"
- >
- {{
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== undefined &&
- tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ] !== null
- ? tableData.readData[
- item.monitorcode.startsWith("Fan")
- ? item.monitorcode.replace(/^Fan/, "Fan2")
- : item.monitorcode
- ]
- : "-"
- }}
- </view>
- <div class="spacer"></div>
- <!-- 间距 -->
- <view
- class="demo-layout bg-purple-light"
- style="color: #677799"
- >
- {{ item.des }}
- </view>
- </div>
- </div>
- </div>
- </div>
- </div>
- </view>
- </view>
- <u-popup :show="show" mode="bottom" :safeAreaInsetBottom="false">
- <div class="containers">
- <view class="passWordName">
- <view
- class="title"
- style="margin-top: 15px"
- v-if="this.TabCur == 'window'"
- >风窗面积</view
- >
- <u-input
- class="passArea"
- style="margin-top: 15px; border-color: #2a94ff"
- v-model="windowArea"
- type="text"
- v-if="this.TabCur == 'window'"
- ></u-input>
- </view>
- <view class="passWordInput">
- <view style="margin-top: 15px" class="title">输入密码</view>
- <u-input
- style="margin-top: 15px; border-color: #2a94ff"
- v-model="password"
- type="password"
- ></u-input
- ></view>
- </div>
- <view class="btns">
- <u-button
- style="margin: 20px"
- type="primary"
- @click="confirmPassword()"
- color="linear-gradient(to right, rgb(53, 138, 254), rgb(38, 171, 244))"
- >确认</u-button
- >
- <u-button
- style="margin: 20px"
- type="primary"
- :plain="true"
- @click="cancelPassword()"
- >取消</u-button
- >
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import api from "@/api/api";
- import initDictOptions from "@/common/util/dictUtil.js";
- import doorAnimate from "../doorAnimate/doorAnimate.vue";
- import windowAnimate from "../windowAnimate/windowAnimate.vue";
- import windrectAnimate from "../windrectAnimate/windrectAnimate.vue";
- import fanlocalAnimate from "../fanlocalAnimate/fanlocalAnimate2.vue";
- import fanmainAnimate from "../fanmainAnimate/fanmainAnimate.vue";
- export default {
- data() {
- return {
- tableData: {}, //监测数据
- typeList: [], //展示字段
- itemId: "", // 初始化 itemId
- name: "", // 初始化 name
- deviceid: "", //初始化设备id
- TabCur: "",
- checked: [],
- backPic0: "url(/static/topnavbar0.png)",
- backPic: "url(/static/topnavbar.png)",
- frontAngle: "", //风窗打开角度
- nwindownum: "", //风窗道数
- ndoorcount: "", //风门道数
- deviceType: "", //设备类型
- show: false, //密码弹窗是否显示
- password: "", //控制设备密码
- paramcode: "", //控制字段
- height: "200px",
- popupStyle: {
- // 弹窗样式
- "background-color": "#fff",
- padding: "20px",
- "box-shadow": "0 2px 4px rgba(0, 0, 0, 0.1)",
- },
- frontGateStatus: "", //前门状态
- rearGateStatus: "", //后门状态
- midGateStatus: "", //状态
- doorNetStatus: "", //风门通信状态
- warnFlag: "", //风门报警
- readTime: "", //时间
- windowAngle: 0, //前窗打开角度
- windowAngle1: 0, //后窗打开角度
- windowArea: "", //风窗面积设定值
- viedeoUrl: "", //监控url
- sign: "",
- title: "测风设备",
- fan1State: "",
- fan2State: "",
- deviceid: "", //ID
- cameralist: [], //摄像数据
- showColum: {},
- };
- },
- onLoad(query) {
- //保存id到 data 中 可以在整个页面中使用
- this.itemId = query.id;
- this.name = query.name;
- this.TabCur = query.type;
- this.ndoorcount = 2;
- },
- components: {
- doorAnimate,
- windowAnimate,
- windrectAnimate,
- fanlocalAnimate,
- fanmainAnimate,
- },
- created() {
- this.getShowColum();
- this.getDeviceInfo(this.itemId);
- this.getVideoUrlById(this.itemId);
- },
- mounted() {
- this.startTimer();
- },
- methods: {
- startTimer() {
- this.timer = setInterval(() => {
- // 执行定时任务
- this.getDeviceInfo(this.itemId);
- }, 5000);
- },
- stopTimer() {
- // 停止定时器
- clearInterval(this.timer);
- },
- // 返回上一个页面
- backPage() {
- this.$destroy();
- uni.navigateBack({
- delta: 1,
- });
- },
- getShowColum() {
- new Promise((resolve, reject) => {
- api
- .getShowColum({})
- .then((response) => {
- if (response.data.code == 200) {
- var showlist = response.data.result;
- this.$store.commit("SET_SHOWCOLUM", showlist);
- this.showColum = showlist;
- } else {
- resolve(response);
- }
- })
- .catch((error) => {
- console.log("catch===>response", response);
- reject(error);
- });
- });
- },
- // //获取app展示字段数据
- // getShowList(type) {
- // const params = {
- // devicekind: type,
- // pagetype: "detail",
- // pageNo: 1,
- // pageSize: 100,
- // };
- // new Promise((resolve, reject) => {
- // api
- // .getShowColumList(params)
- // .then((response) => {
- // if (response.data.code == 200) {
- // this.typeList = response.data.result.records;
- // } else {
- // resolve(response);
- // }
- // })
- // .catch((error) => {
- // reject(error);
- // });
- // });
- // },
- //获取详情数据
- getDeviceInfo(ID) {
- let IDString = String(ID); // 将 ID 转换为字符串
- new Promise((resolve, reject) => {
- api
- .getDeviceMonitor({ devicetype: this.TabCur, ids: IDString })
- .then((response) => {
- if (
- response.data.code == 200 &&
- response.data.result.msgTxt[0].datalist.length > 0
- ) {
- var result = response.data.result.msgTxt[0].datalist[0];
- this.tableData = result;
- if (this.tableData.frontGateOpen == "1") {
- this.tableData.frontGateOpen = "打开";
- } else {
- this.tableData.frontGateOpen = "关闭";
- }
- if (this.tableData.midGateOpen == "1") {
- this.tableData.midGateOpen = "打开";
- } else {
- this.tableData.midGateOpen = "关闭";
- }
- if (this.tableData.rearGateOpen == "1") {
- this.tableData.rearGateOpen = "打开";
- } else {
- this.tableData.rearGateOpen = "关闭";
- }
- this.fan1State = result.readData.Fan1StartStatus;
- this.fan2State = result.readData.Fan2StartStatus;
- this.nwindownum = result.nwindownum;
- this.ndoorcount = result.ndoorcount;
- this.deviceType = result.deviceType;
- this.state = result.readData.sign;
- this.frontGateStatus = this.tableData.frontGateOpen;
- this.midGateStatus = this.tableData.midGateOpen;
- this.rearGateStatus = this.tableData.rearGateOpen;
- this.doorNetStatus = result.netStatus;
- this.warnFlag = result.warnLevel_str;
- this.readTime = result.readTime;
- this.qidongfengji = result.readData.Fan1StartStatus
- ? result.readData.Fan1StartStatus
- : result.readData.Fan2StartStatus;
- var maxarea = result.maxarea;
- this.windowAngle =
- (this.tableData.forntArea / maxarea) * 100 * 0.9;
- this.windowAngle1 =
- (this.tableData.rearArea / maxarea) * 100 * 0.9;
- this.deviceid = result.deviceID;
- this.$forceUpdate();
- } else {
- resolve(response);
- }
- })
- .catch((error) => {
- reject(error);
- });
- });
- },
- //获取监控URL 通过ID获取
- getVideoUrlById(ID) {
- let IDString = String(ID); // 将 ID 转换为字符串
- new Promise((resolve, reject) => {
- api
- .getCameraById({ deviceid: IDString })
- .then((response) => {
- if (response.data.code == 200) {
- if (response.data.result.records.length > 0) {
- this.cameralist = response.data.result.records[0];
- }
- } else {
- resolve(response);
- }
- })
- .catch((error) => {
- reject(error);
- });
- });
- },
- //设备控制
- ctrlDevice(pass) {
- let IDString = String(this.itemId); // 将 ID 转换为字符串
- const params = {
- deviceid: IDString,
- devicetype: this.deviceType,
- paramcode: this.paramcode,
- password: pass,
- value: this.windowArea,
- };
- new Promise((resolve, reject) => {
- api
- .controlDevice(params)
- .then((response) => {
- if (response.data.code == 200) {
- this.getDeviceInfo(IDString);
- // console.log("操作成功");
- } else {
- resolve(response);
- }
- })
- .catch((error) => {
- reject(error);
- });
- });
- },
- // 显示密码输入弹窗
- showPasswordDialog(controlCode) {
- this.paramcode = controlCode;
- this.show = true;
- },
- // 取消密码输入
- cancelPassword() {
- this.show = false;
- },
- confirmPassword() {
- this.ctrlDevice(this.password);
- // 发起请求后关闭密码输入弹窗
- this.show = false;
- },
- },
- destroyed() {
- // 停止定时器
- this.stopTimer();
- },
- };
- </script>
- <style lang="scss" scoped>
- .top-nav {
- background-image: url(../../../../static/topnavbar.png);
- background-size: cover; /* 背景图片大小适应 */
- height: 100%;
- }
- .top-nav2 {
- background-color: #ffffff;
- }
- .main {
- margin-top: 80px;
- }
- .container {
- display: flex;
- flex-direction: column;
- }
- .button-grid {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: 5px; /* 可以根据需要调整行列之间的间距 */
- }
- .fanContent {
- display: flex;
- flex-direction: column;
- margin-top: 10rpx;
- margin-bottom: 10rpx;
- }
- .top,
- .bottom {
- flex: 1; /* 各占 50% */
- }
- .flcard {
- padding: 20rpx;
- background-color: #ffffff;
- margin-bottom: 5rpx;
- }
- .additional-div {
- grid-column: span 2; /* 让附加内容跨越三列 */
- display: flex;
- align-items: center;
- }
- .checkbox-group {
- margin-left: 10px; /* 可以根据需要调整间距 */
- }
- .card {
- background-color: #ffffff;
- margin: auto;
- margin-top: 20rpx;
- width: 90%;
- height: 280rpx;
- border: 1rpx solid #000000;
- border-radius: 20rpx;
- }
- .flex-containe {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- }
- .itemback {
- flex: 0 0 calc(33.33% - 10px); /* 使用calc函数计算每个项目的宽度,减去间距 */
- margin: 5px; /* 间距设置为5px */
- }
- .datacardtime {
- display: flex;
- width: 100%;
- flex: 1;
- margin: 1%;
- float: left;
- height: 50px;
- line-height: 29px;
- text-align: center;
- background: linear-gradient(
- to right,
- rgba(55, 135, 254, 0.08),
- rgba(4, 184, 255, 0.08),
- rgba(60, 161, 237, 0.08)
- );
- }
- .datacard {
- display: flex;
- width: 48%;
- flex: 1;
- margin: 1%;
- float: left;
- height: 180rpx;
- text-align: center;
- background: linear-gradient(
- to right,
- rgba(55, 135, 254, 0.08),
- rgba(4, 184, 255, 0.08),
- rgba(60, 161, 237, 0.08)
- );
- }
- .left-content {
- width: 100%;
- display: flex;
- flex-direction: column;
- }
- .spacer {
- height: 10rpx;
- }
- .right-content {
- width: 50%; /* 右侧内容占据50%宽度 */
- background-image: url(../../../../static/model/Pa.png);
- background-size: 100% 125%;
- }
- /*风窗样式*/
- div.autowindow_new {
- width: 200px;
- height: 200px;
- background-image: url(../../../../static/window/window-bk.png);
- background-size: 100% 100%;
- perspective: 800px;
- }
- /*风窗1 2 3 4*/
- div.window_new_1 {
- margin-top: 12px;
- margin-left: 15px;
- width: 170px;
- height: 30px;
- background-color: crimson;
- box-sizing: border-box;
- float: left;
- z-index: 1;
- /* transition: all 2s; */
- background-image: url(../../../../static/window/window_new1.png);
- background-size: 100% 100%;
- }
- div.window_new_2 {
- margin-top: 2px;
- margin-left: 15px;
- width: 170px;
- height: 29px;
- background-color: crimson;
- box-sizing: border-box;
- float: left;
- z-index: 1;
- /* transition: all 2s; */
- background-image: url(../../../../static/window/window_new1.png);
- background-size: 100% 100%;
- }
- div.window_new_3 {
- margin-top: 2px;
- margin-left: 15px;
- width: 170px;
- height: 29px;
- background-color: crimson;
- box-sizing: border-box;
- float: left;
- z-index: 1;
- /* transition: all 2s; */
- background-image: url(../../../../static/window/window_new1.png);
- background-size: 100% 100%;
- }
- div.window_new_4 {
- margin-top: 2px;
- margin-left: 15px;
- width: 170px;
- height: 29px;
- background-color: crimson;
- box-sizing: border-box;
- float: left;
- z-index: 1;
- /* transition: all 2s; */
- background-image: url(../../../../static/window/window_new1.png);
- background-size: 100% 100%;
- }
- div.window_new_5 {
- margin-top: 2px;
- margin-left: 15px;
- width: 170px;
- height: 29px;
- background-color: crimson;
- box-sizing: border-box;
- float: left;
- z-index: 1;
- /* transition: all 2s; */
- background-image: url(../../../../static/window/window_new1.png);
- background-size: 100% 100%;
- }
- div.window_new_1 {
- transition: all 2s ease;
- transform-origin: center center;
- }
- div.window_new_2 {
- transition: all 2s ease;
- transform-origin: center center;
- }
- div.window_new_3 {
- transition: all 2s ease;
- transform-origin: center center;
- }
- div.window_new_4 {
- transition: all 2s ease;
- transform-origin: center center;
- }
- div.window_new_5 {
- transition: all 2s ease;
- transform-origin: center center;
- }
- .btns {
- display: flex;
- }
- .containers {
- background-color: #fff;
- }
- .passWordName {
- margin: 20px;
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- }
- .title {
- margin-right: 20px;
- line-height: 40px;
- }
- .passWordInput {
- margin: 20px;
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- }
- .passArea {
- border-color: red;
- }
- </style>
|