detail.vue 102 KB

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