details.vue 40 KB

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