detail.vue 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619
  1. <template>
  2. <view class="content" >
  3. <view class="header" :style='"background-image:url("+imgUrl+"/detail/bg.png);background-repeat: no-repeat;background-size: 100% 200%;"'>
  4. <view class="status_info">
  5. <view class="status_detail">
  6. <view class="status_text">{{ getStatusText() }}</view>
  7. <view v-if="deviceInfo.status == 3" class="online_text online">·在线</view>
  8. <view v-if="deviceInfo.status == 4" class="online_text">·离线</view>
  9. </view>
  10. <view class="device_info">机器编号: {{deviceInfo.serialNumber}}</view>
  11. </view>
  12. <view style="position: absolute;right:10vw;top:9vh;z-index: 9" @click="showDrawer">
  13. <image :src="imgUrl+'/detail/setting2.png'" style="width: 50rpx;height: 50rpx;"/>
  14. </view>
  15. <view style="position: relative;top:8%;width: 100%;text-align: center">
  16. <image :src="imgUrl+'/detail/product.png'" style="width: 330rpx;height: 550rpx;"/>
  17. </view>
  18. <view class="tabs">
  19. <view class="child_tab" v-for="item in (summary)" @click="changeTab(item)">
  20. <image :src="imgUrl+'/detail/tab.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  21. <image class="child_img" v-if="item.checked" :src="imgUrl+'/detail/jianyao_on.png'" />
  22. <image class="child_img" v-if="!item.checked" :src="imgUrl+'/detail/jianyao_off.png'" />
  23. <view class="child_title" :class="item.checked?'active_on':''">
  24. {{item.name}}
  25. </view>
  26. </view>
  27. <view class="child_tab" @click="changeTab({name:'baozhuang'})">
  28. <image :src="imgUrl+'/detail/tab.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  29. <image class="child_img" v-if="firstTab" :src="imgUrl+'/detail/baozhuang_off.png'" />
  30. <image class="child_img" v-if="!firstTab" :src="imgUrl+'/detail/baozhuang_on.png'" />
  31. <view class="child_title" :class="firstTab?'':'active_on'">
  32. 包装机
  33. </view>
  34. </view>
  35. </view>
  36. <view v-if="firstTab">
  37. <view class="control">
  38. <view class="control_item">
  39. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  40. <view class="control_item_detail">
  41. <view class="control_item_left" @click="subTemperature(1)">-</view>
  42. <view class="control_item_center">
  43. <view style="position: absolute">
  44. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeTemperature()" v-model="temperature"></u-input>
  45. </view>
  46. </view>
  47. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  48. <view class="control_item_right" @click="addTemperature(1)">+</view>
  49. </view>
  50. <view class="control_item_title">
  51. 温度设置
  52. </view>
  53. </view>
  54. <view class="control_item">
  55. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  56. <view class="control_item_detail">
  57. <view class="control_item_center">
  58. <view style="position: absolute">
  59. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" v-model="leftJianyaoTime"></u-input>
  60. </view>
  61. </view>
  62. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  63. <view class="control_item_right" style="left:75%;top:10rpx" @click="showBaozhuangDlg(3)">
  64. <uni-icons type="gear-filled" size="20"></uni-icons>
  65. </view>
  66. </view>
  67. <view class="control_item_title">
  68. 文火时间倒计时
  69. </view>
  70. </view>
  71. <view class="control_item">
  72. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  73. <view class="control_item_detail">
  74. <view class="control_item_center">
  75. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" :value="currentTemperature"></u-input>
  76. </view>
  77. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  78. </view>
  79. <view class="control_item_title">
  80. 当前温度
  81. </view>
  82. </view>
  83. <view class="control_item">
  84. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  85. <view class="control_item_detail">
  86. <view class="control_item_center">
  87. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" :value="hightTemperature"></u-input>
  88. </view>
  89. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  90. </view>
  91. <view class="control_item_title">
  92. 高温时间
  93. </view>
  94. </view>
  95. </view>
  96. <view class="bottom">
  97. <image :src="imgUrl+'/detail/bg_large.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  98. <view class="bottom_item" @click="decoctControlOnOffChange">
  99. <image v-if="decoctControlOnOffStatus" :src="imgUrl+'/detail/open_on.png'" style="width: 32%;height:32%;"/>
  100. <image v-if="!decoctControlOnOffStatus" :src="imgUrl+'/detail/open_off.png'" style="width: 32%;height:32%;"/>
  101. <view :class="decoctControlOnOffStatus?'active_on':''">开关</view>
  102. </view>
  103. <view class="bottom_item" @click="decoctControlChange">
  104. <image v-if="decoctControlStatus" :src="imgUrl+'/detail/jianing_on.png'" style="width: 32%;height:32%;"/>
  105. <image v-if="!decoctControlStatus" :src="imgUrl+'/detail/jianing_off.png'" style="width: 32%;height:32%;"/>
  106. <view :class="decoctControlStatus?'active_on':''">煎药</view>
  107. </view>
  108. <view class="bottom_item" @click="stopDecoctControlChange">
  109. <image v-if="!decoctControlStatus" :src="imgUrl+'/detail/stop_on.png'" style="width: 32%;height:32%;"/>
  110. <image v-if="decoctControlStatus" :src="imgUrl+'/detail/stop_off.png'" style="width: 32%;height:32%;"/>
  111. <view :class="!decoctControlStatus?'active_on':''">停止</view>
  112. </view>
  113. <view class="bottom_item" @click="toPlan">
  114. <image v-if="leftAppointmentTime>0" :src="imgUrl+'/detail/plan_on.png'" style="width: 32%;height:32%;"/>
  115. <image v-else :src="imgUrl+'/detail/plan_off.png'" style="width: 32%;height:32%;"/>
  116. <view :class="leftAppointmentTime>0?'active_on':''">预约</view>
  117. </view>
  118. </view>
  119. </view>
  120. <view v-if="!firstTab">
  121. <view class="control">
  122. <view class="control_item">
  123. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  124. <view class="control_item_detail">
  125. <view class="control_item_center">
  126. <u-input customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" disabled v-model="edegTemperature"></u-input>
  127. </view>
  128. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  129. <view class="control_item_right" style="left:75%;top:10rpx" @click="showBaozhuangDlg(1)">
  130. <uni-icons type="gear-filled" size="20"></uni-icons>
  131. </view>
  132. </view>
  133. <view class="control_item_title">
  134. 当前封边温度
  135. </view>
  136. </view>
  137. <view class="control_item">
  138. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  139. <view class="control_item_detail">
  140. <view class="control_item_center">
  141. <u-input customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" disabled v-model="sealingTemperature"></u-input>
  142. </view>
  143. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  144. <view class="control_item_right" style="left:75%;top:10rpx" @click="showBaozhuangDlg(2)">
  145. <uni-icons type="gear-filled" size="20"></uni-icons>
  146. </view>
  147. </view>
  148. <view class="control_item_title">
  149. 当前封口温度
  150. </view>
  151. </view>
  152. <view class="control_item">
  153. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  154. <view class="control_item_detail">
  155. <view class="control_item_left" @click="subPackageNumber()">-</view>
  156. <view class="control_item_center">
  157. <view style="position: absolute">
  158. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changePackageNumber" :value="packageNumber"></u-input>
  159. </view>
  160. </view>
  161. <view class="control_item_center_unit" :style="unitFixedStyle">袋</view>
  162. <view class="control_item_right" @click="addPackageNumber()">+</view>
  163. </view>
  164. <view class="control_item_title">
  165. 包装数量
  166. </view>
  167. </view>
  168. <view class="control_item">
  169. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  170. <view class="control_item_detail">
  171. <view class="control_item_left" @click="subPackageVolume()">-</view>
  172. <view class="control_item_center">
  173. <view style="position: absolute">
  174. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changePackageVolume" :value="packageVolume"></u-input>
  175. </view>
  176. </view>
  177. <view class="control_item_center_unit" :style="unitFixedStyle">ml</view>
  178. <view class="control_item_right" @click="addPackageVolume()">+</view>
  179. </view>
  180. <view class="control_item_title">
  181. 包装容量
  182. </view>
  183. </view>
  184. </view>
  185. <view class="bottom">
  186. <image :src="imgUrl+'/detail/bg_large.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  187. <view class="bottom_item" @click="packageControlOnOffChange">
  188. <image v-if="packageControlOnOffStatus" :src="imgUrl+'/detail/open_on.png'" style="width: 32%;height:32%;"/>
  189. <image v-if="!packageControlOnOffStatus" :src="imgUrl+'/detail/open_off.png'" style="width: 32%;height:32%;"/>
  190. <view :class="packageControlOnOffStatus?'active_on':''">开关</view>
  191. </view>
  192. <view class="bottom_item" @click="turnChange(1)">
  193. <image v-if="qitingTurn" :src="imgUrl+'/detail/open_on.png'" style="width: 32%;height:32%;"/>
  194. <image v-if="!qitingTurn" :src="imgUrl+'/detail/open_off.png'" style="width: 32%;height:32%;"/>
  195. <view :class="qitingTurn?'active_on':''">启停</view>
  196. </view>
  197. <view class="bottom_item" @click="turnChange(2)">
  198. <image v-if="baozhuangTurn" :src="imgUrl+'/detail/bao_on.png'" style="width: 32%;height:32%;"/>
  199. <image v-if="!baozhuangTurn" :src="imgUrl+'/detail/bao_off.png'" style="width: 32%;height:32%;"/>
  200. <view :class="baozhuangTurn?'active_on':''">包装</view>
  201. </view>
  202. <view class="bottom_item" @click="turnChange(3)">
  203. <image v-if="qingxiTurn" :src="imgUrl+'/detail/xi_on.png'" style="width: 32%;height:32%;"/>
  204. <image v-if="!qingxiTurn" :src="imgUrl+'/detail/xi_off.png'" style="width: 32%;height:32%;"/>
  205. <view :class="qingxiTurn?'active_on':''">清洗</view>
  206. </view>
  207. </view>
  208. </view>
  209. </view>
  210. <u-popup :show="popDlg" @close="closePop" mode="center" bgColor="transparent" :closeable="true">
  211. <view style="position: relative;width: 500rpx;height:300rpx;background: none">
  212. <view class="control_item" style="width: 100%" v-if="fengbianDlgShow">
  213. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  214. <view class="control_item_detail">
  215. <view class="control_item_left" @click="subEdegTemperature(1)">-</view>
  216. <view class="control_item_center">
  217. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeEdegTemperature" v-model="setEdegTemperature"></u-input>
  218. </view>
  219. <view class="control_item_center_unit" :style="unitFixedStyle1">℃</view>
  220. <view class="control_item_right" @click="addEdegTemperature(1)">+</view>
  221. </view>
  222. <view class="control_item_title">
  223. 封边温度设置
  224. </view>
  225. </view>
  226. <view class="control_item" style="width: 100%" v-if="fengkouDlgShow">
  227. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  228. <view class="control_item_detail">
  229. <view class="control_item_left" @click="subSealingTemperature(1)">-</view>
  230. <view class="control_item_center">
  231. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeSealingTemperature" v-model="setSealingTemperature"></u-input>
  232. </view>
  233. <view class="control_item_center_unit" :style="unitFixedStyle1">℃</view>
  234. <view class="control_item_right" @click="addSealingTemperature(1)">+</view>
  235. </view>
  236. <view class="control_item_title">
  237. 封口温度设置
  238. </view>
  239. </view>
  240. <view class="control_item" style="width: 100%" v-if="wenhuoTimeDlgShow">
  241. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  242. <view class="control_item_detail">
  243. <view class="control_item_left" @click="subTemperatureTime()">-</view>
  244. <view class="control_item_center">
  245. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeTemperatureTime()" v-model="temperatureTime"></u-input>
  246. </view>
  247. <view class="control_item_center_unit" :style="unitFixedStyle1">℃</view>
  248. <view class="control_item_right" @click="addTemperatureTime()">+</view>
  249. </view>
  250. <view class="control_item_title">
  251. 文火时间
  252. </view>
  253. </view>
  254. </view>
  255. </u-popup>
  256. <u-popup :show="deviceInfo.status != 3" mode="center" >
  257. <view style="
  258. margin:2%;padding:10%;background-color: #f0f0f0; /* 背景色 */color: #000; padding: 10px; /* 内边距 */border-radius: 5px; /* 圆角 */font-size: 16px; /* 文字大小 */text-align: center; /* 文字居中 */ ">
  259. 设备未在线,无法操作
  260. </view>
  261. </u-popup>
  262. <u-popup :show="planPopDlg" @close="closePlanPop" mode="center" :closeable="true">
  263. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  264. <view class="control_item" style="width: 100%">
  265. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  266. <view class="control_item_detail">
  267. <view class="control_item_left" @click="subPlanTime(1)" style="left: 18%;">-</view>
  268. <view class="control_item_center">
  269. <view style="position: absolute">
  270. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" v-model="planTime"></u-input>
  271. </view>
  272. </view>
  273. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  274. <view class="control_item_right" style="left: 80%;" @click="addPlanTime(1)">+</view>
  275. </view>
  276. <view class="control_item_title">
  277. 预约时间
  278. </view>
  279. </view>
  280. <view class="control_item" style="width: 100%">
  281. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  282. <view class="control_item_detail">
  283. <view class="control_item_left" @click="subTemperature(1)" style="left: 18%;">-</view>
  284. <view class="control_item_center">
  285. <view style="position: absolute">
  286. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeTemperature()" v-model="temperature"></u-input>
  287. </view>
  288. </view>
  289. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  290. <view class="control_item_right" @click="addTemperature(1)" style="left: 80%;">+</view>
  291. </view>
  292. <view class="control_item_title">
  293. 温度设置
  294. </view>
  295. </view>
  296. <view class="control_item" style="width: 100%">
  297. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  298. <view class="control_item_detail">
  299. <view class="control_item_left" @click="subTemperatureTime()" style="left: 18%;">-</view>
  300. <view class="control_item_center">
  301. <view style="position: absolute">
  302. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeTemperatureTime()" v-model="temperatureTime"></u-input>
  303. </view>
  304. </view>
  305. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  306. <view class="control_item_right" @click="addTemperatureTime()" style="left: 80%;">+</view>
  307. </view>
  308. <view class="control_item_title">
  309. 时间设置
  310. </view>
  311. </view>
  312. <view>
  313. <button style="background: white;" @click="plan">确认</button>
  314. </view>
  315. </view>
  316. </u-popup>
  317. <!-- 预约框-->
  318. <u-popup :show="yuyueIngPop" @close="closeYuyueIngPop" mode="center" :closeable="true">
  319. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  320. <view class="control_item" style="width: 100%">
  321. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  322. <view class="control_item_detail">
  323. <view class="control_item_center">
  324. <u-input customStyle="width:150rpx;border:0px;padding:0px" disabledColor="white" :value="leftAppointmentTime"></u-input>
  325. </view>
  326. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  327. </view>
  328. <view class="control_item_title">
  329. 剩余时间
  330. </view>
  331. </view>
  332. <view>
  333. <button style="background: white;" @click="cancelPlan">取消</button>
  334. </view>
  335. </view>
  336. </u-popup>
  337. <u-popup :show="planIngPopDlg" @close="closePlanIngPop" mode="center" :closeable="true">
  338. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  339. <view class="control_item" style="width: 100%">
  340. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  341. <view class="control_item_detail" style="width: 100%; padding: 40rpx;margin-bottom:10rpx;">
  342. <u-line-progress :percentage="step" activeColor="#50ACFF"></u-line-progress>
  343. </view>
  344. <view class="control_item_title" v-if="leftAppointmentTime>0">
  345. 预约煎药中,倒计时{{leftAppointmentTime}}分钟
  346. </view>
  347. <view class="control_item_title" v-else>
  348. <view v-if="leftJianyaoTime>0">
  349. 正在熬制,请稍等
  350. </view>
  351. <view v-else>
  352. 煎药完成
  353. </view>
  354. </view>
  355. </view>
  356. <view class="control_item" style="width: 100%">
  357. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  358. <view class="control_item_detail">
  359. <view class="control_item_center">
  360. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" :value="currentTemperature"></u-input>
  361. </view>
  362. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  363. </view>
  364. <view class="control_item_title">
  365. 当前温度
  366. </view>
  367. </view>
  368. <view class="control_item" style="width: 100%">
  369. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  370. <view class="control_item_detail">
  371. <view class="control_item_center">
  372. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" :value="leftJianyaoTime"></u-input>
  373. </view>
  374. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  375. </view>
  376. <view class="control_item_title">
  377. 文火倒计时
  378. </view>
  379. </view>
  380. <!-- <view>-->
  381. <!-- <button style="background: white;" @click="cancelPlan">暂停</button>-->
  382. <!-- </view>-->
  383. </view>
  384. </u-popup>
  385. <uni-drawer ref="showLeft" :width="320" :maskClick="true" mode="right" @change="change($event,'showLeft')">
  386. <scroll-view style="height: 88%;padding:20% 0%;" scroll-y="true">
  387. <view style="text-align:center">设置</view>
  388. <view>
  389. <view class="prop-item">
  390. <view class="prop-item-image">
  391. <image :src="imgUrl+'/setting/net.png'" style="width: 100%;height:100%;"/>
  392. </view>
  393. <view class="prop-item-left">网络连接</view>
  394. <view class="prop-item-right">
  395. <view v-if="deviceInfo.status == 3">
  396. 已连接
  397. </view>
  398. <view v-else>
  399. 未连接
  400. <!-- <uni-icons type="forward" size="16"></uni-icons>-->
  401. </view>
  402. </view>
  403. </view>
  404. <view class="prop-item" v-if="firstTab">
  405. <view class="prop-item-image">
  406. <image :src="imgUrl+'/setting/oper_temp.png'" style="width: 100%;height:100%;"/>
  407. </view>
  408. <view class="prop-item-left">温度校准</view>
  409. <view class="prop-item-right" @click="showJiaozhunProp">
  410. {{jiaozhunTemp}}℃<uni-icons type="forward" size="16"></uni-icons>
  411. </view>
  412. </view>
  413. <view class="prop-item" v-if="firstTab">
  414. <view class="prop-item-image">
  415. <image :src="imgUrl+'/setting/list.png'" style="width: 100%;height:100%;"/>
  416. </view>
  417. <view class="prop-item-left">工作模式</view>
  418. <view class="prop-item-right" @click="showModelPicker = true">
  419. <view v-if="workMode == 1">
  420. 微压循环<uni-icons type="forward" size="16"></uni-icons>
  421. </view>
  422. <view v-if="workMode == 2">
  423. 常温二煎的一煎<uni-icons type="forward" size="16"></uni-icons>
  424. </view>
  425. <view v-if="workMode == 3">
  426. 常温二煎的二煎<uni-icons type="forward" size="16"></uni-icons>
  427. </view>
  428. </view>
  429. </view>
  430. <view class="prop-item">
  431. <view class="prop-item-image">
  432. <image :src="imgUrl+'/setting/no.png'" style="width: 100%;height:100%;"/>
  433. </view>
  434. <view class="prop-item-left">二维码编号</view>
  435. <view class="prop-item-right">
  436. <text class="text-right">{{deviceInfo.qrcodeId==null?"未绑定":deviceInfo.qrcodeId}}</text>
  437. </view>
  438. </view>
  439. <view class="prop-item">
  440. <view class="prop-item-image">
  441. <image :src="imgUrl+'/setting/learn.png'" style="width: 100%;height:100%;"/>
  442. </view>
  443. <view class="prop-item-left">使用教程</view>
  444. <view class="prop-item-right">
  445. <uni-icons type="forward" size="16"></uni-icons>
  446. </view>
  447. </view>
  448. <view class="prop-item">
  449. <view class="prop-item-image">
  450. <image :src="imgUrl+'/setting/video.png'" style="width: 100%;height:100%;"/>
  451. </view>
  452. <view class="prop-item-left">维修视频</view>
  453. <view class="prop-item-right">
  454. <uni-icons type="forward" size="16"></uni-icons>
  455. </view>
  456. </view>
  457. <view class="prop-item">
  458. <view class="prop-item-image">
  459. <image :src="imgUrl+'/setting/upload.png'" style="width: 100%;height:100%;"/>
  460. </view>
  461. <view class="prop-item-left">在线升级</view>
  462. <view class="prop-item-right" @click="getUpdateInfo">
  463. <uni-icons type="forward" size="16"></uni-icons>
  464. </view>
  465. </view>
  466. <view class="prop-item">
  467. <view class="prop-item-image">
  468. <image :src="imgUrl+'/setting/shou.png'" style="width: 100%;height:100%;"/>
  469. </view>
  470. <view class="prop-item-left">售后服务</view>
  471. <view class="prop-item-right">
  472. <uni-icons type="forward" size="16"></uni-icons>
  473. </view>
  474. </view>
  475. <view class="prop-item">
  476. <view class="prop-item-image">
  477. <image :src="imgUrl+'/setting/reset.png'" style="width: 100%;height:100%;"/>
  478. </view>
  479. <view class="prop-item-left">恢复出厂</view>
  480. <view class="prop-item-right" @click="reset">
  481. <uni-icons type="forward" size="16"></uni-icons>
  482. </view>
  483. </view>
  484. </view>
  485. </scroll-view>
  486. </uni-drawer>
  487. <u-popup :show="jiaozhunPopDlg" @close="closejiaozhunPop" mode="center" :closeable="true">
  488. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  489. <view class="control_item" style="width: 100%">
  490. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  491. <view class="control_item_detail">
  492. <view class="control_item_left" @click="subJiaoZhunTemperature(1)" style="left: 18%;">-</view>
  493. <view class="control_item_center">
  494. <view style="position: absolute">
  495. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" v-model="jiaozhunTemp_temp"></u-input>
  496. </view>
  497. </view>
  498. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  499. <view class="control_item_right" @click="addJiaoZhunTemperature(1)" style="left: 80%;">+</view>
  500. </view>
  501. <view class="control_item_title">
  502. 校准温度
  503. </view>
  504. </view>
  505. <view>
  506. <button style="background: white;" @click="confirmJiaozhunTemp">确认</button>
  507. </view>
  508. </view>
  509. </u-popup>
  510. <u-picker :show="showModelPicker" @cancel="closeModelPicker" @confirm="confirmMode" :columns="modeList" keyName="text"></u-picker>
  511. </view>
  512. </template>
  513. <script>
  514. import { getDetail,getDeviceStatus,cacheJsonThingsModel,reportError ,getDeviceRunTime,getLatestFirmware} from '@/api/device/device.js'
  515. import config from '@/config'
  516. export default {
  517. data(){
  518. return {
  519. modeList:[[
  520. {id:1,text:"微压循环"},
  521. {id:2,text:"常温二煎的一煎"},
  522. {id:3,text:"常温二煎的二煎"},
  523. {id:3,text:"密闭微压"},
  524. {id:3,text:"常温常压"},
  525. ]],
  526. showModelPicker:false,
  527. unitFixedStyle:"",
  528. unitFixedStyle1:"",
  529. planTime:10,
  530. setSealingTemperature:160,
  531. setEdegTemperature:160,
  532. sealingTemperature:0,
  533. edegTemperature:0,
  534. hightTemperature:0,
  535. currentTemperature:0,
  536. temperatureTime:1,
  537. temperature:0,
  538. packageNumber:0,
  539. packageVolume:50,
  540. firstTab:true,
  541. decoctControlStatus:false,
  542. decoctControlOnOffStatus:false,
  543. packageControlOnOffStatus:false,
  544. subDecoctTabList:[
  545. {name:'子煎药1'},
  546. {name:'子煎药2'},
  547. {name:'子煎药3'},
  548. ],
  549. DecoctControlStatus:false,
  550. PackagControlStatus:false,
  551. baozhuangTurn:false,
  552. qitingTurn:false,
  553. qingxiTurn:false,
  554. subCurrent:0,
  555. current:0,
  556. inputStyle:{height:'44rpx','fontSize':'20rpx'},
  557. modelKey:['PowerControl','LockControl'],
  558. jianyaoKeys : ["TempSetting","TimeSetting"],
  559. baozhuangKeys:["SetSealTemp","SetBandingTemp","PackageQuantity","PackingVolume"],
  560. power:{
  561. loading:true,
  562. value:0,
  563. },
  564. lock:{
  565. loading:true,
  566. value:0,
  567. },
  568. showTimeDlg:false,
  569. showErrDlg:null,
  570. errorMsg:"asdasdasdasd",
  571. show:null,
  572. value:"",
  573. deviceInfo:{},
  574. id:0,
  575. summary:[
  576. ],
  577. tabs:[
  578. {tabName:"煎药控制"},
  579. {tabName:"包装控制"},
  580. ],
  581. activeName:0,
  582. childId:0,
  583. oneToMul:false,
  584. inputProp:[],
  585. watchProp:[],
  586. columns:[],
  587. location:{},
  588. sysDept:null,
  589. timeobj:{alltime:0,avgtime:0},
  590. publishMsg:false,
  591. checkTimer:null,
  592. functions:[],
  593. properties:[],
  594. propMap:{},
  595. jianyaoTimer:null,
  596. baozhuangTimer:null,
  597. editing:false,
  598. workMode:2,
  599. leftAppointmentTime:0,
  600. leftJianyaoTime:0,
  601. imgUrl:"",
  602. popDlg:false,
  603. fengbianDlgShow:false,
  604. fengkouDlgShow:false,
  605. wenhuoTimeDlgShow:false,
  606. planPopDlg:false,
  607. planIngPopDlg:false,
  608. maxWidth:320,
  609. jiaozhunTemp:0,//校准温度,
  610. jiaozhunTemp_temp:0,//校准温度,
  611. jiaozhunPopDlg:false,
  612. step:0,
  613. yuyueIngPop:false,
  614. firmware:{},
  615. jianyaoPopClose:true,
  616. }
  617. },
  618. onLoad: function(opt) {
  619. this.id = opt.id;
  620. // this.id = 61;
  621. this.connectMqtt();
  622. this.getDetail();
  623. this.imgUrl = config.imgUrl
  624. this.fixStyle();
  625. },
  626. destroyed() {
  627. // 取消订阅主题
  628. this.mqttUnSubscribe(this.deviceInfo);
  629. clearTimeout(this.checkTimer);
  630. },
  631. methods:{
  632. getUpdateInfo(){
  633. let self = this;
  634. getLatestFirmware(this.id).then(res=>{
  635. self.firmware = res.data;
  636. let curVersion = self.deviceInfo.firmwareVersion;
  637. let onlineVersion = self.firmware.version
  638. if(curVersion>=onlineVersion){
  639. this.$modal.showToast('当前已经是最新版本')
  640. }else{
  641. uni.showModal({
  642. title: '检测到新版本',
  643. content: "当前版本:"+curVersion+",新版本:"+onlineVersion,
  644. cancelText: '取消',
  645. confirmText: '升级',
  646. success: function(res) {
  647. if (res.confirm) {
  648. self.doUpdate();
  649. }
  650. }
  651. })
  652. }
  653. });
  654. },
  655. doUpdate(){
  656. if(this.deviceInfo.status != 3){
  657. this.notifyError("请等待设备上线后操作")
  658. return;
  659. }
  660. let device = this.deviceInfo;
  661. let message = "";
  662. let topic = "";
  663. let title = "升级";
  664. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  665. message = '{"version":"' + this.firmware.version + '","downloadUrl":"' + this.getDownloadUrl(this.firmware.filePath) + '","size":"'+this.firmware.size+'"}';
  666. this.$mqttTool.publish(topic, message,title).then(res => {
  667. this.notifySuccess(res);
  668. }).catch(res => {
  669. this.notifyError(res);
  670. });
  671. },
  672. getStatusText(){
  673. if(this.baozhuangRunning()){
  674. return "工作中";
  675. }
  676. if(this.jianyaoIng()){
  677. return "工作中";
  678. }
  679. if(this.leftAppointmentTime>0){
  680. return "已预约";
  681. }
  682. return "空闲中";
  683. },
  684. closeYuyueIngPop(){
  685. this.yuyueIngPop = false;
  686. },
  687. confirmMode(item){
  688. console.log(item)
  689. this.workMode = item.value[0].id;
  690. this.setMode(this.workMode);
  691. this.closeModelPicker();
  692. },
  693. closeModelPicker(){
  694. this.showModelPicker = false;
  695. },
  696. confirmJiaozhunTemp(){
  697. this.jiaozhunTemp = this.jiaozhunTemp_temp;
  698. this.temperNumber();
  699. this.closejiaozhunPop();
  700. },
  701. addJiaoZhunTemperature(){
  702. this.jiaozhunTemp_temp ++;
  703. if(this.jiaozhunTemp_temp>20){
  704. this.jiaozhunTemp_temp = 20;
  705. }
  706. },
  707. subJiaoZhunTemperature(){
  708. this.jiaozhunTemp_temp --;
  709. if(this.jiaozhunTemp_temp<-20){
  710. this.jiaozhunTemp_temp = -20;
  711. }
  712. },
  713. closejiaozhunPop(){
  714. this.jiaozhunPopDlg = false;
  715. },
  716. showJiaozhunProp(){
  717. this.jiaozhunTemp_temp = this.jiaozhunTemp;
  718. this.jiaozhunPopDlg = true;
  719. },
  720. fixStyle(){
  721. let self = this;
  722. wx.getSystemInfo({
  723. success: res => {
  724. const { windowWidth, windowHeight, statusBarHeight } = res;
  725. // 在这里可以获取到屏幕的宽度和高度
  726. console.log(windowWidth, windowHeight, statusBarHeight);
  727. if(windowWidth<=350){
  728. self.unitFixedStyle = ";padding-top:6px;left: 28vw;";
  729. self.unitFixedStyle1 = ";padding-top:6px;left: 28vw;";
  730. }else if(windowWidth>=360){
  731. self.unitFixedStyle = ";padding-top:10rpx;";
  732. self.unitFixedStyle1 = ";padding-top:10rpx;left: 32vw;";
  733. }
  734. self.maxWidth = windowWidth;
  735. }
  736. })
  737. },
  738. closePlanIngPop(){
  739. this.jianyaoPopClose = false;
  740. this.planIngPopDlg = false;
  741. },
  742. closePlanPop(){
  743. this.planPopDlg = false;
  744. },
  745. showBaozhuangDlg(type){
  746. this.popDlg = true;
  747. if(type == 1){
  748. this.fengbianDlgShow = true;
  749. }else if(type == 2){
  750. this.fengkouDlgShow = true;
  751. }else if(type == 3){
  752. this.wenhuoTimeDlgShow = true;
  753. }
  754. },
  755. closePop(){
  756. this.popDlg = false;
  757. this.fengbianDlgShow = false;
  758. this.fengkouDlgShow = false;
  759. this.wenhuoTimeDlgShow = false;
  760. },
  761. changeTab(item){
  762. let summary = this.summary;
  763. let self = this;
  764. this.resetChoose();
  765. if(item.name == 'baozhuang'){
  766. this.firstTab = false;
  767. getDeviceStatus(this.id,0).then(res=>{
  768. let data =res.data;
  769. this.deviceInfo = data;
  770. self.parseStatusData(data)
  771. });
  772. }else{
  773. item.checked = true;
  774. this.firstTab = true;
  775. if(summary.length>1){
  776. this.childId = item.id;
  777. this.getDeviceStatus()
  778. }else{
  779. this.getDeviceStatus()
  780. }
  781. }
  782. },
  783. resetChoose(){
  784. for (let i = 0; i <this.summary.length; i++) {
  785. let data = this.summary[i];
  786. data.checked = false;
  787. }
  788. },
  789. changePackageVolume(){
  790. if(this.packageVolume<50){
  791. this.packageVolume = 50;
  792. }
  793. if(this.packageVolume>300){
  794. this.packageVolume = 300;
  795. }
  796. this.sendBaozhuang("PackingVolume");
  797. },
  798. changePackageNumber(){
  799. let min = 1;
  800. let max = 999;
  801. if(this.packageNumber<min){
  802. this.packageNumber = min;
  803. }
  804. if(this.packageNumber>max){
  805. this.packageNumber = max;
  806. }
  807. this.sendBaozhuang("PackageQuantity");
  808. },
  809. changeEdegTemperature(){
  810. let min = 80;
  811. let max = 220;
  812. if(this.setEdegTemperature<min){
  813. this.setEdegTemperature = min;
  814. }
  815. if(this.setEdegTemperature>max){
  816. this.setEdegTemperature = max;
  817. }
  818. console.log("current setEdegTemperature is :"+this.setEdegTemperature)
  819. this.sendBaozhuang("SetBandingTemp");
  820. },
  821. changeSealingTemperature(){
  822. let min = 80;
  823. let max = 220;
  824. if(this.setSealingTemperature<min){
  825. this.setSealingTemperature = min;
  826. }
  827. if(this.setSealingTemperature>max){
  828. this.setSealingTemperature = max;
  829. }
  830. console.log("current setSealingTemperature is :"+this.setSealingTemperature)
  831. this.sendBaozhuang("SetSealTemp");
  832. },
  833. changeTemperature(){
  834. let max = 140;
  835. let min = 100;
  836. if(this.workMode == 2){
  837. min = 1;
  838. }
  839. if(this.temperature<min){
  840. this.temperature = min;
  841. }
  842. if(this.temperature>max){
  843. this.temperature = max;
  844. }
  845. console.log("current temperature is :"+this.temperature)
  846. this.sendJianYao("TempSetting");
  847. },
  848. changeTemperatureTime(){
  849. let min = 1;
  850. let max = 600;
  851. if(this.temperatureTime<min){
  852. this.temperatureTime = min;
  853. }
  854. if(this.temperatureTime>max){
  855. this.temperatureTime = max;
  856. }
  857. console.log("current temperatureTime is :"+this.temperatureTime)
  858. this.sendJianYao("TimeSetting");
  859. },
  860. jianyaoOpen(){
  861. if(this.decoctControlOnOffStatus){
  862. return true;
  863. }
  864. return false;
  865. },
  866. baozhuangOpen(){
  867. if(this.packageControlOnOffStatus){
  868. return true;
  869. }
  870. return false;
  871. },
  872. baozhuangRunning(){
  873. if(this.qingxiTurn || this.baozhuangTurn || this.qitingTurn){
  874. return true;
  875. }
  876. return false;
  877. },
  878. jianyaoIng(){
  879. if(this.decoctControlStatus){
  880. return true;
  881. }
  882. return false;
  883. },
  884. cancelPlan(){
  885. let arr = [];
  886. let obj = {};
  887. obj.id = "AppointmentTime";
  888. obj.shadow = 0;
  889. arr.push(obj);
  890. let self = this;
  891. self.kongzhiJianyao(false,arr);
  892. this.mqttPublish(2,this.deviceInfo,arr,true);
  893. this.closeYuyueIngPop();
  894. },
  895. toPlan(){
  896. if(!this.jianyaoOpen()){
  897. this.$modal.showToast('煎药机已经关机')
  898. return;
  899. }
  900. if(this.leftAppointmentTime>0){
  901. this.yuyueIngPop = true;
  902. }else{
  903. if(this.jianyaoIng()){
  904. this.$modal.showToast('正在煎药')
  905. return;
  906. }
  907. this.planPopDlg = true;
  908. }
  909. },
  910. calcuStep(){
  911. if(this.leftAppointmentTime>0){
  912. this.step = 0;
  913. return 0;
  914. }
  915. if(this.leftJianyaoTime == 0){
  916. this.step = 100;
  917. return ;
  918. }
  919. let currentTemperature = this.currentTemperature;
  920. let hightTemperature = this.temperatureTime-this.leftJianyaoTime;//设置的高温时间
  921. let targetTemperature =100;// this.temperature;
  922. let targetTemperatureTime = this.temperatureTime;//倒计时
  923. if(targetTemperature>100){
  924. targetTemperature = 100;
  925. }
  926. let step = 0;
  927. if(currentTemperature<100){
  928. let tem = currentTemperature/200*100;
  929. step = tem;
  930. }else{
  931. step = 50;
  932. let rate = hightTemperature/targetTemperatureTime;
  933. rate = rate/2;
  934. rate = rate*100;
  935. rate = rate.toFixed(2)
  936. step = step + parseFloat(rate);
  937. }
  938. this.step = step.toFixed(2);
  939. },
  940. plan(){
  941. let self = this;
  942. if(this.planTime>600){
  943. this.$modal.showToast('预约时间最大为600分钟')
  944. return;
  945. }
  946. if(this.planTime == 0){
  947. this.$modal.showToast('预约时间不能为空')
  948. }else{
  949. let arr = [];
  950. let obj = {};
  951. obj.id = "AppointmentTime";
  952. obj.shadow = this.planTime;
  953. arr.push(obj);
  954. this.kongzhiJianyao(true,arr);
  955. this.mqttPublish(2,this.deviceInfo,arr,true);
  956. }
  957. this.$modal.showToast('预约成功')
  958. this.planPopDlg = false;
  959. },
  960. lockCtrl(key){
  961. let arr = [];
  962. let obj = {};
  963. obj.id = "LockControl";
  964. if(key == 0){
  965. obj.shadow = 1;
  966. this.lock.value = 1;
  967. }else{
  968. obj.shadow = 0;
  969. this.lock.value = 0;
  970. }
  971. arr.push(obj);
  972. this.mqttPublish(2,this.deviceInfo,arr)
  973. },
  974. setMode(type){
  975. let arr = [];
  976. let obj = {};
  977. obj.id = "WorkMode";
  978. obj.shadow = type;
  979. arr.push(obj);
  980. this.mqttPublish(2,this.deviceInfo,arr,true)
  981. this.workMode = type;
  982. },
  983. temperNumber(value){
  984. let arr = [];
  985. let obj = {};
  986. obj.id = "CalibrationTemp";
  987. obj.shadow = this.jiaozhunTemp;
  988. arr.push(obj);
  989. this.mqttPublish(2,this.deviceInfo,arr,true)
  990. },
  991. volumeNumber(){
  992. let arr = [];
  993. let obj = {};
  994. obj.id = "CapacityCalibration";
  995. obj.shadow = 1;
  996. arr.push(obj);
  997. this.mqttPublish(2,this.deviceInfo,arr,true)
  998. },
  999. showConfirm(title,content,yes,no){
  1000. uni.showModal({
  1001. title: title,
  1002. content: content,
  1003. success: function (res) {
  1004. if (res.confirm) {
  1005. yes();
  1006. } else if (res.cancel) {
  1007. no();
  1008. }
  1009. }
  1010. });
  1011. },
  1012. reset(){
  1013. let self = this;
  1014. this.showConfirm("提示","确认恢复出厂吗",function(){
  1015. let arr = [];
  1016. let obj = {};
  1017. obj.id = "RestoreFactory";
  1018. obj.shadow = 1;
  1019. arr.push(obj);
  1020. self.mqttPublish(2,self.deviceInfo,arr)
  1021. },function(){});
  1022. },
  1023. turnChange(type){
  1024. let flag = false;
  1025. let obj = {};
  1026. if(type ==3){
  1027. if(this.baozhuangTurn || this.qitingTurn){
  1028. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1029. return;
  1030. }
  1031. flag = this.qingxiTurn;
  1032. obj.id = "WashSwitch";
  1033. }else if(type == 2){
  1034. if(this.qingxiTurn || this.qitingTurn){
  1035. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1036. return;
  1037. }
  1038. flag = this.baozhuangTurn;
  1039. obj.id = "PackageSwitch";
  1040. }else if(type == 1) {
  1041. if(this.qingxiTurn || this.baozhuangTurn){
  1042. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1043. return;
  1044. }
  1045. flag = this.qitingTurn;
  1046. obj.id = "CarrybagSwitch";
  1047. }
  1048. flag = !flag;
  1049. let arr = [];
  1050. if(flag){
  1051. obj.shadow = 1;
  1052. }else{
  1053. obj.shadow = 0;
  1054. }
  1055. arr.push(obj);
  1056. this.mqttPublish(2,this.deviceInfo,arr)
  1057. },
  1058. addPackageVolume(){
  1059. this.packageVolume++;
  1060. console.log("增加包装容量")
  1061. this.changePackageVolume()
  1062. },
  1063. subPackageVolume(){
  1064. this.packageVolume--;
  1065. console.log("减少包装容量")
  1066. this.changePackageVolume()
  1067. },
  1068. addPackageNumber(){
  1069. this.packageNumber++;
  1070. console.log("增加包装数量")
  1071. this.changePackageNumber();
  1072. },
  1073. subPackageNumber(){
  1074. this.packageNumber--;
  1075. console.log("减少包装数量")
  1076. this.changePackageNumber();
  1077. },
  1078. addSealingTemperature(){
  1079. console.log("增加封口温度")
  1080. this.setSealingTemperature++;
  1081. this.changeSealingTemperature();
  1082. },
  1083. subSealingTemperature(){
  1084. console.log("减少封口温度")
  1085. this.setSealingTemperature--;
  1086. this.changeSealingTemperature();
  1087. },
  1088. addEdegTemperature(){
  1089. console.log("增加封边温度")
  1090. this.editing = true;
  1091. this.setEdegTemperature++;
  1092. this.changeEdegTemperature();
  1093. },
  1094. subEdegTemperature(){
  1095. console.log("减少封边温度")
  1096. this.editing = true;
  1097. this.setEdegTemperature--;
  1098. this.changeEdegTemperature();
  1099. },
  1100. addTemperatureTime(){
  1101. console.log("增加煎药时间")
  1102. this.temperatureTime++;
  1103. this.changeTemperatureTime()
  1104. },
  1105. subTemperatureTime(){
  1106. console.log("减少煎药时间")
  1107. this.temperatureTime--;
  1108. if(this.temperatureTime<=0){
  1109. this.temperatureTime = 1;
  1110. }
  1111. this.changeTemperatureTime()
  1112. },
  1113. addTemperature(){
  1114. console.log("增加煎药温度")
  1115. this.temperature++;
  1116. this.changeTemperature();
  1117. },
  1118. subTemperature(type){
  1119. console.log("减少煎药温度")
  1120. this.temperature--;
  1121. this.changeTemperature();
  1122. },
  1123. addPlanTime(){
  1124. console.log("增加预约时间")
  1125. this.planTime++;
  1126. },
  1127. subPlanTime(){
  1128. console.log("减少预约时间")
  1129. this.planTime--;
  1130. },
  1131. sendBaozhuang(targetKey){
  1132. let self = this;
  1133. let arr = [];
  1134. if(this.baozhuangTimer != null){
  1135. clearTimeout(this.baozhuangTimer);
  1136. }
  1137. this.baozhuangTimer = setTimeout(function (){
  1138. for (let i = 0; i <this.baozhuangKeys.length; i++) {
  1139. let key = this.baozhuangKeys[i];
  1140. let obj = {};
  1141. obj.id = key;
  1142. if(key === "PackingVolume"){
  1143. obj.shadow = this.packageVolume;
  1144. }
  1145. if(key === "PackageQuantity"){
  1146. obj.shadow = this.packageNumber;
  1147. }
  1148. if(key === "SetSealTemp"){
  1149. obj.shadow = this.setSealingTemperature;
  1150. }
  1151. if(key === "SetBandingTemp"){
  1152. obj.shadow = this.setEdegTemperature;
  1153. }
  1154. if(targetKey == key){
  1155. arr.push(obj);
  1156. break;
  1157. }
  1158. }
  1159. this.mqttPublish(2,this.deviceInfo,arr)
  1160. }.bind(this),500);
  1161. },
  1162. sendJianYao(targetKey){
  1163. let arr = [];
  1164. if(this.jianyaoTimer != null){
  1165. clearTimeout(this.jianyaoTimer);
  1166. }
  1167. this.jianyaoTimer = setTimeout(function (){
  1168. for (let i = 0; i <this.jianyaoKeys.length; i++) {
  1169. let key = this.jianyaoKeys[i];
  1170. let obj = {};
  1171. obj.id = key;
  1172. if(key === "TempSetting"){
  1173. obj.shadow = this.temperature;
  1174. }
  1175. if(key === "TimeSetting"){
  1176. obj.shadow = this.temperatureTime;
  1177. }
  1178. if(targetKey == key){
  1179. arr.push(obj);
  1180. break;
  1181. }
  1182. }
  1183. this.mqttPublish(2,this.deviceInfo,arr,true)
  1184. }.bind(this),500);
  1185. },
  1186. buildPropKey(key){
  1187. if(this.childId !=0){
  1188. return key+"_"+this.childId;
  1189. }else{
  1190. return key;
  1191. }
  1192. },
  1193. decoctControlChange(){
  1194. let obj = {};
  1195. let arr = [];
  1196. if(!this.decoctControlOnOffStatus){
  1197. this.notifyError("请先开机后再进行操作")
  1198. return;
  1199. }
  1200. if(this.decoctControlStatus){
  1201. this.showJianyao();
  1202. return;
  1203. }
  1204. this.decoctControlStatus = !this.decoctControlStatus;
  1205. obj.id = "DecoctingSwitch";
  1206. if(this.decoctControlStatus){
  1207. obj.shadow = 1;
  1208. console.log("煎药状态打开")
  1209. this.checkJianyao();
  1210. }else{
  1211. obj.shadow = 0;
  1212. console.log("煎药状态关闭")
  1213. }
  1214. arr.push(obj);
  1215. this.mqttPublish(2,this.deviceInfo,arr,true)
  1216. },
  1217. kongzhiJianyao(flag,arr){//不判断煎药状态
  1218. let obj = {};
  1219. if(!this.decoctControlOnOffStatus){
  1220. this.notifyError("请先开机后再进行操作")
  1221. return;
  1222. }
  1223. obj.id = "DecoctingSwitch";
  1224. if(flag){
  1225. obj.shadow = 1;
  1226. console.log("煎药状态打开")
  1227. this.checkJianyao();
  1228. }else{
  1229. obj.shadow = 0;
  1230. console.log("煎药状态关闭")
  1231. }
  1232. arr.push(obj);
  1233. },
  1234. stopDecoctControlChange(){
  1235. let obj = {};
  1236. let arr = [];
  1237. if(!this.decoctControlOnOffStatus){
  1238. this.notifyError("请先开机后再进行操作")
  1239. return;
  1240. }
  1241. if(!this.decoctControlStatus){
  1242. return;
  1243. }
  1244. this.decoctControlStatus = !this.decoctControlStatus;
  1245. obj.id = "DecoctingSwitch";
  1246. if(this.decoctControlStatus){
  1247. obj.shadow = 1;
  1248. console.log("煎药状态打开")
  1249. }else{
  1250. obj.shadow = 0;
  1251. console.log("煎药状态关闭")
  1252. }
  1253. arr.push(obj);
  1254. let obj2 = {};
  1255. obj2.id = "AppointmentTime";
  1256. obj2.shadow = 0;
  1257. arr.push(obj2);
  1258. this.mqttPublish(2,this.deviceInfo,arr,true)
  1259. },
  1260. decoctControlOnOffChange(){
  1261. let obj = {};
  1262. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  1263. let arr = [];
  1264. obj.id = "PowerControl";
  1265. let isMul = false;
  1266. if(this.decoctControlStatus){
  1267. this.$modal.showToast('请先结束煎药后操作')
  1268. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  1269. return;
  1270. }
  1271. if(this.oneToMul && this.firstTab){
  1272. obj.id = "PowerCtl";
  1273. isMul = true;
  1274. }
  1275. if(this.decoctControlOnOffStatus){
  1276. obj.shadow = 1;
  1277. console.log("煎药机开关打开")
  1278. }else{
  1279. obj.shadow = 0;
  1280. console.log("煎药机开关关闭")
  1281. }
  1282. arr.push(obj);
  1283. this.mqttPublish(2,this.deviceInfo,arr,isMul)
  1284. },
  1285. packageControlOnOffChange(){
  1286. let obj = {};
  1287. let arr = [];
  1288. if(this.baozhuangRunning()){
  1289. this.$modal.showToast('请先停止运行后操作')
  1290. return;
  1291. }
  1292. obj.id = "PackagePowerControl";
  1293. this.packageControlOnOffStatus = !this.packageControlOnOffStatus;
  1294. if(this.packageControlOnOffStatus){
  1295. console.log("包装机器开关打开")
  1296. obj.shadow = 1;
  1297. }else{
  1298. console.log("包装机器开关关闭")
  1299. obj.shadow = 0;
  1300. }
  1301. arr.push(obj);
  1302. this.mqttPublish(2,this.deviceInfo,arr)
  1303. },
  1304. containKey(arr,key){
  1305. for (let i = 0; i < arr.length; i++) {
  1306. const data = arr[i];
  1307. if(data == key){
  1308. return true;
  1309. }
  1310. }
  1311. return false;
  1312. },
  1313. // 抽屉状态发生变化触发
  1314. change(e, type) {
  1315. console.log(e);
  1316. },
  1317. showDrawer() {
  1318. this.$refs.showLeft.open();
  1319. },
  1320. closeDrawer() {
  1321. this.$refs.showLeft.close();
  1322. },
  1323. checkItemValue(item){
  1324. if(!item.shadow){
  1325. item.shadow = 0;
  1326. }
  1327. if(!item.unit){
  1328. item.unit = "";
  1329. }
  1330. return true;
  1331. },
  1332. sendProperties(){
  1333. let properties = this.properties;
  1334. for (let i = 0; i < properties; i++) {
  1335. let property = this.properties[i];
  1336. let shadow = property.shadow;
  1337. if(shadow){
  1338. arr.push(property);
  1339. }
  1340. }
  1341. this.mqttPublish(1,this.deviceInfo,arr)
  1342. },
  1343. sendFunctions(){
  1344. let arr = [];
  1345. let functions = this.functions;
  1346. for (let i = 0; i < functions.length; i++) {
  1347. let functionObj = this.functions[i];
  1348. let shadow = functionObj.shadow;
  1349. if(shadow){
  1350. arr.push(functionObj);
  1351. }
  1352. }
  1353. this.mqttPublish(2,this.deviceInfo,arr)
  1354. },
  1355. changeProp(key,val){
  1356. let item = null;
  1357. let obj = null;
  1358. let oneToMul = this.oneToMul;
  1359. if(key === "LockControl"){
  1360. this.lock.value = val;
  1361. item = this.lock;
  1362. }else if(key === "PowerControl"){
  1363. this.power.value = val;
  1364. item = this.power;
  1365. }
  1366. let value = val;
  1367. obj = item.item;
  1368. if(value){
  1369. obj.value = 1;
  1370. obj.shadow = 1;
  1371. }else{
  1372. obj.value = 0;
  1373. obj.shadow = 0;
  1374. }
  1375. if(!oneToMul){
  1376. }
  1377. this.publishThingsModel(this.deviceInfo,obj);
  1378. },
  1379. checkCommonProp(item){
  1380. let id =item.id;
  1381. let isCommonKey = this.modelKey.some(res=>{
  1382. return id === res;
  1383. })
  1384. return !isCommonKey;
  1385. },
  1386. getRunTime(){
  1387. let self = this;
  1388. getDeviceRunTime(this.id).then(res=>{
  1389. self.timeobj = res.data;
  1390. if(self.timeobj.avgtime == ""){
  1391. self.timeobj.avgtime = 0;
  1392. }
  1393. if(self.timeobj.alltime == ""){
  1394. self.timeobj.alltime = 0;
  1395. }
  1396. })
  1397. },
  1398. seeTime(){
  1399. this.showTimeDlg = true;
  1400. this.getRunTime();
  1401. },
  1402. closeTime(){
  1403. this.showTimeDlg = false;
  1404. },
  1405. cancel(){
  1406. this.showErrDlg = false;
  1407. },
  1408. reportError(){
  1409. this.showErrDlg = true;
  1410. },
  1411. doReportError(){
  1412. if(!this.errorMsg){
  1413. this.$modal.showToast('异常信息不能为空')
  1414. }else{
  1415. let self = this;
  1416. let errObj = {};
  1417. errObj.deviceId = this.deviceInfo.deviceId;
  1418. errObj.deviceName = this.deviceInfo.deviceName
  1419. errObj.desc = this.errorMsg;
  1420. errObj.deptId= this.deviceInfo.deptId;
  1421. reportError(errObj).then(res=>{
  1422. self.$modal.showToast(res.msg)
  1423. self.cancel();
  1424. })
  1425. }
  1426. },
  1427. openLocation(){
  1428. uni.openLocation({
  1429. latitude: this.location.latitude,
  1430. longitude: this.location.longitude,
  1431. success: function () {
  1432. console.log('success');
  1433. }
  1434. });
  1435. },
  1436. confirmItemData(e){
  1437. let data = e.value[0];
  1438. this.show.text = data.text;
  1439. this.show.shadow=data.value;
  1440. this.show = null;
  1441. console.log(data);
  1442. },
  1443. send(){
  1444. let shadow = false
  1445. let _arr = []
  1446. this.inputProp.forEach((item)=>{
  1447. _arr.push(item.value)
  1448. })
  1449. // if(_arr.some(val => val === '' || val.length < 0)){
  1450. // shadow = true
  1451. // }
  1452. if(this.deviceInfo.status != 3){
  1453. uni.showToast({
  1454. title:"设备暂未上线",
  1455. icon:"error"
  1456. })
  1457. return;
  1458. }
  1459. if(shadow){
  1460. uni.showToast({
  1461. title:"数据不能为空",
  1462. icon:"error"
  1463. })
  1464. return;
  1465. }
  1466. this.publishThingsModel(this.deviceInfo,this.inputProp.map(item=>{return{"id":item.id,"value":item.value}}))
  1467. },
  1468. /** 更新设备状态 */
  1469. updateDeviceStatus(device) {
  1470. },
  1471. chooseItemData(data){
  1472. if(this.deviceInfo.status != 3){
  1473. uni.showToast({
  1474. title:"设备暂未上线",
  1475. icon:"error"
  1476. })
  1477. return;
  1478. }
  1479. this.columns = [data.enumList];
  1480. this.show =data;
  1481. },
  1482. getDetail(){
  1483. let self = this;
  1484. getDetail(this.id).then(res=>{
  1485. self.deviceInfo = res.data;
  1486. self.location = {
  1487. latitude: self.deviceInfo.latitude,
  1488. longitude: self.deviceInfo.longitude};
  1489. self.sysDept = self.deviceInfo.sysDept;
  1490. self.parseSummay(res.data.summary)
  1491. self.mqttSubscribe(res.data);
  1492. self.getDeviceStatus();
  1493. self.seeTime();
  1494. self.summary[0].checked = true;
  1495. });
  1496. },
  1497. getDeviceStatus(){
  1498. let self = this;
  1499. if(this.summary.length>1){
  1500. }else{
  1501. this.childId = 0;
  1502. }
  1503. getDeviceStatus(this.id,this.childId).then(res=>{
  1504. let data =res.data;
  1505. this.deviceInfo = data;
  1506. self.parseStatusData(data)
  1507. });
  1508. },
  1509. getNewDeviceStatus(item){
  1510. console.log(item);
  1511. let self = this;
  1512. if(item.index == 0){
  1513. this.firstTab = true;
  1514. this.getDeviceStatus();
  1515. }
  1516. if(item.index == 1){
  1517. this.firstTab = false;
  1518. getDeviceStatus(this.id,0).then(res=>{
  1519. let data =res.data;
  1520. this.deviceInfo = data;
  1521. self.parseStatusData(data)
  1522. });
  1523. }
  1524. },
  1525. changeSub(item){
  1526. this.childId = item.id;
  1527. this.getDeviceStatus()
  1528. },
  1529. parseEnumList(){
  1530. let enumList = this.deviceInfo.enumList;
  1531. for (let enumListElement of enumList) {
  1532. let id = enumListElement.id;
  1533. if(id.indexOf("LockControl") !=-1){
  1534. let shadow = enumListElement.shadow;
  1535. this.lock.item = enumListElement;
  1536. if(shadow == 1){
  1537. this.lock.value = true;
  1538. this.lock.loading = false;
  1539. }else if(shadow == 0){
  1540. this.lock.value = false;
  1541. this.lock.loading = false;
  1542. }else{
  1543. this.lock.loading = true;
  1544. }
  1545. }
  1546. if(id.indexOf("PowerControl") !=-1){
  1547. let shadow = enumListElement.shadow;
  1548. if(this.oneToMul){
  1549. if(!this.firstTab){
  1550. if(shadow == 1){
  1551. this.decoctControlOnOffStatus = true;
  1552. }else if(shadow == 0){
  1553. this.decoctControlOnOffStatus = false;
  1554. }
  1555. }
  1556. }else{
  1557. if(shadow == 1){
  1558. this.decoctControlOnOffStatus = true;
  1559. }else if(shadow == 0){
  1560. this.decoctControlOnOffStatus = false;
  1561. }
  1562. }
  1563. }
  1564. if(id.indexOf("PowerCtl") !=-1){
  1565. if(this.oneToMul && this.firstTab){
  1566. let shadow = enumListElement.shadow;
  1567. if(shadow == 1){
  1568. this.decoctControlOnOffStatus = true;
  1569. }else if(shadow == 0){
  1570. this.decoctControlOnOffStatus = false;
  1571. }
  1572. }
  1573. }
  1574. this.formatValue(id,enumListElement,"PackagePowerControl","packageControlOnOffStatus")
  1575. this.formatValue(id,enumListElement,"DecoctingSwitch","decoctControlStatus")
  1576. this.formatValue(id,enumListElement,"CarrybagSwitch","qitingTurn")
  1577. this.formatValue(id,enumListElement,"WashSwitch","qingxiTurn")
  1578. this.formatValue(id,enumListElement,"PackageSwitch","baozhuangTurn");
  1579. if(id.indexOf("WorkMode") !=-1){
  1580. let shadow = enumListElement.shadow;
  1581. if(!shadow){
  1582. shadow = 1;
  1583. }
  1584. this.workMode = shadow;
  1585. }
  1586. let shadow = enumListElement.shadow
  1587. let valueList = enumListElement.enumList;
  1588. for (let valueObj of valueList){
  1589. if(valueObj.value == shadow){
  1590. enumListElement.text = valueObj.text;
  1591. }
  1592. }
  1593. }
  1594. },
  1595. formatValue(id,enumListElement,key,propkey){
  1596. if(id.indexOf(key) !=-1){
  1597. let shadow = enumListElement.shadow;
  1598. if(shadow == 1){
  1599. this[propkey] = true;
  1600. }else if(shadow == 0){
  1601. this[propkey] = false;
  1602. }
  1603. }
  1604. },
  1605. parseStatusData(data){
  1606. let self = this;
  1607. cacheJsonThingsModel(data.productId).then(res=>{
  1608. let thingsModel = JSON.parse(res.data);
  1609. let arr = [];
  1610. let arrayList = data.arrayList;
  1611. arr = arr.concat(arrayList);
  1612. let enumList = data.enumList;
  1613. arr = arr.concat(enumList);
  1614. let integerList = data.integerList;
  1615. arr = arr.concat(integerList);
  1616. let stringList = data.stringList;
  1617. arr = arr.concat(stringList);
  1618. self.inputProp = arr;
  1619. for (let i = 0; i < thingsModel.functions.length; i++) {
  1620. for (let j = 0; j < arr.length; j++) {
  1621. let model = arr[j];
  1622. if(model.id == thingsModel.functions[i].id){
  1623. self.functions.push(model);
  1624. }
  1625. }
  1626. }
  1627. for (let i = 0; i < thingsModel.properties.length; i++) {
  1628. for (let j = 0; j < arr.length; j++) {
  1629. let model = arr[j];
  1630. if(model.id == thingsModel.properties[i].id){
  1631. self.properties.push(model);
  1632. }
  1633. }
  1634. }
  1635. let readOnlyList = data.readOnlyList;
  1636. self.watchProp = readOnlyList;
  1637. self.parseEnumList();
  1638. self.parseProp();
  1639. self.checkJianyao();
  1640. })
  1641. },
  1642. showJianyao(){
  1643. this.calcuStep();
  1644. this.planIngPopDlg = true;
  1645. },
  1646. parseProp(){
  1647. let self = this;
  1648. for (let i = 0; i <self.inputProp.length; i++) {
  1649. let prop = self.inputProp[i];
  1650. let value = prop.shadow||0;
  1651. let id = prop.id;
  1652. if(id === "TimeSetting"){//温度设置
  1653. self.temperatureTime = value;
  1654. }
  1655. if(id === "TempSetting"){
  1656. self.temperature = value;
  1657. }
  1658. this.setPropValue(id,"SlowfireTiem","leftJianyaoTime",value,0)
  1659. this.setPropValue(id,"HighTempTime","hightTemperature",value,0)
  1660. this.setPropValue(id,"CurrentTemp","currentTemperature",value,0)
  1661. this.setPropValue(id,"CalibrationTemp","jiaozhunTemp",value,0)
  1662. this.setPropValue(id,"PackingVolume","packageVolume",value,50)
  1663. this.setPropValue(id,"PackageQuantity","packageNumber",value,1)
  1664. this.setPropValue(id,"SealTemp","sealingTemperature",value)
  1665. this.setPropValue(id,"BandingTemp","edegTemperature",value)
  1666. this.setPropValue(id,"SetSealTemp","setSealingTemperature",value,160)
  1667. this.setPropValue(id,"SetBandingTemp","setEdegTemperature",value,160)
  1668. this.setPropValue(id,"LeftAppointmentTime","leftAppointmentTime",value,0)
  1669. self.propMap[id] = prop;
  1670. }
  1671. },
  1672. setPropValue(id,key,propKey,value,defaultValue){
  1673. if(!value && defaultValue){
  1674. value = defaultValue;
  1675. }
  1676. if(id === key){
  1677. this[propKey] = value;
  1678. }
  1679. },
  1680. parseSummay(summary){
  1681. let self = this;
  1682. if(!summary){
  1683. summary = "";
  1684. }
  1685. if(summary.length>0){
  1686. this.summary = JSON.parse(summary);
  1687. if(self.summary.length>0){
  1688. this.oneToMul = true;
  1689. for (let i = 0; i < self.summary.length; i++) {
  1690. self.summary[i].tabName = self.summary[i].name
  1691. }
  1692. let childId = "";
  1693. if(this.oneToMul){
  1694. this.childId = self.summary[0].id;
  1695. }
  1696. }else{
  1697. this.summary = [{name:"煎药机一"}]
  1698. }
  1699. }else{
  1700. this.summary = [{name:"煎药机一"}]
  1701. }
  1702. },
  1703. goDeviceDetail(id){
  1704. uni.navigateTo({
  1705. url: '/pages/device/detail/detail?id='+id
  1706. });
  1707. },
  1708. async connectMqtt() {
  1709. if (this.$mqttTool.client == null) {
  1710. await this.$mqttTool.connect(this.vuex_token);
  1711. }
  1712. this.mqttCallback();
  1713. this.startCheck();
  1714. },
  1715. /** Mqtt订阅主题 */
  1716. mqttSubscribe(device) {
  1717. // 订阅当前设备状态和实时监测
  1718. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  1719. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  1720. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  1721. let topics = [];
  1722. topics.push(topicStatus);
  1723. topics.push(topicProperty);
  1724. topics.push(topicFunction);
  1725. this.$mqttTool.subscribe(topics);
  1726. },
  1727. /** Mqtt取消订阅主题 */
  1728. mqttUnSubscribe(device) {
  1729. // 订阅当前设备状态和实时监测
  1730. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  1731. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  1732. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  1733. let topics = [];
  1734. topics.push(topicStatus);
  1735. topics.push(topicProperty);
  1736. topics.push(topicFunction);
  1737. console.log('取消订阅', topics);
  1738. this.$mqttTool.unsubscribe(topics);
  1739. },
  1740. /* Mqtt回调处理 */
  1741. mqttCallback() {
  1742. this.$mqttTool.client.on('message', (topic, message, buffer) => {
  1743. let topics = topic.split('/');
  1744. let productId = topics[1];
  1745. let deviceNum = topics[2];
  1746. console.log('接收到内容:'+message);
  1747. message = JSON.parse(message.toString());
  1748. if (topics[3] == 'status') {
  1749. console.log('接收到【设备状态-运行】主题:', topic);
  1750. console.log('接收到【设备状态-运行】内容:', message);
  1751. // 更新列表中设备的状态
  1752. if (this.deviceInfo.serialNumber == deviceNum) {
  1753. this.deviceInfo.status = message.status;
  1754. this.deviceInfo.isShadow = message.isShadow;
  1755. this.deviceInfo.rssi = message.rssi;
  1756. this.updateDeviceStatus(this.deviceInfo);
  1757. }
  1758. }
  1759. if (topics[3] == 'property' || topics[3] == 'function') {
  1760. console.log('接收到【物模型】主题:', topic);
  1761. console.log('接收到【物模型】内容:', message);
  1762. if(this.oneToMul){
  1763. let curTabId = this.childId;
  1764. let msg = [];
  1765. for (let i = 0; i < message.length; i++) {
  1766. let curMsg = message[i];
  1767. let id = curMsg.id;
  1768. let ids = id.split("_");
  1769. let value = curMsg.value;
  1770. if(ids.length == 2){
  1771. if(curTabId == ids[1]){
  1772. msg.push({id:ids[0],value:value});
  1773. }
  1774. }else{
  1775. msg.push(curMsg);
  1776. }
  1777. }
  1778. message = msg;
  1779. }
  1780. // 更新列表中设备的属性
  1781. if (this.deviceInfo.serialNumber == deviceNum) {
  1782. for (let j = 0; j < message.length; j++) {
  1783. let isComplete = false;
  1784. let msgId = message[j].id;
  1785. this.exchangeData(msgId,message[j]);
  1786. // 布尔类型
  1787. for (let k = 0; k < this.deviceInfo.boolList.length && !isComplete; k++) {
  1788. if (this.deviceInfo.boolList[k].id == message[j].id) {
  1789. this.deviceInfo.boolList[k].shadow = message[j].value;
  1790. isComplete = true;
  1791. break;
  1792. }
  1793. }
  1794. // 枚举类型
  1795. for (let k = 0; k < this.deviceInfo.enumList.length && !isComplete; k++) {
  1796. if (this.deviceInfo.enumList[k].id == message[j].id) {
  1797. this.deviceInfo.enumList[k].shadow = message[j].value;
  1798. isComplete = true;
  1799. break;
  1800. }
  1801. }
  1802. // 字符串类型
  1803. for (let k = 0; k < this.deviceInfo.stringList.length && !isComplete; k++) {
  1804. if (this.deviceInfo.stringList[k].id == message[j].id) {
  1805. this.deviceInfo.stringList[k].shadow = message[j].value;
  1806. isComplete = true;
  1807. break;
  1808. }
  1809. }
  1810. // 数组类型
  1811. for (let k = 0; k < this.deviceInfo.arrayList.length && !isComplete; k++) {
  1812. if (this.deviceInfo.arrayList[k].id == message[j].id) {
  1813. this.deviceInfo.arrayList[k].shadow = message[j].value;
  1814. isComplete = true;
  1815. break;
  1816. }
  1817. }
  1818. // 整数类型
  1819. for (let k = 0; k < this.deviceInfo.integerList.length && !isComplete; k++) {
  1820. if (this.deviceInfo.integerList[k].id == message[j].id) {
  1821. this.deviceInfo.integerList[k].shadow = message[j].value;
  1822. isComplete = true;
  1823. break;
  1824. }
  1825. }
  1826. // 小数类型
  1827. for (let k = 0; k < this.deviceInfo.decimalList.length && !isComplete; k++) {
  1828. if (this.deviceInfo.decimalList[k].id == message[j].id) {
  1829. this.deviceInfo.decimalList[k].shadow = message[j].value;
  1830. isComplete = true;
  1831. break;
  1832. }
  1833. }
  1834. // 监测数据
  1835. for (let k = 0; k < this.deviceInfo.readOnlyList.length && !isComplete; k++) {
  1836. if (this.deviceInfo.readOnlyList[k].id == message[j].id) {
  1837. this.deviceInfo.readOnlyList[k].shadow = message[j].value;
  1838. // 更新图表
  1839. // for (let m = 0; m < this.monitorChart.length; m++) {
  1840. // if (message[j].id == this.monitorChart[m].data.id) {
  1841. // let data = [{
  1842. // value: message[j].value,
  1843. // name: this.monitorChart[m].data.name
  1844. // }];
  1845. // this.monitorChart[m].chart.setOption({
  1846. // series: [{
  1847. // data: data
  1848. // }]
  1849. // });
  1850. // break;
  1851. // }
  1852. // }
  1853. isComplete = true;
  1854. break;
  1855. }
  1856. }
  1857. }
  1858. this.parseEnumList();
  1859. this.checkJianyao();
  1860. if(this.planIngPopDlg){
  1861. this.calcuStep();
  1862. }
  1863. }
  1864. this.$forceUpdate();
  1865. }
  1866. });
  1867. },
  1868. checkJianyao(){
  1869. // if(!this.jianyaoPopClose){
  1870. // return;
  1871. // }
  1872. // let self = this;
  1873. // setTimeout(function(){
  1874. // if(self.decoctControlStatus){
  1875. // self.showJianyao();
  1876. // }
  1877. // },1000);
  1878. },
  1879. exchangeData(msgId,obj){
  1880. if(msgId === "TempSetting"){
  1881. this.temperature = obj.value;
  1882. }
  1883. if(msgId === "TimeSetting"){
  1884. this.temperatureTime = obj.value;
  1885. }
  1886. if(msgId === "CurrentTemp"){
  1887. this.currentTemperature = obj.value;
  1888. }
  1889. if(msgId === "HighTempTime"){
  1890. this.hightTemperature = obj.value;
  1891. }
  1892. if(msgId === "SealTemp"){
  1893. if(!this.editing){
  1894. this.sealingTemperature = obj.value;
  1895. }
  1896. }
  1897. if(msgId === "BandingTemp"){
  1898. if(!this.editing){
  1899. this.edegTemperature = obj.value;
  1900. }
  1901. }
  1902. if(msgId === "PackingVolume"){
  1903. if(!this.editing){
  1904. this.packageVolume = obj.value;
  1905. }
  1906. }
  1907. if(msgId === "PackageQuantity"){
  1908. if(!this.editing){
  1909. this.packageNumber = obj.value;
  1910. }
  1911. }
  1912. if(msgId === "LeftAppointmentTime"){
  1913. this.leftAppointmentTime = obj.value;
  1914. }
  1915. if(msgId === "SlowfireTiem"){
  1916. this.leftJianyaoTime = obj.value;
  1917. }
  1918. if(msgId === "CalibrationTemp"){
  1919. this.jiaozhunTemp = obj.value;
  1920. }
  1921. },
  1922. /** 发布物模型 类型(1=属性,2=功能) */
  1923. publishThingsModel(device, model) {
  1924. // 获取缓存的Json物模型
  1925. cacheJsonThingsModel(device.productId).then(response => {
  1926. let thingsModel = JSON.parse(response.data);
  1927. let type = 0;
  1928. for (let i = 0; i < thingsModel.functions.length; i++) {
  1929. if (model.id == thingsModel.functions[i].id) {
  1930. type = 2;
  1931. break;
  1932. }
  1933. }
  1934. if (type == 0) {
  1935. for (let i = 0; i < thingsModel.properties.length; i++) {
  1936. if (model.id == thingsModel.properties[i].id) {
  1937. type = 1;
  1938. break;
  1939. }
  1940. }
  1941. }
  1942. if (type != 0) {
  1943. this.mqttPublish(type, device, [model]);
  1944. }
  1945. });
  1946. },
  1947. notifyError(res){
  1948. uni.showToast({
  1949. title:res,
  1950. icon:"error"
  1951. })
  1952. },
  1953. notifySuccess(res){
  1954. uni.showToast({
  1955. title:res,
  1956. icon:"success"
  1957. })
  1958. },
  1959. getDownloadUrl(path){
  1960. return this.firmware.downUrl +"/iot/tool/download?fileName="+ path;
  1961. },
  1962. /**
  1963. * Mqtt发布消息
  1964. * @type 类型(1=属性,2=功能,3=OTA升级,4=实时监测)
  1965. * @device 设备
  1966. * @model 物模型
  1967. * */
  1968. mqttPublish(type, device, modelList,needMore) {
  1969. if(this.deviceInfo.status != 3){
  1970. this.notifyError("请等待设备上线后操作")
  1971. return;
  1972. }
  1973. if(modelList.length == 0){
  1974. return;
  1975. }
  1976. let topic = "";
  1977. let message = ""
  1978. let oneToMul = false;
  1979. if(this.summary.length>1){
  1980. oneToMul = true;
  1981. }
  1982. if(!needMore){
  1983. oneToMul = false;
  1984. }
  1985. if(this.firstTab){
  1986. let isKaijiKey = false;
  1987. if(modelList.length >0){
  1988. let modelData = modelList[0];
  1989. let curKeyId = modelData.id;
  1990. if(!this.decoctControlOnOffStatus){
  1991. if(oneToMul){
  1992. if(curKeyId.indexOf("PowerCtl") !=-1){
  1993. isKaijiKey = true;
  1994. }
  1995. }else{
  1996. if(curKeyId.indexOf("PowerControl") !=-1){
  1997. isKaijiKey = true;
  1998. }
  1999. }
  2000. }else{
  2001. isKaijiKey = true;
  2002. }
  2003. }
  2004. if(!isKaijiKey){
  2005. this.notifyError("请先开机后再进行操作")
  2006. return;
  2007. }
  2008. }else{
  2009. let isKaijiKey = false;
  2010. if(modelList.length >0){
  2011. let modelData = modelList[0];
  2012. let curKeyId = modelData.id;
  2013. if(!this.packageControlOnOffStatus){
  2014. if(curKeyId.indexOf("PackagePowerControl") !=-1){
  2015. isKaijiKey = true;
  2016. }
  2017. }else{
  2018. isKaijiKey = true;
  2019. }
  2020. }
  2021. if(!isKaijiKey){
  2022. this.notifyError("请先开机后再进行操作")
  2023. return;
  2024. }
  2025. }
  2026. if (type == 1) {
  2027. if (device.status == 3) {
  2028. // 属性,在线模式
  2029. topic = "/" + device.productId + "/" + device.serialNumber + "/property-online/get";
  2030. }
  2031. } else if (type == 2) {
  2032. if (device.status == 3) {
  2033. // 功能,在线模式
  2034. topic = "/" + device.productId + "/" + device.serialNumber + "/function-online/get";
  2035. }
  2036. } else if (type == 3) {
  2037. // OTA升级
  2038. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  2039. } else {
  2040. return;
  2041. }
  2042. let title = "";
  2043. if(type == 1){
  2044. title = "属性";
  2045. }else if(type == 2){
  2046. title = "功能";
  2047. }else if(type == 3){
  2048. title = "升级";
  2049. }
  2050. if (topic != "") {
  2051. // 发布
  2052. let arr = [];
  2053. for (let i = 0; i <modelList.length; i++) {
  2054. let model = modelList[i];
  2055. let modelId = model.id;
  2056. if(oneToMul){
  2057. let childId = this.childId;
  2058. if(childId){
  2059. modelId = modelId+"_"+childId;
  2060. }
  2061. }
  2062. let shadow = model.shadow+"";
  2063. let modelType = model.type;
  2064. let shadowInt = parseInt(shadow,10);
  2065. let isNumber = false;
  2066. let shadowStr = shadowInt+"";
  2067. if(shadowStr === shadow){
  2068. isNumber = true;
  2069. shadow = shadowInt;
  2070. }
  2071. if(modelType == "integer" && !isNumber){
  2072. this.$modal.showToast(model.name+'的值必须是数字类型')
  2073. return;
  2074. }
  2075. arr.push({id:modelId,value:shadow+""});
  2076. }
  2077. message = JSON.stringify(arr);
  2078. let self = this;
  2079. this.$mqttTool.publish(topic, message,title).then(res => {
  2080. this.notifySuccess(res);
  2081. }).catch(res => {
  2082. this.notifyError(res);
  2083. });
  2084. }
  2085. },
  2086. startCheck(){
  2087. let self = this;
  2088. this.checkTimer = setTimeout(function (){
  2089. self.sendHeart();
  2090. self.startCheck();
  2091. },20000);
  2092. },
  2093. checkActive(){
  2094. let self = this;
  2095. setTimeout(function (){
  2096. if(self.publishMsg){
  2097. self.resetConn()
  2098. }
  2099. },3000);
  2100. },
  2101. sendHeart(){
  2102. console.log("发送心跳111")
  2103. let device = this.deviceInfo;
  2104. let self = this;
  2105. let topic = "/property-offline/post";
  2106. self.publishMsg = true;
  2107. self.checkActive();
  2108. this.$mqttTool.publish(topic, "ok", "heart").then(res => {
  2109. self.publishMsg = false;
  2110. }).catch(res => {
  2111. self.publishMsg = false;
  2112. });
  2113. },
  2114. resetConn(){
  2115. console.log("检测异常,重连")
  2116. this.$mqttTool.end();
  2117. this.$mqttTool.client = null;
  2118. this.connectMqtt();
  2119. this.getDetail();
  2120. }
  2121. }
  2122. }
  2123. </script>
  2124. <style>
  2125. .send_btn{
  2126. width: 160rpx !important;
  2127. height: 40rpx !important;
  2128. font-size: 10px !important;
  2129. margin-top: 5px;
  2130. }
  2131. uni-col{
  2132. width: 150px;
  2133. }
  2134. .header{
  2135. width: 100%;
  2136. background: white;
  2137. padding:0px 20rpx;
  2138. position: relative;
  2139. height: 100vh;
  2140. position: relative;
  2141. }
  2142. .content {
  2143. display: flex;
  2144. align-items: center;
  2145. justify-content: center;
  2146. color: #060B25;
  2147. }
  2148. .logo {
  2149. height: 200rpx;
  2150. width: 200rpx;
  2151. margin-top: 200rpx;
  2152. margin-left: auto;
  2153. margin-right: auto;
  2154. margin-bottom: 50rpx;
  2155. }
  2156. .text-area {
  2157. margin:10px;
  2158. padding-bottom: 10px;
  2159. justify-content: center;
  2160. width: 100%;
  2161. }
  2162. .grid-text {
  2163. font-size: 14px;
  2164. color: #909399;
  2165. padding: 10rpx 0 20rpx 0rpx;
  2166. /* #ifndef APP-PLUS */
  2167. box-sizing: border-box;
  2168. /* #endif */
  2169. }
  2170. .title {
  2171. font-size: 36rpx;
  2172. color: #8f8f94;
  2173. }
  2174. .item{
  2175. height: 80rpx;
  2176. line-height: 80rpx;
  2177. }
  2178. .bg{
  2179. position: relative;
  2180. }
  2181. .text-left{
  2182. color: #8A92A5;
  2183. }
  2184. .text-right{
  2185. color: #545454;
  2186. }
  2187. .prop-text{
  2188. position: relative;
  2189. margin:20rpx 0;
  2190. font-size: 26rpx;
  2191. }
  2192. .prop-card-area{
  2193. }
  2194. .prop-card{
  2195. width: 28%;
  2196. height: 100rpx;
  2197. text-align: center;
  2198. display: inline-block;
  2199. background: #F5FCFF;
  2200. box-shadow: 0px 9rpx 8rpx 0px rgba(0,0,0,0.09);
  2201. border-radius: 8rpx;
  2202. margin:0px 15rpx;
  2203. line-height: 48rpx;
  2204. }
  2205. .prop-card-top{
  2206. color: #3E9CFC;
  2207. }
  2208. .prop-card-bottom{
  2209. color: #8A92A5;
  2210. }
  2211. .tab-area {
  2212. background: white;
  2213. position: absolute;
  2214. left: 0px;
  2215. right: 0px;
  2216. top:480rpx;
  2217. bottom:-20px;
  2218. min-height: 200rpx;
  2219. box-shadow: 0rpx 5rpx 27rpx 0rpx rgba(195, 195, 195, 0.4);
  2220. border-radius: 40rpx;
  2221. overflow-y: auto;
  2222. padding-bottom:80rpx;
  2223. }
  2224. .prop-item{
  2225. position: relative;
  2226. display: flex;
  2227. flex-direction: row;
  2228. height: 100rpx;
  2229. line-height: 100rpx;
  2230. margin:0 20rpx;
  2231. }
  2232. .prop-item-left{
  2233. color: #545454;
  2234. width: 100%;
  2235. font-size: 16px;
  2236. border-bottom: 1px solid lightgray;
  2237. margin-left: 120rpx;
  2238. }
  2239. .prop-item-image{
  2240. width: 120rpx;
  2241. height: 120rpx;
  2242. position: absolute;
  2243. bottom:-10rpx;
  2244. }
  2245. .prop-item-right{
  2246. position: absolute;
  2247. right:10rpx;
  2248. top:5rpx;
  2249. }
  2250. input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{
  2251. color:#666;
  2252. font-size:12px;
  2253. }
  2254. .clearfix::after {
  2255. content: "";
  2256. display: block;
  2257. clear: both;
  2258. }
  2259. .decoctControlHeader {
  2260. display: flex;
  2261. align-items: center;
  2262. font-weight: 600;
  2263. }
  2264. .decoctControlTop {
  2265. display: flex;
  2266. height: 240rpx;
  2267. border-bottom:1px #B2B2B2 dotted;
  2268. margin:0 40rpx;
  2269. }
  2270. .decoctControlTopLeft {
  2271. width:40%;
  2272. line-height: 2;
  2273. text-align: center;
  2274. margin: 0 15px;
  2275. position: relative;
  2276. }
  2277. .addTemperature {
  2278. border-radius:5px;
  2279. position:absolute;
  2280. background-color: dodgerblue;
  2281. color:white;
  2282. width: 30px;
  2283. height: 30px;
  2284. left:15px;
  2285. top:80px;
  2286. }
  2287. .addTemperatureBtn {
  2288. border-radius:10px;
  2289. position:absolute;
  2290. clip-path: polygon(50% 0,100% 100%,0 100%);
  2291. transform: scale(0.5);
  2292. left: 0;
  2293. top:0;
  2294. bottom: 0;
  2295. right: 0;
  2296. margin: auto;
  2297. }
  2298. .subTemperature {
  2299. border-radius:5px;
  2300. position:absolute;
  2301. background-color: dodgerblue;
  2302. color:white;
  2303. width: 30px;
  2304. height: 30px;
  2305. right:15px;
  2306. top:80px;
  2307. }
  2308. .subTemperatureBtn {
  2309. border-radius:10px;
  2310. position:absolute;
  2311. clip-path: polygon(50% 0,100% 100%,0 100%);
  2312. transform: scale(0.5);
  2313. left: 0;
  2314. top:0;
  2315. bottom: 0;
  2316. right: 0;
  2317. margin: auto;
  2318. }
  2319. .decoctControlTopRight {
  2320. width:40%;
  2321. line-height: 2;
  2322. text-align: center;
  2323. margin: 0 15px;
  2324. position: relative;
  2325. }
  2326. .decoctControlBottom {
  2327. border-bottom:1px #B2B2B2 dotted;
  2328. width:91vw;
  2329. margin:0 auto;
  2330. padding:10px;
  2331. display: flex;
  2332. justify-content:space-between;
  2333. align-items: center;
  2334. }
  2335. .addTime {
  2336. border-radius:5px;
  2337. position:absolute;
  2338. background-color: dodgerblue;
  2339. color:white;
  2340. width: 30px;
  2341. height: 30px;
  2342. left:15px;
  2343. top:80px;
  2344. }
  2345. .addTimeBtn {
  2346. border-radius:10px;
  2347. position:absolute;
  2348. clip-path: polygon(50% 0,100% 100%,0 100%);
  2349. transform: scale(0.5);
  2350. left: 0;
  2351. top:0;
  2352. bottom: 0;
  2353. right: 0;
  2354. margin: auto;
  2355. }
  2356. .subTime {
  2357. border-radius:5px;
  2358. position:absolute;
  2359. background-color: dodgerblue;
  2360. color:white;
  2361. width: 30px;
  2362. height: 30px;
  2363. right:15px;
  2364. top:80px;
  2365. }
  2366. .subTimeBtn {
  2367. border-radius:10px;
  2368. position:absolute;
  2369. clip-path: polygon(50% 0,100% 100%,0 100%);
  2370. transform: scale(0.5);
  2371. left: 0;
  2372. top:0;
  2373. bottom: 0;
  2374. right: 0;
  2375. margin: auto;
  2376. }
  2377. .packageControlBottomRight {
  2378. border-radius:5px;
  2379. padding:5px 10px;
  2380. margin-right: 15px;
  2381. background-color: #3c9cff;
  2382. color: #fff;
  2383. }
  2384. .packageControlBottomClear {
  2385. border-radius:5px;
  2386. padding:5px 10px;
  2387. background-color: #B2B2B2;
  2388. color: #fff;
  2389. }
  2390. .active_btn{
  2391. background-color: #3c9cff;
  2392. }
  2393. .baozhuang-sub{
  2394. right: 10rpx !important;
  2395. }
  2396. .baozhuang-add{
  2397. left: 6rpx !important;
  2398. }
  2399. .control-input-box{
  2400. display: flex;
  2401. flex-direction: row;
  2402. padding-left: 26rpx;
  2403. }
  2404. .control-input-box-danwei{
  2405. padding-top:12rpx;
  2406. margin-left:4rpx;
  2407. }
  2408. .tabs{
  2409. position: relative;
  2410. top:7vh;
  2411. }
  2412. .child_tab{
  2413. position: relative;
  2414. display: inline-block;
  2415. width: 25%;
  2416. height: 180rpx;
  2417. }
  2418. .child_img{
  2419. width: 50rpx;
  2420. height: 50rpx;
  2421. left: 66rpx;
  2422. top: 66rpx;
  2423. position: relative;
  2424. }
  2425. .child_title{
  2426. position: absolute;
  2427. left: 0px;
  2428. right: 0px;
  2429. text-align: center;
  2430. font-size: 12px;
  2431. bottom: -12rpx;
  2432. color: #060B25;
  2433. }
  2434. .control{
  2435. width: 100%;
  2436. margin-top:8vh;
  2437. position: relative;
  2438. }
  2439. .control_item{
  2440. position: relative;
  2441. width: 50%;
  2442. display: inline-block;
  2443. height: 150rpx;
  2444. }
  2445. .control_item_detail{
  2446. position: relative;
  2447. top:22rpx;
  2448. }
  2449. .control_item_left{
  2450. position:absolute;;
  2451. left:22%;
  2452. font-size: 55px;
  2453. z-index: 999;
  2454. top:-30rpx
  2455. }
  2456. .control_item_center{
  2457. position:absolute;;
  2458. left:34%;
  2459. top:0vh;
  2460. }
  2461. .control_item_right{
  2462. position:absolute;;
  2463. left:67%;
  2464. font-size: 34px;
  2465. z-index: 999;
  2466. }
  2467. .control_item_center_unit{
  2468. position: absolute;
  2469. left:26vw;
  2470. top: 0.8vh;
  2471. width:200rpx;
  2472. }
  2473. .control_item_title{
  2474. position: absolute;
  2475. bottom:34rpx;
  2476. font-size: 12px;
  2477. width: 100%;
  2478. text-align: center;
  2479. }
  2480. .bottom{
  2481. height: 140rpx;
  2482. position: absolute;
  2483. left: 0px;
  2484. width: 94%;
  2485. margin: 0 3%;
  2486. padding-top: 10rpx;
  2487. }
  2488. .bottom_item{
  2489. display: inline-block;
  2490. width: 25%;
  2491. font-size: 12px;
  2492. height: 100%;
  2493. position: relative;
  2494. text-align: center;
  2495. margin-top: 2vh;
  2496. }
  2497. .active_on{
  2498. color: #50ACFF;
  2499. }
  2500. .status_info{
  2501. position: absolute;
  2502. left: 5vw;
  2503. top: 8vh;
  2504. }
  2505. .status_detail{
  2506. display: flex;
  2507. flex-direction: row;
  2508. }
  2509. .status_text{
  2510. font-size: 16px;
  2511. }
  2512. .online_text{
  2513. font-size: 12px;
  2514. padding-top: 3px;
  2515. }
  2516. .online{
  2517. color: #017128;
  2518. }
  2519. .device_info{
  2520. font-size: 13px;
  2521. }
  2522. </style>