index.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  1. <template>
  2. <view>
  3. <view class="textbox">
  4. <view class="inputs">
  5. <u-search placeholder="请输入设备名称/编号" v-model="device_id" placeholder-color="#909696" :show-action="false"
  6. search-icon-color="#909696" @input="searchinput">
  7. </u-search>
  8. </view>
  9. <view class="tab">
  10. <view class="tab-content">
  11. <view class="tab-box tab-box-top">
  12. <view v-for="(item,index) in menuList" :key="index" @click="change(index,item)"
  13. v-if="isShow(item)"
  14. :class="['tab-item',current==index?'active':'']">
  15. <image class="img-icon" :src="item.app_menu_icon" mode=""></image>
  16. <view class="text">{{ getSlice(item.purview_name) }}</view>
  17. </view>
  18. </view>
  19. <u-empty v-if="!menuList.length && !loading" :image-size="100" text="暂无设备权限,请联系工作人员添加"></u-empty>
  20. </view>
  21. </view>
  22. <view class="listbox" v-if="menuList.length">
  23. <view class="second-tab">
  24. <view class="tab-box">
  25. <view
  26. v-for="(item,index) in list"
  27. :key="index"
  28. @click="changeDevice(item,index)"
  29. v-show="!item.url"
  30. :class="['tab-item',currents == index?'active':'']"
  31. >
  32. <text>{{item.purview_name}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="third-tab">
  37. <view
  38. class="third-tab-item"
  39. @click="changeStatus('')"
  40. :class="{'active-tab' : device_status == ''}"
  41. >总计{{ counts }}</view>
  42. <view
  43. class="third-tab-item"
  44. @click="changeStatus('1')"
  45. :class="{'active-tab' : device_status == '1'}"
  46. >在线{{ online_counts }}</view>
  47. <view
  48. class="third-tab-item"
  49. @click="changeStatus('0')"
  50. :class="{'active-tab' : device_status == '0'}"
  51. >离线{{ offline_counts }}</view>
  52. </view>
  53. <scroll-view
  54. :scroll-top="0"
  55. :scroll-y="true"
  56. class="list scroll-Y"
  57. @scrolltoupper="upper"
  58. @scrolltolower="lower"
  59. @scroll="scroll"
  60. >
  61. <view class="list_item" v-for="(item, index) in eqlistdata" :key="index" @click="historys(item)">
  62. <view class="list_item_top">
  63. <p class="p1">
  64. <span class="title">{{ (item.name || '--' )}}</span>
  65. <span class="sub-title" @click.stop="modification(item)">信息修改</span>
  66. </p>
  67. <p class="online-status"
  68. v-if="item.status == 1 || item.is_online" >
  69. <image
  70. :src="$imageURL+'/bigdata_app/newImg/home/online1.png'"
  71. mode=""
  72. ></image>
  73. <text class="status-text-online">在线</text>
  74. </p>
  75. <p
  76. v-else
  77. class="online-status"
  78. >
  79. <image
  80. :src="$imageURL+'/bigdata_app/newImg/home/offline.png'"
  81. mode=""
  82. ></image>
  83. <text class="status-text-offline">离线</text>
  84. </p>
  85. </view>
  86. <view class="list_item_text">
  87. <p v-if="item.imei">
  88. <span class="label">IMEI</span>{{ (item.dui || item.imei) }}
  89. </p>
  90. <p>
  91. <span class="label">设备ID</span>{{ item.only_for_show || item.id || item.device_id }}
  92. </p>
  93. <p>
  94. <span class="label">上报时间</span>{{ (item.report || item.uptime) | timeFormat() }}
  95. </p>
  96. <p style="display:flex;align-items: center;">
  97. <span class="label">设备位置</span>
  98. <span class="nav-label">{{ (item.address|| '无') }}</span>
  99. </p>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. </view>
  104. </view>
  105. <view class="loading" v-if="loadingtf">
  106. <image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
  107. </view>
  108. <view class="top" v-if="isTop" @click="top">
  109. <image
  110. :src="
  111. $imageURL+'/bigdata_app' +
  112. '/image/6209a98f0cb3b5086f2ca36152c9269.png'
  113. " mode=""></image>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. Debounce,
  120. Throttle
  121. } from '../../util/anitthro.js';
  122. export default {
  123. data() {
  124. return {
  125. list: [],
  126. pur_id: '',
  127. loading: false,
  128. currentPur_id:'',
  129. device_status: '',
  130. counts:0,
  131. online_counts:0,
  132. offline_counts:0,
  133. current: 0,
  134. currents: 0,
  135. total: 0,
  136. refreshData:'',
  137. page: 1,
  138. size: 10,
  139. eqlistdata: [],
  140. isTop: false,
  141. device_model: '',
  142. infoalter: false, // 权限设置,
  143. type_id: 0, //设备类型,
  144. imgpath: [],
  145. loadingtf: false,
  146. width: 0, //顶部搜索栏宽度
  147. device_id: '', //搜索设备ID
  148. menuList: []
  149. };
  150. },
  151. methods: {
  152. isShow(item){
  153. return item.pur_id != 422
  154. },
  155. getSlice(name){
  156. return name.slice(0,4)
  157. },
  158. modification(item) {
  159. uni.navigateTo({
  160. url:
  161. './seabox/modification?data=' +
  162. JSON.stringify(item) +
  163. '&id=' +
  164. this.type_id,
  165. });
  166. },
  167. changeStatus(status){
  168. this.device_status = status;
  169. Debounce(() => {
  170. this.page = 1;
  171. this.eqlist();
  172. }, 500)();
  173. },
  174. async getUserlogin() {
  175. this.list = [];
  176. this.loading = true;
  177. const res = await this.$myRequest({
  178. url: '/api/api_gateway?method=user.login.user_login_info',
  179. method: 'POST',
  180. data: {
  181. is_app: 1,
  182. },
  183. });
  184. this.loading = false;
  185. res.forEach(item=>{
  186. item.icon = '/bigdata_app/newImg/home/sqjd.png'
  187. })
  188. const menulist = res || [];
  189. const menuItem = menulist.find(item => item.purview_name == '智慧物联')
  190. this.menuList = menuItem.children || [];
  191. if(this.menuList.length == 0){
  192. //提示暂无分配权限
  193. uni.showToast({
  194. title: '暂无分配权限,请联系工作人员',
  195. icon: 'none',
  196. });
  197. return
  198. }
  199. if(!this.pur_id){
  200. this.list = this.menuList[0].children || []
  201. this.pur_id = this.menuList[0].pur_id || '';
  202. this.current = 0;
  203. }else{
  204. this.list = this.menuList.find(item => item.pur_id == this.pur_id)?.children || []
  205. this.pur_id = this.menuList.find(item => item.pur_id == this.pur_id)?.pur_id || '';
  206. this.current = this.menuList.findIndex(item => item.pur_id == this.pur_id);
  207. }
  208. if(this.list.length > 1){
  209. if(this.list[0].purview_name != '全部'){
  210. this.list.unshift({
  211. device_type_id: '',
  212. purview_name: '全部'
  213. })
  214. }
  215. }
  216. const firstChild = this.list[0];
  217. this.type_id = firstChild.device_type_id;
  218. if(firstChild.device_type_id !== ''){
  219. this.device_model = firstChild?.device_model || '';
  220. }else{
  221. this.device_model = '';
  222. }
  223. this.initPage();
  224. },
  225. async eqlist(tf) {
  226. this.counts = 0;
  227. this.online_counts = 0;
  228. this.offline_counts = 0;
  229. this.loadingtf = true;
  230. let data = {
  231. device_type_id: this.type_id,
  232. page_num: this.page,
  233. page_size: this.size,
  234. pur_id: this.pur_id,
  235. device_status: this.device_status,
  236. device_id: this.device_id,
  237. device_model: this.device_model
  238. }
  239. const res = await this.$myRequest({
  240. url: '/api/api_gateway?method=device.app_device.app_device_list',
  241. data: data,
  242. });
  243. this.loadingtf = false;
  244. const status = res?.status || {};
  245. this.online_counts = status.online || 0;
  246. this.offline_counts = status.offline || 0;
  247. this.counts = (status.online || 0) + (status.offline || 0);
  248. this.total = res.total || 0;
  249. if (tf) {
  250. this.eqlistdata = this.eqlistdata.concat(res.data);
  251. } else {
  252. this.eqlistdata = res.data;
  253. }
  254. },
  255. change(index,itemData) {
  256. this.list = this.menuList[index].children || []
  257. const list = [];
  258. this.list.forEach(item=>{
  259. if(item.url){
  260. list.push(item)
  261. }
  262. })
  263. // if(list.length > 1){
  264. // if(this.list[0].purview_name != '全部'){
  265. // this.list.unshift({
  266. // device_type_id: '',
  267. // purview_name: '全部'
  268. // })
  269. // }
  270. // }
  271. this.current = index;
  272. const item = this.list[0];
  273. this.pur_id = itemData.pur_id || '';
  274. // this.changeDevice(item,0);
  275. },
  276. changeDevice(item,index){
  277. this.currents = index;
  278. this.currentPur_id = item.pur_id || '';
  279. const name = item.menu;
  280. if (name === 'cbd4') {
  281. this.device_model = 11;
  282. } else if(name === 'cbd1'){
  283. this.device_model = 12;
  284. } else if(name === 'cbd3'){
  285. this.device_model = '';
  286. } else if(name === 'cbd5'){
  287. this.device_model = 13;
  288. } else if(name === 'cbd6'){
  289. this.device_model = 14;
  290. }else if(name === 'gkcbd1'){
  291. this.device_model = 15;
  292. } else if(name === 'zhiCbd'){
  293. this.device_model = 16;
  294. } else {
  295. this.device_model = item.device_model || '';
  296. }
  297. this.page = 1;
  298. this.eqlistdata = [];
  299. this.type_id = item.device_type_id;
  300. Debounce(() => {
  301. this.eqlist();
  302. }, 500)();
  303. },
  304. top() {
  305. uni.pageScrollTo({
  306. scrollTop: 0,
  307. duration: 500,
  308. });
  309. },
  310. initPage(){
  311. this.eqlistdata = [];
  312. this.currents = 0;
  313. this.page = 1;
  314. Debounce(() => {
  315. this.eqlist();
  316. }, 500)();
  317. this.width = 0;
  318. },
  319. historys(item) {
  320. const type_id = item.type_id;
  321. item.pur_id = this.pur_id;
  322. switch (type_id) {
  323. // 水肥新设备
  324. case 22:
  325. var obj = {};
  326. obj.d_id = item.d_id;
  327. obj.device_id = item.id;
  328. obj.is_online = item.status;
  329. obj.lat = item.lat;
  330. obj.lng = item.lng;
  331. obj.equip_name = item.name;
  332. obj.uptime = item.uptime;
  333. uni.navigateTo({
  334. url: '../waterandfernew/details?shebei=' + JSON.stringify(obj),
  335. });
  336. break;
  337. // 病虫害可视监测
  338. case 14:
  339. item.addtime = item.uptime;
  340. uni.navigateTo({
  341. url: '../cb/sy/detail?detail=' + JSON.stringify(item),
  342. });
  343. break;
  344. case 2:
  345. item.addtime = item.uptime;
  346. // uni.navigateTo({
  347. // url: '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
  348. // });
  349. // uni.navigateTo({
  350. // url: '../scd/detail?info=' + JSON.stringify(item),
  351. // });
  352. if(item.device_model == 102){
  353. uni.navigateTo({
  354. url: '../scd/detail?info=' + JSON.stringify(item),
  355. });
  356. }else{
  357. uni.navigateTo({
  358. url: '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
  359. });
  360. }
  361. break;
  362. case 38:
  363. var obj = {};
  364. obj.d_id = item.d_id;
  365. obj.equip_id = item.id;
  366. obj.is_online = item.status;
  367. obj.lat = item.lat;
  368. obj.lng = item.lng;
  369. obj.equip_name = item.name;
  370. obj.uptime = item.uptime;
  371. uni.navigateTo({
  372. url: '../environment/equipment-new?shebei=' + JSON.stringify(obj),
  373. });
  374. break;
  375. case 5:
  376. var obj = {};
  377. obj.d_id = item.d_id;
  378. obj.equip_id = item.id;
  379. obj.is_online = item.status;
  380. obj.lat = item.lat;
  381. obj.lng = item.lng;
  382. obj.equip_name = item.name;
  383. obj.uptime = item.uptime;
  384. uni.navigateTo({
  385. url: '../environment/equipment?shebei=' + JSON.stringify(obj),
  386. });
  387. break;
  388. case 6:
  389. uni.navigateTo({
  390. url: '/pages/webview?device_id=' +
  391. item.id +
  392. '&accessToken=' +
  393. this.accessToken,
  394. });
  395. break;
  396. case 44:
  397. uni.navigateTo({
  398. url:
  399. '/pages/webviewdgp?device_id=' +
  400. item.id +
  401. '&accessToken=' +
  402. uni.getStorageSync('session_key') +
  403. '&type=dgp',
  404. });
  405. break;
  406. case 3:
  407. item.addtime = item.uptime;
  408. item.type = item.type_id;
  409. uni.navigateTo({
  410. url: '../cbd/detail?info=' + JSON.stringify(item),
  411. });
  412. break;
  413. case 28:
  414. item.addtime = item.uptime;
  415. item.type = item.type_id;
  416. uni.navigateTo({
  417. url: '../cb/smallPest/smallPest?info=' + JSON.stringify(item),
  418. });
  419. break;
  420. case 4:
  421. item.addtime = item.uptime;
  422. item.type = item.type_id;
  423. uni.navigateTo({
  424. url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
  425. });
  426. break;
  427. case 32:
  428. case 35:
  429. item.addtime = item.uptime;
  430. item.type = item.type_id;
  431. uni.navigateTo({
  432. url: '../cb/equip-detail/equip-detail-new?info=' +
  433. JSON.stringify(item),
  434. });
  435. break;
  436. case 33:
  437. case 34:
  438. item.addtime = item.uptime;
  439. item.type = item.type_id;
  440. // uni.navigateTo({
  441. // url: '../cb/equip-detail/equip-detail-new?info=' +
  442. // JSON.stringify(item),
  443. // });
  444. let cmd = ''
  445. if(type_id == 34){
  446. cmd = 'sy1'
  447. }else if(type_id == 33){
  448. cmd = 'sy2'
  449. }
  450. uni.navigateTo({
  451. url: '../sy/detail?info=' +
  452. JSON.stringify(item) +
  453. '&cmd=' +
  454. cmd,
  455. });
  456. break;
  457. case 7:
  458. item.addtime = item.uptime;
  459. item.type = item.type_id;
  460. // uni.navigateTo({
  461. // url: '../bzy/detail?info=' + JSON.stringify(item),
  462. // });
  463. if(item.pur_id == 458){
  464. uni.navigateTo({
  465. url: '../bzy/detail?info=' + JSON.stringify(item),
  466. });
  467. }else{
  468. uni.navigateTo({
  469. url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
  470. });
  471. }
  472. break;
  473. case 8:
  474. uni.navigateTo({
  475. url: '../cb/thxydetail/thxydetail?imei=' + item.id,
  476. });
  477. break;
  478. case 29:
  479. uni.navigateTo({
  480. url: `../cb/nlNewXy/nlNewXy?imei=${item.id}&showId=${item.d_id}`,
  481. });
  482. break;
  483. case 24:
  484. uni.navigateTo({
  485. url: '../cb/zjxydetail/thxydetail?imei=' + item.id,
  486. });
  487. break;
  488. case 12:
  489. item.addtime = item.uptime;
  490. uni.navigateTo({
  491. url: '../cb/xctdetail/xctdetail?info=' + JSON.stringify(item),
  492. });
  493. break;
  494. case 13:
  495. var obj = {};
  496. obj.d_id = item.d_id;
  497. obj.device_id = item.id;
  498. obj.is_online = item.status;
  499. obj.lat = item.lat;
  500. obj.lng = item.lng;
  501. obj.equip_name = item.name;
  502. obj.uptime = item.uptime;
  503. uni.navigateTo({
  504. url: '../waterandfer/datails?shebei=' + JSON.stringify(obj),
  505. });
  506. break;
  507. case 15:
  508. var obj = {};
  509. obj.d_id = item.d_id;
  510. obj.device_id = item.id;
  511. obj.is_online = item.status;
  512. obj.lat = item.lat;
  513. obj.lng = item.lng;
  514. obj.equip_name = item.name;
  515. obj.uptime = item.uptime;
  516. obj.address = item.address || '无';
  517. uni.navigateTo({
  518. url: '../environment/gsequipment?shebei=' + JSON.stringify(obj),
  519. });
  520. break;
  521. case 17:
  522. break;
  523. case 18:
  524. var obj = {};
  525. obj.device_id = item.id;
  526. obj.is_online = item.status;
  527. uni.navigateTo({
  528. url: '../cb/shuifeiL/shuifeiL?detail=' + JSON.stringify(obj),
  529. });
  530. break;
  531. case 43:
  532. uni.navigateTo({
  533. url: "/pages/fmSys/details?info=" + JSON.stringify(item)
  534. })
  535. break;
  536. // case 44:
  537. // uni.navigateTo({
  538. // url: "/pages/webviewdgp/webview?device_id=" + item.id + "&accessToken=" + this.accessToken || uni
  539. // .getStorageSync('session_key') +
  540. // '&type=dgp'
  541. // })
  542. // break;
  543. case 11:
  544. var obj = {};
  545. obj.d_id = item.d_id;
  546. obj.device_id = item.id;
  547. obj.is_online = item.status;
  548. obj.lat = item.lat;
  549. obj.lng = item.lng;
  550. obj.equip_name = item.name;
  551. obj.uptime = item.uptime;
  552. obj.location = item.address;
  553. obj.type = 11;
  554. uni.navigateTo({
  555. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  556. });
  557. break;
  558. case 19:
  559. var obj = {};
  560. obj.d_id = item.d_id;
  561. obj.device_id = item.id;
  562. obj.is_online = item.status;
  563. obj.lat = item.lat;
  564. obj.lng = item.lng;
  565. obj.equip_name = item.name;
  566. obj.uptime = item.uptime;
  567. obj.location = item.address;
  568. obj.type = 19;
  569. uni.navigateTo({
  570. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  571. });
  572. break;
  573. case 20:
  574. var obj = {};
  575. obj.d_id = item.d_id;
  576. obj.device_id = item.id;
  577. obj.is_online = item.status;
  578. obj.lat = item.lat;
  579. obj.lng = item.lng;
  580. obj.equip_name = item.name;
  581. obj.uptime = item.uptime;
  582. obj.location = item.address;
  583. obj.type = 20;
  584. uni.navigateTo({
  585. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  586. });
  587. break;
  588. case 21:
  589. var obj = {};
  590. obj.d_id = item.d_id;
  591. obj.device_id = item.id;
  592. obj.is_online = item.status;
  593. obj.lat = item.lat;
  594. obj.lng = item.lng;
  595. obj.equip_name = item.name;
  596. obj.uptime = item.uptime;
  597. obj.location = item.address;
  598. obj.type = 21;
  599. uni.navigateTo({
  600. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  601. });
  602. break;
  603. case 26:
  604. var obj = {};
  605. obj.d_id = item.d_id;
  606. obj.device_id = item.id;
  607. obj.is_online = item.status;
  608. obj.lat = item.lat;
  609. obj.lng = item.lng;
  610. obj.equip_name = item.name;
  611. obj.uptime = item.uptime;
  612. obj.location = item.address;
  613. obj.type = 26;
  614. uni.navigateTo({
  615. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  616. });
  617. break;
  618. case 27:
  619. var obj = {};
  620. obj.d_id = item.d_id;
  621. obj.device_id = item.id;
  622. obj.is_online = item.status;
  623. obj.lat = item.lat;
  624. obj.lng = item.lng;
  625. obj.equip_name = item.name;
  626. obj.uptime = item.uptime;
  627. obj.location = item.address;
  628. obj.type = 26;
  629. uni.navigateTo({
  630. url: '../disease/mls/mls?shebei=' + JSON.stringify(obj),
  631. });
  632. break;
  633. case 25:
  634. item.addtime = item.uptime;
  635. uni.navigateTo({
  636. url: '../cb/xylps/detail?detail=' + JSON.stringify(item),
  637. });
  638. break;
  639. case 40:
  640. item.addtime = item.uptime;
  641. uni.navigateTo({
  642. url: `../cb/shuifeizs/shuifeizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  643. });
  644. break;
  645. case 42:
  646. item.addtime = item.uptime;
  647. uni.navigateTo({
  648. url: `../cb/wenshizs/wenshizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  649. });
  650. break;
  651. case 45:
  652. item.addtime = item.uptime;
  653. uni.navigateTo({
  654. url: `../cb/shuifeizsFirst/shuifeizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  655. });
  656. break;
  657. case 46:
  658. uni.navigateTo({
  659. url: `../deviceDetails/weatherStation/index?devBid=${item.id}&devName=${item.name}&devStatus=${item.status}&address=${item.address}&uptime=${item.uptime}&d_id=${item.d_id}&deviceType=46`,
  660. });
  661. break;
  662. case 47:
  663. uni.navigateTo({
  664. url: `../cb/zhamenFirst/zhamenzs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  665. });
  666. break;
  667. default:
  668. item.addtime = item.uptime;
  669. item.type = this.type_id;
  670. uni.navigateTo({
  671. url: '../cb/xy2.0/particulars?info=' + JSON.stringify(item),
  672. });
  673. break;
  674. }
  675. },
  676. searchinput() {
  677. Debounce(() => {
  678. this.eqlistdata = [];
  679. this.page = 1;
  680. this.eqlist();
  681. }, 1000)();
  682. },
  683. scrollTop(e) {},
  684. upper() {},
  685. lower() {
  686. if(this.eqlistdata.length >= this.total){
  687. return;
  688. }
  689. Debounce(() => {
  690. this.page++;
  691. this.eqlist(true);
  692. }, 500)();
  693. },
  694. scroll() {},
  695. },
  696. watch:{
  697. pur_id(){
  698. setTimeout(() => {
  699. this.getUserlogin();
  700. }, 100);
  701. },
  702. },
  703. onLoad() {
  704. const that = this;
  705. uni.$on('purId', (item) => {
  706. that.pur_id = item.purId;
  707. that.menu = item.menu;
  708. that.device_model = item.device_model;
  709. });
  710. uni.$on('refreshData', (refreshData) => {
  711. this.eqlist();
  712. });
  713. this.getUserlogin();
  714. },
  715. onShow() {
  716. // 监听刷新数据事件
  717. const refreshData = uni.getStorageSync('refreshData');
  718. if(!this.refreshData){
  719. this.refreshData = refreshData;
  720. // 如果发生改变,刷新数据
  721. if(refreshData){
  722. Debounce(() => {
  723. this.getUserlogin();
  724. }, 500)();
  725. }
  726. }else if(this.refreshData != refreshData){
  727. this.refreshData = refreshData;
  728. Debounce(() => {
  729. this.getUserlogin();
  730. }, 500)();
  731. }
  732. },
  733. onTabItemTap(e) {
  734. },
  735. onReachBottom() {
  736. if(this.eqlistdata.length >= this.total){
  737. return;
  738. }
  739. Debounce(() => {
  740. this.page++;
  741. this.eqlist(true);
  742. }, 500)();
  743. },
  744. onPageScroll(e) {
  745. //nvue暂不支持滚动监听,可用bindingx代替
  746. if (e.scrollTop > 200) {
  747. //距离大于200时显示
  748. this.isTop = true;
  749. } else {
  750. //距离小于200时隐藏
  751. this.isTop = false;
  752. }
  753. },
  754. };
  755. </script>
  756. <style lang="scss">
  757. page {
  758. background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  759. }
  760. /deep/.uni-icons {
  761. font-size: 40rpx !important;
  762. }
  763. input{
  764. background: transparent !important;
  765. }
  766. .textbox {
  767. width: 100%;
  768. height: calc(100vh - 82rpx);
  769. padding-top: 82rpx;
  770. box-sizing: border-box;
  771. }
  772. .inputs {
  773. width: 65%;
  774. margin-left: 12rpx;
  775. /deep/.u-content {
  776. background-color: #fff !important;
  777. }
  778. /deep/.uni-input-wrapper {
  779. background-color: #fff !important;
  780. }
  781. }
  782. .utabs_box {
  783. width: 100%;
  784. position: fixed;
  785. top: 88px;
  786. background-color: #ffffff;
  787. z-index: 100;
  788. .utabs {
  789. width: 95%;
  790. margin: 0 auto;
  791. }
  792. }
  793. .loading {
  794. position: fixed;
  795. top: 440px;
  796. width: 95%;
  797. left: 2.5%;
  798. text-align: center;
  799. .img {
  800. width: 300rpx;
  801. height: 40rpx;
  802. }
  803. }
  804. .active-tab{
  805. border-radius: 8rpx;
  806. background: linear-gradient(0deg, #0bbc580f 0%, #0bbc580f 100%), #00000005;
  807. }
  808. .tab-box {
  809. font-size: 30rpx;
  810. box-sizing: border-box;
  811. width: 100%;
  812. height: 100%;
  813. overflow-y: hidden;
  814. overflow-x: auto;
  815. white-space: nowrap;
  816. // 去掉滚动条
  817. -ms-overflow-style: none;
  818. scrollbar-width: none;
  819. .tab-item {
  820. cursor: pointer;
  821. position: relative;
  822. text-align: center;
  823. display: inline-block;
  824. padding: 16rpx 24rpx;
  825. box-sizing: border-box;
  826. span {
  827. display: inline-block;
  828. }
  829. }
  830. }
  831. .tab-box-top{
  832. .tab-item {
  833. width: 140rpx;
  834. text-align: center;
  835. }
  836. }
  837. .tab {
  838. // background-color: #0BBC58;
  839. margin-top: 42rpx;
  840. margin-bottom: 38rpx;
  841. padding: 0 32rpx;
  842. .img-icon {
  843. width: 80rpx;
  844. height: 80rpx;
  845. margin-bottom: 12rpx;
  846. }
  847. .text {
  848. color: #303133;
  849. font-size: 24rpx;
  850. }
  851. .tab-content {
  852. width: 100%;
  853. height: 162rpx;
  854. }
  855. .tab-item.active {
  856. border-radius: 24rpx;
  857. background: linear-gradient(0deg, #0bbc580f 0%, #0bbc580f 100%), #00000005;
  858. }
  859. }
  860. .second-tab {
  861. height: 80rpx;
  862. .tab-item{
  863. font-size: 28rpx;
  864. color: #999999;
  865. }
  866. .tab-item.active {
  867. color: #303133;
  868. font-weight: 700;
  869. }
  870. .tab-item.active::after {
  871. content: '';
  872. position: absolute;
  873. bottom: 0;
  874. left: 50%;
  875. transform: translateX(-50%);
  876. width: 18px; /* 比文字略宽 */
  877. height: 18px;
  878. border: 3px solid #0BBC58;
  879. border-radius: 50%;
  880. border-color: transparent; /* 隐藏其他部分 */
  881. border-bottom-color: #0BBC58; /* 组合成45度角 */
  882. // transform: rotate(0deg); /* 调整角度 */
  883. }
  884. }
  885. .third-tab {
  886. margin: 8rpx 0;
  887. height: 64rpx;
  888. line-height: 64rpx;
  889. display: flex;
  890. justify-content: space-between;
  891. .third-tab-item {
  892. flex: 1;
  893. text-align: center;
  894. }
  895. }
  896. .list {
  897. width: 100%;
  898. background-color: #F5F6FA;
  899. // margin-bottom: 100rpx;
  900. overflow-y: auto;
  901. padding: 0 32rpx;
  902. box-sizing: border-box;
  903. .list_item {
  904. width: 100%;
  905. margin: 0 auto 24rpx;
  906. padding: 32rpx;
  907. box-sizing: border-box;
  908. position: relative;
  909. background-color: #ffffff;
  910. border-radius: 16rpx;
  911. .list_item_top {
  912. .p1 {
  913. width: 86%;
  914. font-size: 28rpx;
  915. overflow: hidden;
  916. display: flex;
  917. align-items: center;
  918. .title{
  919. max-width: 75%;
  920. color: #333333;
  921. font-size: 28rpx;
  922. font-weight: 700;
  923. margin-right: 8rpx;
  924. overflow: hidden;
  925. text-overflow: ellipsis;
  926. white-space: nowrap;
  927. }
  928. .sub-title{
  929. border-radius: 32rpx;
  930. border:2rpx solid #0bbc58;
  931. padding: 4rpx 12rpx;
  932. font-size: 22rpx;
  933. font-weight: 400;
  934. overflow: hidden;
  935. text-overflow: ellipsis;
  936. white-space: nowrap;
  937. color:#0bbc58;
  938. margin-left: 20rpx;
  939. }
  940. }
  941. }
  942. .online-status{
  943. font-size: 28rpx;
  944. position: absolute;
  945. top:0rpx;
  946. text-align: center;
  947. right: 8rpx;
  948. top: 2rpx;
  949. width: 76px;
  950. height: 28px;
  951. // line-height: 28px;
  952. // border-radius: 0px 0px 0px 26px;
  953. // border: 1px solid #ffffff;
  954. image{
  955. width: 140rpx;
  956. height: 56rpx;
  957. }
  958. .status-text-online{
  959. color: #0BBC58;
  960. position: absolute;
  961. top: 0rpx;
  962. right: 0rpx;
  963. width: 120rpx;
  964. height: 56rpx;
  965. line-height: 56rpx;
  966. font-size: 26rpx;
  967. }
  968. .status-text-offline{
  969. color: #FB4E52;
  970. position: absolute;
  971. top: 0rpx;
  972. right: 0rpx;
  973. width: 120rpx;
  974. height: 56rpx;
  975. line-height: 56rpx;
  976. font-size: 26rpx;
  977. }
  978. }
  979. // .p2 {
  980. // color: #0BBC58;
  981. // background: #0bbc581a;
  982. // }
  983. // .p_out {
  984. // color: #FB4E52;
  985. // background: #fb4e521a;
  986. // }
  987. .list_item_text {
  988. margin-top: 20rpx;
  989. p {
  990. font-size: 24rpx;
  991. color: #303133;
  992. margin-top: 10rpx;
  993. word-break: break-all;
  994. }
  995. .label{
  996. color: #999999;
  997. text-align: left;
  998. margin-right: 32rpx;
  999. font-size: 24rpx;
  1000. min-width: 90rpx;
  1001. display: inline-block;
  1002. }
  1003. .nav-label{
  1004. //超出隐藏
  1005. display: inline-block;
  1006. width: 70%;
  1007. overflow: hidden;
  1008. text-overflow: ellipsis;
  1009. white-space: nowrap;
  1010. }
  1011. }
  1012. .list_item_btn {
  1013. width: 126rpx;
  1014. color: #42b983;
  1015. height: 40rpx;
  1016. text-align: center;
  1017. border: 1rpx solid #42b983;
  1018. border-radius: 25rpx;
  1019. font-size: 24rpx;
  1020. line-height: 35rpx;
  1021. position: absolute;
  1022. bottom: 15rpx;
  1023. right: 20rpx;
  1024. }
  1025. }
  1026. }
  1027. .top {
  1028. position: fixed;
  1029. right: 30px;
  1030. bottom: 100px;
  1031. z-index: 100;
  1032. image {
  1033. width: 100rpx;
  1034. height: 100rpx;
  1035. }
  1036. }
  1037. </style>