deviceData.vue 30 KB

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