deviceData.vue 30 KB

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