infoPage.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  1. <template>
  2. <view id="iotDevice-info-page">
  3. <!-- 基础信息 -->
  4. <view class="info-title-max-big-box">
  5. <view class="info-title-name-box">
  6. <view>设备名称:{{newData.deviceName}}</view>
  7. <view :class="newData.online?'online-1':'online-2'">{{newData.online ?'在线':'离线'}}</view>
  8. </view>
  9. <view class="info-title-name-box">
  10. <view>设备类型:{{newData.typeName}}</view>
  11. <view :class="newData.state?'state-1':'state-2'">{{newData.state ?'启用':'停用'}}</view>
  12. </view>
  13. <view class="info-title-text"><span>设备编号:</span>{{newData.deviceNo}}</view>
  14. <view class="info-title-text"><span>设备ID:</span>{{newData.id}}</view>
  15. <view class="info-title-text">
  16. <span>位置:</span>
  17. {{newData.schoolName?newData.schoolName:''}}
  18. {{newData.schoolName?' - '+newData.buildName:''}}
  19. {{newData.buildName?' - '+newData.floorName:''}}
  20. {{newData.floorName?' - '+newData.subjectName:''}}
  21. </view>
  22. </view>
  23. <!-- 选项卡按钮 -->
  24. <view class="info-button-max-big-box">
  25. <view class="info-button-view" @click="buttonCheck(1)"
  26. :class="pageType == 1?'info-button-check':''">设备日志</view>
  27. <view class="info-button-view" @click="buttonCheck(2)"
  28. :class="pageType == 2?'info-button-check':''">设备诊断</view>
  29. <view class="info-button-view" @click="buttonCheck(3)"
  30. :class="pageType == 3?'info-button-check':''">设备调试</view>
  31. <view class="info-button-view" @click="buttonCheck(4)" v-if="newData.typeKey == 'sensor'"
  32. :class="pageType == 4?'info-button-check':''">上报数据</view>
  33. </view>
  34. <!-- 设备日志 -->
  35. <view class="info-log-max-big-box" v-if="pageType == 1">
  36. <view class="query-max-big-box">
  37. <view class="query-input-box">
  38. <picker @change="typeListChange" :value="typeListIndex" :range="typeList">
  39. <view style="width:330rpx;" class="query-input"
  40. :class="!typeName?'query-input-placeholder':''">
  41. {{typeName?typeName:'选择类型'}}
  42. </view>
  43. </picker>
  44. </view>
  45. <view class="query-button-one" @click="handleQuery">查询</view>
  46. <view class="query-button-two" @click="resetQuery">重置</view>
  47. </view>
  48. <view class="list-max-big-box">
  49. <view class="list-max-big-null" v-if="!dataList[0]">暂无数据</view>
  50. <view class="for-list-max-big-box"
  51. v-for="(item,index) in dataList" :key="index">
  52. <view class="for-list-title-box">
  53. <view>{{item.logTypeName}}</view>
  54. <view :class="item.state?'stateColorA':'stateColorB'">{{item.state?'成功':'失败'}}</view>
  55. <view>{{parseTime(item.createTime,"{y}-{m}-{d} {h}:{i}")}}</view>
  56. </view>
  57. <view class="for-list-remark-box">
  58. <view class="for-list-remark">备注:{{item.remark}}</view>
  59. <view class="for-list-button" @click="shadeOpen(item,1)">查看</view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="pagination-max-big-box">
  64. <view class="pagination-button" @click="paginationButton(1)"
  65. :class="queryParams.page == 1 ? 'pagination-color':''">上一页</view>
  66. <view class="pagination-num">{{queryParams.page}}/{{pages}}</view>
  67. <view class="pagination-button" @click="paginationButton(2)"
  68. :class="queryParams.page == pages || queryParams.page > pages ? 'pagination-color':''">下一页</view>
  69. </view>
  70. </view>
  71. <!-- 设备诊断 -->
  72. <view class="info-feature-max-big-box" v-if="pageType == 2">
  73. <view class="schedule-box">
  74. <view class="schedule-min-box">
  75. <view :style="'width:'+scheduleData.schedule+'%;'"></view>
  76. </view>
  77. <view class="schedule-title-box">
  78. <view v-if="scheduleData.featureType > 0">{{scheduleData.featureType == 3 ? '诊断完成' : '诊断中...'}}</view>
  79. </view>
  80. </view>
  81. <view class="info-feature-for-box"
  82. v-for="(item,index) in featureDataList" :key="index">
  83. <image :src="item.featureType == 0 ? warningImg : (item.featureType == 1 ? successImg : errorImg)"></image>
  84. <view class="info-feature-for-title-box">
  85. <view>{{item.name}}</view>
  86. <view>{{item.remark}}</view>
  87. </view>
  88. <view class="info-feature-for-type-box"
  89. :class="item.featureType === 0?'colorC':(item.featureType === 1?'colorA':'colorB')">
  90. {{item.featureType == 0 ?'':(item.featureType == 1 ?'正常':item.response)}}
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 功能调试 -->
  95. <view class="info-deBug-max-big-box" v-if="pageType == 3">
  96. <view class="info-deBug-max-big-null" v-if="!debugDataList[0]">暂无数据</view>
  97. <view class="info-deBug-for-box" @click.stop="lookDebugInfo(item)"
  98. v-for="(item,index) in debugDataList" :key="index">
  99. <image :src="item.featureType == 0 ? warningImg : (item.featureType == 1 ? successImg : errorImg)"></image>
  100. <view class="info-deBug-for-title-box">
  101. <view>{{item.name}}</view>
  102. <view>{{item.remark}}</view>
  103. </view>
  104. <view class="info-deBug-for-type-box"
  105. :class="item.featureType === 0?'colorC':(item.featureType === 1?'colorA':'colorB')">
  106. {{item.featureType == 0 ?'':(item.featureType == 1 ?'正常':'异常')}}
  107. </view>
  108. <view class="info-deBug-for-button">
  109. <view :class="item.featureType === 0 ? 'buttonTypeA' : 'buttonTypeB'"
  110. @click.stop="debugButton(item,index)">
  111. {{item.featureType === 0 ? '调试' : '复位'}}
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="info-feature-button-box" v-if="pageType == 2">
  117. <view class="info-feature-button-null"></view>
  118. <view class="info-feature-button" @click="resetButton" v-if="scheduleData.featureType == 3">重新诊断</view>
  119. <view class="info-feature-button-null"></view>
  120. </view>
  121. <view class="info-positon-max-big-box" v-if="shadeType == 1 || shadeType == 2">
  122. <view class="info-positon-big-box">
  123. <view class="info-positon-box" v-if="shadeType == 1">
  124. <view class="info-positon-text-box">
  125. <view>请求:</view>
  126. <view class="info-positon-text">{{shadeData.reqBody}}</view>
  127. </view>
  128. <view class="info-positon-text-box">
  129. <view>响应:</view>
  130. <view class="info-positon-text">{{shadeData.respBody}}</view>
  131. </view>
  132. </view>
  133. <view class="info-positon-box" v-if="shadeType == 2">
  134. <view class="info-positon-text-box">
  135. <view>功能名称:</view>
  136. <view class="info-positon-text">{{shadeData.name}}</view>
  137. </view>
  138. <view class="info-positon-text-box">
  139. <view>功能备注:</view>
  140. <view class="info-positon-text">{{shadeData.remark}}</view>
  141. </view>
  142. <view class="info-positon-text-box">
  143. <view>请求地址:</view>
  144. <view class="info-positon-text">{{shadeData.reqApi}}</view>
  145. </view>
  146. <view class="info-positon-text-box">
  147. <view>请求方式:</view>
  148. <view class="info-positon-text">{{shadeData.reqMethod}}</view>
  149. </view>
  150. <view class="info-positon-text-for-box" v-if="shadeData.dataList[0]">
  151. <view>请求参数:</view>
  152. <view class="info-positon-text-for" v-for="(minItem,minIndex) in shadeData.dataList" :key="minIndex">
  153. {{minItem.key}} : {{minItem.value}}
  154. </view>
  155. </view>
  156. <view class="info-positon-text-box">
  157. <view>响应参数:</view>
  158. <view class="info-positon-text">{{shadeData.response}}</view>
  159. </view>
  160. </view>
  161. <view class="info-positon-button-box">
  162. <view @click="shadeOff">关闭</view>
  163. </view>
  164. </view>
  165. </view>
  166. <!-- 设备日志 -->
  167. <view class="info-log-max-big-box" v-if="pageType == 4">
  168. <view class="query-max-big-box">
  169. <view class="query-input-box">
  170. <picker @change="dataTypeListChange" :value="dataTypeListIndex" :range="dataTypeList">
  171. <view style="width:330rpx;" class="query-input"
  172. :class="!dataTypeName?'query-input-placeholder':''">
  173. {{dataTypeName?dataTypeName:'选择状态'}}
  174. </view>
  175. </picker>
  176. </view>
  177. <view class="query-button-one" @click="logHandleQuery">查询</view>
  178. <view class="query-button-two" @click="logResetQuery">重置</view>
  179. </view>
  180. <!-- 上报日志 -->
  181. <view class="list-max-big-box">
  182. <view class="list-max-big-null" v-if="!logList[0]">暂无数据</view>
  183. <view class="for-list-max-big-box"
  184. v-for="(item,index) in logList" :key="index">
  185. <view class="for-list-title-box">
  186. <view>数值:{{item.deviceValue}}</view>
  187. <view :class="item.dataType == 1?'stateColorA':'stateColorB'">{{item.dataType == 1?'正常数据':'风险数据'}}</view>
  188. </view>
  189. <view class="for-list-remark-box">
  190. <view class="for-list-remark">上报时间:{{parseTime(item.createTime,"{y}-{m}-{d} {h}:{i}")}}</view>
  191. </view>
  192. </view>
  193. </view>
  194. <view class="pagination-max-big-box">
  195. <view class="pagination-button" @click="logPaginationButton(1)"
  196. :class="logQueryParams.page == 1 ? 'pagination-color':''">上一页</view>
  197. <view class="pagination-num">{{logQueryParams.page}}/{{logPages}}</view>
  198. <view class="pagination-button" @click="logPaginationButton(2)"
  199. :class="logQueryParams.page == pages || logQueryParams.page > pages? 'pagination-color':''">下一页</view>
  200. </view>
  201. </view>
  202. </view>
  203. </template>
  204. <script>
  205. import {
  206. iotDeviceDetail,
  207. iotDeviceCheckOnline,
  208. iotDeviceCheckConnect,
  209. iotDeviceCheckState,
  210. iotTypeFunctionDropList,
  211. iotDebugFunctionGet,
  212. iotDebugFunctionPost,
  213. itoDeviceLogList,
  214. itoDeviceDataList
  215. } from '@/api/index.js'
  216. export default {
  217. data(){
  218. return {
  219. successImg:require('@/images/success_icon.png'),
  220. errorImg:require('@/images/error_icon.png'),
  221. warningImg:require('@/images/warning_icon.png'),
  222. pageType:1,
  223. newData:{},
  224. //进度条数据
  225. scheduleData:{
  226. featureType:0,
  227. schedule:0,
  228. },
  229. //诊断相关
  230. featureDataList:[
  231. {
  232. name:"设备状态",
  233. remark:"禁用状态会导致诊断失败",
  234. type:'state',
  235. featureType:0,
  236. response:'',
  237. },
  238. {
  239. name:"在线状态 ",
  240. remark:"禁用会导致设备连接失败",
  241. type:'online',
  242. featureType:0,
  243. response:'',
  244. },
  245. {
  246. name:"通信状态",
  247. remark:"禁用和配置错误会导致设备连接失败",
  248. type:'connect',
  249. featureType:0,
  250. response:'',
  251. },
  252. ],
  253. //调试功能相关
  254. debugDataList:[],
  255. //调试方法数据
  256. debugIndex:null,
  257. //物联日志相关
  258. typeList:['成功','失败'],
  259. typeListIndex:0,
  260. typeName:'',
  261. dataList:[],
  262. pages:0,
  263. queryParams:{
  264. page:1,
  265. pageSize:10,
  266. state:null,
  267. },
  268. //弹窗相关
  269. shadeType:false,
  270. shadeData:{},
  271. //上报日志相关
  272. dataTypeList:['正常数据','风险数据'],
  273. dataTypeListIndex:0,
  274. dataTypeName:'',
  275. logList:[],
  276. logPages:0,
  277. logQueryParams:{
  278. page:1,
  279. pageSize:10,
  280. dataType:'',
  281. },
  282. }
  283. },
  284. onLoad(option) {
  285. this.iotDeviceDetail(option.id);
  286. },
  287. onShow() {
  288. },
  289. methods: {
  290. //子页面切换
  291. buttonCheck(type){
  292. if(this.pageType != type){
  293. if(type == 1){
  294. this.resetQuery();
  295. }else if(type == 2){
  296. this.resetButton();
  297. }else if(type == 3){
  298. this.iotTypeFunctionDropList();
  299. }else if(type == 4){
  300. this.logHandleQuery();
  301. }
  302. this.$set(this,'pageType',type);
  303. }
  304. },
  305. //详情接口
  306. async iotDeviceDetail(id){
  307. const { data } = await iotDeviceDetail({id:id});
  308. if (data.code == 200) {
  309. this.$set(this,'newData',data.data);
  310. this.getList();
  311. this.diagnosis();
  312. this.iotTypeFunctionDropList();
  313. }
  314. },
  315. //重新诊断
  316. resetButton(){
  317. let self = this;
  318. this.$set(this,'scheduleData',{
  319. featureType:0,
  320. schedule:0,
  321. });
  322. this.$set(this.featureDataList[0],'featureType',0);
  323. this.$set(this.featureDataList[1],'featureType',0);
  324. this.$set(this.featureDataList[2],'featureType',0);
  325. setTimeout(() => {
  326. self.diagnosis();
  327. }, 100);
  328. },
  329. //诊断(顺序执行)
  330. diagnosis(){
  331. this.iotDeviceCheckState().then(res=>{
  332. this.iotDeviceCheckOnline().then(res=>{
  333. this.iotDeviceCheckConnect();
  334. })
  335. })
  336. },
  337. //设备状态
  338. async iotDeviceCheckState(){
  339. const { data } = await iotDeviceCheckState({id:this.newData.id});
  340. this.$set(this.scheduleData,'featureType',this.scheduleData.featureType+1);
  341. this.$set(this.scheduleData,'schedule',this.scheduleData.schedule+33);
  342. this.$set(this.featureDataList[0],'response',data.message);
  343. if(data.data){
  344. this.$set(this.featureDataList[0],'featureType',1);
  345. }else{
  346. this.$set(this.featureDataList[0],'featureType',2);
  347. }
  348. },
  349. //在线状态
  350. async iotDeviceCheckOnline(){
  351. const { data } = await iotDeviceCheckOnline({id:this.newData.id});
  352. this.$set(this.scheduleData,'featureType',this.scheduleData.featureType+1);
  353. this.$set(this.scheduleData,'schedule',this.scheduleData.schedule+33);
  354. this.$set(this.featureDataList[1],'response',data.message);
  355. if(data.data){
  356. this.$set(this.featureDataList[1],'featureType',1);
  357. this.$set(this.newData,'online',true);
  358. }else{
  359. this.$set(this.featureDataList[1],'featureType',2);
  360. this.$set(this.newData,'online',false);
  361. }
  362. },
  363. //通信状态
  364. async iotDeviceCheckConnect(){
  365. const { data } = await iotDeviceCheckConnect({id:this.newData.id});
  366. this.$set(this.scheduleData,'featureType',this.scheduleData.featureType+1);
  367. this.$set(this.scheduleData,'schedule',this.scheduleData.schedule+34);
  368. this.$set(this.featureDataList[2],'response',data.message);
  369. if(data.data){
  370. this.$set(this.featureDataList[2],'featureType',1);
  371. }else{
  372. this.$set(this.featureDataList[2],'featureType',2);
  373. }
  374. },
  375. //获取功能调试列表
  376. async iotTypeFunctionDropList(){
  377. const { data } = await iotTypeFunctionDropList({typeId:this.newData.typeId});
  378. if(data.code == 200){
  379. data.data.forEach((item) => {
  380. item.featureType = 0;
  381. })
  382. this.$set(this,'debugDataList',data.data);
  383. }
  384. },
  385. //调试功能接口
  386. debugButton(item,index){
  387. if(item.featureType === 0){
  388. this.$set(this,'debugIndex',index);
  389. let url = item.reqApi
  390. let dataList = JSON.parse(item.reqParams);
  391. let obj = {
  392. url:item.reqApi,
  393. }
  394. for(let i=0;i<dataList.length;i++){
  395. if(dataList[i].keyType == 'data'){
  396. obj[dataList[i].keyName] = this.newData[dataList[i].keyName];
  397. }else if(dataList[i].keyType == 'argument'){
  398. obj[dataList[i].keyName] = dataList[i].keyArgument;
  399. }else if(dataList[i].keyType == 'file'){
  400. obj[dataList[i].keyName] = uni.getStorageSync('fileBrowseEnvironment') + dataList[i].keyFile;
  401. }
  402. }
  403. if(item.reqMethod == 'POST'){
  404. this.iotDebugFunctionPost(url,obj);
  405. }else if(item.reqMethod == 'GET'){
  406. this.iotDebugFunctionGet(url,obj);
  407. }
  408. }else{
  409. this.$set(this.debugDataList[index],'response','');
  410. this.$set(this.debugDataList[index],'featureType',0);
  411. this.$set(this,'debugIndex',null);
  412. }
  413. },
  414. //post调试
  415. async iotDebugFunctionPost(url,obj){
  416. const { data } = await iotDebugFunctionPost(url,obj);
  417. this.$set(this.debugDataList[this.debugIndex],'response',JSON.stringify(data));
  418. if(data.code == 200){
  419. this.$set(this.debugDataList[this.debugIndex],'featureType',1);
  420. }else{
  421. this.$set(this.debugDataList[this.debugIndex],'featureType',2);
  422. }
  423. },
  424. //get调试
  425. async iotDebugFunctionGet(url,obj){
  426. const { data } = await iotDebugFunctionGet(url,obj);
  427. this.$set(this.debugDataList[this.debugIndex],'response',JSON.stringify(data));
  428. if(data.code == 200){
  429. this.$set(this.debugDataList[this.debugIndex],'featureType',1);
  430. }else{
  431. this.$set(this.debugDataList[this.debugIndex],'featureType',2);
  432. }
  433. },
  434. //查看debug数据
  435. lookDebugInfo(item){
  436. if(item.featureType != 0){
  437. let obj = {
  438. name:item.name,
  439. remark:item.remark,
  440. reqApi:item.reqApi,
  441. reqMethod:item.reqMethod,
  442. response:item.response,
  443. dataList:[],
  444. }
  445. let dataList = JSON.parse(item.reqParams);
  446. for(let i=0;i<dataList.length;i++){
  447. if(dataList[i].keyType == 'data'){
  448. obj.dataList.push({
  449. key:dataList[i].keyName,
  450. value:this.newData[dataList[i].keyName]?this.newData[dataList[i].keyName]:'',
  451. })
  452. }else if(dataList[i].keyType == 'argument'){
  453. obj.dataList.push({
  454. key:dataList[i].keyName,
  455. value:dataList[i].keyArgument?dataList[i].keyArgument:'',
  456. })
  457. }else if(dataList[i].keyType == 'file'){
  458. obj.dataList.push({
  459. key:dataList[i].keyName,
  460. value:dataList[i].keyFile?uni.getStorageSync('fileBrowseEnvironment') + dataList[i].keyFile:'',
  461. })
  462. }
  463. }
  464. this.shadeOpen(obj,2);
  465. }
  466. },
  467. //状态选中
  468. typeListChange(event){
  469. this.$set(this,'typeName',event.target.value == 0?'成功':'失败');
  470. this.$set(this.queryParams,'state',event.target.value == 0?true:false);
  471. },
  472. //查询按钮
  473. handleQuery(){
  474. this.$set(this.queryParams,'page',1);
  475. this.getList();
  476. },
  477. //重置按钮
  478. resetQuery(){
  479. this.$set(this,'typeListIndex',0);
  480. this.$set(this,'typeName','');
  481. this.$set(this,'queryParams',{
  482. page:1,
  483. pageSize:10,
  484. state:null,
  485. });
  486. this.getList();
  487. },
  488. //翻页
  489. paginationButton(type){
  490. if(type == 1){
  491. if(this.queryParams.page != 1){
  492. this.queryParams.page--
  493. this.getList();
  494. }
  495. }else if(type == 2){
  496. if(this.queryParams.page != this.pages && this.queryParams.page < this.pages){
  497. this.queryParams.page++
  498. this.getList();
  499. }
  500. }
  501. },
  502. //获取物联设备列表
  503. async getList(){
  504. let obj = JSON.parse(JSON.stringify(this.queryParams))
  505. obj.deviceId = this.newData.id;
  506. const {data} = await itoDeviceLogList(obj);
  507. if(data.code==200){
  508. this.$set(this,'pages',data.data.pages);
  509. this.$set(this,'dataList',data.data.records);
  510. }
  511. },
  512. //开启弹窗
  513. shadeOpen(item,type){
  514. this.$set(this,'shadeData',item);
  515. this.$set(this,'shadeType',type);
  516. },
  517. //关闭弹窗
  518. shadeOff(){
  519. this.$set(this,'shadeType',0);
  520. this.$set(this,'shadeData',{});
  521. },
  522. //上报日志相关
  523. //log状态选中
  524. dataTypeListChange(event){
  525. this.$set(this,'dataTypeName',event.target.value == 0?'成功':'失败');
  526. this.$set(this.logQueryParams,'dataType',event.target.value == 0?1:2);
  527. },
  528. //查询按钮
  529. logHandleQuery(){
  530. this.$set(this.logQueryParams,'page',1);
  531. this.itoDeviceDataList();
  532. },
  533. //重置按钮
  534. logResetQuery(){
  535. this.$set(this,'dataTypeListIndex',0);
  536. this.$set(this,'dataTypeName','');
  537. this.$set(this,'logQueryParams',{
  538. page:1,
  539. pageSize:10,
  540. dataType:'',
  541. });
  542. this.itoDeviceDataList();
  543. },
  544. //翻页
  545. logPaginationButton(type){
  546. if(type == 1){
  547. if(this.logQueryParams.page != 1){
  548. this.logQueryParams.page--
  549. this.itoDeviceDataList();
  550. }
  551. }else if(type == 2){
  552. if(this.logQueryParams.page != this.pages && this.logQueryParams.page < this.pages){
  553. this.logQueryParams.page++
  554. this.itoDeviceDataList();
  555. }
  556. }
  557. },
  558. async itoDeviceDataList(){
  559. let obj = JSON.parse(JSON.stringify(this.logQueryParams))
  560. obj.deviceNo = this.newData.deviceNo;
  561. const {data} = await itoDeviceDataList(obj);
  562. if(data.code==200){
  563. this.$set(this,'logPages',data.data.pages);
  564. this.$set(this,'logList',data.data.records);
  565. }
  566. },
  567. //开启弹窗
  568. logShadeOpen(item,type){
  569. this.$set(this,'shadeData',item);
  570. this.$set(this,'shadeType',type);
  571. },
  572. //关闭弹窗
  573. logShadeOff(){
  574. this.$set(this,'shadeType',0);
  575. this.$set(this,'shadeData',{});
  576. },
  577. }
  578. }
  579. </script>
  580. <style lang="stylus" scoped>
  581. #iotDevice-info-page {
  582. display: flex;
  583. flex: 1;
  584. flex-direction: column;
  585. overflow: hidden;
  586. .info-title-max-big-box{
  587. height:250rpx;
  588. background-color: #fff;
  589. font-size:30rpx;
  590. padding:20rpx 30rpx;
  591. .info-title-name-box{
  592. display: flex;
  593. view{
  594. line-height:50rpx;
  595. }
  596. view:nth-child(1){
  597. flex: 1;
  598. }
  599. view:nth-child(2){
  600. margin:5rpx 0;
  601. height:40rpx;
  602. line-height:40rpx;
  603. font-size:26rpx;
  604. width:100rpx;
  605. text-align: center;
  606. color:#fff;
  607. border-radius:8rpx;
  608. }
  609. .online-1{
  610. background-color:#14AE10;
  611. }
  612. .online-2{
  613. background-color:#999;
  614. }
  615. .state-1{
  616. background-color:#0183FA;
  617. }
  618. .state-2{
  619. background-color:#999;
  620. }
  621. }
  622. .info-title-text{
  623. line-height:50rpx;
  624. span{
  625. display: inline-block;
  626. // width:160rpx;
  627. }
  628. }
  629. }
  630. .info-button-max-big-box{
  631. display: flex;
  632. .info-button-view{
  633. background-color: #999;
  634. color:#fff;
  635. line-height:60rpx;
  636. height:60rpx;
  637. flex:1;
  638. text-align: center;
  639. font-size:28rpx;
  640. }
  641. .info-button-check{
  642. background-color: #0183FA !important;
  643. }
  644. }
  645. .info-log-max-big-box{
  646. flex:1;
  647. display:flex;
  648. flex-direction: column;
  649. overflow-x: hidden;
  650. .query-max-big-box{
  651. height:80rpx;
  652. background-color: #fff;
  653. display: flex;
  654. font-size:28rpx;
  655. .query-input-box{
  656. display: flex;
  657. margin:10rpx 0 0 20rpx;
  658. .query-input{
  659. padding:0 20rpx;
  660. height:60rpx;
  661. line-height:60rpx;
  662. font-size:26rpx;
  663. border-radius:8rpx;
  664. border:1px solid #dedede;
  665. }
  666. .query-input-placeholder{
  667. color: #999 !important;
  668. }
  669. }
  670. .query-button-one{
  671. margin:10rpx 0 0 10rpx;
  672. background-color: #0183FA;
  673. color:#fff;
  674. border-radius:8rpx;
  675. width:160rpx;
  676. height:62rpx;
  677. line-height:62rpx;
  678. text-align: center;
  679. font-size:28rpx;
  680. }
  681. .query-button-two{
  682. margin:10rpx;
  683. background-color: #999;
  684. color:#fff;
  685. border-radius:8rpx;
  686. width:160rpx;
  687. height:62rpx;
  688. line-height:62rpx;
  689. text-align: center;
  690. font-size:28rpx;
  691. }
  692. .query-button-three{
  693. margin:10rpx 10rpx 0 0;
  694. background-color: #409EFF;
  695. color:#fff;
  696. border-radius:8rpx;
  697. width:100rpx;
  698. height:62rpx;
  699. line-height:62rpx;
  700. text-align: center;
  701. font-size:28rpx;
  702. }
  703. }
  704. .list-max-big-box{
  705. flex:1;
  706. overflow-x: hidden;
  707. overflow-y: scroll;
  708. margin:20rpx;
  709. .list-max-big-null{
  710. font-size:28rpx;
  711. text-align:center;
  712. line-height:100rpx;
  713. color:#999;
  714. }
  715. .for-list-max-big-box{
  716. background-color: #fff;
  717. color:#333;
  718. font-size:30rpx;
  719. margin-bottom:20rpx;
  720. border-radius:8rpx;
  721. .for-list-title-box{
  722. display: flex;
  723. border-bottom:1rpx solid #dedede;
  724. padding:20rpx;
  725. view{
  726. line-height:50rpx;
  727. font-size:28rpx;
  728. }
  729. view:nth-child(1){
  730. flex:1;
  731. }
  732. view:nth-child(2){
  733. width:140rpx;
  734. }
  735. view:nth-child(3){
  736. width:240rpx;
  737. }
  738. .stateColorA{
  739. color:#14AE10;
  740. }
  741. .stateColorB{
  742. color:#FF6666;
  743. }
  744. }
  745. .for-list-remark-box{
  746. display: flex;
  747. .for-list-remark{
  748. padding:20rpx;
  749. line-height:50rpx;
  750. font-size:28rpx;
  751. flex:1;
  752. display:block;
  753. overflow:hidden;
  754. text-overflow:ellipsis;
  755. white-space:nowrap;
  756. }
  757. .for-list-button{
  758. margin:20rpx 20rpx 0 0;
  759. border-radius:8rpx;
  760. width:120rpx;
  761. height:50rpx;
  762. line-height:50rpx;
  763. text-align: center;
  764. font-size:28rpx;
  765. background-color:#409EFF ;
  766. color: #fff;
  767. }
  768. }
  769. }
  770. }
  771. .pagination-max-big-box{
  772. height:80rpx;
  773. background-color: #fff;
  774. display: flex;
  775. .pagination-button{
  776. margin:10rpx;
  777. border-radius:8rpx;
  778. width:140rpx;
  779. height:60rpx;
  780. line-height:60rpx;
  781. text-align: center;
  782. font-size:28rpx;
  783. background-color:#0183FA;
  784. color:#fff;
  785. }
  786. .pagination-num{
  787. flex:1;
  788. text-align: center;
  789. line-height:80rpx;
  790. }
  791. .pagination-color{
  792. background-color: #dedede;
  793. }
  794. }
  795. }
  796. .info-feature-max-big-box{
  797. flex:1;
  798. overflow-x: hidden;
  799. overflow-y: scroll;
  800. .schedule-box{
  801. padding-bottom:10rpx;
  802. .schedule-min-box{
  803. border:1rpx solid #999;
  804. padding:2rpx;
  805. border-radius:20rpx;
  806. height:20rpx;
  807. margin:40rpx 40rpx 0 50rpx;
  808. view{
  809. height:20rpx;
  810. border-radius:20rpx;
  811. background-color: #00a0e9;
  812. }
  813. }
  814. .schedule-title-box{
  815. height:30rpx;
  816. line-height:30rpx;
  817. text-align: center;
  818. font-size:24rpx;
  819. margin:10rpx 0;
  820. }
  821. }
  822. .info-feature-for-box{
  823. display: flex;
  824. background-color: #fff;
  825. font-size:28rpx;
  826. height:100rpx;
  827. margin:0 30rpx 10rpx;
  828. border-radius:12rpx;
  829. image{
  830. width:60rpx;
  831. height:60rpx;
  832. margin:20rpx;
  833. }
  834. .info-feature-for-title-box{
  835. padding:10rpx 0;
  836. flex:1;
  837. view{
  838. color:#333;
  839. line-height:40rpx;
  840. }
  841. view:nth-child(1){
  842. font-size:28rpx;
  843. }
  844. view:nth-child(2){
  845. font-size:24rpx;
  846. }
  847. }
  848. .info-feature-for-type-box{
  849. width:200rpx;
  850. font-size:26rpx;
  851. font-weight:700;
  852. line-height:100rpx;
  853. text-align: center;
  854. }
  855. .colorA{
  856. color:#24B276;
  857. }
  858. .colorB{
  859. color:#FF6666;
  860. }
  861. .colorC{
  862. color:#FF9000;
  863. }
  864. }
  865. }
  866. .info-deBug-max-big-box{
  867. flex:1;
  868. overflow-x: hidden;
  869. overflow-y: scroll;
  870. padding:30rpx 0;
  871. .info-deBug-max-big-null{
  872. font-size:28rpx;
  873. text-align:center;
  874. line-height:100rpx;
  875. color:#999;
  876. }
  877. .info-deBug-for-box{
  878. display: flex;
  879. background-color: #fff;
  880. font-size:28rpx;
  881. height:100rpx;
  882. margin:0 30rpx 10rpx;
  883. border-radius:12rpx;
  884. image{
  885. width:60rpx;
  886. height:60rpx;
  887. margin:20rpx;
  888. }
  889. .info-deBug-for-title-box{
  890. padding:10rpx 0;
  891. flex:1;
  892. view{
  893. color:#333;
  894. line-height:40rpx;
  895. }
  896. view:nth-child(1){
  897. font-size:28rpx;
  898. }
  899. view:nth-child(2){
  900. font-size:24rpx;
  901. }
  902. }
  903. .info-deBug-for-type-box{
  904. width:80rpx;
  905. font-size:26rpx;
  906. font-weight:700;
  907. line-height:100rpx;
  908. }
  909. .colorA{
  910. color:#24B276;
  911. }
  912. .colorB{
  913. color:#FF6666;
  914. }
  915. .colorC{
  916. color:#FF9000;
  917. }
  918. .info-deBug-for-button{
  919. view{
  920. margin:25rpx 25rpx 25rpx 0;
  921. height:50rpx;
  922. line-height:50rpx;
  923. font-size:28rpx;
  924. width:120rpx;
  925. text-align: center;
  926. cursor: pointer;
  927. border-radius:4rpx;
  928. }
  929. .buttonTypeA{
  930. border:1px solid #0183FA;
  931. background-color: #0183FA;
  932. color:#fff;
  933. }
  934. .buttonTypeB{
  935. border:1px solid #999999;
  936. background-color: #999999;
  937. color:#fff;
  938. }
  939. }
  940. }
  941. }
  942. .info-feature-button-box{
  943. display: flex;
  944. .info-feature-button-null{
  945. flex:1;
  946. }
  947. .info-feature-button{
  948. margin:20rpx 0;
  949. width:160rpx;
  950. height:60rpx;
  951. line-height:60rpx;
  952. background-color: #0183FA;
  953. color:#fff;
  954. text-align: center;
  955. font-size:24rpx;
  956. border-radius:12rpx;
  957. margin-top:30rpx;
  958. }
  959. }
  960. .info-positon-max-big-box{
  961. z-index:100;
  962. position: absolute;
  963. bottom:0;
  964. left:0;
  965. width:100%;
  966. height:100%;
  967. background-color: rgba(0,0,0,0.6);
  968. .info-positon-big-box{
  969. width:80%;
  970. height:80%;
  971. margin-left:10%;
  972. margin-top:10%;
  973. border-radius:16rpx;
  974. display: flex;
  975. flex-direction:column;
  976. overflow-x: hidden;
  977. overflow-y: scroll;
  978. background-color: #fff;
  979. .info-positon-box{
  980. flex:1;
  981. overflow-x: hidden;
  982. overflow-y: scroll;
  983. .info-positon-text-box{
  984. view:nth-child(1){
  985. padding:10rpx 20rpx;
  986. background-color: #eeeeee;
  987. font-size:28rpx;
  988. }
  989. .info-positon-text{
  990. padding:20rpx 40rpx;
  991. word-wrap: break-word;
  992. font-size:26rpx;
  993. }
  994. }
  995. .info-positon-text-for-box{
  996. padding-bottom:10rpx;
  997. view:nth-child(1){
  998. padding:10rpx 20rpx;
  999. background-color: #eeeeee;
  1000. font-size:28rpx;
  1001. margin-bottom:10rpx;
  1002. }
  1003. .info-positon-text-for{
  1004. padding:10rpx 40rpx;
  1005. word-wrap: break-word;
  1006. line-height:26rpx;
  1007. font-size:26rpx;
  1008. }
  1009. }
  1010. }
  1011. .info-positon-button-box{
  1012. border-top:1px solid #dedede;
  1013. view{
  1014. background-color: #999;
  1015. color:#fff;
  1016. text-align: center;
  1017. line-height:60rpx;
  1018. height:60rpx;
  1019. font-size:28rpx;
  1020. width:160rpx;
  1021. margin:10rpx auto;
  1022. border-radius:12rpx;
  1023. }
  1024. }
  1025. }
  1026. }
  1027. }
  1028. </style>