deviceData.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  1. <template>
  2. <view class="device-data-container">
  3. <!-- 顶部时间戳和图标区域 -->
  4. <view class="device-data-wraper">
  5. <view class="top-bar">
  6. <view class="timestamp">
  7. {{formatDate(deviceInfo.uptime)}}
  8. <u-icon name="reload" color="#0BBC58" style="margin-left: 12rpx" @click="refreshData"></u-icon>
  9. </view>
  10. <view class="icon-group">
  11. <!-- <view class="icon-item refresh-icon">
  12. <img class="copy-icon" :src="sim"/>
  13. </view>
  14. <view class="icon-item settings-icon" @click="openSettings">
  15. <img class="copy-icon" :src="setting"/>
  16. </view> -->
  17. <!-- <view class="icon-item info-icon">
  18. <img class="copy-icon" :src="edit"/>
  19. </view> -->
  20. </view>
  21. </view>
  22. <!-- 主要数据面板 -->
  23. <view class="main-data-panel">
  24. <view class="data-column-left">
  25. <view class="data-item">
  26. <text class="data-value">{{ deviceStatic.vol }}</text>
  27. <text class="data-label">电量</text>
  28. </view>
  29. <view class="data-item">
  30. <text class="data-value">{{ deviceStatic.gs == 1? '落虫' : '排水' }}</text>
  31. <text class="data-label">通道状态</text>
  32. </view>
  33. <view class="data-item">
  34. <text class="data-value">{{ deviceStatic.upds == 1? '打开' : '关闭' }}</text>
  35. <text class="data-label">上仓门</text>
  36. </view>
  37. <view class="data-item">
  38. <text class="data-value">{{ deviceStatic.dver }}</text>
  39. <text class="data-label">设备版本</text>
  40. </view>
  41. </view>
  42. <view class="data-column-left">
  43. <view class="data-item">
  44. <text class="data-value">{{ deviceStatic.tmod == '1' ? '时控' : '光控' }}</text>
  45. <text class="data-label">定时模式</text>
  46. </view>
  47. <view class="data-item">
  48. <text class="data-value">{{ deviceStatic.hs == '1' ? '加热' : '正常' }}</text>
  49. <text class="data-label">加热状态</text>
  50. </view>
  51. <view class="data-item">
  52. <text class="data-value">{{ deviceStatic.dpds == '1' ? '打开' : '关闭' }}</text>
  53. <text class="data-label">下仓门</text>
  54. </view>
  55. <view class="data-item">
  56. <text class="data-value">{{ deviceStatic.tph || '' }}℃</text>
  57. <text class="data-label">高温限值</text>
  58. </view>
  59. </view>
  60. <view class="data-column-right">
  61. <view class="device-image-container">
  62. <image class="device-image" src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/cbd.png" mode="aspectFit"></image>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 图表区域 -->
  68. <view class="chart-section">
  69. <view class="chart-header">
  70. <view class="chart-tabs">
  71. <view
  72. v-for="(tab, index) in chartTabs"
  73. :key="index"
  74. class="chart-tab-item"
  75. :class="{ active: activeChartTab === index }"
  76. @click="switchChartTab(index)"
  77. >
  78. {{ tab.name }}
  79. </view>
  80. </view>
  81. <!-- <view class="chart-dropdown">
  82. <text class="iconfont dropdown-icon">&#xe606;</text>
  83. </view> -->
  84. </view>
  85. <view class="chart-content">
  86. <view class="chart-canvas-container" v-if="!show" :key="chartKey">
  87. <!-- <div id="tempChart" class="chart-canvas"></div> -->
  88. <qiun-data-charts type="line" :chartData="chartData" :canvas2d="true" :inScrollView="true" :opts="opts" :ontouch="true"/>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 历史数据表格 -->
  93. <view class="history-section">
  94. <view class="history-header">
  95. <text class="history-title">历史数据</text>
  96. </view>
  97. <view class="history-table">
  98. <view class="table-container">
  99. <!-- 固定列 -->
  100. <view class="fixed-column">
  101. <view class="fixed-header">
  102. <text class="header-cell fixed">上报时间</text>
  103. </view>
  104. <view class="fixed-body">
  105. <view
  106. v-for="(item, index) in historyData"
  107. :key="index"
  108. class="fixed-row"
  109. :class="{ even: index % 2 === 0 }"
  110. >
  111. <text class="body-cell fixed">{{ formatTime(item.addtime) }}</text>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- 可滑动列 -->
  116. <view class="scrollable-column">
  117. <view class="scrollable-header">
  118. <text class="header-cell">环境温度(°C)</text>
  119. <text class="header-cell">环境湿度(%)</text>
  120. <text class="header-cell">加热仓温度(°C)</text>
  121. <text class="header-cell">雨控状态</text>
  122. <text class="header-cell">温控状态</text>
  123. <text class="header-cell">光控状态</text>
  124. <text class="header-cell">灯管状态</text>
  125. <text class="header-cell">信号强度</text>
  126. <text class="header-cell">电流(mA)</text>
  127. <text class="header-cell">电压(V)</text>
  128. <text class="header-cell">经度</text>
  129. <text class="header-cell">纬度</text>
  130. </view>
  131. <view class="scrollable-body">
  132. <view
  133. v-for="(item, index) in historyData"
  134. :key="index"
  135. class="scrollable-row"
  136. :class="{ even: index % 2 === 0 }"
  137. >
  138. <text class="body-cell">{{ item.at }}</text>
  139. <text class="body-cell">{{ item.ah }}</text>
  140. <text class="body-cell">{{ item.hrt }}</text>
  141. <text class="body-cell">{{ getRpsDict(item) }}</text>
  142. <text class="body-cell">{{ getTpsDict(item) }}</text>
  143. <text class="body-cell">{{ getLpsDict(item) }}</text>
  144. <text class="body-cell">{{ getStateDict(item) }}</text>
  145. <text class="body-cell">{{ item.csq }}</text>
  146. <text class="body-cell">{{ item.current }}</text>
  147. <text class="body-cell">{{ item.vbat }}</text>
  148. <text class="body-cell">{{ item.lng }}</text>
  149. <text class="body-cell">{{ item.lat }}</text>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. <view class="pagination">
  156. <text class="pagination-btn prev-btn" @click="prevPage">上一页</text>
  157. <text class="pagination-info">{{currentPage}}/{{totalPages}}</text>
  158. <text class="pagination-btn next-btn" @click="nextPage">下一页</text>
  159. </view>
  160. </view>
  161. <u-popup v-model="show" mode="bottom" border-radius="20">
  162. <view style="height:70vh">
  163. <view class="tabs-container">
  164. <view class="tabs-item" @click="switchTab(0)" :class="{ active: activeTab === 0 }" v-if="data_iccid">数据SIM卡流量</view>
  165. <view class="tabs-item" @click="switchTab(1)" :class="{ active: activeTab === 1 }">图片SIM卡流量</view>
  166. </view>
  167. <view class="sim-container" v-if="activeTab === 0">
  168. <view class="sim-item">
  169. <text class="sim-label">ICCID:</text>
  170. <text class="sim-value">{{ deviceInfoStatic.iccid }}</text>
  171. </view>
  172. <view class="sim-item">
  173. <text class="sim-label">总流量:</text>
  174. <text class="sim-value">{{ deviceInfoStatic.total }}</text>
  175. </view>
  176. <view class="sim-item">
  177. <text class="sim-label">状态:</text>
  178. <text class="sim-value">{{ deviceInfoStatic.status }}</text>
  179. </view>
  180. <view class="sim-item">
  181. <text class="sim-label">到期时间:</text>
  182. <text class="sim-value">{{ deviceInfoStatic.expire }}</text>
  183. </view>
  184. <view class="sim-item">
  185. <text class="sim-label">厂商名称:</text>
  186. <text class="sim-value">{{ deviceInfoStatic.company }}</text>
  187. </view>
  188. <view class="sim-item">
  189. <text class="sim-label">已使用:</text>
  190. <text class="sim-value"><text style="color: #0BBC58">{{ deviceInfoStatic.used }}</text>/{{ deviceInfoStatic.total }}</text>
  191. </view>
  192. <view class="sim-item">
  193. <text class="sim-value">
  194. <u-line-progress active-color="#0BBC58" :percent="deviceInfoStatic.used / deviceInfoStatic.total * 100" :show-percent="false"></u-line-progress>
  195. </text>
  196. </view>
  197. </view>
  198. <view class="sim-container" v-if="activeTab === 1">
  199. <view class="sim-item" style="display:flex;align-items: center;height:80rpx;">
  200. <text class="sim-label">ICCID:</text>
  201. <text v-if="show1" style="margin-right: 10rpx">{{ photo_iccid }}</text>
  202. <text class="sim-value" style="color: #0BBC58;" @click="changeSim" v-if="show1">
  203. 更换SIM卡
  204. </text>
  205. <view v-else class="sim-value-change">
  206. <u-input v-model="data_iccidInput" placeholder="请输入ICCID" class="sim-value"></u-input>
  207. <view class="sim-value-button" size="small" @click="changeSimHandler">确认</view>
  208. <view class="sim-value-button" size="small" @click="show1 = true">取消</view>
  209. </view>
  210. </view>
  211. </view>
  212. </view>
  213. </u-popup>
  214. <floatButton>
  215. <view slot="icon">
  216. <view class="general-border">
  217. <image :src="general" class="general-icon"></image>
  218. </view>
  219. </view>
  220. <view slot="expanded">
  221. <view class="general-images">
  222. <view class="general-image edit-border" @click="editData">
  223. <image :src="editBorder" class="image-icon"></image>
  224. </view>
  225. <view class="general-image sim-border" @click="simData">
  226. <image :src="simBorder" class="image-icon"></image>
  227. </view>
  228. <view class="general-image setting-border" @click="openSettings">
  229. <image :src="settingBorder" class="image-icon"></image>
  230. </view>
  231. </view>
  232. </view>
  233. </floatButton>
  234. </view>
  235. </template>
  236. <script>
  237. import setting from '../assets/setting.png';
  238. import edit from '../assets/edit.png';
  239. import sim from '../assets/sim.png';
  240. import Circulation from '../../../static/js/equipState_dict.json';
  241. import floatButton from './floating-button.vue';
  242. import general from '../assets/general.png';
  243. import editBorder from '../assets/editBorder.png';
  244. import settingBorder from '../assets/settingBorder.png';
  245. import simBorder from '../assets/simBorder.png';
  246. let chartInstance = null;
  247. export default {
  248. name: 'DeviceData',
  249. props:{
  250. deviceInfo:{
  251. type:Object,
  252. default:()=>({}),
  253. },
  254. deviceStatic:{
  255. type:Object,
  256. default:()=>({}),
  257. },
  258. polylineList:{
  259. type:Array,
  260. default:()=>[],
  261. },
  262. deviceHistoryList:{
  263. type:Array,
  264. default:()=>[],
  265. },
  266. totalPage:{
  267. type:Number,
  268. default:0
  269. },
  270. currentPage:{
  271. type:Number,
  272. default:0
  273. },
  274. page_size:{
  275. type:Number,
  276. default:10
  277. },
  278. },
  279. components: {
  280. floatButton,
  281. },
  282. computed:{
  283. totalPages(){
  284. return Math.ceil(this.totalPage / this.page_size)
  285. }
  286. },
  287. data() {
  288. return {
  289. setting,
  290. general,
  291. editBorder,
  292. settingBorder,
  293. simBorder,
  294. activeTab: 0,
  295. edit,
  296. sim,
  297. show:false,
  298. show1:true,
  299. equipStateDict:{},
  300. chartTabs: [
  301. { name: '温度', id: 'new_tem' },
  302. { name: '湿度', id: 'new_hum' },
  303. { name: '加热仓温度', id: 'others' },
  304. ],
  305. opts: {
  306. type: 'line',
  307. xAxis: {
  308. disableGrid: true,
  309. itemCount: 3,
  310. scrollShow: true
  311. },
  312. yAxis: {
  313. disableGrid: true,
  314. gridType: 'dash',
  315. splitNumber: 5,
  316. min: 0,
  317. format: (val) => {
  318. return Math.round(val)
  319. }
  320. },
  321. extra: {
  322. line: {
  323. type: 'curve'
  324. },
  325. tooltip: {
  326. format: {
  327. name: '',
  328. value: (val) => Math.round(val)
  329. }
  330. }
  331. },
  332. legend: {
  333. },
  334. enableScroll: true
  335. },
  336. xData:[],
  337. yData:[],
  338. activeChartTab: 0,
  339. historyData: [],
  340. data_iccid:'',
  341. data_iccidInput:'',
  342. deviceInfoStatic:{},
  343. photo_iccid:'',
  344. chartData: {},
  345. chartKey: 0
  346. };
  347. },
  348. mounted(){
  349. this.equipStateDict = Circulation
  350. },
  351. watch:{
  352. polylineList:{
  353. handler(newVal, oldVal){
  354. this.xData = newVal.map(item => this.formatDate(new Date(item.addtime)));
  355. this.yData = newVal.map(item => Number(item.new_tem) || 0);
  356. if(this.xData.length){
  357. this.initChart();
  358. }
  359. },
  360. deep:true,
  361. immediate:true,
  362. },
  363. deviceHistoryList:{
  364. handler(newVal, oldVal){
  365. this.historyData = []
  366. if(newVal.length > 0){
  367. newVal.forEach(item=>{
  368. this.historyData.push(item.d_h_t)
  369. })
  370. }
  371. },
  372. deep:true,
  373. immediate:true,
  374. },
  375. },
  376. methods: {
  377. editData(){
  378. uni.navigateTo({
  379. url: '/pages/afterSale/addafter?d_id=' + this.deviceInfo.d_id +'&device_id='+this.deviceInfo.id + '&device_type=' + this.deviceInfo.type,
  380. })
  381. },
  382. prevPage(){
  383. this.$emit('prevPage', this.currentPage)
  384. },
  385. nextPage(){
  386. this.$emit('nextPage', this.currentPage)
  387. },
  388. changeSim(){
  389. this.show1 = false
  390. },
  391. changeSimHandler(){
  392. if(this.data_iccidInput){
  393. this.changeSimAction(this.data_iccidInput);
  394. }else{
  395. this.$u.toast('请输入ICCID')
  396. }
  397. },
  398. switchTab(index){
  399. this.activeTab = index
  400. },
  401. simData(){
  402. this.show = true
  403. },
  404. async changeSimAction(simid){
  405. const res = await this.$myRequest({
  406. url: '/api/api_gateway?method=forecast.send_control.device_sim_update',
  407. method: 'POST',
  408. data: {
  409. d_id: this.deviceInfo.d_id,
  410. simid,
  411. },
  412. });
  413. if(res){
  414. this.$u.toast('更换成功')
  415. this.show1 = true
  416. this.data_iccidInput = ''
  417. this.getSimNew()
  418. }
  419. },
  420. async getSimNew(){
  421. const res = await this.$myRequest({
  422. url: '/api/api_gateway?method=forecast.send_control.device_sim_new',
  423. method: 'POST',
  424. data: {
  425. d_id: this.deviceInfo.d_id,
  426. },
  427. });
  428. if(res){
  429. const data_iccid = res.data_iccid
  430. this.data_iccid = data_iccid
  431. this.photo_iccid = res.photo_iccid
  432. if(data_iccid){
  433. this.getQueryNew(data_iccid);
  434. }else{
  435. this.activeTab = 1
  436. }
  437. }
  438. },
  439. async getQueryNew(data_iccid){
  440. const res = await this.$myRequest({
  441. url: '/api/api_gateway?method=forecast.send_control.sim_query_new',
  442. method: 'POST',
  443. data: {
  444. iccid: data_iccid,
  445. },
  446. });
  447. this.deviceInfoStatic = res
  448. },
  449. async refreshData(){
  450. const res = await this.$myRequest({
  451. url: '/api/api_gateway?method=forecast.send_control.get_device_config',
  452. method: 'POST',
  453. data: {
  454. device_type_id: this.deviceInfo.type,
  455. d_id: this.deviceInfo.d_id,
  456. control_type:'data',
  457. device_model: this.deviceInfo.device_model || 0,
  458. },
  459. });
  460. if(res){
  461. // 弹出提示
  462. this.$u.toast('刷新成功')
  463. }
  464. },
  465. getStateDict(item){
  466. return item.ws == 0 ? '待机' : this.equipStateDict.lamp.value[item.lamp]
  467. },
  468. getRpsDict(item){
  469. return this.equipStateDict.rps.value[item.rps]
  470. },
  471. getTpsDict(item){
  472. return this.equipStateDict.tps.value[item.tps]
  473. },
  474. getLpsDict(item){
  475. return this.equipStateDict.lps.value[item.lps]
  476. },
  477. openSettings(){
  478. uni.navigateTo({
  479. url: '/pages/cbd/deviceControl?deviceId=' + this.deviceInfo.id + '&d_id=' + this.deviceInfo.d_id,
  480. });
  481. },
  482. initChart() {
  483. this.$nextTick(() => {
  484. this.updateChartsData();
  485. });
  486. },
  487. // 格式化时间
  488. formatDate(dateString) {
  489. const date = new Date(dateString*1000);
  490. const year = date.getFullYear();
  491. const month = String(date.getMonth() + 1).padStart(2, '0');
  492. const day = String(date.getDate()).padStart(2, '0');
  493. return `${year}-${month}-${day}`;
  494. },
  495. formatTime(dateString) {
  496. const date = new Date(dateString*1000);
  497. const year = date.getFullYear();
  498. const month = String(date.getMonth() + 1).padStart(2, '0');
  499. const day = String(date.getDate()).padStart(2, '0');
  500. const hour = String(date.getHours()).padStart(2, '0');
  501. const minute = String(date.getMinutes()).padStart(2, '0');
  502. const second = String(date.getSeconds()).padStart(2, '0');
  503. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  504. },
  505. drawChart() {
  506. // 销毁已有的图表实例
  507. if (chartInstance) {
  508. chartInstance.dispose();
  509. }
  510. // 初始化图表
  511. const chartDom = document.getElementById('tempChart');
  512. if (!chartDom) return;
  513. // chartInstance = echarts.init(chartDom);
  514. if(!chartInstance){
  515. return
  516. }
  517. const option = {
  518. backgroundColor: '#FFFFFF',
  519. tooltip: {
  520. trigger: 'axis'
  521. },
  522. legend: {
  523. show: false
  524. },
  525. grid: {
  526. left: '3%',
  527. right: '4%',
  528. bottom: '3%',
  529. top: '8%',
  530. containLabel: true
  531. },
  532. xAxis: {
  533. type: 'category',
  534. boundaryGap: false,
  535. data: this.xData,
  536. axisLine: {
  537. lineStyle: {
  538. color: '#CCCCCC'
  539. }
  540. },
  541. axisLabel: {
  542. fontSize: 10,
  543. color: '#999999'
  544. },
  545. splitLine: {
  546. show: false
  547. }
  548. },
  549. yAxis: {
  550. type: 'value',
  551. splitNumber: 4,
  552. axisLine: {
  553. show: true,
  554. lineStyle: {
  555. color: '#CCCCCC'
  556. }
  557. },
  558. axisLabel: {
  559. fontSize: 10,
  560. color: '#999999'
  561. },
  562. splitLine: {
  563. show: true,
  564. lineStyle: {
  565. color: '#E5E5E5',
  566. type: 'dashed'
  567. }
  568. }
  569. },
  570. series: [
  571. {
  572. name: this.chartTabs[this.activeChartTab].name,
  573. type: 'line',
  574. smooth: true,
  575. data: this.yData,
  576. lineStyle: {
  577. color: '#0BBC58',
  578. width: 2
  579. },
  580. itemStyle: {
  581. color: '#0BBC58',
  582. borderColor: '#0BBC58',
  583. borderWidth: 2
  584. },
  585. symbol: 'circle',
  586. symbolSize: 6,
  587. // areaStyle: {
  588. // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  589. // {
  590. // offset: 0,
  591. // color: 'rgba(11, 188, 88, 0.3)'
  592. // },
  593. // {
  594. // offset: 1,
  595. // color: 'rgba(11, 188, 88, 0)'
  596. // }
  597. // ])
  598. // }
  599. }
  600. ]
  601. };
  602. chartInstance.setOption(option);
  603. // 监听窗口大小变化,调整图表大小
  604. window.addEventListener('resize', () => {
  605. chartInstance.resize();
  606. });
  607. },
  608. switchChartTab(index) {
  609. this.activeChartTab = index;
  610. // 根据不同标签切换数据
  611. if (this.chartTabs[index].id === 'new_tem') {
  612. this.yData = this.polylineList.map(item => Number(item.new_tem) || 0);
  613. } else if (this.chartTabs[index].id === 'new_hum') {
  614. this.yData = this.polylineList.map(item => Number(item.new_hum) || 0);
  615. } else if (this.chartTabs[index].id === 'others') {
  616. this.yData = this.polylineList.map(item => Number(item.others) || 0);
  617. }
  618. this.$nextTick(() => {
  619. // this.drawChart();
  620. this.updateChartsData();
  621. });
  622. },
  623. updateChartsData(){
  624. const lineData = {
  625. categories: this.xData,
  626. series: [
  627. {
  628. name: this.chartTabs[this.activeChartTab].name,
  629. data: this.yData
  630. }
  631. ]
  632. };
  633. this.chartData = lineData;
  634. }
  635. }
  636. };
  637. </script>
  638. <style lang="scss" scoped>
  639. .device-data-container {
  640. width: 100%;
  641. }
  642. .device-data-wraper{
  643. padding: 16rpx;
  644. background: #ffffff;
  645. border-radius: 16rpx;
  646. }
  647. /* 顶部时间戳和图标区域 */
  648. .top-bar {
  649. display: flex;
  650. justify-content: space-between;
  651. align-items: center;
  652. padding: 16rpx 0;
  653. .timestamp {
  654. font-size: 28rpx;
  655. font-family: 'Source Han Sans CN VF', sans-serif;
  656. font-weight: 400;
  657. color: #999999;
  658. }
  659. .icon-group {
  660. display: flex;
  661. gap: 10rpx;
  662. .icon-item {
  663. width: 56rpx;
  664. height: 56rpx;
  665. display: flex;
  666. align-items: center;
  667. justify-content: center;
  668. border-radius: 50%;
  669. .iconfont {
  670. font-size: 36rpx;
  671. }
  672. &.refresh-icon .iconfont {
  673. color: #0BBC58;
  674. }
  675. &.settings-icon .iconfont {
  676. color: #999999;
  677. }
  678. &.info-icon .iconfont {
  679. color: #999999;
  680. }
  681. }
  682. }
  683. }
  684. .sim-container{
  685. padding: 0 20rpx;
  686. .sim-item{
  687. margin-bottom: 20rpx;
  688. .sim-value-change{
  689. display: flex;
  690. align-items: center;
  691. .sim-value-button{
  692. padding: 8rpx 16rpx;
  693. border-radius: 8rpx;
  694. font-size: 24rpx;
  695. font-family: 'Source Han Sans CN VF', sans-serif;
  696. font-weight: 400;
  697. color: #042118;
  698. background: #0BBC58;
  699. color: #ffffff;
  700. margin-left: 20rpx;
  701. }
  702. }
  703. }
  704. }
  705. .general-border{
  706. width: 100rpx;
  707. height: 100rpx;
  708. border-radius: 50%;
  709. display: flex;
  710. align-items: center;
  711. justify-content: center;
  712. transition: all 0.3s ease;
  713. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  714. .general-icon{
  715. width: 50rpx;
  716. height: 50rpx;
  717. border-radius: 50%;
  718. }
  719. }
  720. .general-images{
  721. display: flex;
  722. align-items: center;
  723. justify-content: center;
  724. position: relative;
  725. .general-image{
  726. position: absolute;
  727. width: 80rpx;
  728. height: 80rpx;
  729. border-radius: 50%;
  730. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  731. display:flex;
  732. align-items: center;
  733. justify-content: center;
  734. .image-icon{
  735. width: 45rpx;
  736. height: 45rpx;
  737. }
  738. }
  739. .edit-border{
  740. top: 45rpx;
  741. left: -110rpx;
  742. }
  743. .sim-border{
  744. top: -125rpx;
  745. left: -110rpx;
  746. }
  747. .setting-border{
  748. top: -40rpx;
  749. left: -180rpx;
  750. }
  751. }
  752. /* 主要数据面板 */
  753. .main-data-panel {
  754. display: flex;
  755. background: #FFFFFF;
  756. border-radius: 16rpx;
  757. margin-bottom: 16rpx;
  758. .data-column-left {
  759. flex: 1;
  760. display: flex;
  761. flex-direction: column;
  762. gap: 24rpx;
  763. .data-item {
  764. display: flex;
  765. flex-direction: column;
  766. gap: 8rpx;
  767. .data-label {
  768. font-size: 24rpx;
  769. font-family: 'Source Han Sans CN VF', sans-serif;
  770. font-weight: 400;
  771. color: #999999;
  772. }
  773. .data-value {
  774. font-size: 24rpx;
  775. font-family: 'Source Han Sans CN VF', sans-serif;
  776. font-weight: 700;
  777. color: #042118;
  778. &.temp-value {
  779. color: #FF6B6B;
  780. }
  781. }
  782. .data-unit {
  783. font-size: 24rpx;
  784. font-family: 'Source Han Sans CN VF', sans-serif;
  785. font-weight: 400;
  786. color: #999999;
  787. }
  788. }
  789. }
  790. .data-column-right {
  791. flex: 1;
  792. display: flex;
  793. flex-direction: column;
  794. align-items: center;
  795. gap: 16rpx;
  796. .device-image-container {
  797. position: relative;
  798. width: 200rpx;
  799. height: 200rpx;
  800. display: flex;
  801. align-items: center;
  802. justify-content: center;
  803. .device-glow {
  804. position: absolute;
  805. width: 180rpx;
  806. height: 180rpx;
  807. background: radial-gradient(circle, rgba(11, 188, 88, 0.3) 0%, rgba(11, 188, 88, 0) 70%);
  808. border-radius: 50%;
  809. }
  810. .device-image {
  811. position: relative;
  812. width: 260rpx;
  813. height: 360rpx;
  814. z-index: 1;
  815. top: 60rpx;
  816. }
  817. }
  818. .device-info {
  819. display: flex;
  820. flex-direction: column;
  821. gap: 12rpx;
  822. width: 100%;
  823. .info-row {
  824. display: flex;
  825. justify-content: space-between;
  826. align-items: center;
  827. .info-label {
  828. font-size: 24rpx;
  829. font-family: 'Source Han Sans CN VF', sans-serif;
  830. font-weight: 400;
  831. color: #999999;
  832. }
  833. .info-value {
  834. font-size: 36rpx;
  835. font-family: 'Source Han Sans CN VF', sans-serif;
  836. font-weight: 700;
  837. color: #042118;
  838. }
  839. .info-version {
  840. font-size: 24rpx;
  841. font-family: 'Source Han Sans CN VF', sans-serif;
  842. font-weight: 400;
  843. color: #999999;
  844. }
  845. .info-label-small {
  846. font-size: 24rpx;
  847. font-family: 'Source Han Sans CN VF', sans-serif;
  848. font-weight: 400;
  849. color: #999999;
  850. }
  851. }
  852. }
  853. }
  854. }
  855. .tabs-container{
  856. display:flex;
  857. align-items: center;
  858. gap: 24rpx;
  859. padding: 24rpx;
  860. .tabs-item{
  861. font-size: 28rpx;
  862. font-family: 'Source Han Sans CN VF', sans-serif;
  863. font-weight: 500;
  864. color: #999999;
  865. }
  866. .tabs-item.active{
  867. color: #0BBC58;
  868. }
  869. }
  870. /* 图表区域 */
  871. .chart-section {
  872. background: #FFFFFF;
  873. border-radius: 16rpx;
  874. padding: 24rpx 32rpx 32rpx;
  875. margin: 24rpx 0;
  876. .chart-header {
  877. display: flex;
  878. justify-content: space-between;
  879. align-items: center;
  880. margin-bottom: 24rpx;
  881. .chart-tabs {
  882. display: flex;
  883. gap: 48rpx;
  884. overflow-x: auto;
  885. white-space: nowrap;
  886. .chart-tab-item {
  887. font-size: 28rpx;
  888. font-family: 'Source Han Sans CN VF', sans-serif;
  889. font-weight: 500;
  890. color: #999999;
  891. position: relative;
  892. padding-bottom: 8rpx;
  893. transition: all 0.3s;
  894. &.active {
  895. color: #0BBC58;
  896. font-weight: 700;
  897. &::after {
  898. content: '';
  899. position: absolute;
  900. bottom: 0;
  901. left: 0;
  902. right: 0;
  903. height: 4rpx;
  904. background: #0BBC58;
  905. border-radius: 2rpx;
  906. }
  907. }
  908. }
  909. }
  910. .chart-dropdown {
  911. .dropdown-icon {
  912. font-size: 28rpx;
  913. color: #999999;
  914. }
  915. }
  916. }
  917. .chart-content {
  918. .chart-legend {
  919. display: flex;
  920. justify-content: space-between;
  921. align-items: center;
  922. margin-bottom: 16rpx;
  923. .legend-item {
  924. display: flex;
  925. align-items: center;
  926. gap: 8rpx;
  927. .legend-dot {
  928. width: 16rpx;
  929. height: 16rpx;
  930. background: #0BBC58;
  931. border-radius: 50%;
  932. }
  933. .legend-text {
  934. font-size: 24rpx;
  935. font-family: 'Source Han Sans CN VF', sans-serif;
  936. font-weight: 400;
  937. color: #042118;
  938. }
  939. }
  940. .legend-average {
  941. .average-text {
  942. font-size: 24rpx;
  943. font-family: 'Source Han Sans CN VF', sans-serif;
  944. font-weight: 400;
  945. color: #999999;
  946. }
  947. }
  948. }
  949. .chart-canvas-container {
  950. width: 100%;
  951. height: 400rpx;
  952. .chart-canvas {
  953. width: 100%;
  954. height: 100%;
  955. }
  956. }
  957. }
  958. }
  959. .copy-icon{
  960. width: 40rpx;
  961. height: 40rpx;
  962. }
  963. /* 历史数据表格 */
  964. .history-section {
  965. background: #FFFFFF;
  966. border-radius: 16rpx;
  967. padding: 24rpx 32rpx 32rpx;
  968. .history-header {
  969. margin-bottom: 24rpx;
  970. .history-title {
  971. font-size: 32rpx;
  972. font-family: 'Source Han Sans CN VF', sans-serif;
  973. font-weight: 700;
  974. color: #042118;
  975. }
  976. }
  977. .history-table {
  978. margin-bottom: 24rpx;
  979. .table-container {
  980. display: flex;
  981. position: relative;
  982. /* 固定列 */
  983. .fixed-column {
  984. width: 240rpx;
  985. position: relative;
  986. z-index: 2;
  987. background: #FFFFFF;
  988. .fixed-header {
  989. border-bottom: 2rpx solid #F0F0F0;
  990. padding: 16rpx 0;
  991. .header-cell.fixed {
  992. font-size: 24rpx;
  993. font-family: 'Source Han Sans CN VF', sans-serif;
  994. font-weight: 500;
  995. color: #666666;
  996. text-align: left;
  997. padding-left: 0;
  998. }
  999. }
  1000. .fixed-body {
  1001. .fixed-row {
  1002. padding: 16rpx 0;
  1003. border-bottom: 1rpx solid #F5F5F5;
  1004. height: 80rpx;
  1005. display: flex;
  1006. align-items: center;
  1007. &.even {
  1008. background: #FAFAFA;
  1009. }
  1010. .body-cell.fixed {
  1011. font-size: 24rpx;
  1012. font-family: 'Source Han Sans CN VF', sans-serif;
  1013. font-weight: 400;
  1014. color: #042118;
  1015. text-align: left;
  1016. padding-left: 0;
  1017. }
  1018. }
  1019. }
  1020. }
  1021. /* 可滑动列 */
  1022. .scrollable-column {
  1023. flex: 1;
  1024. overflow-x: auto;
  1025. white-space: nowrap;
  1026. /* 隐藏滚动条 */
  1027. &::-webkit-scrollbar {
  1028. display: none;
  1029. }
  1030. scrollbar-width: none;
  1031. .scrollable-header {
  1032. display: flex;
  1033. border-bottom: 2rpx solid #F0F0F0;
  1034. padding: 20rpx 0;
  1035. .header-cell {
  1036. min-width: 140rpx;
  1037. font-size: 24rpx;
  1038. font-family: 'Source Han Sans CN VF', sans-serif;
  1039. font-weight: 500;
  1040. color: #666666;
  1041. text-align: center;
  1042. // 超出隐藏
  1043. overflow: hidden;
  1044. text-overflow: ellipsis;
  1045. white-space: nowrap;
  1046. margin-right: 10rpx;
  1047. }
  1048. }
  1049. .scrollable-body {
  1050. .scrollable-row {
  1051. display: flex;
  1052. padding: 16rpx 0;
  1053. border-bottom: 1rpx solid #F5F5F5;
  1054. height: 80rpx;
  1055. align-items: center;
  1056. &.even {
  1057. background: #FAFAFA;
  1058. }
  1059. .body-cell {
  1060. min-width: 140rpx;
  1061. font-size: 24rpx;
  1062. font-family: 'Source Han Sans CN VF', sans-serif;
  1063. font-weight: 400;
  1064. color: #042118;
  1065. text-align: center;
  1066. margin-right: 10rpx;
  1067. }
  1068. }
  1069. }
  1070. }
  1071. }
  1072. }
  1073. .pagination {
  1074. display: flex;
  1075. justify-content: space-between;
  1076. align-items: center;
  1077. .pagination-btn {
  1078. font-size: 24rpx;
  1079. font-family: 'Source Han Sans CN VF', sans-serif;
  1080. font-weight: 400;
  1081. padding: 6rpx 18rpx;
  1082. border-radius: 8rpx;
  1083. transition: all 0.3s;
  1084. &.prev-btn {
  1085. color: #656565;
  1086. border: 1px solid #E4E7ED;
  1087. }
  1088. &.next-btn {
  1089. color: #0BBC58;
  1090. border: 1px solid #0BBC58;
  1091. }
  1092. }
  1093. .pagination-info {
  1094. font-size: 28rpx;
  1095. font-family: 'Source Han Sans CN VF', sans-serif;
  1096. font-weight: 400;
  1097. color: #999999;
  1098. }
  1099. }
  1100. }
  1101. </style>