deviceData.vue 30 KB

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