deviceData.vue 30 KB

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