deviceData2.vue 29 KB

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