details.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  1. <template>
  2. <view class="box">
  3. <view class="status_bar"></view>
  4. <view style="position: fixed;z-index: 100;width: 100%;">
  5. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="水肥详情"></uni-nav-bar>
  6. </view>
  7. <!-- 上面要素值 -->
  8. <view class="bigBox bigOpen" v-if="show">
  9. <view class="topInfo">
  10. <u-row gutter="10">
  11. <u-col span="3" v-for="item in ElementList" :key="item.id">
  12. <view class="item">
  13. <view>{{item.value}}</view>
  14. <view>{{item.unit}}</view>
  15. <view>{{item.name}}</view>
  16. </view>
  17. </u-col>
  18. </u-row>
  19. <view class="readmore" v-if="!show" @click="show=true;getHistoryData()">
  20. 查看详情<u-icon name="arrow-down" color="#93FFDE" size="28"></u-icon>
  21. </view>
  22. </view>
  23. <!-- 统计图 -->
  24. <view class="hisBox" v-show="show">
  25. <view class="axiosBox">
  26. <view class="title">
  27. 历史数据
  28. </view>
  29. <view class="histimeBox">
  30. <u-icon name="calendar" color="#C1C1C1" size="24"></u-icon>
  31. <view class="time" @click="calendarshow = true">
  32. {{historyTime.startDate ? historyTime.startDate : timestampToDateTime(new Date().getTime()/1000)}}
  33. </view>
  34. <view class="">至</view>
  35. <view class="time" @click="calendarshow = true">
  36. {{historyTime.endDate ? historyTime.endDate : timestampToDateTime(new Date().getTime()/1000)}}
  37. </view>
  38. <u-icon name="close-circle" color="#C1C1C1" size="28" @click="historyTime={};getHistoryData()"
  39. v-if="historyTime.startDate"></u-icon>
  40. </view>
  41. <u-calendar v-model="calendarshow" mode="range" @change="changeDate"></u-calendar>
  42. <view class="chartBox">
  43. <canvas canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
  44. @touchstart="touchLineA($event)" @touchmove="moveLineA($event)"
  45. @touchend="touchEndLineA($event)"></canvas>
  46. </view>
  47. </view>
  48. <view class="readmoreHIs" @click="show=false">
  49. 收起详情<u-icon name="arrow-up" color="#14A478" size="28"></u-icon>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="bigBox" v-else>
  54. <view class="topInfo">
  55. <u-row gutter="10">
  56. <u-col span="3" v-for="item in ElementList" :key="item.id">
  57. <view class="item">
  58. <view>{{item.value}}</view>
  59. <view>{{item.unit}}</view>
  60. <view>{{item.name}}</view>
  61. </view>
  62. </u-col>
  63. </u-row>
  64. <view class="readmore" v-if="!show" @click="show=true;getHistoryData()">
  65. 查看详情<u-icon name="arrow-down" color="#93FFDE" size="28"></u-icon>
  66. </view>
  67. </view>
  68. <!-- 统计图 -->
  69. <view class="hisBox" v-show="show">
  70. <view class="axiosBox">
  71. <view class="title">
  72. 历史数据
  73. </view>
  74. <view class="histimeBox">
  75. <u-icon name="calendar" color="#C1C1C1" size="24"></u-icon>
  76. <view class="time" @click="calendarshow = true">
  77. {{historyTime.startDate ? historyTime.startDate : timestampToDateTime(new Date().getTime()/1000)}}
  78. </view>
  79. <view class="">至</view>
  80. <view class="time" @click="calendarshow = true">
  81. {{historyTime.endDate ? historyTime.endDate : timestampToDateTime(new Date().getTime()/1000)}}
  82. </view>
  83. <u-icon name="close-circle" color="#C1C1C1" size="28" @click="historyTime={};getHistoryData()"
  84. v-if="historyTime.startDate"></u-icon>
  85. </view>
  86. <u-calendar v-model="calendarshow" mode="range" @change="changeDate"></u-calendar>
  87. <view class="chartBox">
  88. <canvas canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
  89. @touchstart="touchLineA($event)" @touchmove="moveLineA($event)"
  90. @touchend="touchEndLineA($event)"></canvas>
  91. </view>
  92. </view>
  93. <view class="readmoreHIs" @click="show=false">
  94. 收起详情<u-icon name="arrow-up" color="#14A478" size="28"></u-icon>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="" v-if="!show">
  99. <!-- 历史记录弹框 -->
  100. <u-tabs :list="list" active-color="#14A478" bar-width="100" :is-scroll="false" :current="current"
  101. @change="change"></u-tabs>
  102. <!-- 设备图 -->
  103. <view class="devicePhoto" v-if="current == 0">
  104. <view class="titleBox">
  105. <u-alert-tips type="primary" :title-style="alertTipColor" title="点击按钮可对应控制阀门开关,开即打开,关即关闭"
  106. :show-icon="true"></u-alert-tips>
  107. <!-- <view class="btn" @click="statusPanel=true">控制面板</view> -->
  108. <!-- <u-popup v-model="statusPanel" mode="bottom">
  109. <view class="consoleBox">
  110. <view class="swichBox">
  111. <u-row :gutter="16" justify="space-between">
  112. <u-col span="6" v-for="(item, index) in buttonList" v-if="(index + 1) % 2 == 1">
  113. <view class="preSwich">
  114. <view>肥料{{ (index + 1) / 2 > 1 ? (index + 2) / 2 : 1 }}</view>
  115. <u-switch v-model="item.off" active-color="#14A478" inactive-color="#AEB4C2"
  116. :loading="item.disabled"
  117. @change="switchchange($event, item.number, item, index, true)"></u-switch>
  118. </view>
  119. </u-col>
  120. <u-col span="6" v-for="(item, index) in facilityvalve"
  121. v-if="index > buttonList.length - 1">
  122. <view class="preSwich">
  123. <view>{{item.name}}</view>
  124. <u-switch v-model="item.off" active-color="#14A478" inactive-color="#AEB4C2"
  125. :loading="item.disabled"
  126. @change="switchchange($event, item.number, item, index)"></u-switch>
  127. </view>
  128. </u-col>
  129. </u-row>
  130. </view>
  131. <u-button type="success" @click="statusPanel=false">确定</u-button>
  132. </view>
  133. </u-popup> -->
  134. </view>
  135. <view class="main">
  136. <image class="mainContent" src="../../static/images/waterandfernew/mainNew.png"></image>
  137. <!-- <view class="sourceBox">
  138. <view class="smallBox">
  139. 水源
  140. </view>
  141. </view> -->
  142. <!-- 桶 -->
  143. <view class="colList">
  144. <view class="preClo" v-for="item, index in pickBtnList" :key="item.type">
  145. <view>
  146. {{resultBan[index].e_name}}
  147. </view>
  148. <image src="../../static/images/waterandfernew/colNew.png" v-if="pickBtnList.length == 1">
  149. </image>
  150. <image src="../../static/images/waterandfernew/colLeft.png"
  151. v-else-if="pickBtnList.length > 1 && index == 0"></image>
  152. <image src="../../static/images/waterandfernew/colRight.png"
  153. v-else-if="pickBtnList.length > 1 && index == pickBtnList.length - 1"></image>
  154. <image src="../../static/images/waterandfernew/colCenter.png" v-else></image>
  155. <view class="jiaoBtn" v-if="resultBan.length > 0">
  156. <u-switch v-model="resultBan[index]['off']" active-color="#14A478"
  157. inactive-color="#AEB4C2" :loading="resultBan[index]['disabled']"
  158. @change="switchchange($event, resultBan[index]['number'], resultBan[index], index)"></u-switch>
  159. </view>
  160. <view class="shanBox" v-if="resultBan.length > 0">
  161. <image v-if="!resultBan[index]['off']"
  162. src="../../static/images/waterandfernew/shan.png"></image>
  163. <image v-else class="circleAnm"
  164. src="../../static/images/waterandfernew/shanannimate.png"></image>
  165. </view>
  166. <view class="btnBox" @click="switchchange($event, item.number, item, index, true)">
  167. <image v-if="item.off" src="../../static/images/waterandfernew/feiopen.png"></image>
  168. <image v-else src="../../static/images/waterandfernew/feiclose.png"></image>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 废料管口 -->
  173. <view class="exit">
  174. <image src="../../static/images/waterandfernew/exit.png"></image>
  175. </view>
  176. <!-- 注肥泵 -->
  177. <view class="feiLight"
  178. @click="switchchange(!feiBengItem.e_status, feiBengItem.number, feiBengItem, feiBengIndex)">
  179. <image v-if="feiBengItem.e_status" src="../../static/images/waterandfernew/feiAllopen.png"></image>
  180. <image v-else src="../../static/images/waterandfernew/feiAllclose.png"></image>
  181. </view>
  182. <!-- 控制柜 -->
  183. <view class="kongBox">
  184. <image v-if="feiBengItem.e_status" src="../../static/images/waterandfernew/kongclose.png"></image>
  185. <image v-else src="../../static/images/waterandfernew/kongopen.png"></image>
  186. </view>
  187. <!-- 进水泵 -->
  188. <view class="warterIn"
  189. @click="switchchange(!mainBengItem.e_status, mainBengItem.number, mainBengItem, mainBengIndex)">
  190. <image v-if="mainBengItem.e_status" src="../../static/images/waterandfernew/feiopen.png"></image>
  191. <image v-else src="../../static/images/waterandfernew/feiclose.png"></image>
  192. </view>
  193. <!-- 进水指示 -->
  194. <view class="warterLight">
  195. <image v-if="mainBengItem.e_status" src="../../static/images/waterandfernew/bengopen.png"></image>
  196. <image v-else src="../../static/images/waterandfernew/bengclose.png"></image>
  197. </view>
  198. <!-- 电风扇 -->
  199. <!-- <view class="fengBox">
  200. <view class="relativeBox">
  201. <image src="../../static/images/waterandfernew/fengmain.png"></image>
  202. <image :class="feiBeng ? 'circleAnm' : ''"
  203. src="../../static/images/waterandfernew/fengleafs.png"></image>
  204. </view>
  205. </view> -->
  206. <!-- 水管控制阀 -->
  207. <view class="benList">
  208. <!-- <view class="preBen" v-for="item, index in buttonList" v-if="(index + 1) % 2 == 1"
  209. @click="switchchange(!item.off, item.number, item, index, true)">
  210. <image class="daoguan" src="../../static/images/waterandfernew/bottomNew.png"
  211. v-if="(index + 1) % 2 < 4"></image>
  212. <view class="info">
  213. 肥料{{ (index + 1) / 2 > 1 ? (index + 2) / 2 : 1 }}开关
  214. </view>
  215. <image class="status" v-if="item.off" src="../../static/images/waterandfernew/open.png">
  216. </image>
  217. <image class="status" v-else src="../../static/images/waterandfernew/close.png"></image>
  218. </view> -->
  219. <view class="preBen" v-for="item, index in faList"
  220. @click="switchchange(!item.e_status, item.number, item, index)">
  221. <image class="daoguan" src="../../static/images/waterandfernew/bottomNew.png"
  222. v-if="index < 5"></image>
  223. <view class="info">
  224. {{item.e_name}}
  225. </view>
  226. <image class="status" v-if="item.e_status" src="../../static/images/waterandfernew/open.png">
  227. </image>
  228. <image class="status" v-else src="../../static/images/waterandfernew/close.png"></image>
  229. </view>
  230. </view>
  231. </view>
  232. </view>
  233. <!-- 操作记录 -->
  234. <view class="consoleList" v-else>
  235. <view class="histimeBox">
  236. <u-icon name="calendar" color="#C1C1C1" size="24"></u-icon>
  237. <view class="time" @click="consoleshow = true">
  238. {{consoleTime.startDate ? consoleTime.startDate : '开始'}}
  239. </view>
  240. <view class="">至</view>
  241. <view class="time" @click="consoleshow = true">{{consoleTime.endDate ? consoleTime.endDate : '结束'}}
  242. </view>
  243. <u-icon name="close-circle" color="#C1C1C1" size="28" @click="clearContime"
  244. v-if="consoleTime.startDate"></u-icon>
  245. </view>
  246. <u-calendar v-model="consoleshow" mode="range" @change="changeConsoleDate"></u-calendar>
  247. <view class="tableList tableTitle">
  248. <view>设备名称</view>
  249. <view>操作内容</view>
  250. <view>操作时间</view>
  251. </view>
  252. <view class="tableList" v-for="(item, index) in tableData" :key="item.uptime">
  253. <view>{{item.device_name}}</view>
  254. <view :class="item.status ? 'success' : 'error'">{{item.operation_content}}</view>
  255. <view>{{item.uptime}}</view>
  256. </view>
  257. <u-loadmore :status="status" />
  258. </view>
  259. </view>
  260. </view>
  261. </template>
  262. <script>
  263. import uCharts from '../../components/js_sdk/u-charts/u-charts/u-charts.js';
  264. var canvaColumnA = null;
  265. var canvasRing = null;
  266. export default {
  267. data() {
  268. return {
  269. typeObj: {
  270. 1: '控制柜',
  271. 2: '灌溉泵',
  272. 3: '搅拌机',
  273. 4: '注肥泵',
  274. 5: '阀控器',
  275. 6: '施肥桶'
  276. }, //阀控器类型对应
  277. pickBtnList: [], // 肥料开关列表
  278. resultBan: [], // 搅拌机开关列表
  279. faList: [], // 发空气开关列表
  280. alertTipColor: {
  281. color: '#1890FF',
  282. fontSize: "12px"
  283. },
  284. device_id: '',
  285. mainBengEKey: '',
  286. mainBengIndex: 0, // 进水泵的位置
  287. mainBengItem:{},
  288. mainBeng: false,
  289. feiBeng: false,
  290. feiBengItem: {}, // 施肥泵的位置
  291. feiBengEKey:'',
  292. calendarshow: false,
  293. historyTime: {},
  294. cWidth: '350',
  295. cHeight: '350',
  296. pixelRatio: 1,
  297. facilityvalve: [],
  298. feiNum: 0, //肥料桶实际占据通道个数
  299. buttonList: [], // 肥料开关列表
  300. colomRoundList: ['j1', 'j2', 'j3', 'j4', 'j5', 'j6', 'j7', 'j8'], // 废料桶的通道
  301. ElementList: [],
  302. typename: [
  303. "-",
  304. "风机",
  305. "水泵",
  306. "增氧机",
  307. "湿帘",
  308. "遮阳",
  309. "开窗",
  310. "保温",
  311. "投食机",
  312. ],
  313. show: false,
  314. list: [{
  315. name: '设备控制'
  316. }, {
  317. name: '执行结果'
  318. }, {
  319. name: '操作记录'
  320. }],
  321. statusPanel: false,
  322. current: 0,
  323. consoleshow: false,
  324. consoleTime: {},
  325. tableData: [],
  326. page: 1,
  327. total: 0,
  328. status: 'loadmore'
  329. }
  330. },
  331. methods: {
  332. clickLeft() {
  333. uni.navigateBack({
  334. delta: 1
  335. })
  336. },
  337. changeTimeStatus(item, changeIndex) {
  338. this.timer = setTimeout(() => {
  339. item.disabled = false; // 改变值
  340. this.facilityvalve[changeIndex].disabled = false;
  341. this.getEquipstatus()
  342. this.timer = null; // 清空定时器引用
  343. }, 15000);
  344. },
  345. // 选择日期
  346. changeDate(e) {
  347. console.log(e)
  348. this.historyTime = e;
  349. this.getHistoryData()
  350. },
  351. // 绘制折线图
  352. showColumn(id, xtitle, xinfo) {
  353. var _self = this
  354. canvaColumnA = new uCharts({
  355. canvasId: id,
  356. type: 'line',
  357. legend: {
  358. position: "top"
  359. },
  360. fontSize: 11,
  361. background: '#FFFFFF',
  362. pixelRatio: 1,
  363. animation: true,
  364. dataLabel: false,
  365. categories: xtitle,
  366. series: xinfo,
  367. enableScroll: true, //开启图表拖拽功能
  368. xAxis: {
  369. disabled: true,
  370. disableGrid: false,
  371. type: 'grid',
  372. gridType: 'dash',
  373. itemCount: 15, //x轴单屏显示数据的数量,默认为5个
  374. scrollShow: true, //新增是否显示滚动条,默认false
  375. scrollAlign: 'right', //滚动条初始位置
  376. scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
  377. scrollColor: '#DEE7F7', //默认为 #A6A6A6
  378. },
  379. yAxis: {},
  380. width: _self.cWidth * 1,
  381. height: _self.cHeight * 1,
  382. extra: {
  383. line: {
  384. type: 'curve'
  385. }
  386. }
  387. });
  388. },
  389. touchLineA(e) {
  390. // console.log(e)
  391. canvaColumnA.scrollStart(e);
  392. },
  393. moveLineA(e) {
  394. canvaColumnA.scroll(e);
  395. },
  396. touchEndLineA(e) {
  397. canvaColumnA.touchLegend(e);
  398. // canvaColumnA.showToolTip(e);
  399. canvaColumnA.scrollEnd(e);
  400. //下面是toolTip事件,如果滚动后不需要显示,可不填写
  401. canvaColumnA.showToolTip(e, {
  402. format: function(item, category) {
  403. return category + ' ' + item.name + ':' + item.data
  404. }
  405. });
  406. },
  407. // 时间戳转换
  408. timestampToDateTime(timestamp, isTime) {
  409. var date = new Date(timestamp * 1000); // 将时间戳转换为毫秒并创建一个日期对象
  410. var year = date.getFullYear(); // 获取年份
  411. var month = ('0' + (date.getMonth() + 1)).slice(-2); // 获取月份,并补零
  412. var day = ('0' + date.getDate()).slice(-2); // 获取日期,并补零
  413. var hours = ('0' + date.getHours()).slice(-2); // 获取小时,并补零
  414. var minutes = ('0' + date.getMinutes()).slice(-2); // 获取分钟,并补零
  415. var seconds = ('0' + date.getSeconds()).slice(-2); // 获取秒数,并补零
  416. if (isTime) {
  417. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  418. } else {
  419. return `${year}-${month}-${day}`;
  420. }
  421. },
  422. // 历史数据
  423. async getHistoryData() {
  424. uni.showLoading({
  425. title: '加载中'
  426. });
  427. const {
  428. historyTime
  429. } = this;
  430. // 获取当前日期
  431. var currentDate = new Date();
  432. // 设置时间为 0 点
  433. currentDate.setHours(0, 0, 0, 0);
  434. let begin = historyTime.startDate ? (new Date(historyTime.startDate).getTime() / 1000) - 8 * 3600 : (
  435. Math.floor(currentDate.getTime() / 1000));
  436. // 设置时间为 24 点
  437. currentDate.setHours(24, 0, 0, 0);
  438. let end = historyTime.endDate ? (new Date(historyTime.endDate).getTime() / 1000) - 8 * 3600 : (Math
  439. .floor(currentDate.getTime() / 1000));
  440. //折线图数据
  441. let res = await this.$myRequest({
  442. url: "/api/api_gateway?method=weather.weather.sf_data_chart",
  443. data: {
  444. device_id: this.device_id,
  445. begin: begin,
  446. end: end,
  447. },
  448. })
  449. uni.hideLoading();
  450. var conf = res.conf.eleName;
  451. var dat = res.dat.reverse();
  452. //console.log(dat);
  453. conf = conf.split("/");
  454. // var arr1 = [];
  455. var regroupData = []; //重组数据
  456. let options = [];
  457. var timeList = [];
  458. for (var i = 0; i < conf.length; i++) {
  459. // var arr = [];
  460. if (conf[i] != "-") {
  461. var optionobj = {};
  462. optionobj.value = i;
  463. optionobj.label = conf[i];
  464. options.push(optionobj);
  465. var reddata = [];
  466. dat.forEach((item, index) => {
  467. if (timeList.length < dat.length) {
  468. timeList.push(this.timestampToDateTime(item.uptime, true));
  469. }
  470. var status = item.device_status.split(",");
  471. // //console.log(status);
  472. var arr = [];
  473. for (var j = 0; j < status.length; j++) {
  474. if (status[j].indexOf("e") + 1) {
  475. arr.push(status[j]);
  476. }
  477. }
  478. // //console.log(arr)
  479. var dataobj = {};
  480. for (var k = 0; k < arr.length; k++) {
  481. var indexs = arr[k].indexOf(":");
  482. // //console.log(arr[k])
  483. if (k == 0) {
  484. dataobj[arr[k].slice(1, indexs).trim()] = arr[k]
  485. .substr(indexs + 1)
  486. .trim();
  487. } else {
  488. dataobj[arr[k].slice(0, indexs).trim()] = arr[k]
  489. .substr(indexs + 1)
  490. .trim();
  491. }
  492. }
  493. // //console.log(dataobj)
  494. for (var key in dataobj) {
  495. // //console.log(i)
  496. var str = "'e" + (i + 1) + "'";
  497. // //console.log(key,str);
  498. if (key == str) {
  499. if (Number(dataobj[key]) == 32767) {
  500. // reddata.push([]);
  501. } else {
  502. reddata.push(Number(dataobj[key]));
  503. }
  504. }
  505. }
  506. });
  507. regroupData.push({
  508. name: conf[i],
  509. type: "spline",
  510. fillColor: {
  511. linearGradient: [0, 0, 0, 300],
  512. },
  513. data: reddata,
  514. });
  515. }
  516. }
  517. // console.log(timeList);
  518. this.showColumn('canvasColumnA', timeList, regroupData)
  519. },
  520. // 切换选项卡
  521. change(index) {
  522. this.page = 1;
  523. this.total = 0;
  524. this.current = index;
  525. this.status = 'loadmore';
  526. this.tableData = [];
  527. this.getEquipcontroldata();
  528. },
  529. // 获取要素实时数据
  530. async getElmentInfo() {
  531. uni.showLoading({
  532. title: '加载中'
  533. });
  534. let res = await this.$myRequest({
  535. url: "/api/api_gateway?method=xphsp.views.device_elements",
  536. data: {
  537. device_id: this.device_id,
  538. },
  539. })
  540. uni.hideLoading();
  541. var conf = res.conf.eleName.split('/');
  542. var dataList = [res.data.device_data];
  543. if (dataList.length == 0) return
  544. this.ElementList = [];
  545. conf.forEach((item, index) => {
  546. let obj = {}
  547. if (item == '-') return
  548. obj.name = item;
  549. let valList = dataList[0][`e${index + 1}`].split('#');
  550. obj.value = valList[0];
  551. obj.unit = valList[1];
  552. obj.time = dataList[0].uptime;
  553. this.ElementList.push(obj)
  554. })
  555. // console.log(this.ElementList)
  556. },
  557. // 当前配置的元素列表
  558. async getPickList() {
  559. // e_type类型对应
  560. // 1:'控制柜',
  561. // 2:'灌溉泵',
  562. // 3:'搅拌机',
  563. // 4:'注肥泵',
  564. // 5:'阀控器',
  565. // 6:'施肥桶'
  566. let res = await this.$myRequest({
  567. url: "/api/api_gateway?method=xphsp.views.sf_valve_location_list",
  568. data: {
  569. sf_device_id: this.device_id,
  570. },
  571. });
  572. let pickList = [];
  573. let pickBtnList = []; // 肥料开关
  574. let pickBanList = []; // 肥料搅拌机开关
  575. let faList = []; // 管道阀开关
  576. res.forEach((pick, index) => {
  577. this.facilityvalve.forEach(item => {
  578. if (pick.e_key == item.type) {
  579. // 获取当前灌溉泵位置
  580. let pickObj = Object.assign(pick,item);
  581. if(pick.e_type == 2) {
  582. this.mainBengIndex = pickList.length;
  583. this.mainBengItem = pickObj;
  584. this.mainBeng = pickObj.e_status;
  585. this.mainBengEKey = pickObj.e_key;
  586. }
  587. // 获取当前施肥泵位置
  588. if(pick.e_type == 4) {
  589. this.feiBengIndex = pickList.length;
  590. this.feiBengItem = pickObj;
  591. this.feiBeng = pickObj.e_status;
  592. this.feiBengEKey = pickObj.e_key;
  593. }
  594. // 获取肥料开关列表
  595. if (pick.e_type == 6) {
  596. pickBtnList.push(pickObj)
  597. }
  598. // 获取搅拌机开关列表
  599. if (pick.e_type == 3) {
  600. pickBanList.push(pickObj)
  601. }
  602. // 获取管道阀开关列表
  603. if (pick.e_type == 1 || pick.e_type == 5) {
  604. faList.push(pickObj)
  605. }
  606. pickList.push(pickObj)
  607. }
  608. })
  609. })
  610. // 把肥料和搅拌机位置对应起来(根据创建时间)
  611. let resultBan = [];
  612. pickBtnList.forEach(fei => {
  613. pickBanList.forEach(ban => {
  614. if (fei.create_time == ban.create_time) {
  615. resultBan.push(ban)
  616. }
  617. })
  618. })
  619. this.pickBtnList = pickBtnList;
  620. this.resultBan = resultBan;
  621. this.faList = faList;
  622. console.log(pickBtnList, pickBanList, resultBan, faList)
  623. },
  624. // 元素状态
  625. async getEquipstatus() {
  626. uni.showLoading({
  627. title: '加载中'
  628. });
  629. this.facilityvalve = [];
  630. let res = await this.$myRequest({
  631. url: "/api/api_gateway?method=xphsp.views.device_info",
  632. data: {
  633. device_id: this.device_id,
  634. },
  635. })
  636. uni.hideLoading();
  637. var conf = res.conf.relayName;
  638. var dataobj = res.device_status;
  639. var relayNum = res.conf.relayNum;
  640. var arr = [];
  641. function numberToArray(number) {
  642. // 将数字转换为字符串
  643. let numString = number.toString();
  644. // 创建一个空数组,用于存储结果
  645. let result = [];
  646. // 遍历字符串的每个字符,并将其转换为对应的数字
  647. for (let i = 0; i < numString.length; i++) {
  648. result.push(parseInt(numString.charAt(i)));
  649. }
  650. return result;
  651. }
  652. for (var i = 0; i < dataobj.length; i++) {
  653. // if (offobj[i].indexOf("j") + 1) {
  654. arr.push(offobj[i]);
  655. // }
  656. }
  657. conf = conf.split("/");
  658. relayNum = relayNum.split("/");
  659. var arr1 = [];
  660. var reg = /\d/;
  661. let totalP = Math.ceil((conf.length) / 32); //总圈数
  662. for (var i = 0; i < conf.length; i++) {
  663. var obj = {};
  664. obj.name = conf[i];
  665. // if (reg.test(conf[i])) {
  666. // obj.name2 = conf[i].slice(0, conf[i].length - 1);
  667. // } else {
  668. // obj.name2 = conf[i];
  669. // }
  670. obj.name2 = this.typename[relayNum[i]];
  671. obj.number = i;
  672. obj.type = `j${i + 1}`;
  673. obj.disabled = false;
  674. // "state": 1 继电器打开 ;"state": 0 继电器关闭
  675. // 处理开关值
  676. // J开头表示状态,总共只有32长度,超过32则从头赋值 位数多一位
  677. // 例:1和33是都在J1里面,返回值是一个二进制数 倒数第一位表示第一个 第二位表示33状态 以此类推
  678. // 根据总长度 为超过32的j赋值
  679. // 当前是循环的第几轮
  680. let baseP = Math.ceil((i + 1) / 32);
  681. if (i > 31) {
  682. dataobj[`j${i + 1}`] = dataobj[
  683. `j${(i + 1) % 32 == 0 ? 32 : (i + 1) % 32}`]; // 当前脚标/32取余 当恰好整除的时候 取32
  684. }
  685. dataobj[`j${i + 1}`] = dataobj[`j${i + 1}`].slice(-totalP); // 截取当前圈数的最后几位数字
  686. let baseOff = numberToArray(dataobj[`j${i + 1}`]); // 把当前值根据位数 转换为数组
  687. obj.off = baseOff[baseP - 1] == '0' ? false : true; // 根据当前圈数,取对应的数组的值
  688. arr1.push(obj);
  689. }
  690. for (var i = 0; i < arr1.length; i++) {
  691. if (arr1[i].name != "-") {
  692. this.facilityvalve.push(arr1[i]);
  693. }
  694. }
  695. let feiNum = 0; // 记录废料桶占据通道个数,两个通道为一个肥料桶
  696. this.buttonList = [];
  697. this.facilityvalve.forEach((item, index) => {
  698. if (this.colomRoundList.indexOf(item.type) > -1) {
  699. feiNum++;
  700. this.buttonList.push(item);
  701. }
  702. })
  703. this.feiNum = feiNum;
  704. this.getPickList();
  705. console.log(this.facilityvalve)
  706. },
  707. async getEquipcontrol(num, state, double_order, item) {
  708. // console.log({
  709. // device_id: item.cc_device_id == '' ? this.device_id : item.cc_device_id,
  710. // relayNum: num,
  711. // relayState: state,
  712. // double_order
  713. // });
  714. //设备控制
  715. uni.showLoading({
  716. title: '正在下发指令'
  717. });
  718. let res = await this.$myRequest({
  719. url: "/api/api_gateway?method=xphsp.views.control_order",
  720. data: {
  721. device_id: item.cc_device_id == '' ? this.device_id : item.cc_device_id,
  722. relayNum: num,
  723. relayState: state,
  724. double_order
  725. },
  726. })
  727. uni.hideLoading();
  728. if (res.msg_code == 200) {
  729. uni.showToast({
  730. title: '指令下发成功',
  731. duration: 2000,
  732. icon: 'none'
  733. });
  734. } else {
  735. uni.showToast({
  736. title: res.msg,
  737. duration: 2000,
  738. icon: 'none'
  739. })
  740. setTimeout(() => {
  741. this.getEquipstatus()
  742. }, 2000)
  743. }
  744. },
  745. // sf_control_data
  746. // 操作记录日期
  747. changeConsoleDate(e) {
  748. this.consoleTime = e;
  749. this.tableData = [];
  750. this.page = 1;
  751. this.getEquipcontroldata()
  752. },
  753. clearContime() {
  754. this.consoleTime = {};
  755. this.tableData = [];
  756. this.page = 1;
  757. this.getEquipcontroldata()
  758. },
  759. //操作记录
  760. async getEquipcontroldata() {
  761. uni.showLoading({
  762. title: '加载中'
  763. });
  764. const {
  765. consoleTime
  766. } = this;
  767. let begin = consoleTime.startDate ? new Date(consoleTime.startDate).getTime() / 1000 : '';
  768. let end = consoleTime.endDate ? new Date(consoleTime.endDate).getTime() / 1000 : '';
  769. //操作记录
  770. let res = await this.$myRequest({
  771. method: "POST",
  772. url: "/api/api_gateway?method=xphsp.views.control_log",
  773. data: {
  774. device_id: this.device_id,
  775. page_num: this.page,
  776. page_size: 15,
  777. start: begin,
  778. end: end,
  779. sys_control: this.current - 1
  780. },
  781. })
  782. uni.hideLoading();
  783. // this.tableData = [];
  784. var record = res.result;
  785. this.tableData = [...this.tableData, ...record];
  786. this.total = res.count;
  787. if (this.page * 15 > this.total) {
  788. this.status = 'nomore'
  789. } else {
  790. this.status = 'loadmore'
  791. }
  792. // console.log(this.tableData);
  793. },
  794. switchchange(e, state, item, index, isfeiButton) {
  795. // 是否是肥料开关,是的话 两个合并为一个
  796. item.disabled = true;
  797. if (isfeiButton) {
  798. // console.log(item, this.mainBengEKey, this.feiBengEKey)
  799. this.changeTimeStatus(item, index);
  800. // 当前是打开
  801. if (!item.e_status) {
  802. // 打开通道传1,关闭通道传0
  803. this.getEquipcontrol(state, 1, 1, item);
  804. // this.getEquipcontrol(state + 1, 0);
  805. } else {
  806. // this.getEquipcontrol(state + 1, 0);
  807. this.getEquipcontrol(state, 0, 1, item);
  808. }
  809. item.off = !item.off;
  810. item.e_status = !item.e_status;
  811. return
  812. }
  813. item.off = !item.off;
  814. item.e_status = !item.e_status;
  815. // if (item.type == this.mainBengEKey) {
  816. // // 判断注水泵是否打开
  817. // this.mainBeng = !item.e_status;
  818. // // console.log(this.mainBeng);
  819. // }
  820. // if (item.type == this.feiBengEKey) {
  821. // // 判断施肥阀是否打开
  822. // this.feiBeng = !item.e_status;
  823. // }
  824. // console.log(item, this.mainBengEKey, this.feiBengEKey)
  825. // if (this.colomRoundList.indexOf(item.type) > -1) {
  826. // let changeIndex = index;
  827. // if ((index + 1) % 2 == 0) {
  828. // // 偶数 往前取值
  829. // this.facilityvalve[index - 1].disabled = true;
  830. // changeIndex = index - 1;
  831. // } else if ((index + 1) % 2 == 1) {
  832. // // 基数 往后取值
  833. // this.facilityvalve[index + 1].disabled = true;
  834. // changeIndex = index + 1;
  835. // }
  836. // item.disabled = true;
  837. // this.changeTimeStatus(item, changeIndex);
  838. // this.getEquipcontrol(changeIndex, Number(!e));
  839. // } else {
  840. // }
  841. item.disabled = true;
  842. this.changeTimeStatus(item, index);
  843. //console.log(Number(e), state);
  844. this.getEquipcontrol(state, Number(e), undefined, item);
  845. },
  846. currentchange(e) {
  847. //页码
  848. if (this.type == 0) {
  849. this.pageDialog = e;
  850. } else {
  851. this.page = e;
  852. }
  853. this.getEquipcontroldata(this.type);
  854. },
  855. },
  856. onReachBottom() {
  857. if (this.current != 0 && this.status == 'loadmore') {
  858. this.page++;
  859. this.getEquipcontroldata()
  860. }
  861. },
  862. onLoad(option) {
  863. this.$forceUpdate()
  864. let deviceItem = JSON.parse(option.shebei)
  865. this.device_id = deviceItem.device_id;
  866. this.getEquipstatus();
  867. this.getElmentInfo();
  868. this.getEquipcontroldata();
  869. // this.getPickList();
  870. }
  871. }
  872. </script>
  873. <style scoped lang="less">
  874. .circleAnm {
  875. animation: ancirle 1s linear infinite;
  876. }
  877. // 旋转
  878. @keyframes ancirle {
  879. 0% {
  880. transform: rotate(360deg);
  881. }
  882. 100% {
  883. transform: rotate(0);
  884. }
  885. }
  886. .box {
  887. position: relative;
  888. width: 100%;
  889. min-height: 100vh;
  890. overflow: auto;
  891. padding-top: 40px;
  892. }
  893. .bigBox {
  894. width: 100%;
  895. padding-top: 40px;
  896. }
  897. .bigOpen {
  898. height: 100vh;
  899. }
  900. /deep/ .u-flex {
  901. display: flex;
  902. justify-content: center;
  903. }
  904. .topInfo {
  905. background: #14A478;
  906. color: #fff;
  907. font-size: 28rpx;
  908. padding-bottom: 32rpx;
  909. box-sizing: border-box;
  910. border-bottom-left-radius: 16rpx;
  911. border-bottom-right-radius: 16rpx;
  912. /deep/ .u-col {
  913. box-sizing: border-box;
  914. margin-top: 32rpx;
  915. box-sizing: border-box;
  916. .item {
  917. text-align: center;
  918. view:first-child {
  919. font-size: 40rpx;
  920. }
  921. view:nth-child(2) {
  922. font-size: 24rpx;
  923. line-height: 40rpx;
  924. opacity: .72;
  925. }
  926. }
  927. }
  928. }
  929. .readmore {
  930. text-align: center;
  931. font-size: 26rpx;
  932. line-height: 40rpx;
  933. margin-top: 32rpx;
  934. color: #93FFDE;
  935. .u-icon {
  936. margin-left: 15rpx;
  937. }
  938. }
  939. .histimeBox {
  940. display: flex;
  941. align-items: center;
  942. justify-content: space-between;
  943. height: 56rpx;
  944. padding: 6rpx 24rpx;
  945. box-sizing: border-box;
  946. border-radius: 8rpx;
  947. margin-top: 54rpx;
  948. border: 2rpx solid var(--neutral-color-border-light, #E4EDEA);
  949. .u-icon {
  950. z-index: 10;
  951. }
  952. .time {
  953. width: 280rpx;
  954. color: #C1C1C1;
  955. }
  956. view {
  957. color: #333333;
  958. text-align: center;
  959. }
  960. }
  961. .consoleBox {
  962. position: relative;
  963. max-height: 75vh;
  964. padding-bottom: 80rpx;
  965. overflow: auto;
  966. .u-row {
  967. box-sizing: border-box;
  968. .u-col {
  969. box-sizing: border-box;
  970. }
  971. }
  972. .u-btn {
  973. position: absolute;
  974. bottom: 0;
  975. left: 0;
  976. right: 0;
  977. background: #14A478;
  978. }
  979. .swichBox {
  980. position: relative;
  981. padding: 32rpx;
  982. overflow: hidden;
  983. .preSwich {
  984. display: flex;
  985. align-items: center;
  986. justify-content: space-between;
  987. padding: 24rpx 18rpx;
  988. border-radius: 8rpx;
  989. background: #EFF2FA;
  990. margin-bottom: 32rpx;
  991. view {
  992. color: #333333;
  993. font-size: 28rpx;
  994. }
  995. }
  996. }
  997. }
  998. .hisBox {
  999. position: relative;
  1000. width: 100vw;
  1001. padding-bottom: 100rpx;
  1002. box-sizing: border-box;
  1003. overflow-y: scroll;
  1004. .axiosBox {
  1005. position: relative;
  1006. padding: 48rpx 32rpx;
  1007. .title {
  1008. color: #333333;
  1009. font-size: 28rpx;
  1010. font-weight: 700;
  1011. }
  1012. .chartBox {
  1013. position: relative;
  1014. margin-top: 32rpx;
  1015. height: 800rpx;
  1016. overflow: hidden;
  1017. #canvasColumnA {
  1018. width: 100%;
  1019. height: 800rpx;
  1020. }
  1021. }
  1022. }
  1023. .readmoreHIs {
  1024. position: absolute;
  1025. bottom: 60rpx;
  1026. left: 50%;
  1027. transform: translate(-50%);
  1028. color: #14A478;
  1029. z-index: 5;
  1030. }
  1031. }
  1032. .devicePhoto {
  1033. padding: 32rpx;
  1034. .titleBox {
  1035. display: flex;
  1036. align-items: center;
  1037. justify-content: space-between;
  1038. .btn {
  1039. padding: 10rpx 14rpx;
  1040. border-radius: 8rpx;
  1041. background: #14A478;
  1042. color: #fff;
  1043. font-size: 28rpx;
  1044. }
  1045. }
  1046. .main {
  1047. position: relative;
  1048. width: 678rpx;
  1049. height: 612rpx;
  1050. margin-top: 10px;
  1051. .mainContent {
  1052. position: absolute;
  1053. left: 50%;
  1054. transform: translateX(-50%);
  1055. width: 678rpx;
  1056. top: 10rpx;
  1057. height: 602rpx;
  1058. z-index: 1;
  1059. }
  1060. .sourceBox {
  1061. position: absolute;
  1062. left: 20rpx;
  1063. z-index: 2;
  1064. display: flex;
  1065. align-items: center;
  1066. justify-content: center;
  1067. width: 112rpx;
  1068. height: 112rpx;
  1069. background: #E3FDFF;
  1070. border-radius: 112rpx;
  1071. color: #fff;
  1072. view {
  1073. width: 85rpx;
  1074. height: 85rpx;
  1075. background: #1890FF;
  1076. border-radius: 85rpx;
  1077. text-align: center;
  1078. line-height: 85rpx;
  1079. font-size: 28rpx;
  1080. }
  1081. }
  1082. .colList {
  1083. position: absolute;
  1084. z-index: 2;
  1085. top: 44rpx;
  1086. left: 154rpx;
  1087. width: 528rpx;
  1088. display: flex;
  1089. justify-content: center;
  1090. overflow: hidden;
  1091. .preClo {
  1092. position: relative;
  1093. float: left;
  1094. width: 88rpx;
  1095. // margin-left: 40rpx;
  1096. view {
  1097. text-align: center;
  1098. color: #333333;
  1099. font-size: 28rpx;
  1100. margin-bottom: 20rpx;
  1101. }
  1102. image {
  1103. width: 88rpx;
  1104. height: 272rpx;
  1105. }
  1106. .shanBox {
  1107. position: absolute;
  1108. width: 64rpx;
  1109. height: 64rpx;
  1110. top: 116rpx;
  1111. left: 50%;
  1112. transform: translateX(-50%);
  1113. z-index: 2;
  1114. image {
  1115. width: 64rpx;
  1116. height: 64rpx;
  1117. }
  1118. }
  1119. .jiaoBtn {
  1120. position: absolute;
  1121. width: 64rpx;
  1122. height: 32rpx;
  1123. top: 72rpx;
  1124. left: 50%;
  1125. transform: translateX(-50%);
  1126. z-index: 2;
  1127. /deep/ .u-switch__node {
  1128. width: 28rpx !important;
  1129. height: 28rpx !important;
  1130. top: 2rpx !important;
  1131. }
  1132. /deep/ .u-switch__loading {
  1133. height: 20rpx !important;
  1134. }
  1135. /deep/ .u-switch {
  1136. width: 64rpx;
  1137. height: 32rpx;
  1138. }
  1139. /deep/ .u-switch--on .u-switch__node {
  1140. transform: translateX(36rpx) !important;
  1141. }
  1142. }
  1143. .btnBox {
  1144. position: absolute;
  1145. width: 66rpx;
  1146. height: 72rpx;
  1147. bottom: 40rpx;
  1148. left: 22rpx;
  1149. z-index: 2;
  1150. image {
  1151. width: 66rpx;
  1152. height: 72rpx;
  1153. }
  1154. }
  1155. }
  1156. }
  1157. .benList {
  1158. position: absolute;
  1159. width: 678rpx;
  1160. left: 50%;
  1161. transform: translateX(-50%);
  1162. top: 610rpx;
  1163. .preBen {
  1164. float: left;
  1165. text-align: center;
  1166. width: 20%;
  1167. .daoguan {
  1168. width: 20rpx;
  1169. height: 40rpx;
  1170. }
  1171. .info {
  1172. color: #333333;
  1173. font-size: 12px;
  1174. font-weight: 400;
  1175. }
  1176. .status {
  1177. width: 76rpx;
  1178. height: 100rpx;
  1179. margin-top: 10rpx;
  1180. }
  1181. }
  1182. }
  1183. .lineExit {}
  1184. .exit {
  1185. position: absolute;
  1186. width: 22rpx;
  1187. height: 20rpx;
  1188. top: 360rpx;
  1189. right: 251rpx;
  1190. z-index: 2;
  1191. image {
  1192. width: 22rpx;
  1193. height: 20rpx;
  1194. }
  1195. }
  1196. .warterIn {
  1197. position: absolute;
  1198. width: 66rpx;
  1199. height: 72rpx;
  1200. top: 190rpx;
  1201. left: 52rpx;
  1202. z-index: 3;
  1203. image {
  1204. width: 66rpx;
  1205. height: 72rpx;
  1206. }
  1207. }
  1208. .warterLight {
  1209. position: absolute;
  1210. width: 72rpx;
  1211. height: 48rpx;
  1212. top: 506rpx;
  1213. left: 110rpx;
  1214. z-index: 3;
  1215. image {
  1216. width: 72rpx;
  1217. height: 48rpx;
  1218. }
  1219. }
  1220. .feiLight {
  1221. position: absolute;
  1222. width: 72rpx;
  1223. height: 66rpx;
  1224. top: 424rpx;
  1225. right: 140rpx;
  1226. z-index: 3;
  1227. image {
  1228. width: 72rpx;
  1229. height: 66rpx;
  1230. }
  1231. }
  1232. .kongBox {
  1233. position: absolute;
  1234. width: 84rpx;
  1235. height: 108rpx;
  1236. top: 390rpx;
  1237. right: 228rpx;
  1238. z-index: 3;
  1239. image {
  1240. width: 84rpx;
  1241. height: 108rpx;
  1242. }
  1243. }
  1244. .fengBox {
  1245. position: absolute;
  1246. right: 12rpx;
  1247. top: 270rpx;
  1248. width: 55rpx;
  1249. height: 44rpx;
  1250. z-index: 2;
  1251. .relativeBox {
  1252. position: relative;
  1253. width: 100%;
  1254. height: 100%;
  1255. image:nth-child(1) {
  1256. width: 16rpx;
  1257. height: 32rpx;
  1258. }
  1259. image:nth-child(2) {
  1260. position: absolute;
  1261. right: 0;
  1262. top: -6rpx;
  1263. width: 44rpx;
  1264. height: 44rpx;
  1265. }
  1266. }
  1267. }
  1268. }
  1269. }
  1270. .consoleList {
  1271. padding: 0 32rpx;
  1272. .histimeBox {
  1273. margin: 32rpx 0;
  1274. }
  1275. .tableTitle {
  1276. background: #E8F3F0;
  1277. color: #333;
  1278. font-weight: 600;
  1279. }
  1280. .tableList {
  1281. font-size: 28rpx;
  1282. height: 78rpx;
  1283. color: #666666;
  1284. display: flex;
  1285. justify-content: space-between;
  1286. align-items: center;
  1287. border-bottom: 2rpx solid var(--neutral-color-border-base, #DCE6E3);
  1288. view {
  1289. text-align: center;
  1290. }
  1291. .success {
  1292. color: #14A478;
  1293. }
  1294. .error {
  1295. color: #FF5951;
  1296. }
  1297. view:nth-child(1) {
  1298. width: 120rpx;
  1299. text-align: left;
  1300. }
  1301. view:nth-child(2) {
  1302. width: 280rpx;
  1303. }
  1304. view:nth-child(3) {
  1305. width: 280rpx;
  1306. }
  1307. }
  1308. }
  1309. </style>