autodoor.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  1. <template>
  2. <view style="overflow: auto; height: 100%">
  3. <!-- 建议放在外层 -->
  4. <u-navbar
  5. :title="name"
  6. @leftClick="backPage"
  7. :bgImage="backPic"
  8. :bgStatusImage="backPic0"
  9. >
  10. <view class="u-nav-slot" slot="left">
  11. <u-icon name="arrow-left" size="20"> </u-icon>
  12. </view>
  13. </u-navbar>
  14. <view class="main">
  15. <view class="u-page container">
  16. <div class="button-grid flcard" v-if="this.TabCur == 'gate'">
  17. <u-button
  18. type="primary"
  19. text="打开前门"
  20. @click="showPasswordDialog('frontGateOpen_S')"
  21. ></u-button>
  22. <u-button
  23. type="primary"
  24. text="关闭前门"
  25. @click="showPasswordDialog('frontGateClose_S')"
  26. ></u-button>
  27. <u-button
  28. type="primary"
  29. text="打开后门"
  30. @click="showPasswordDialog('rearGateOpen_S')"
  31. ></u-button>
  32. <u-button
  33. type="primary"
  34. text="关闭后门"
  35. @click="showPasswordDialog('rearGateClose_S')"
  36. ></u-button>
  37. <u-button
  38. type="primary"
  39. text="打开前后门"
  40. @click="showPasswordDialog('sameTimeOpen')"
  41. ></u-button>
  42. <u-button
  43. type="primary"
  44. text="关闭前后门"
  45. @click="showPasswordDialog('sameTimeClose')"
  46. ></u-button>
  47. </div>
  48. <div
  49. class="button-grid flcard"
  50. v-if="this.TabCur == 'window' && this.nwindownum == 1"
  51. >
  52. <u-button
  53. type="primary"
  54. text="设定面积"
  55. @click="showPasswordDialog('frontSetValue')"
  56. ></u-button>
  57. </div>
  58. <div
  59. class="button-grid flcard"
  60. v-if="this.TabCur == 'window' && this.nwindownum == 2"
  61. >
  62. <u-button
  63. type="primary"
  64. text="设定前窗面积"
  65. @click="showPasswordDialog('frontSetValue')"
  66. ></u-button>
  67. <u-button
  68. type="primary"
  69. text="设定后窗面积"
  70. @click="showPasswordDialog('rearSetValue')"
  71. ></u-button>
  72. </div>
  73. <div class="flcard" v-if="this.TabCur == 'gate'">
  74. <doorAnimate
  75. :gatestate1="frontGateStatus"
  76. :gatestate2="midGateStatus"
  77. :gatestate3="rearGateStatus"
  78. :cameralist="cameralist"
  79. :height="height"
  80. :doorcount="ndoorcount"
  81. ></doorAnimate>
  82. </div>
  83. <div class="flcard" v-if="this.TabCur == 'windrect'">
  84. <windrectAnimate
  85. :state="state"
  86. :title="title"
  87. :videoURL="viedeoUrl"
  88. :height="height"
  89. :type="deviceType"
  90. ></windrectAnimate>
  91. </div>
  92. <div class="flcard" v-if="this.TabCur == 'fanlocal'">
  93. <fanlocalAnimate
  94. :fan1State="fan1State"
  95. :fan2State="fan2State"
  96. :title="title"
  97. :videoURL="viedeoUrl"
  98. :height="height"
  99. ></fanlocalAnimate>
  100. </div>
  101. <div class="flcard" v-if="this.TabCur == 'fanmain'">
  102. <fanmainAnimate
  103. ref="fanpage"
  104. style="width: 100%"
  105. :door1="door1"
  106. :topdoor1="topdoor1"
  107. :fundoor1="fundoor1"
  108. :door2="door2"
  109. :topdoor2="topdoor2"
  110. :fundoor2="fundoor2"
  111. :nowfengji="qidongfengji"
  112. ></fanmainAnimate>
  113. </div>
  114. <div
  115. class="flcard"
  116. v-if="this.TabCur == 'window' && this.nwindownum == 1"
  117. >
  118. <windowAnimate
  119. :windowAngle="windowAngle"
  120. :height="height"
  121. :windowcount="nwindownum"
  122. ></windowAnimate>
  123. </div>
  124. <div
  125. class="flcard"
  126. v-if="this.TabCur == 'window' && this.nwindownum == 2"
  127. >
  128. <windowAnimate
  129. :windowAngle="windowAngle"
  130. :windowAngle1="windowAngle1"
  131. :height="height"
  132. :windowcount="nwindownum"
  133. ></windowAnimate>
  134. </div>
  135. <div class="flcard">
  136. <div
  137. class="flex-container"
  138. v-if="TabCur != 'fanlocal' && TabCur != 'fanmain'"
  139. >
  140. <div
  141. class="itemback"
  142. v-for="(item, index) in showColum[TabCur + '_detail']"
  143. :key="index"
  144. v-show="item.appShow == 1"
  145. >
  146. <div
  147. class="datacardtime"
  148. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  149. >
  150. <view
  151. class="demo-layout bg-purple-light"
  152. style="padding: 20rpx; color: #3787fe"
  153. >
  154. {{ readTime }}
  155. </view>
  156. </div>
  157. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  158. <div class="left-content">
  159. <view
  160. v-if="item.monitorcode == 'ndoortype' && item.datatype == 1"
  161. class="demo-layout bg-purple-light"
  162. style="margin-top: 60rpx; color: #3787fe"
  163. >
  164. {{
  165. tableData[item.monitorcode] == "1"
  166. ? "行人"
  167. : tableData[item.monitorcode] == "2"
  168. ? "行车"
  169. : "--"
  170. }}
  171. </view>
  172. <view
  173. v-else-if="
  174. item.monitorcode == 'netStatus' && item.datatype == 1
  175. "
  176. class="demo-layout bg-purple-light"
  177. style="margin-top: 60rpx; color: #3787fe"
  178. >
  179. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  180. </view>
  181. <view
  182. v-else-if="
  183. item.monitorcode == 'warnFlag' && item.datatype == 1
  184. "
  185. class="demo-layout bg-purple-light"
  186. style="margin-top: 60rpx; color: #3787fe"
  187. >
  188. {{ warnFlag == "1" ? "正常" : "异常" }}
  189. </view>
  190. <view
  191. v-else-if="item.datatype == 1"
  192. class="demo-layout bg-purple-light"
  193. style="margin-top: 60rpx; color: #3787fe"
  194. >
  195. {{
  196. tableData[item.monitorcode] == null ||
  197. tableData[item.monitorcode] == ""
  198. ? "--"
  199. : tableData[item.monitorcode]
  200. }}
  201. </view>
  202. <view
  203. v-else-if="item.datatype == 2"
  204. class="demo-layout bg-purple-light"
  205. style="margin-top: 60rpx; color: #3787fe"
  206. >
  207. {{
  208. tableData.readData[item.monitorcode] == null ||
  209. tableData.readData[item.monitorcode] == ""
  210. ? "--"
  211. : tableData.readData[item.monitorcode]
  212. }}
  213. </view>
  214. <div class="spacer"></div>
  215. <!-- 间距 -->
  216. <view
  217. class="demo-layout bg-purple-light"
  218. style="color: #677799"
  219. >
  220. {{ item.des }}
  221. </view>
  222. </div>
  223. <!-- <div
  224. class="right-content"
  225. :style="{
  226. backgroundImage:
  227. item.monitorcode === 'frontRearDP' ||
  228. item.monitorcode === 'frontRearDifference'
  229. ? 'url(\'../../../../static/model/Pa.png\')'
  230. : item.monitorcode === 'sourcePressure'
  231. ? 'url(\'../../../../static/model/MPa.png\')'
  232. : item.monitorcode === 'frontGateOpen'
  233. ? 'url(\'../../../../static/model/doorNet.png\')'
  234. : item.monitorcode === 'rearGateOpen'
  235. ? 'url(\'../../../../static/model/doorNet.png\')'
  236. : item.monitorcode === 'midGateOpen'
  237. ? 'url(\'../../../../static/model/doorNet.png\')'
  238. : item.monitorcode === 'warnFlag'
  239. ? 'url(\'../../../../static/model/9432.png\')'
  240. : item.monitorcode === 'netStatus'
  241. ? 'url(\'../../../../static/model/9431.png\')'
  242. : item.monitorcode === 'm3'
  243. ? 'url(\'../../../../static/model/windM3.png\')'
  244. : item.monitorcode === 'fsectarea'
  245. ? 'url(\'../../../../static/model/duanArea.png\')'
  246. : item.monitorcode === 'incipientWindSpeed1' ||
  247. item.monitorcode === 'incipientWindSpeed2' ||
  248. item.monitorcode === 'incipientWindSpeed3' ||
  249. item.monitorcode === 'va'
  250. ? 'url(\'../../../../static/model/fengsu.png\')'
  251. : 'url(\'\')',
  252. backgroundSize: '100% 100%',
  253. }"
  254. ></div> -->
  255. </div>
  256. </div>
  257. </div>
  258. <div class="flex-container" v-else-if="TabCur == 'fanmain'">
  259. <!-- <div>主机</div> -->
  260. <div
  261. class="itemback"
  262. v-for="(item, index) in showColum[TabCur + '_monitor_left']"
  263. :key="index"
  264. v-show="item.appShow == 1"
  265. >
  266. <div
  267. class="datacardtime"
  268. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  269. >
  270. <view
  271. class="demo-layout bg-purple-light"
  272. style="padding: 20rpx; color: #3787fe"
  273. >
  274. {{ readTime }}
  275. </view>
  276. </div>
  277. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  278. <div class="left-content">
  279. <view
  280. v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
  281. class="demo-layout bg-purple-light"
  282. style="margin-top: 60rpx; color: #3787fe"
  283. >
  284. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  285. </view>
  286. <view
  287. v-else-if="item.datatype == 1"
  288. class="demo-layout bg-purple-light"
  289. style="margin-top: 60rpx; color: #3787fe"
  290. >
  291. {{
  292. tableData[item.monitorcode] !== undefined &&
  293. tableData[item.monitorcode] !== null
  294. ? tableData[item.monitorcode]
  295. : "-"
  296. }}
  297. </view>
  298. <view
  299. v-else-if="item.datatype == 2"
  300. class="demo-layout bg-purple-light"
  301. style="margin-top: 60rpx; color: #3787fe"
  302. >
  303. {{
  304. tableData.readData[item.monitorcode] !== undefined &&
  305. tableData.readData[item.monitorcode] !== null
  306. ? tableData.readData[item.monitorcode]
  307. : "-"
  308. }}
  309. </view>
  310. <div class="spacer"></div>
  311. <!-- 间距 -->
  312. <view
  313. class="demo-layout bg-purple-light"
  314. style="color: #677799"
  315. >
  316. {{ item.des }}
  317. </view>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. <div class="flex-container" v-else-if="TabCur == 'fanlocal'">
  323. <!-- <div>主机</div> -->
  324. <div
  325. class="itemback"
  326. v-for="(item, index) in showColum[TabCur + '_monitor_right']"
  327. :key="index"
  328. v-show="item.appShow == 1"
  329. >
  330. <div
  331. class="datacardtime"
  332. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  333. >
  334. <view
  335. class="demo-layout bg-purple-light"
  336. style="padding: 20rpx; color: #3787fe"
  337. >
  338. {{ readTime }}
  339. </view>
  340. </div>
  341. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  342. <div class="left-content">
  343. <view
  344. v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
  345. class="demo-layout bg-purple-light"
  346. style="margin-top: 60rpx; color: #3787fe"
  347. >
  348. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  349. </view>
  350. <view
  351. v-else-if="item.datatype == 1"
  352. class="demo-layout bg-purple-light"
  353. style="margin-top: 60rpx; color: #3787fe"
  354. >
  355. {{
  356. tableData[item.monitorcode] !== undefined &&
  357. tableData[item.monitorcode] !== null
  358. ? tableData[item.monitorcode]
  359. : "-"
  360. }}
  361. </view>
  362. <view
  363. v-else-if="item.datatype == 2"
  364. class="demo-layout bg-purple-light"
  365. style="margin-top: 60rpx; color: #3787fe"
  366. >
  367. {{
  368. tableData.readData[item.monitorcode] !== undefined &&
  369. tableData.readData[item.monitorcode] !== null
  370. ? tableData.readData[item.monitorcode]
  371. : "-"
  372. }}
  373. </view>
  374. <div class="spacer"></div>
  375. <!-- 间距 -->
  376. <view
  377. class="demo-layout bg-purple-light"
  378. style="color: #677799"
  379. >
  380. {{ item.des }}
  381. </view>
  382. </div>
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. </view>
  388. </view>
  389. <u-popup :show="show" mode="bottom" :safeAreaInsetBottom="false">
  390. <div class="containers">
  391. <view class="passWordName">
  392. <view
  393. class="title"
  394. style="margin-top: 15px"
  395. v-if="this.TabCur == 'window'"
  396. >风窗面积</view
  397. >
  398. <u-input
  399. class="passArea"
  400. style="margin-top: 15px; border-color: #2a94ff"
  401. v-model="windowArea"
  402. type="text"
  403. v-if="this.TabCur == 'window'"
  404. ></u-input>
  405. </view>
  406. <view class="passWordInput">
  407. <view style="margin-top: 15px" class="title">输入密码</view>
  408. <u-input
  409. style="margin-top: 15px; border-color: #2a94ff"
  410. v-model="password"
  411. type="password"
  412. ></u-input
  413. ></view>
  414. </div>
  415. <view class="btns">
  416. <u-button
  417. style="margin: 20px"
  418. type="primary"
  419. @click="confirmPassword()"
  420. color="linear-gradient(to right, rgb(53, 138, 254), rgb(38, 171, 244))"
  421. >确认</u-button
  422. >
  423. <u-button
  424. style="margin: 20px"
  425. type="primary"
  426. :plain="true"
  427. @click="cancelPassword()"
  428. >取消</u-button
  429. >
  430. </view>
  431. </u-popup>
  432. </view>
  433. </template>
  434. <script>
  435. import api from "@/api/api";
  436. import initDictOptions from "@/common/util/dictUtil.js";
  437. import doorAnimate from "../doorAnimate/doorAnimate.vue";
  438. import windowAnimate from "../windowAnimate/windowAnimate.vue";
  439. import windrectAnimate from "../windrectAnimate/windrectAnimate.vue";
  440. import fanlocalAnimate from "../fanlocalAnimate/fanlocalAnimate2.vue";
  441. import fanmainAnimate from "../fanmainAnimate/fanmainAnimate.vue";
  442. export default {
  443. data() {
  444. return {
  445. tableData: {}, //监测数据
  446. typeList: [], //展示字段
  447. itemId: "", // 初始化 itemId
  448. name: "", // 初始化 name
  449. deviceid: "", //初始化设备id
  450. TabCur: "",
  451. checked: [],
  452. backPic0: "url(/static/topnavbar0.png)",
  453. backPic: "url(/static/topnavbar.png)",
  454. frontAngle: "", //风窗打开角度
  455. nwindownum: "", //风窗道数
  456. ndoorcount: "", //风门道数
  457. deviceType: "", //设备类型
  458. show: false, //密码弹窗是否显示
  459. password: "", //控制设备密码
  460. paramcode: "", //控制字段
  461. height: "200px",
  462. popupStyle: {
  463. // 弹窗样式
  464. "background-color": "#fff",
  465. padding: "20px",
  466. "box-shadow": "0 2px 4px rgba(0, 0, 0, 0.1)",
  467. },
  468. frontGateStatus: "", //前门状态
  469. rearGateStatus: "", //后门状态
  470. midGateStatus: "", //状态
  471. doorNetStatus: "", //风门通信状态
  472. warnFlag: "", //风门报警
  473. readTime: "", //时间
  474. windowAngle: 0, //前窗打开角度
  475. windowAngle1: 0, //后窗打开角度
  476. windowArea: "", //风窗面积设定值
  477. viedeoUrl: "", //监控url
  478. sign: "",
  479. title: "测风设备",
  480. fan1State: "",
  481. fan2State: "",
  482. deviceid: "", //ID
  483. cameralist: [], //摄像数据
  484. showColum: {},
  485. };
  486. },
  487. onLoad(query) {
  488. //保存id到 data 中 可以在整个页面中使用
  489. this.itemId = query.id;
  490. this.name = query.name;
  491. this.TabCur = query.type;
  492. this.ndoorcount = 2;
  493. },
  494. components: {
  495. doorAnimate,
  496. windowAnimate,
  497. windrectAnimate,
  498. fanlocalAnimate,
  499. fanmainAnimate,
  500. },
  501. created() {
  502. this.getShowColum();
  503. this.getDeviceInfo(this.itemId);
  504. this.getVideoUrlById(this.itemId);
  505. },
  506. mounted() {
  507. this.startTimer();
  508. },
  509. methods: {
  510. startTimer() {
  511. this.timer = setInterval(() => {
  512. // 执行定时任务
  513. this.getDeviceInfo(this.itemId);
  514. }, 5000);
  515. },
  516. stopTimer() {
  517. // 停止定时器
  518. clearInterval(this.timer);
  519. },
  520. // 返回上一个页面
  521. backPage() {
  522. this.$destroy();
  523. uni.navigateBack({
  524. delta: 1,
  525. });
  526. },
  527. getShowColum() {
  528. new Promise((resolve, reject) => {
  529. api
  530. .getShowColum({})
  531. .then((response) => {
  532. if (response.data.code == 200) {
  533. var showlist = response.data.result;
  534. this.$store.commit("SET_SHOWCOLUM", showlist);
  535. this.showColum = showlist;
  536. } else {
  537. resolve(response);
  538. }
  539. })
  540. .catch((error) => {
  541. console.log("catch===>response", response);
  542. reject(error);
  543. });
  544. });
  545. },
  546. // //获取app展示字段数据
  547. // getShowList(type) {
  548. // const params = {
  549. // devicekind: type,
  550. // pagetype: "detail",
  551. // pageNo: 1,
  552. // pageSize: 100,
  553. // };
  554. // new Promise((resolve, reject) => {
  555. // api
  556. // .getShowColumList(params)
  557. // .then((response) => {
  558. // if (response.data.code == 200) {
  559. // this.typeList = response.data.result.records;
  560. // } else {
  561. // resolve(response);
  562. // }
  563. // })
  564. // .catch((error) => {
  565. // reject(error);
  566. // });
  567. // });
  568. // },
  569. //获取详情数据
  570. getDeviceInfo(ID) {
  571. let IDString = String(ID); // 将 ID 转换为字符串
  572. new Promise((resolve, reject) => {
  573. api
  574. .getDeviceMonitor({ devicetype: this.TabCur, ids: IDString })
  575. .then((response) => {
  576. if (
  577. response.data.code == 200 &&
  578. response.data.result.msgTxt[0].datalist.length > 0
  579. ) {
  580. var result = response.data.result.msgTxt[0].datalist[0];
  581. this.tableData = result;
  582. if (this.tableData.frontGateOpen == "1") {
  583. this.tableData.frontGateOpen = "打开";
  584. } else {
  585. this.tableData.frontGateOpen = "关闭";
  586. }
  587. if (this.tableData.midGateOpen == "1") {
  588. this.tableData.midGateOpen = "打开";
  589. } else {
  590. this.tableData.midGateOpen = "关闭";
  591. }
  592. if (this.tableData.rearGateOpen == "1") {
  593. this.tableData.rearGateOpen = "打开";
  594. } else {
  595. this.tableData.rearGateOpen = "关闭";
  596. }
  597. this.fan1State = result.readData.Fan1StartStatus;
  598. this.fan2State = result.readData.Fan2StartStatus;
  599. this.nwindownum = result.nwindownum;
  600. this.ndoorcount = result.ndoorcount;
  601. this.deviceType = result.deviceType;
  602. this.state = result.readData.sign;
  603. this.frontGateStatus = this.tableData.frontGateOpen;
  604. this.midGateStatus = this.tableData.midGateOpen;
  605. this.rearGateStatus = this.tableData.rearGateOpen;
  606. this.doorNetStatus = result.netStatus;
  607. this.warnFlag = result.warnLevel_str;
  608. this.readTime = result.readTime;
  609. this.qidongfengji = result.readData.Fan1StartStatus
  610. ? result.readData.Fan1StartStatus
  611. : result.readData.Fan2StartStatus;
  612. var maxarea = result.maxarea;
  613. this.windowAngle =
  614. (this.tableData.forntArea / maxarea) * 100 * 0.9;
  615. this.windowAngle1 =
  616. (this.tableData.rearArea / maxarea) * 100 * 0.9;
  617. this.deviceid = result.deviceID;
  618. this.$forceUpdate();
  619. } else {
  620. resolve(response);
  621. }
  622. })
  623. .catch((error) => {
  624. reject(error);
  625. });
  626. });
  627. },
  628. //获取监控URL 通过ID获取
  629. getVideoUrlById(ID) {
  630. let IDString = String(ID); // 将 ID 转换为字符串
  631. new Promise((resolve, reject) => {
  632. api
  633. .getCameraById({ deviceid: IDString })
  634. .then((response) => {
  635. if (response.data.code == 200) {
  636. if (response.data.result.records.length > 0) {
  637. this.cameralist = response.data.result.records[0];
  638. }
  639. } else {
  640. resolve(response);
  641. }
  642. })
  643. .catch((error) => {
  644. reject(error);
  645. });
  646. });
  647. },
  648. //设备控制
  649. ctrlDevice(pass) {
  650. let IDString = String(this.itemId); // 将 ID 转换为字符串
  651. const params = {
  652. deviceid: IDString,
  653. devicetype: this.deviceType,
  654. paramcode: this.paramcode,
  655. password: pass,
  656. value: this.windowArea,
  657. };
  658. new Promise((resolve, reject) => {
  659. api
  660. .controlDevice(params)
  661. .then((response) => {
  662. if (response.data.code == 200) {
  663. this.getDeviceInfo(IDString);
  664. // console.log("操作成功");
  665. } else {
  666. resolve(response);
  667. }
  668. })
  669. .catch((error) => {
  670. reject(error);
  671. });
  672. });
  673. },
  674. // 显示密码输入弹窗
  675. showPasswordDialog(controlCode) {
  676. this.paramcode = controlCode;
  677. this.show = true;
  678. },
  679. // 取消密码输入
  680. cancelPassword() {
  681. this.show = false;
  682. },
  683. confirmPassword() {
  684. this.ctrlDevice(this.password);
  685. // 发起请求后关闭密码输入弹窗
  686. this.show = false;
  687. },
  688. },
  689. destroyed() {
  690. // 停止定时器
  691. this.stopTimer();
  692. },
  693. };
  694. </script>
  695. <style lang="scss" scoped>
  696. .top-nav {
  697. background-image: url(../../../../static/topnavbar.png);
  698. background-size: cover; /* 背景图片大小适应 */
  699. height: 100%;
  700. }
  701. .top-nav2 {
  702. background-color: #ffffff;
  703. }
  704. .main {
  705. margin-top: 80px;
  706. }
  707. .container {
  708. display: flex;
  709. flex-direction: column;
  710. }
  711. .button-grid {
  712. display: grid;
  713. grid-template-columns: repeat(4, 1fr);
  714. gap: 5px; /* 可以根据需要调整行列之间的间距 */
  715. }
  716. .fanContent {
  717. display: flex;
  718. flex-direction: column;
  719. margin-top: 10rpx;
  720. margin-bottom: 10rpx;
  721. }
  722. .top,
  723. .bottom {
  724. flex: 1; /* 各占 50% */
  725. }
  726. .flcard {
  727. padding: 20rpx;
  728. background-color: #ffffff;
  729. margin-bottom: 5rpx;
  730. }
  731. .additional-div {
  732. grid-column: span 2; /* 让附加内容跨越三列 */
  733. display: flex;
  734. align-items: center;
  735. }
  736. .checkbox-group {
  737. margin-left: 10px; /* 可以根据需要调整间距 */
  738. }
  739. .card {
  740. background-color: #ffffff;
  741. margin: auto;
  742. margin-top: 20rpx;
  743. width: 90%;
  744. height: 280rpx;
  745. border: 1rpx solid #000000;
  746. border-radius: 20rpx;
  747. }
  748. .flex-containe {
  749. display: flex;
  750. flex-direction: row;
  751. flex-wrap: wrap;
  752. }
  753. .itemback {
  754. flex: 0 0 calc(33.33% - 10px); /* 使用calc函数计算每个项目的宽度,减去间距 */
  755. margin: 5px; /* 间距设置为5px */
  756. }
  757. .datacardtime {
  758. display: flex;
  759. width: 100%;
  760. flex: 1;
  761. margin: 1%;
  762. float: left;
  763. height: 50px;
  764. line-height: 29px;
  765. text-align: center;
  766. background: linear-gradient(
  767. to right,
  768. rgba(55, 135, 254, 0.08),
  769. rgba(4, 184, 255, 0.08),
  770. rgba(60, 161, 237, 0.08)
  771. );
  772. }
  773. .datacard {
  774. display: flex;
  775. width: 48%;
  776. flex: 1;
  777. margin: 1%;
  778. float: left;
  779. height: 180rpx;
  780. text-align: center;
  781. background: linear-gradient(
  782. to right,
  783. rgba(55, 135, 254, 0.08),
  784. rgba(4, 184, 255, 0.08),
  785. rgba(60, 161, 237, 0.08)
  786. );
  787. }
  788. .left-content {
  789. width: 100%;
  790. display: flex;
  791. flex-direction: column;
  792. }
  793. .spacer {
  794. height: 10rpx;
  795. }
  796. .right-content {
  797. width: 50%; /* 右侧内容占据50%宽度 */
  798. background-image: url(../../../../static/model/Pa.png);
  799. background-size: 100% 125%;
  800. }
  801. /*风窗样式*/
  802. div.autowindow_new {
  803. width: 200px;
  804. height: 200px;
  805. background-image: url(../../../../static/window/window-bk.png);
  806. background-size: 100% 100%;
  807. perspective: 800px;
  808. }
  809. /*风窗1 2 3 4*/
  810. div.window_new_1 {
  811. margin-top: 12px;
  812. margin-left: 15px;
  813. width: 170px;
  814. height: 30px;
  815. background-color: crimson;
  816. box-sizing: border-box;
  817. float: left;
  818. z-index: 1;
  819. /* transition: all 2s; */
  820. background-image: url(../../../../static/window/window_new1.png);
  821. background-size: 100% 100%;
  822. }
  823. div.window_new_2 {
  824. margin-top: 2px;
  825. margin-left: 15px;
  826. width: 170px;
  827. height: 29px;
  828. background-color: crimson;
  829. box-sizing: border-box;
  830. float: left;
  831. z-index: 1;
  832. /* transition: all 2s; */
  833. background-image: url(../../../../static/window/window_new1.png);
  834. background-size: 100% 100%;
  835. }
  836. div.window_new_3 {
  837. margin-top: 2px;
  838. margin-left: 15px;
  839. width: 170px;
  840. height: 29px;
  841. background-color: crimson;
  842. box-sizing: border-box;
  843. float: left;
  844. z-index: 1;
  845. /* transition: all 2s; */
  846. background-image: url(../../../../static/window/window_new1.png);
  847. background-size: 100% 100%;
  848. }
  849. div.window_new_4 {
  850. margin-top: 2px;
  851. margin-left: 15px;
  852. width: 170px;
  853. height: 29px;
  854. background-color: crimson;
  855. box-sizing: border-box;
  856. float: left;
  857. z-index: 1;
  858. /* transition: all 2s; */
  859. background-image: url(../../../../static/window/window_new1.png);
  860. background-size: 100% 100%;
  861. }
  862. div.window_new_5 {
  863. margin-top: 2px;
  864. margin-left: 15px;
  865. width: 170px;
  866. height: 29px;
  867. background-color: crimson;
  868. box-sizing: border-box;
  869. float: left;
  870. z-index: 1;
  871. /* transition: all 2s; */
  872. background-image: url(../../../../static/window/window_new1.png);
  873. background-size: 100% 100%;
  874. }
  875. div.window_new_1 {
  876. transition: all 2s ease;
  877. transform-origin: center center;
  878. }
  879. div.window_new_2 {
  880. transition: all 2s ease;
  881. transform-origin: center center;
  882. }
  883. div.window_new_3 {
  884. transition: all 2s ease;
  885. transform-origin: center center;
  886. }
  887. div.window_new_4 {
  888. transition: all 2s ease;
  889. transform-origin: center center;
  890. }
  891. div.window_new_5 {
  892. transition: all 2s ease;
  893. transform-origin: center center;
  894. }
  895. .btns {
  896. display: flex;
  897. }
  898. .containers {
  899. background-color: #fff;
  900. }
  901. .passWordName {
  902. margin: 20px;
  903. display: flex;
  904. flex-direction: row;
  905. justify-content: space-around;
  906. }
  907. .title {
  908. margin-right: 20px;
  909. line-height: 40px;
  910. }
  911. .passWordInput {
  912. margin: 20px;
  913. display: flex;
  914. flex-direction: row;
  915. justify-content: space-around;
  916. }
  917. .passArea {
  918. border-color: red;
  919. }
  920. </style>