index.vue 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <el-col :span="4" class="nav-class" v-loading="navLoading">
  5. <div class="nav-box">
  6. <div class="item-school" v-for="(item0, index0) in navData" :key="index0">
  7. <div class="school" @click="school_toggle(item0.id, item0.label)">
  8. <div>{{item0.label}}</div>
  9. <i v-if="item0.isShow" class="el-icon-arrow-down"></i>
  10. <i v-else class="el-icon-arrow-right"></i>
  11. </div>
  12. <div class="item-loudong" v-for="(item1, index1) in item0.children" :key="index1" :style="{display: item0.isShow ? '' : 'none'}">
  13. <div class="loudong" @click="loudong_toggle(item1.id + '|' + item0.id, item1.label + '|'+ item0.label)">
  14. <div class="louidong_text" :title="item1.label">{{item1.label}}</div>
  15. <i v-if="item1.isShow" class="el-icon-arrow-down"></i>
  16. <i v-else class="el-icon-arrow-right"></i>
  17. </div>
  18. <div class="item-louceng" v-for="(item2, index2) in item1.children" :key="index2" :style="{display: item1.isShow ? '' : 'none'}">
  19. <div :id="`louceng${index0}${index1}${index2}`" class="louceng" :class="louceng_click_id == item2.id ? 'louceng-clicked' : '' "
  20. @click="louceng_click($event, item2.id + '|' + item1.id + '|' + item0.id, item2.label + '|' + item1.label + '|'+ item0.label, item2.rooms)">
  21. {{item2.label}}
  22. </div>
  23. </div>
  24. <div class="loudong-add-louceng" :style="{display: item1.isShow ? '' : 'none'}"
  25. @click="add_louceng(item1.id + '|' + item0.id, item1.label + '|'+ item0.label)">
  26. <i class="el-icon-circle-plus-outline"></i>
  27. <div class="loudong-add-louceng-txt">添加楼层</div>
  28. </div>
  29. </div>
  30. <div class="add-loudong" @click="add_loudong(item0.id, item0.label)" :style="{display: item0.isShow ? '' : 'none'}">
  31. <i class="el-icon-circle-plus-outline"></i>
  32. <div class="add-loudong-txt">添加楼栋</div>
  33. </div>
  34. </div>
  35. </div>
  36. </el-col>
  37. <el-col :span="20">
  38. <div class="cell">
  39. <div class="cell-title">
  40. <div class="title-left">
  41. <div class="title">{{currentData.title_any_where}} 空调管理</div>
  42. <div class="title-detail">房间:{{room_number}}间</div>
  43. <div class="title-detail">设备:{{device_number}}台</div>
  44. <div class="title-detail">离线:{{offline_device_number}}台</div>
  45. <div class="title-detail">关机:{{shutdown_device_number}}台</div>
  46. <div class="title-detail">已开:{{open_number}}台</div>
  47. <div class="title-detail">预警:{{warning_number}}台</div>
  48. </div>
  49. <div class="title-right">
  50. <el-button type="primary" @click="add_room">新增房间</el-button>
  51. </div>
  52. </div>
  53. <div class="cell-body" v-loading="listLoading">
  54. <div class="cell-body-top-btns">
  55. <el-button :class="btnActive == 'all' ? 'btn-active':'btn-no-active'" type="primary" size="medium" round
  56. @click="top_btn_click('all')">全部</el-button>
  57. <el-button :class="btnActive == 'powerOn' ? 'btn-active':'btn-no-active'" type="primary" size="medium" round
  58. @click="top_btn_click('powerOn')">开机</el-button>
  59. <el-button :class="btnActive == 'powerOff' ? 'btn-active':'btn-no-active'" type="primary" size="medium" round
  60. @click="top_btn_click('powerOff')">关机</el-button>
  61. <el-button :class="btnActive == 'abnormal' ? 'btn-active':'btn-no-active'" type="primary" size="medium" round
  62. @click="top_btn_click('abnormal')">离线</el-button>
  63. </div>
  64. <el-row>
  65. <el-col :span="12">
  66. <div class="panel-left" :style="{display: currentData.rooms[0].room == '' ? 'none' : ''}">
  67. <div class="panel-header">
  68. <div class="panel-title-caption">
  69. <svg-icon icon-class="panel-home" class="panel-title-icon" />
  70. <div class="panel-title">{{currentData.rooms[0].room}}</div>
  71. </div>
  72. <div class="panel-title-btns">
  73. <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
  74. @click="operate_modify_room(currentData.rooms[0].room)">编辑</el-button>
  75. <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
  76. @click="operate_delete_room(currentData.rooms[0].room)">删除
  77. </el-button>
  78. </div>
  79. </div>
  80. <div class="panel-body">
  81. <el-table :data="currentData.rooms[0].tableData" height="170" v-loading="airsLoading[0].loading"
  82. :element-loading-text="airsLoading[0].text" element-loading-spinner="el-icon-loading" :cell-style="setCellStyle"
  83. element-loading-background="rgba(0, 0, 0, 0.8)" :header-cell-style="setHeaderSellStyle">
  84. <el-table-column label="名称" align="center" width="140">
  85. <template slot-scope="scope">
  86. <span>{{ scope.row.name }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="ID" align="center">
  90. <template slot-scope="scope">
  91. <span>{{ scope.row.ip }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="类型" align="center" width="85">
  95. <template slot-scope="scope">
  96. <span>{{ scope.row.device }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="使用时长" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.userTime }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="告警状态" align="center">
  105. <template slot-scope="scope">
  106. <span v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
  107. <span v-else @click="alarm_status_click(scope.$index, scope.row)"
  108. class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="开关状态" align="center">
  112. <template slot-scope="scope">
  113. <span v-if="scope.row.onOffStatus == 0" title="已关机"
  114. @click="open_close_airs(0, scope.$index, scope.row, 'open')">
  115. <svg-icon icon-class="power" class="power-icon-off" />
  116. </span>
  117. <span v-else class="txt-cell-blue" title="已开机"
  118. @click="open_close_airs(0, scope.$index, scope.row, 'close')">
  119. <svg-icon icon-class="power" class="power-icon-on" />
  120. </span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="操作" align="center">
  124. <template slot-scope="scope">
  125. <el-button class="btn-cell-blue" size="mini" round
  126. @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[0].room)">
  127. 删除
  128. </el-button>
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. </div>
  133. <div class="panel-footer" @click="">
  134. <i class="el-icon-circle-plus-outline"></i>
  135. <div class="panel-footer-txt" @click="add_device(currentData.rooms[0].room)">
  136. 添加设备</div>
  137. </div>
  138. </div>
  139. </el-col>
  140. <el-col :span="12">
  141. <div class="panel-right" :style="{display: currentData.rooms[1].room == '' ? 'none' : ''}">
  142. <div class="panel-header">
  143. <div class="panel-title-caption">
  144. <svg-icon icon-class="panel-home" class="panel-title-icon" />
  145. <div class="panel-title">{{currentData.rooms[1].room}}</div>
  146. </div>
  147. <div class="panel-title-btns">
  148. <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
  149. @click="operate_modify_room(currentData.rooms[1].room)">编辑</el-button>
  150. <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
  151. @click="operate_delete_room(currentData.rooms[1].room)">删除
  152. </el-button>
  153. </div>
  154. </div>
  155. <div class="panel-body">
  156. <el-table :data="currentData.rooms[1].tableData" height="170" v-loading="airsLoading[1].loading"
  157. :element-loading-text="airsLoading[1].text" element-loading-spinner="el-icon-loading"
  158. element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle" :header-cell-style="setHeaderSellStyle">
  159. <el-table-column label="名称" align="center" width="140">
  160. <template slot-scope="scope">
  161. <span>{{ scope.row.name }}</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="ID" align="center">
  165. <template slot-scope="scope">
  166. <span>{{ scope.row.ip }}</span>
  167. </template>
  168. </el-table-column>
  169. <el-table-column label="类型" align="center" width="85">
  170. <template slot-scope="scope">
  171. <span>{{ scope.row.device }}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="使用时长" align="center">
  175. <template slot-scope="scope">
  176. <span>{{ scope.row.userTime }}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="告警状态" align="center">
  180. <template slot-scope="scope">
  181. <span v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
  182. <span v-else @click="alarm_status_click(scope.$index, scope.row)"
  183. class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="开关状态" align="center">
  187. <template slot-scope="scope">
  188. <span v-if="scope.row.onOffStatus == 0" title="已关机"
  189. @click="open_close_airs(1, scope.$index, scope.row, 'open')">
  190. <svg-icon icon-class="power" class="power-icon-off" />
  191. </span>
  192. <span v-else class="txt-cell-blue" title="已开机"
  193. @click="open_close_airs(1, scope.$index, scope.row, 'close')">
  194. <svg-icon icon-class="power" class="power-icon-on" />
  195. </span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="操作" align="center">
  199. <template slot-scope="scope">
  200. <el-button class="btn-cell-blue" size="mini" round
  201. @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[1].room)">
  202. 删除
  203. </el-button>
  204. </template>
  205. </el-table-column>
  206. </el-table>
  207. </div>
  208. <div class="panel-footer" @click="">
  209. <i class="el-icon-circle-plus-outline"></i>
  210. <div class="panel-footer-txt" @click="add_device(currentData.rooms[1].room)">
  211. 添加设备</div>
  212. </div>
  213. </div>
  214. </el-col>
  215. </el-row>
  216. <el-row>
  217. <el-col :span="12">
  218. <div class="panel-left" :style="{display: currentData.rooms[2].room == '' ? 'none' : ''}">
  219. <div class="panel-header">
  220. <div class="panel-title-caption">
  221. <svg-icon icon-class="panel-home" class="panel-title-icon" />
  222. <div class="panel-title">{{currentData.rooms[2].room}}</div>
  223. </div>
  224. <div class="panel-title-btns">
  225. <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
  226. @click="operate_modify_room(currentData.rooms[2].room)">编辑</el-button>
  227. <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
  228. @click="operate_delete_room(currentData.rooms[2].room)">删除
  229. </el-button>
  230. </div>
  231. </div>
  232. <div class="panel-body">
  233. <el-table :data="currentData.rooms[2].tableData" height="170" v-loading="airsLoading[2].loading"
  234. :element-loading-text="airsLoading[2].text" element-loading-spinner="el-icon-loading"
  235. element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle" :header-cell-style="setHeaderSellStyle">
  236. <el-table-column label="名称" align="center" width="140">
  237. <template slot-scope="scope">
  238. <span>{{ scope.row.name }}</span>
  239. </template>
  240. </el-table-column>
  241. <el-table-column label="ID" align="center">
  242. <template slot-scope="scope">
  243. <span>{{ scope.row.ip }}</span>
  244. </template>
  245. </el-table-column>
  246. <el-table-column label="类型" align="center" width="85">
  247. <template slot-scope="scope">
  248. <span>{{ scope.row.device }}</span>
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="使用时长" align="center">
  252. <template slot-scope="scope">
  253. <span>{{ scope.row.userTime }}</span>
  254. </template>
  255. </el-table-column>
  256. <el-table-column label="告警状态" align="center">
  257. <template slot-scope="scope">
  258. <span v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
  259. <span v-else @click="alarm_status_click(scope.$index, scope.row)"
  260. class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
  261. </template>
  262. </el-table-column>
  263. <el-table-column label="开关状态" align="center">
  264. <template slot-scope="scope">
  265. <span v-if="scope.row.onOffStatus == 0" title="已关机"
  266. @click="open_close_airs(2, scope.$index, scope.row, 'open')">
  267. <svg-icon icon-class="power" class="power-icon-off" />
  268. </span>
  269. <span v-else class="txt-cell-blue" title="已开机"
  270. @click="open_close_airs(2, scope.$index, scope.row, 'close')">
  271. <svg-icon icon-class="power" class="power-icon-on" />
  272. </span>
  273. </template>
  274. </el-table-column>
  275. <el-table-column label="操作" align="center">
  276. <template slot-scope="scope">
  277. <el-button class="btn-cell-blue" size="mini" round
  278. @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[2].room)">
  279. 删除
  280. </el-button>
  281. </template>
  282. </el-table-column>
  283. </el-table>
  284. </div>
  285. <div class="panel-footer" @click="">
  286. <i class="el-icon-circle-plus-outline"></i>
  287. <div class="panel-footer-txt" @click="add_device(currentData.rooms[2].room)">
  288. 添加设备</div>
  289. </div>
  290. </div>
  291. </el-col>
  292. <el-col :span="12">
  293. <div class="panel-right" :style="{display: currentData.rooms[3].room == '' ? 'none' : ''}">
  294. <div class="panel-header">
  295. <div class="panel-title-caption">
  296. <svg-icon icon-class="panel-home" class="panel-title-icon" />
  297. <div class="panel-title">{{currentData.rooms[3].room}}</div>
  298. </div>
  299. <div class="panel-title-btns">
  300. <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
  301. @click="operate_modify_room(currentData.rooms[3].room)">编辑</el-button>
  302. <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
  303. @click="operate_delete_room(currentData.rooms[3].room)">删除
  304. </el-button>
  305. </div>
  306. </div>
  307. <div class="panel-body">
  308. <el-table :data="currentData.rooms[3].tableData" height="170" v-loading="airsLoading[3].loading"
  309. :element-loading-text="airsLoading[3].text" element-loading-spinner="el-icon-loading"
  310. element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle" :header-cell-style="setHeaderSellStyle">
  311. <el-table-column label="名称" align="center" width="140">
  312. <template slot-scope="scope">
  313. <span>{{ scope.row.name }}</span>
  314. </template>
  315. </el-table-column>
  316. <el-table-column label="ID" align="center">
  317. <template slot-scope="scope">
  318. <span>{{ scope.row.ip }}</span>
  319. </template>
  320. </el-table-column>
  321. <el-table-column label="类型" align="center" width="85">
  322. <template slot-scope="scope">
  323. <span>{{ scope.row.device }}</span>
  324. </template>
  325. </el-table-column>
  326. <el-table-column label="使用时长" align="center">
  327. <template slot-scope="scope">
  328. <span>{{ scope.row.userTime }}</span>
  329. </template>
  330. </el-table-column>
  331. <el-table-column label="告警状态" align="center">
  332. <template slot-scope="scope">
  333. <span v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
  334. <span v-else @click="alarm_status_click(scope.$index, scope.row)"
  335. class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
  336. </template>
  337. </el-table-column>
  338. <el-table-column label="开关状态" align="center">
  339. <template slot-scope="scope">
  340. <span v-if="scope.row.onOffStatus == 0" title="已关机"
  341. @click="open_close_airs(3, scope.$index, scope.row, 'open')">
  342. <svg-icon icon-class="power" class="power-icon-off" />
  343. </span>
  344. <span v-else class="txt-cell-blue" title="已开机"
  345. @click="open_close_airs(3, scope.$index, scope.row, 'close')">
  346. <svg-icon icon-class="power" class="power-icon-on" />
  347. </span>
  348. </template>
  349. </el-table-column>
  350. <el-table-column label="操作" align="center">
  351. <template slot-scope="scope">
  352. <el-button class="btn-cell-blue" size="mini" round
  353. @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[3].room)">
  354. 删除
  355. </el-button>
  356. </template>
  357. </el-table-column>
  358. </el-table>
  359. </div>
  360. <div class="panel-footer" @click="">
  361. <i class="el-icon-circle-plus-outline"></i>
  362. <div class="panel-footer-txt" @click="add_device(currentData.rooms[3].room)">
  363. 添加设备</div>
  364. </div>
  365. </div>
  366. </el-col>
  367. </el-row>
  368. <div class="pagination-table">
  369. <el-pagination @current-change="currentPageChange" :hide-on-single-page="hideOnSinglePage"
  370. :current-page.sync="pagination.currentPage" :page-size="pagination.pageSize" layout="prev, pager, next, jumper"
  371. :total="pagination.total">
  372. </el-pagination>
  373. </div>
  374. </div>
  375. </div>
  376. </el-col>
  377. </el-row>
  378. <!-- 添加楼栋 -->
  379. <el-dialog title="添加楼栋" custom-class="el-dialog-add-loudong" :visible.sync="dialog_add_loudong" :close-on-click-modal="false"
  380. :close-on-press-escape="false" @close="dialog_close('form_add_loudong')">
  381. <!-- <el-form :model="form_add_loudong" ref="add_loudong_form" :rules="form_add_loudong_rules"> -->
  382. <el-form :model="form_add_loudong" ref="add_loudong_form">
  383. <el-form-item label="校区:" :label-width="formLabelWidth">
  384. <span>{{form_add_loudong.school}}</span>
  385. </el-form-item>
  386. <el-form-item label="楼栋:" :label-width="formLabelWidth" prop="building" :required="true">
  387. <el-input v-model="form_add_loudong.building" autocomplete="off" placeholder="请输入楼栋名称" ref="ref_loudong" maxlength="15"></el-input>
  388. </el-form-item>
  389. </el-form>
  390. <div slot="footer" class="dialog-footer">
  391. <el-button @click="dialog_add_loudong = false">取 消</el-button>
  392. <el-button type="primary" @click="dialog_add_loudong_click">确 定</el-button>
  393. </div>
  394. </el-dialog>
  395. <!-- 添加楼层 -->
  396. <el-dialog title="添加楼层" custom-class="el-dialog-add-louceng" :visible.sync="dialog_add_louceng" :close-on-click-modal="false"
  397. :close-on-press-escape="false" @close="dialog_close('form_add_louceng')">
  398. <el-form :model="form_add_louceng" ref="add_louceng_form" :rules="form_add_louceng_rules">
  399. <el-form-item label="校区:" :label-width="formLabelWidth">
  400. <div>{{form_add_louceng.school}}</div>
  401. </el-form-item>
  402. <el-form-item label="楼栋:" :label-width="formLabelWidth">
  403. <div>{{form_add_louceng.building}}</div>
  404. </el-form-item>
  405. <el-form-item label="楼层:" :label-width="formLabelWidth" prop="floor" :required="true">
  406. <el-input v-model="form_add_louceng.floor" autocomplete="off" placeholder="请输入楼层号" ref="ref_louceng" maxlength="1"
  407. @keydown.enter.native="dialog_add_louceng_click"></el-input>
  408. </el-form-item>
  409. </el-form>
  410. <div slot="footer" class="dialog-footer">
  411. <el-button @click="dialog_add_louceng = false">取 消</el-button>
  412. <el-button type="primary" @click="dialog_add_louceng_click">确 定</el-button>
  413. </div>
  414. </el-dialog>
  415. <!-- 操作员详情 -->
  416. <el-dialog title="操作员详情" custom-class="el-dialog-operator_details" :visible.sync="dialog_operator_details"
  417. @close="dialog_close('form_operator_details')">
  418. <el-form :model="form_operator_details">
  419. <el-form-item label="姓  名:" :label-width="formLabelWidth">
  420. <div>{{form_operator_details.name}}</div>
  421. </el-form-item>
  422. <el-form-item label="联系方式:" :label-width="formLabelWidth">
  423. <div>{{form_operator_details.contact}}</div>
  424. </el-form-item>
  425. </el-form>
  426. </el-dialog>
  427. <!-- 添加房间 -->
  428. <el-dialog title="新增房间" custom-class="el-dialog-add-room" :visible.sync="dialog_add_room" :close-on-click-modal="false" :close-on-press-escape="false"
  429. @close="dialog_close('form_add_room')">
  430. <el-form :model="form_add_room" ref="add_room_form" :rules="form_add_room_rules">
  431. <el-form-item label="校区:" :label-width="formLabelWidth">
  432. <div>{{form_add_room.school}}</div>
  433. </el-form-item>
  434. <el-form-item label="楼栋:" :label-width="formLabelWidth">
  435. <div>{{form_add_room.building}}</div>
  436. </el-form-item>
  437. <el-form-item label="楼层:" :label-width="formLabelWidth">
  438. <div>{{form_add_room.floor}}</div>
  439. </el-form-item>
  440. <el-form-item label="房间:" :label-width="formLabelWidth" :required="true" prop="room">
  441. <el-input v-model="form_add_room.room" autocomplete="off" placeholder="请输入房间名称" ref="ref_add_room" maxlength="10"
  442. @keydown.enter.native="dialog_add_room_click"></el-input>
  443. </el-form-item>
  444. </el-form>
  445. <div slot="footer" class="dialog-footer">
  446. <el-button @click="dialog_add_room = false">取 消</el-button>
  447. <el-button type="primary" @click="dialog_add_room_click">确 定</el-button>
  448. </div>
  449. </el-dialog>
  450. <!-- 添加空调设备 -->
  451. <el-dialog :title="currentData.addDevice + ' 添加设备'" custom-class="el-dialog-add-device" :visible.sync="dialog_add_device" :close-on-click-modal="false"
  452. :close-on-press-escape="false" @close="dialog_close('form_add_device')">
  453. <el-form :model="form_add_device" ref="add_device_form" :rules="form_add_device_rules">
  454. <el-form-item label="当前坐标:" :label-width="formLabelWidth">
  455. <div>{{form_add_device.school + ' / ' + form_add_device.build + ' / ' + form_add_device.floors}}
  456. </div>
  457. </el-form-item>
  458. <el-form-item label="操作员:" :label-width="formLabelWidth" prop="cao">
  459. <el-input v-model="cao" autocomplete="off" placeholder="请输入操作员" ref="ref_cao" readonly="" maxlength="10"></el-input>
  460. </el-form-item>
  461. <el-form-item label="手机号码:" :label-width="formLabelWidth" prop="contact">
  462. <el-input v-model="contact" autocomplete="off" placeholder="请输入手机号码" ref="ref_contact" maxlength="11" readonly=""></el-input>
  463. </el-form-item>
  464. <el-form-item label="设备名称:" :label-width="formLabelWidth" prop="deviceName" :required="true">
  465. <el-input v-model="form_add_device.deviceName" autocomplete="off" placeholder="请输入设备名称" ref="ref_deviceName" maxlength="10"></el-input>
  466. </el-form-item>
  467. <el-form-item label="设备IP/ID:" :label-width="formLabelWidth" prop="deviceIp" :required="true">
  468. <el-input v-model="form_add_device.deviceIp" autocomplete="off" placeholder="请输入设备IP/ID" maxlength="4">
  469. </el-input>
  470. </el-form-item>
  471. <el-form-item label="设备类型:" :label-width="formLabelWidth" prop="checkedDevice" :required="true">
  472. <el-checkbox-group v-model="form_add_device.checkedDevice" :min="0" :max="1" style="width: 380px;">
  473. <el-checkbox v-for="(device, index) in form_add_device.devices" :label="device" :key="index">
  474. {{device}}
  475. </el-checkbox>
  476. </el-checkbox-group>
  477. </el-form-item>
  478. </el-form>
  479. <div slot="footer" class="dialog-footer">
  480. <el-button @click="dialog_add_device = false">取 消</el-button>
  481. <el-button type="primary" @click="dialog_add_air_click">确 定</el-button>
  482. </div>
  483. </el-dialog>
  484. <!-- 编辑房间 -->
  485. <el-dialog title="编辑房间" custom-class="el-dialog-modify-room" :visible.sync="dialog_modify_room" :close-on-click-modal="false"
  486. :close-on-press-escape="false" @close="dialog_close('form_modify_room')">
  487. <el-form :model="form_modify_room" ref="modify_room_form" :rules="form_modify_room_rules">
  488. <el-form-item label="校区:" :label-width="formLabelWidth">
  489. <div>{{form_modify_room.school}}</div>
  490. </el-form-item>
  491. <el-form-item label="楼栋:" :label-width="formLabelWidth">
  492. <div>{{form_modify_room.building}}</div>
  493. </el-form-item>
  494. <el-form-item label="楼层:" :label-width="formLabelWidth">
  495. <div>{{form_modify_room.floor}}</div>
  496. </el-form-item>
  497. <el-form-item label="房间:" :label-width="formLabelWidth" :required="true" prop="room">
  498. <el-input v-model="form_modify_room.room" autocomplete="off" placeholder="请输入房间号" ref="ref_modi_room" maxlength="10"
  499. @keydown.enter.native="dialog_modify_room_click(show_modify_room)"></el-input>
  500. </el-form-item>
  501. </el-form>
  502. <div slot="footer" class="dialog-footer">
  503. <el-button @click="dialog_modify_room = false">取 消</el-button>
  504. <el-button type="primary" @click="dialog_modify_room_click(show_modify_room)">确 定</el-button>
  505. </div>
  506. </el-dialog>
  507. <!-- 删除房间 -->
  508. <el-dialog custom-class="el-dialog-delete-room" :visible.sync="dialog_delete_room" :close-on-click-modal="false" :close-on-press-escape="false"
  509. :show-close="false">
  510. <div slot="" class="del-air-body">
  511. <img src="../../icons/serveAC/del_warning.png" alt="">
  512. <div class="del-air-body-txt">是否确定删除房间【{{ show_delete_room }}】?</div>
  513. </div>
  514. <div slot="footer" class="dialog-footer">
  515. <el-button @click="dialog_delete_room = false"> 否 </el-button>
  516. <el-button type="primary" @click="dialog_delete_rooms_click(show_delete_room)"> 是 </el-button>
  517. </div>
  518. </el-dialog>
  519. <!-- 删除空调 -->
  520. <el-dialog custom-class="el-dialog-delete-air" :visible.sync="dialog_delete_air" :close-on-click-modal="false" :close-on-press-escape="false"
  521. :show-close="false">
  522. <div slot="" class="del-air-body">
  523. <img src="../../icons/serveAC/del_warning.png" alt="">
  524. <div class="del-air-body-txt">是否确定刪除IP/ID为【{{delAir.deleteAirIp}}】的空调?</div>
  525. </div>
  526. <div slot="footer" class="dialog-footer">
  527. <el-button @click="dialog_delete_air = false"> 否 </el-button>
  528. <el-button type="primary" @click="dialog_delete_air_click"> 是 </el-button>
  529. </div>
  530. </el-dialog>
  531. </div>
  532. </template>
  533. <script>
  534. import {
  535. getBuildingData,
  536. addBuild,
  537. addFloors,
  538. addRooms,
  539. addAirs,
  540. getRoomAirs,
  541. deleteAirs,
  542. getRoomsAndAirs,
  543. getOpeningAndAbnomal,
  544. updateRooms,
  545. delRooms,
  546. startAirs,
  547. stopAirs,
  548. selAirsStatus,
  549. getDevices
  550. } from '@/api/serveAC';
  551. export default {
  552. data() {
  553. // var checkloudong = (rule, value, callback) => {
  554. // if (!value) {
  555. // return callback(new Error('请输入楼栋名称'));
  556. // }
  557. // setTimeout(() => {
  558. // var reg = /^[a-zA-Z0-9_\u4e00-\u9fa5]{2,10}$/
  559. // if (!reg.test(value)) {
  560. // callback(new Error('必须为2-10个汉字、数字、字母或下划线!'));
  561. // } else {
  562. // callback();
  563. // }
  564. // }, 100);
  565. // }
  566. var checklouceng = (rule, value, callback) => {
  567. if (!value) {
  568. return callback(new Error('请输入数字楼层号'));
  569. }
  570. setTimeout(() => {
  571. var reg = /^[1-9]{1}$/
  572. if (!reg.test(value)) {
  573. callback(new Error('楼层只能输入 1 到 9 的数字'));
  574. } else {
  575. callback();
  576. }
  577. }, 100);
  578. };
  579. var checkroom = (rule, value, callback) => {
  580. if (!value) {
  581. return callback(new Error('请输入房间号'));
  582. }
  583. setTimeout(() => {
  584. callback();
  585. }, 100);
  586. // setTimeout(() => {
  587. // var regH = /[\d]$/g;
  588. // var floor = this.currentData.floor.replace(regH, '');
  589. // var reg = /[1-9]{1}[0-9]{2,3}$/
  590. // if (value.indexOf(floor)) {
  591. // callback(new Error('房间号数字部分,必须以楼层号开头!'));
  592. // } else if (!reg.test(value)) {
  593. // callback(new Error('房间号数字部分,为3-4个数字,非0开头!栋号不需要添加!'));
  594. // } else {
  595. // callback();
  596. // }
  597. // }, 100);
  598. };
  599. // var checkCao = (rule, value, callback) => {
  600. // if (!value) {
  601. // return callback(new Error('请输入操作员'));
  602. // };
  603. // setTimeout(() => {
  604. // var reg = /^[\u4e00-\u9fa5]{2,10}$/
  605. // if (!reg.test(value)) {
  606. // callback(new Error('必须为2-10个汉字!'));
  607. // } else {
  608. // callback();
  609. // }
  610. // }, 100);
  611. // };
  612. // var checkcontact = (rule, value, callback) => {
  613. // if (!value) {
  614. // return callback(new Error('请输入手机号码'));
  615. // };
  616. // setTimeout(() => {
  617. // var reg =
  618. // /^((13[0-9])|(14[0|5|6|7|9])|(15[0-3])|(15[5-9])|(16[6|7])|(17[2|3|5|6|7|8])|(18[0-9])|(19[1|8|9]))\d{8}$/
  619. // if (!reg.test(value)) {
  620. // callback(new Error('手机号码输入不规范!'));
  621. // } else {
  622. // callback();
  623. // }
  624. // }, 100);
  625. // };
  626. var checkDeviceName = (rule, value, callback) => {
  627. if (!value) {
  628. return callback(new Error('请输入设备名称'));
  629. }
  630. setTimeout(() => {
  631. var reg = /^[a-zA-Z0-9_\u4e00-\u9fa5]{2,10}$/
  632. if (!reg.test(value)) {
  633. callback(new Error('必须为2-10个汉字、数字、字母或下划线!'));
  634. } else {
  635. callback();
  636. }
  637. }, 100);
  638. };
  639. var checkDeviceIp = (rule, value, callback) => {
  640. if (!value) {
  641. return callback(new Error('请输入设备IP/ID'));
  642. }
  643. setTimeout(() => {
  644. var reg = /^[0-9]{4}$/
  645. if (!reg.test(value)) {
  646. callback(new Error('必须为4位数字!'));
  647. } else {
  648. callback();
  649. }
  650. }, 100);
  651. };
  652. var checkCheckedDevice = (rule, value, callback) => {
  653. if (!value[0]) {
  654. return callback(new Error('请选择设备类型'));
  655. } else {
  656. callback();
  657. }
  658. };
  659. return {
  660. hideOnSinglePage: true, // 只有一页时是否隐藏
  661. cao: this.$store.state.user.user_name, // 操作员
  662. contact: this.$store.state.user.phone,
  663. room_number: 0, // 房间数量
  664. device_number: 0, // 设备数量
  665. offline_device_number: 0, // 离线数量
  666. shutdown_device_number: 0, // 关机数量
  667. open_number: 0, // 已开启
  668. warning_number: 0, // 预警台数
  669. search_datatime: '',
  670. // 添加楼栋
  671. dialog_add_loudong: false, // 显示 或 隐藏 添加楼栋对话框
  672. form_add_loudong: { // 添加楼栋数据
  673. school: '',
  674. building: ''
  675. },
  676. // form_add_loudong_rules: { // 添加楼栋表单验证
  677. // building: [{
  678. // validator: checkloudong
  679. // }]
  680. // },
  681. // 添加楼层
  682. dialog_add_louceng: false,
  683. form_add_louceng: { // 添加楼层数据
  684. school: '',
  685. building: '',
  686. floor: ''
  687. },
  688. form_add_louceng_rules: { // 添加楼层表单验证
  689. floor: [{
  690. validator: checklouceng
  691. }]
  692. },
  693. // 新增房间
  694. dialog_add_room: false,
  695. form_add_room: { // 新增房间数据
  696. school: '',
  697. building: '',
  698. floor: '',
  699. room: ''
  700. },
  701. form_add_room_rules: { // 添加房间表单验证
  702. room: [{
  703. validator: checkroom
  704. }]
  705. },
  706. // 修改房间
  707. dialog_modify_room: false,
  708. form_modify_room: { // 修改房间数据
  709. school: '',
  710. building: '',
  711. floor: '',
  712. room: ''
  713. },
  714. form_modify_room_rules: { // 修改房间表单验证
  715. room: [{
  716. validator: checkroom
  717. }]
  718. },
  719. // 添加设备
  720. dialog_add_device: false,
  721. form_add_device: { // 添加设备数据
  722. school: '',
  723. build: '',
  724. floors: '',
  725. room: '',
  726. deviceName: '',
  727. deviceIp: '',
  728. checkedDevice: [],
  729. devices: [],
  730. duration_use: 0.00, // 使用时长
  731. is_normal: '1', // 是否正常
  732. is_on: '0' // 是否开启
  733. },
  734. form_add_device_rules: {
  735. deviceName: [{
  736. validator: checkDeviceName
  737. }],
  738. deviceIp: [{
  739. validator: checkDeviceIp
  740. }],
  741. checkedDevice: [{
  742. validator: checkCheckedDevice
  743. }],
  744. // cao: [{
  745. // validator: checkCao
  746. // }],
  747. // contact: [{
  748. // validator: checkcontact
  749. // }]
  750. },
  751. dialog_operator_details: false, // 操作员详情
  752. form_operator_details: { // 操作员详情数据
  753. name: '',
  754. contact: ''
  755. },
  756. dialog_delete_room: false, // 删除房间
  757. show_delete_room: '', // 记录需要删除的房间
  758. dialog_delete_air: false, // 删除空调
  759. show_modify_room: '', // 记录需要修改的房间
  760. btnActive: 'all',
  761. louceng_click_id: '',
  762. // 左侧导航数据:校区,楼栋,楼层
  763. navData: [],
  764. form: {
  765. status: '',
  766. name: '',
  767. building: '',
  768. floor: '',
  769. room: '',
  770. device: ''
  771. },
  772. formLabelWidth: '120px',
  773. // 保存当前页数据
  774. currentData: {
  775. school: '',
  776. building: '',
  777. floor: '',
  778. allRooms: [],
  779. rooms: [{
  780. room: '',
  781. tableData: []
  782. }, {
  783. room: '',
  784. tableData: []
  785. }, {
  786. room: '',
  787. tableData: []
  788. }, {
  789. room: '',
  790. tableData: []
  791. }],
  792. addDevice: '',
  793. title_any_where: '',
  794. clickElement: ''
  795. },
  796. // 分页参数
  797. pagination: {
  798. pageSize: 4,
  799. currentPage: 1,
  800. total: 0
  801. },
  802. delAir: {
  803. deleteAirIp: '',
  804. room: ''
  805. },
  806. navLoading: false, // 加载
  807. listLoading: false,
  808. airsLoading: [{
  809. loading: false,
  810. text: ''
  811. }, {
  812. loading: false,
  813. text: ''
  814. }, {
  815. loading: false,
  816. text: ''
  817. }, {
  818. loading: false,
  819. text: ''
  820. }],
  821. deviceOptions: []
  822. }
  823. },
  824. created() {
  825. // 获取表格数据
  826. this.get_loudong_data()
  827. // 默认选中第一个房间
  828. let auto_click = setInterval(() => {
  829. let louchen_first = document.getElementById("louceng000");
  830. if (louchen_first !== null) {
  831. louchen_first.click();
  832. clearInterval(auto_click);
  833. }
  834. }, 200);
  835. // 空调设备类型
  836. this.get_Devices();
  837. },
  838. mounted() {
  839. var obj = document.getElementsByClassName("el-pagination__jump")[0];
  840. if (typeof obj == 'undefined') {
  841. return;
  842. } else {
  843. obj[0].childNodes[0].nodeValue = "跳至";
  844. }
  845. },
  846. methods: {
  847. /**
  848. * 获取所有的空调列表
  849. */
  850. get_Devices() {
  851. var _this = this;
  852. // 开始发送请求,获取配置数据
  853. getDevices().then((res) => {
  854. // console.log(res.data);
  855. if (res.code == 200) {
  856. let resdata = res.data;
  857. _this.deviceOptions = [];
  858. for (var i = 0; i < resdata.length; i++) {
  859. _this.deviceOptions.push(resdata[i].air_config);
  860. }
  861. _this.deviceOptions.sort((a, b) => a - b);
  862. this.form_add_device.devices = _this.deviceOptions;
  863. } else {
  864. _this.deviceOptions = [];
  865. this.$message.warning('没有符合条件的数据!');
  866. }
  867. }).catch((err) => {
  868. // console.log(err);
  869. this.$message.error(err.message);
  870. });
  871. },
  872. /**
  873. * 开关空调
  874. * @param {Object} roomIndex
  875. * @param {Object} rowIndex
  876. */
  877. open_close_airs(roomIndex, rowIndex, row, open_close) {
  878. // console.log(roomIndex, rowIndex, row, open_close);
  879. // console.log(this.currentData.rooms[roomIndex].tableData[rowIndex]);
  880. // console.log(row);
  881. let air_ip = this.currentData.rooms[roomIndex].tableData[rowIndex].ip;
  882. if (open_close == 'open') {
  883. this.$set(this.airsLoading[roomIndex], 'loading', true);
  884. this.$set(this.airsLoading[roomIndex], 'text', row.name + ' ' + row.device + ' 正在【开机】中...');
  885. let user = this.$store.state.user;
  886. startAirs({
  887. admin_name: user.name,
  888. password: user.pwd,
  889. air_ip: air_ip
  890. }).then((res) => {
  891. // console.log(res);
  892. if (typeof res.code == 'undefined' || res.code == '') {
  893. this.$message.error('返回数据格式问题,code未获取到!')
  894. return
  895. }
  896. if (res.code == 200) {
  897. this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex], 'onOffStatus',
  898. res.is_on)
  899. if (res.is_normal == 1) {
  900. this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
  901. 'alarmStatus', '正常')
  902. } else {
  903. this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
  904. 'alarmStatus', '离线')
  905. }
  906. // let _this = this;
  907. // setTimeout(() => {
  908. // _this.getAirsStatus(roomIndex, rowIndex, air_ip)
  909. // }, 4000)
  910. } else {
  911. this.$message.error(res.message)
  912. }
  913. this.$set(this.airsLoading[roomIndex], 'loading', false);
  914. // 刷新顶部数据
  915. this.flush_top_data();
  916. }).catch((err) => {
  917. // console.log(err);
  918. // this.$message.error(err.message)
  919. this.$set(this.airsLoading[roomIndex], 'loading', false);
  920. // 刷新顶部数据
  921. this.flush_top_data();
  922. })
  923. } else if (open_close == 'close') {
  924. this.$set(this.airsLoading[roomIndex], 'loading', true);
  925. this.$set(this.airsLoading[roomIndex], 'text', row.name + ' ' + row.device + ' 正在【关机】中...');
  926. stopAirs({
  927. air_ip: air_ip
  928. }).then((res) => {
  929. // console.log(res);
  930. if (typeof res.code == 'undefined' || res.code == '') {
  931. this.$message.error('返回数据格式问题,code未获取到!')
  932. return
  933. }
  934. if (res.code == 200) {
  935. this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex], 'onOffStatus',
  936. res.is_on)
  937. if (res.is_normal == 1) {
  938. this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
  939. 'alarmStatus', '正常')
  940. } else {
  941. this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
  942. 'alarmStatus', '离线')
  943. }
  944. // let _this = this;
  945. // setTimeout(() => {
  946. // _this.getAirsStatus(roomIndex, rowIndex, air_ip)
  947. // }, 4000)
  948. } else {
  949. this.$message.error(res.message)
  950. }
  951. this.$set(this.airsLoading[roomIndex], 'loading', false);
  952. // 刷新顶部数据
  953. this.flush_top_data();
  954. }).catch((err) => {
  955. // console.log(err);
  956. // this.$message.error(err.message)
  957. this.$set(this.airsLoading[roomIndex], 'loading', false);
  958. // 刷新顶部数据
  959. this.flush_top_data();
  960. })
  961. }
  962. },
  963. /**
  964. * 获取空调状态
  965. * @param {Object} roomIndex
  966. * @param {Object} rowIndex
  967. * @param {Object} air_ip
  968. */
  969. getAirsStatus(roomIndex, rowIndex, air_ip) {
  970. // console.log(roomIndex, rowIndex);
  971. selAirsStatus({
  972. air_ip: air_ip
  973. }).then((res) => {
  974. console.log(res);
  975. if (typeof res.code == 'undefined' || res.code == '') {
  976. this.$message.error('返回数据格式问题,code未获取到!')
  977. return
  978. }
  979. if (res.code == 200) {
  980. this.currentData.rooms[roomIndex].tableData[rowIndex].onOffStatus == res.is_on
  981. this.currentData.rooms[roomIndex].tableData[rowIndex].alarmStatus == res.is_normal
  982. } else {
  983. this.$message.error(res.message)
  984. }
  985. }).catch((err) => {
  986. // console.log(err);
  987. this.$message.error(err.message)
  988. })
  989. },
  990. /**
  991. * 编辑修改房间
  992. */
  993. dialog_modify_room_click(room) {
  994. this.$refs["modify_room_form"].validate(validate => {
  995. if (validate) {
  996. updateRooms({
  997. school: this.form_modify_room.school,
  998. build: this.form_modify_room.building,
  999. floors: this.form_modify_room.floor,
  1000. dom: this.form_modify_room.room,
  1001. old_dom: room
  1002. }).then((res) => {
  1003. // console.log(res);
  1004. if (typeof res.code == 'undefined' || res.code == '') {
  1005. this.$message.error('返回数据格式问题,code未获取到!')
  1006. return
  1007. }
  1008. if (res.code == 200) {
  1009. // 隐藏删除对话框
  1010. this.dialog_modify_room = false
  1011. // 更新本地变量中的房间
  1012. let tmp = this.navData
  1013. for (var i = 0; i < tmp.length; i++) {
  1014. if (tmp[i].label == this.form_modify_room.school && typeof tmp[i]
  1015. .children !==
  1016. 'undefined' && tmp[i].children.length > 0) {
  1017. let tmp1 = tmp[i].children;
  1018. for (var j = 0; j < tmp1.length; j++) {
  1019. if (tmp1[j].label == this.form_modify_room.building &&
  1020. typeof tmp1[j]
  1021. .children !== 'undefined' && tmp1[j].children.length > 0) {
  1022. let tmp2 = tmp1[j].children;
  1023. for (var k = 0; k < tmp2.length; k++) {
  1024. if (tmp2[k].label == this.form_modify_room.floor &&
  1025. typeof tmp2[k]
  1026. .rooms !== 'undefined' && tmp2[k].rooms.length > 0
  1027. ) {
  1028. let tmp3 = tmp2[k].rooms;
  1029. for (var p = 0; p < tmp3.length; p++) {
  1030. if (tmp3[p] == room) {
  1031. this.navData[i].children[j].children[k]
  1032. .rooms[p] =
  1033. this
  1034. .form_modify_room.building + '-' + this
  1035. .form_modify_room.room;
  1036. }
  1037. }
  1038. this.navData[i].children[j].children[k].rooms
  1039. .sort();
  1040. }
  1041. }
  1042. }
  1043. }
  1044. }
  1045. }
  1046. // 自动点击
  1047. this.currentData.clickElement.click()
  1048. } else {
  1049. this.$message.error(res.message)
  1050. }
  1051. }).catch((err) => {
  1052. // console.log(err);
  1053. this.$message.error(err.message)
  1054. })
  1055. } else {
  1056. this.$message.error('验证不通过')
  1057. return false
  1058. }
  1059. });
  1060. },
  1061. /**
  1062. * 删除房间
  1063. * @param {Object} room
  1064. */
  1065. dialog_delete_rooms_click(room) {
  1066. let data = this.currentData.title_any_where.split('-')
  1067. delRooms({
  1068. school: data[0],
  1069. build: data[1],
  1070. floors: data[2],
  1071. dom: room
  1072. }).then((res) => {
  1073. // console.log(res);
  1074. if (typeof res.code == 'undefined' || res.code == '') {
  1075. this.$message.error('返回数据格式问题,code未获取到!')
  1076. return
  1077. }
  1078. if (res.code == 200) {
  1079. // 隐藏删除对话框
  1080. this.dialog_delete_room = false
  1081. // 更新本地变量中的房间
  1082. let tmp = this.navData
  1083. for (var i = 0; i < tmp.length; i++) {
  1084. if (tmp[i].label == data[0] && typeof tmp[i].children !== 'undefined' && tmp[i]
  1085. .children.length > 0) {
  1086. let tmp1 = tmp[i].children
  1087. for (var j = 0; j < tmp1.length; j++) {
  1088. if (tmp1[j].label == data[1] && typeof tmp1[j].children !==
  1089. 'undefined' && tmp1[j].children.length > 0) {
  1090. let tmp2 = tmp1[j].children
  1091. for (var k = 0; k < tmp2.length; k++) {
  1092. if (tmp2[k].label == data[2] && typeof tmp2[k].rooms !==
  1093. 'undefined' && tmp2[k].rooms.length > 0) {
  1094. let tmp3 = tmp2[k].rooms
  1095. for (var p = 0; p < tmp3.length; p++) {
  1096. if (tmp3[p] == room) {
  1097. this.navData[i].children[j].children[k].rooms
  1098. .splice(p, 1)
  1099. }
  1100. }
  1101. this.navData[i].children[j].children[k].rooms.sort()
  1102. }
  1103. }
  1104. }
  1105. }
  1106. }
  1107. }
  1108. // 自动点击
  1109. this.currentData.clickElement.click()
  1110. } else {
  1111. this.$message.error(res.message)
  1112. }
  1113. }).catch((err) => {
  1114. // console.log(err);
  1115. this.$message.error(err.message)
  1116. })
  1117. },
  1118. /**
  1119. * 获取楼栋信息
  1120. */
  1121. get_loudong_data() {
  1122. this.navLoading = true;
  1123. getBuildingData().then((res) => {
  1124. // console.log(res);
  1125. if (typeof res.code == 'undefined' || res.code == '') {
  1126. this.$message.error('返回数据格式问题,code未获取到!');
  1127. return;
  1128. }
  1129. // console.log(res.data);
  1130. if (typeof res.data == 'undefined' || res.data == '') {
  1131. this.$message.error('返回数据格式问题,data未获取到!');
  1132. return;
  1133. }
  1134. // 校区
  1135. let school = JSON.parse(res.data);
  1136. // console.log('school', school);
  1137. if (school.length > 0) {
  1138. this.navData = []
  1139. let tmpSchool = []
  1140. for (var i = 0; i < school.length; i++) {
  1141. let nData = []
  1142. let builds = school[i].builds
  1143. for (var j = 0; j < builds.length; j++) {
  1144. let tmpBuilds = {}
  1145. let tmpFloors = []
  1146. let floors = builds[j]['floors']
  1147. for (var k = 0; k < floors.length; k++) {
  1148. let floor = {
  1149. id: floors[k].id,
  1150. label: floors[k].floor,
  1151. rooms: floors[k].rooms
  1152. }
  1153. // 房间排序
  1154. floor.rooms.sort();
  1155. tmpFloors.push(floor);
  1156. }
  1157. // 楼层排序
  1158. tmpFloors.sort((a, b) => {
  1159. return (a.label - b.label)
  1160. })
  1161. tmpBuilds.id = builds[j].id
  1162. tmpBuilds.label = builds[j].building
  1163. tmpBuilds.isShow = true
  1164. tmpBuilds.children = []
  1165. tmpBuilds.children = tmpFloors
  1166. nData.push(tmpBuilds)
  1167. }
  1168. // 楼栋排序
  1169. nData.sort((a, b) => a.label.localeCompare(b.label))
  1170. tmpSchool.push({
  1171. id: school[i].id,
  1172. label: school[i].school,
  1173. isShow: true,
  1174. children: nData
  1175. })
  1176. }
  1177. // 校区排序
  1178. tmpSchool.sort((a, b) => b.label.localeCompare(a.label))
  1179. this.navData = tmpSchool
  1180. // console.log(JSON.stringify(this.navData));
  1181. } else {
  1182. this.navData = []
  1183. this.$message.warning('没有符合条件的数据!')
  1184. }
  1185. }).catch((err) => {
  1186. // console.log(err);
  1187. this.$message.error(err.message)
  1188. });
  1189. this.navLoading = false;
  1190. },
  1191. /**
  1192. * 获取房间数据
  1193. * @param {Object} school
  1194. * @param {Object} build
  1195. * @param {Object} floors
  1196. * @param {Object} room
  1197. * @param {Object} index
  1198. */
  1199. get_room_airs_data(school, build, floors, room, index) {
  1200. // console.log(school, build, floors, room, index);
  1201. let param = {
  1202. school: school,
  1203. build: build,
  1204. floors: floors,
  1205. dom: room
  1206. }
  1207. getRoomAirs(param).then((res) => {
  1208. // console.log(res);
  1209. if (typeof res.code == 'undefined' || res.code == '') {
  1210. this.$message.error('返回数据格式问题,code未获取到!')
  1211. return
  1212. }
  1213. if (res.code == 200) {
  1214. let data = res.data
  1215. // 有设备数据
  1216. if (typeof data !== 'undefined' && data !== '') {
  1217. let tmpTableData = []
  1218. for (var i = 0; i < data.length; i++) {
  1219. let room = {}
  1220. let param = this.btnActive
  1221. if (param == 'all') { // 全部
  1222. room = {
  1223. name: data[i].air_name, // 名称
  1224. ip: data[i].air_ip, // 空调ip或id
  1225. building: data[i].build, // 楼栋
  1226. device: data[i].air_config, // 空调配置
  1227. userTime: data[i].duration_use, // 使用时长
  1228. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1229. onOffStatus: data[i].is_on, // 是否开启
  1230. userName: data[i].cao, // 操作员
  1231. contact: '待接口返回,待优化' // 联系方式
  1232. };
  1233. } else if (param == 'powerOn' && data[i].is_on == '1') { // 开机
  1234. room = {
  1235. name: data[i].air_name, // 名称
  1236. ip: data[i].air_ip, // 空调ip或id
  1237. building: data[i].build, // 楼栋
  1238. device: data[i].air_config, // 空调配置
  1239. userTime: data[i].duration_use, // 使用时长
  1240. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1241. onOffStatus: data[i].is_on, // 是否开启
  1242. userName: data[i].cao, // 操作员
  1243. contact: '待接口返回,待优化' // 联系方式
  1244. };
  1245. } else if (param == 'powerOff' && data[i].is_on == '0') { // 关机
  1246. room = {
  1247. name: data[i].air_name, // 名称
  1248. ip: data[i].air_ip, // 空调ip或id
  1249. building: data[i].build, // 楼栋
  1250. device: data[i].air_config, // 空调配置
  1251. userTime: data[i].duration_use, // 使用时长
  1252. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1253. onOffStatus: data[i].is_on, // 是否开启
  1254. userName: data[i].cao, // 操作员
  1255. contact: '待接口返回,待优化' // 联系方式
  1256. };
  1257. } else if (param == 'abnormal' && data[i].is_normal == '0') { // 离线
  1258. room = {
  1259. name: data[i].air_name, // 名称
  1260. ip: data[i].air_ip, // 空调ip或id
  1261. building: data[i].build, // 楼栋
  1262. device: data[i].air_config, // 空调配置
  1263. userTime: data[i].duration_use, // 使用时长
  1264. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1265. onOffStatus: data[i].is_on, // 是否开启
  1266. userName: data[i].cao, // 操作员
  1267. contact: '待接口返回,待优化' // 联系方式
  1268. };
  1269. }
  1270. if (JSON.stringify(room) !== '{}') {
  1271. // 每个房间的设备循环添加
  1272. tmpTableData.push(room)
  1273. }
  1274. }
  1275. if (tmpTableData.length > 0) {
  1276. tmpTableData.sort((a, b) => a.ip.localeCompare(b.ip))
  1277. this.currentData.rooms[index].tableData = tmpTableData
  1278. }
  1279. } else {
  1280. // this.$message.warning(room + ' 没有设备的数据!')
  1281. }
  1282. this.currentData.rooms[index].room = room
  1283. } else {
  1284. this.$message.error('异常!请检查数据!')
  1285. }
  1286. }).catch((err) => {
  1287. // console.log(err);
  1288. this.$message.error(err.message)
  1289. })
  1290. },
  1291. /**
  1292. * 选项的展开与收起,进行切换,递归调用
  1293. * @param {Object} obj
  1294. * @param {Object} id
  1295. */
  1296. toggle_item(obj, id) {
  1297. for (var i = 0; i < obj.length; i++) {
  1298. if (obj[i].id == id) {
  1299. if (obj[i].isShow) {
  1300. obj[i].isShow = false
  1301. } else {
  1302. obj[i].isShow = true
  1303. }
  1304. return
  1305. }
  1306. if (typeof obj[i].children != 'undefined' && obj[i].children.length > 0) {
  1307. this.toggle_item(obj[i].children, id)
  1308. }
  1309. }
  1310. },
  1311. /**
  1312. * 选项的展开与收起,进行切换
  1313. * @param {Object} e
  1314. */
  1315. school_toggle(id, label) {
  1316. // console.log(id);
  1317. // console.log(label);
  1318. // 获取id
  1319. this.toggle_item(this.navData, id)
  1320. },
  1321. /**
  1322. * 单击楼栋
  1323. * @param {Object} e
  1324. */
  1325. loudong_toggle(id, label) {
  1326. this.pagination.pageSize = 4;
  1327. this.pagination.currentPage = 1;
  1328. this.pagination.total = 0;
  1329. let ids = id.split('|')
  1330. let labels = label.split('|')
  1331. // console.log(ids);
  1332. // console.log(labels);
  1333. // 获取id
  1334. this.toggle_item(this.navData, ids[0])
  1335. },
  1336. /**
  1337. * 单击楼层
  1338. * @param {Object} e
  1339. * @param {Object} id
  1340. * @param {Object} label
  1341. * @param {Object} rooms
  1342. */
  1343. louceng_click(e, id, label, rooms) {
  1344. // console.log(e, id, label, rooms);
  1345. this.listLoading = true;
  1346. let ids = id.split('|');
  1347. let labels = label.split('|');
  1348. // console.log(ids);
  1349. // console.log(labels);
  1350. // console.log(rooms);
  1351. // 清空当前页面活动数据
  1352. this.currentData = {
  1353. school: '',
  1354. building: '',
  1355. floor: '',
  1356. allRooms: [],
  1357. rooms: [{
  1358. room: '',
  1359. tableData: []
  1360. }, {
  1361. room: '',
  1362. tableData: []
  1363. }, {
  1364. room: '',
  1365. tableData: []
  1366. }, {
  1367. room: '',
  1368. tableData: []
  1369. }],
  1370. addDevice: '',
  1371. title_any_where: '',
  1372. clickElement: e.target
  1373. };
  1374. // 分页每次单价楼层时,都要初始化
  1375. this.pagination = {
  1376. pageSize: 4,
  1377. currentPage: 1,
  1378. total: 0
  1379. };
  1380. this.offline_device_number = 0; // 离线数量初始化
  1381. this.shutdown_device_number = 0; // 关机数量初始化
  1382. // 点击的楼层id
  1383. this.louceng_click_id = ids[0];
  1384. // 填充数据
  1385. this.currentData.school = labels[2];
  1386. this.currentData.building = labels[1];
  1387. this.currentData.floor = labels[0];
  1388. // 给右侧窗口标题赋值
  1389. this.currentData.title_any_where = this.currentData.school + '-' + this.currentData
  1390. .building + '-' + this.currentData.floor;
  1391. // 获取开机、关机、异常的房间,空的不显示
  1392. this.open_close_abnormal(this.currentData.school, this.currentData.building, this.currentData.floor,
  1393. rooms);
  1394. // 刷新顶部数据
  1395. this.flush_top_data();
  1396. // 延迟取消加载loading
  1397. setTimeout(() => {
  1398. this.listLoading = false;
  1399. }, 500);
  1400. },
  1401. /**
  1402. * 刷新顶部数据
  1403. */
  1404. flush_top_data() {
  1405. // 某层房间、空调数
  1406. this.getRoomsAndAirs(this.currentData.school, this.currentData.building, this.currentData.floor);
  1407. // 某层空调开启和异常统计
  1408. this.getOpeningAndAbnomal(this.currentData.school, this.currentData.building, this.currentData.floor);
  1409. },
  1410. /**
  1411. * 获取开机、关机、异常房间数
  1412. * @param {Object} school
  1413. * @param {Object} build
  1414. * @param {Object} floors
  1415. * @param {Object} rooms
  1416. */
  1417. open_close_abnormal(school, build, floors, rooms) {
  1418. // console.log(school, build, floors, rooms);
  1419. let _this = this,
  1420. len = rooms.length;
  1421. for (var i = 0; i < len; i++) {
  1422. // 延时执行
  1423. (function(t, school, build, floors, room, len) { // 注意这里是形参
  1424. setTimeout(function() {
  1425. _this.get_rooms(t, school, build, floors, room, len)
  1426. }, 50 * t); // 还是0.05执行一次,不是累加的
  1427. })(i, school, build, floors, rooms[i], len - 1); // 注意这里是实参,这里把要用的参数传进去
  1428. }
  1429. },
  1430. /**
  1431. * 获取房间数量
  1432. * @param {Object} school
  1433. * @param {Object} build
  1434. * @param {Object} floors
  1435. * @param {Object} room
  1436. */
  1437. get_rooms(index, school, build, floors, room, len) {
  1438. // console.log(index, school, build, floors, room, len);
  1439. if (this.btnActive == 'all') {
  1440. this.currentData.allRooms.push(room);
  1441. if (index == len) {
  1442. // console.log(this.currentData);
  1443. this.pagination_showData()
  1444. }
  1445. } else {
  1446. let param = {
  1447. school: school,
  1448. build: build,
  1449. floors: floors,
  1450. dom: room
  1451. }
  1452. getRoomAirs(param).then((res) => {
  1453. // console.log(res);
  1454. if (typeof res.code == 'undefined' || res.code == '') {
  1455. // this.$message.error('返回数据格式问题,code未获取到!')
  1456. return
  1457. }
  1458. if (res.code == 200) {
  1459. let data = res.data
  1460. // 有设备数据
  1461. if (typeof data !== 'undefined' && data !== '') {
  1462. let tmpTableData = []
  1463. for (var i = 0; i < data.length; i++) {
  1464. let room = {}
  1465. let param = this.btnActive
  1466. if (param == 'all') {
  1467. room = {
  1468. name: data[i].air_name, // 名称
  1469. ip: data[i].air_ip, // 空调ip或id
  1470. building: data[i].build, // 楼栋
  1471. device: data[i].air_config, // 空调配置
  1472. userTime: data[i].duration_use, // 使用时长
  1473. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1474. onOffStatus: data[i].is_on, // 是否开启
  1475. userName: data[i].cao, // 操作员
  1476. contact: '待接口返回,待优化' // 联系方式
  1477. }
  1478. } else if (param == 'powerOn' && data[i].is_on == '1') {
  1479. room = {
  1480. name: data[i].air_name, // 名称
  1481. ip: data[i].air_ip, // 空调ip或id
  1482. building: data[i].build, // 楼栋
  1483. device: data[i].air_config, // 空调配置
  1484. userTime: data[i].duration_use, // 使用时长
  1485. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1486. onOffStatus: data[i].is_on, // 是否开启
  1487. userName: data[i].cao, // 操作员
  1488. contact: '待接口返回,待优化' // 联系方式
  1489. }
  1490. } else if (param == 'powerOff' && data[i].is_on == '0') {
  1491. room = {
  1492. name: data[i].air_name, // 名称
  1493. ip: data[i].air_ip, // 空调ip或id
  1494. building: data[i].build, // 楼栋
  1495. device: data[i].air_config, // 空调配置
  1496. userTime: data[i].duration_use, // 使用时长
  1497. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1498. onOffStatus: data[i].is_on, // 是否开启
  1499. userName: data[i].cao, // 操作员
  1500. contact: '待接口返回,待优化' // 联系方式
  1501. }
  1502. } else if (param == 'abnormal' && data[i].is_normal == '0') {
  1503. room = {
  1504. name: data[i].air_name, // 名称
  1505. ip: data[i].air_ip, // 空调ip或id
  1506. building: data[i].build, // 楼栋
  1507. device: data[i].air_config, // 空调配置
  1508. userTime: data[i].duration_use, // 使用时长
  1509. alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
  1510. onOffStatus: data[i].is_on, // 是否开启
  1511. userName: data[i].cao, // 操作员
  1512. contact: '待接口返回,待优化' // 联系方式
  1513. }
  1514. }
  1515. if (JSON.stringify(room) !== '{}') {
  1516. // 每个房间的设备循环添加
  1517. tmpTableData.push(room)
  1518. }
  1519. }
  1520. if (tmpTableData.length > 0) {
  1521. this.currentData.allRooms.push(room)
  1522. }
  1523. } else {
  1524. // this.$message.warning(room + ' 没有设备的数据!')
  1525. }
  1526. } else {
  1527. this.$message.error('异常!请检查数据!')
  1528. }
  1529. if (index == len) {
  1530. // console.log(this.currentData);
  1531. this.pagination_showData()
  1532. }
  1533. }).catch((err) => {
  1534. // console.log(err);
  1535. this.$message.error(err.message)
  1536. });
  1537. }
  1538. },
  1539. /**
  1540. * 分页显示数据
  1541. */
  1542. pagination_showData() {
  1543. // 赋值分页数据
  1544. this.pagination.total = this.currentData.allRooms.length;
  1545. // 最后一页删除后已经空了,则显示前一页或第1页
  1546. let size = Math.ceil(this.pagination.total / 4);
  1547. if (size != 0 && this.pagination.currentPage > size) {
  1548. this.pagination.currentPage = size;
  1549. }
  1550. // 进行分页处理
  1551. this.roomDataPagination(this.pagination.currentPage, this.pagination.pageSize, this
  1552. .currentData.allRooms, this.currentData.school, this.currentData.building, this
  1553. .currentData.floor);
  1554. },
  1555. /**
  1556. * 某层空调开启和异常统计
  1557. * @param {Object} school
  1558. * @param {Object} build
  1559. * @param {Object} floors
  1560. */
  1561. getOpeningAndAbnomal(school, build, floors) {
  1562. getOpeningAndAbnomal({
  1563. school,
  1564. build,
  1565. floors
  1566. }).then((res) => {
  1567. // console.log(res);
  1568. if (typeof res.code == 'undefined' || res.code == '') {
  1569. this.$message.error('返回数据格式问题,code未获取到!');
  1570. return;
  1571. }
  1572. if (res.code == 200) {
  1573. // 填充数据
  1574. this.open_number = res.onNum; // 已开启
  1575. this.warning_number = res.stateNum; // 预警台数
  1576. this.offline_device_number = res.offlineNum // 离线数量
  1577. this.shutdown_device_number = res.shutDownNum // 关机数量
  1578. } else {
  1579. this.open_number = 0;
  1580. this.warning_number = 0;
  1581. this.offline_device_number = 0;
  1582. this.shutdown_device_number = 0;
  1583. // this.$message.error(res.message);
  1584. }
  1585. }).catch((err) => {
  1586. // console.log(err);
  1587. this.$message.error(err.message);
  1588. })
  1589. },
  1590. /**
  1591. * 某层房间、空调数
  1592. * @param {Object} school
  1593. * @param {Object} build
  1594. * @param {Object} floors
  1595. */
  1596. getRoomsAndAirs(school, build, floors) {
  1597. getRoomsAndAirs({
  1598. school,
  1599. build,
  1600. floors
  1601. }).then((res) => {
  1602. // console.log(res);
  1603. if (typeof res.code == 'undefined' || res.code == '') {
  1604. this.$message.error('返回数据格式问题,code未获取到!');
  1605. return;
  1606. }
  1607. if (res.code == 200) {
  1608. // 填充数据
  1609. this.room_number = res.domNum;
  1610. this.device_number = res.airNum;
  1611. } else {
  1612. this.room_number = 0;
  1613. this.device_number = 0;
  1614. // this.$message.error(res.message);
  1615. }
  1616. }).catch((err) => {
  1617. // console.log(err);
  1618. this.$message.error(err.message);
  1619. })
  1620. },
  1621. /**
  1622. * 实现分页
  1623. * @param {Object} currentPage
  1624. * @param {Object} pageSize
  1625. * @param {Object} rooms
  1626. */
  1627. roomDataPagination(currentPage, pageSize, rooms, school, build, floors) {
  1628. // console.log(currentPage, pageSize, rooms, school, build, floors);
  1629. let startRecord = (currentPage - 1) * pageSize
  1630. // 避免最后一页不满4个的情况
  1631. let len = rooms.length
  1632. if (startRecord + pageSize < rooms.length) {
  1633. len = startRecord + pageSize
  1634. }
  1635. let _this = this
  1636. let index = 0
  1637. for (var i = startRecord; i < len; i++) {
  1638. // 延时执行
  1639. (function(t, school, build, floors, room, index) { // 注意这里是形参
  1640. setTimeout(function() {
  1641. _this.get_room_airs_data(school, build, floors, room, index)
  1642. }, 50 * t); // 还是0.05执行一次,不是累加的
  1643. })(i, school, build, floors, rooms[i], index); // 注意这里是实参,这里把要用的参数传进去
  1644. index = index + 1
  1645. }
  1646. },
  1647. /**
  1648. * 添加房间
  1649. */
  1650. add_room() {
  1651. if (this.currentData.school == '' || this.currentData.building == '' || this.currentData.floor ==
  1652. '') {
  1653. this.$message.warning('请选择楼层后,再添加房间!')
  1654. return
  1655. }
  1656. // 填充数据
  1657. this.form_add_room.school = this.currentData.school
  1658. this.form_add_room.building = this.currentData.building
  1659. this.form_add_room.floor = this.currentData.floor
  1660. // 显示添加房间
  1661. this.dialog_add_room = true
  1662. setTimeout(() => {
  1663. this.$nextTick(() => {
  1664. this.$refs.ref_add_room.focus()
  1665. })
  1666. }, 500)
  1667. },
  1668. /**
  1669. * 添加楼层
  1670. * @param {Object} e
  1671. */
  1672. add_louceng(id, label) {
  1673. // let ids = id.split('|')
  1674. let labels = label.split('|')
  1675. // console.log(ids);
  1676. // console.log(labels);
  1677. this.form_add_louceng.school = labels[1]
  1678. this.form_add_louceng.building = labels[0]
  1679. // 显示添加楼层
  1680. this.dialog_add_louceng = true
  1681. setTimeout(() => {
  1682. this.$nextTick(() => {
  1683. this.$refs.ref_louceng.focus()
  1684. })
  1685. }, 500)
  1686. },
  1687. /**
  1688. * 告警状态: 异常
  1689. * @param {Object} index
  1690. * @param {Object} row
  1691. */
  1692. alarm_status_click(index, row) {
  1693. // console.log(index, row);
  1694. this.form_operator_details.name = row.userName
  1695. this.form_operator_details.contact = row.contact
  1696. // 显示操作详情
  1697. this.dialog_operator_details = true
  1698. },
  1699. /**
  1700. * 添加楼栋
  1701. */
  1702. add_loudong(id, label) {
  1703. // console.log(id);
  1704. // console.log(label);
  1705. this.form_add_loudong.school = label
  1706. // 显示添加楼栋
  1707. this.dialog_add_loudong = true
  1708. setTimeout(() => {
  1709. this.$nextTick(() => {
  1710. this.$refs.ref_loudong.focus()
  1711. })
  1712. }, 500)
  1713. },
  1714. /**
  1715. * 添加楼栋对话框
  1716. */
  1717. dialog_add_loudong_click() {
  1718. this.$refs["add_loudong_form"].validate(validate => {
  1719. if (validate) {
  1720. // console.log(this.form_add_loudong);
  1721. addBuild(this.form_add_loudong).then((res) => {
  1722. // console.log(res);
  1723. if (typeof res.code == 'undefined' || res.code == '') {
  1724. this.$message.error('返回数据格式问题,code未获取到!')
  1725. return
  1726. }
  1727. if (res.code == 200) {
  1728. this.get_loudong_data()
  1729. this.$message.success('楼栋添加成功!')
  1730. this.dialog_add_loudong = false
  1731. } else {
  1732. this.$message.error(res.message)
  1733. }
  1734. }).catch((err) => {
  1735. // console.log(err);
  1736. this.$message.error(err.message)
  1737. })
  1738. } else {
  1739. this.$message.error('验证不通过')
  1740. return false
  1741. }
  1742. })
  1743. },
  1744. /**
  1745. * 添加楼层对话框
  1746. */
  1747. dialog_add_louceng_click() {
  1748. this.$refs["add_louceng_form"].validate(validate => {
  1749. if (validate) {
  1750. // console.log(this.form_add_louceng);
  1751. addFloors(this.form_add_louceng).then((res) => {
  1752. // console.log(res);
  1753. if (typeof res.code == 'undefined' || res.code == '') {
  1754. this.$message.error('返回数据格式问题,code未获取到!')
  1755. return
  1756. }
  1757. if (res.code == 200) {
  1758. this.get_loudong_data()
  1759. this.$message.success('楼层添加成功!')
  1760. this.dialog_add_louceng = false
  1761. } else {
  1762. this.$message.error(res.message)
  1763. }
  1764. }).catch((err) => {
  1765. // console.log(err);
  1766. this.$message.error(err.message)
  1767. })
  1768. } else {
  1769. this.$message.error('验证不通过')
  1770. return false
  1771. }
  1772. })
  1773. },
  1774. /**
  1775. * 添加房间对话框
  1776. */
  1777. dialog_add_room_click() {
  1778. this.$refs["add_room_form"].validate(validate => {
  1779. if (validate) {
  1780. // console.log(this.form_add_room);
  1781. addRooms(this.form_add_room).then((res) => {
  1782. // console.log(res);
  1783. if (typeof res.code == 'undefined' || res.code == '') {
  1784. this.$message.error('返回数据格式问题,code未获取到!')
  1785. return
  1786. }
  1787. if (res.code == 200) {
  1788. this.get_loudong_data()
  1789. this.$message.success('房间添加成功!')
  1790. this.dialog_add_room = false
  1791. let _this = this
  1792. setTimeout(() => {
  1793. _this.currentData.clickElement.click()
  1794. }, 1000)
  1795. } else {
  1796. this.$message.error(res.message)
  1797. }
  1798. }).catch((err) => {
  1799. // console.log(err);
  1800. this.$message.error(err.message)
  1801. })
  1802. } else {
  1803. this.$message.error('验证不通过')
  1804. return false
  1805. }
  1806. })
  1807. },
  1808. /**
  1809. * 添加空调对话框
  1810. */
  1811. dialog_add_air_click() {
  1812. this.$refs["add_device_form"].validate(validate => {
  1813. if (validate) {
  1814. // console.log(this.form_add_device);
  1815. addAirs(this.form_add_device).then((res) => {
  1816. // console.log(res);
  1817. if (typeof res.code == 'undefined' || res.code == '') {
  1818. this.$message.error('返回数据格式问题,code未获取到!')
  1819. return
  1820. }
  1821. if (res.code == 200) {
  1822. this.get_loudong_data()
  1823. this.$message.success('空调设备添加成功!')
  1824. this.dialog_add_device = false
  1825. let _this = this
  1826. setTimeout(() => {
  1827. _this.currentData.clickElement.click()
  1828. }, 1000)
  1829. setTimeout(() => {
  1830. }, 300)
  1831. } else {
  1832. this.$message.error(res.message)
  1833. }
  1834. }).catch((err) => {
  1835. // console.log(err);
  1836. this.$message.error(err.message)
  1837. })
  1838. } else {
  1839. this.$message.error('验证不通过')
  1840. return false
  1841. }
  1842. })
  1843. },
  1844. /**
  1845. * 刪除空调对话框
  1846. */
  1847. dialog_delete_air_click() {
  1848. let delAir = {
  1849. school: this.currentData.school,
  1850. build: this.currentData.building,
  1851. floors: this.currentData.floor,
  1852. dom: this.delAir.room,
  1853. air_ip: this.delAir.deleteAirIp
  1854. }
  1855. // console.log(delAir);
  1856. deleteAirs(delAir).then((res) => {
  1857. // console.log(res);
  1858. if (typeof res.code == 'undefined' || res.code == '') {
  1859. this.$message.error('返回数据格式问题,code未获取到!')
  1860. return
  1861. }
  1862. if (res.code == 200) {
  1863. this.get_loudong_data()
  1864. this.$message.success('空调 ' + delAir.air_ip + ' 删除成功!')
  1865. this.dialog_delete_air = false
  1866. let _this = this
  1867. setTimeout(() => {
  1868. _this.currentData.clickElement.click()
  1869. }, 1000)
  1870. } else {
  1871. this.$message.error(res.message)
  1872. }
  1873. }).catch((err) => {
  1874. // console.log(err);
  1875. this.$message.error(err.message)
  1876. })
  1877. },
  1878. /**
  1879. * 主题部分按钮的单击事件
  1880. * @param {Object} param
  1881. */
  1882. top_btn_click(param) {
  1883. // console.log(param);
  1884. this.btnActive = param;
  1885. if (param == 'all') {
  1886. this.currentData.clickElement.click();
  1887. } else if (param == 'powerOn') {
  1888. this.currentData.clickElement.click();
  1889. } else if (param == 'powerOff') {
  1890. this.currentData.clickElement.click();
  1891. } else if (param == 'abnormal') {
  1892. this.currentData.clickElement.click();
  1893. } else {
  1894. this.$message.error('点击按钮出错!');
  1895. }
  1896. },
  1897. /**
  1898. * 添加空调设备
  1899. * @param {Object} room
  1900. */
  1901. add_device(room) {
  1902. // this.$message.success(room);
  1903. this.currentData.addDevice = room;
  1904. // 填充数据
  1905. this.form_add_device.school = this.currentData.school;
  1906. this.form_add_device.build = this.currentData.building;
  1907. this.form_add_device.floors = this.currentData.floor;
  1908. this.form_add_device.room = room;
  1909. // 显示对话框
  1910. this.dialog_add_device = true;
  1911. setTimeout(() => {
  1912. this.$nextTick(() => {
  1913. this.$refs.ref_deviceName.focus();
  1914. });
  1915. }, 500);
  1916. },
  1917. /**
  1918. * 操作编辑修改房间
  1919. * @param {Object} room
  1920. */
  1921. operate_modify_room(room) {
  1922. let tmpData = this.currentData.title_any_where.split('-');
  1923. this.form_modify_room.school = tmpData[0]
  1924. this.form_modify_room.building = tmpData[1]
  1925. this.form_modify_room.floor = tmpData[2]
  1926. this.form_modify_room.room = room.split('-')[1]
  1927. this.show_modify_room = room
  1928. this.dialog_modify_room = true
  1929. setTimeout(() => {
  1930. this.$nextTick(() => {
  1931. this.$refs.ref_modi_room.focus()
  1932. })
  1933. }, 500)
  1934. },
  1935. /**
  1936. * 操作删除房间
  1937. */
  1938. operate_delete_room(room) {
  1939. this.show_delete_room = room
  1940. this.dialog_delete_room = true
  1941. },
  1942. /**
  1943. * 操作删除空调
  1944. * @param {Object} index
  1945. * @param {Object} row
  1946. */
  1947. operate_delete_air(index, row, room) {
  1948. // console.log(index, row, row.ip, room);
  1949. this.delAir.deleteAirIp = row.ip
  1950. this.delAir.room = room
  1951. this.dialog_delete_air = true
  1952. },
  1953. /**
  1954. * 对话框关闭时清理数据
  1955. */
  1956. dialog_close(param) {
  1957. if (param == 'form_add_loudong') {
  1958. this.form_add_loudong = {
  1959. school: '',
  1960. building: ''
  1961. }
  1962. }
  1963. if (param == 'form_add_louceng') {
  1964. this.form_add_louceng = {
  1965. school: '',
  1966. building: '',
  1967. floor: ''
  1968. }
  1969. }
  1970. if (param == 'form_add_room') {
  1971. this.form_add_room = {
  1972. school: '',
  1973. building: '',
  1974. floor: '',
  1975. room: ''
  1976. }
  1977. }
  1978. if (param == 'form_modify_room') {
  1979. this.form_modify_room = {
  1980. school: '',
  1981. building: '',
  1982. floor: '',
  1983. room: ''
  1984. }
  1985. }
  1986. if (param == 'form_add_device') {
  1987. this.form_add_device = {
  1988. school: '',
  1989. build: '',
  1990. floors: '',
  1991. room: '',
  1992. deviceName: '',
  1993. deviceIp: '',
  1994. checkedDevice: [],
  1995. devices: [],
  1996. duration_use: 0.00, // 使用时长
  1997. is_normal: '0', // 是否正常
  1998. is_on: '0', // 是否开启
  1999. }
  2000. }
  2001. if (param == 'form_operator_details') {
  2002. this.form_operator_details = {
  2003. name: '',
  2004. contact: ''
  2005. }
  2006. }
  2007. },
  2008. /**
  2009. * currentPage 改变时会触发
  2010. * @param {Object} val
  2011. */
  2012. currentPageChange(val) {
  2013. this.listLoading = true;
  2014. // console.log('当前页:' + val);
  2015. // 清理一下当前数据中的rooms
  2016. this.currentData.rooms = [{
  2017. room: '',
  2018. tableData: []
  2019. }, {
  2020. room: '',
  2021. tableData: []
  2022. }, {
  2023. room: '',
  2024. tableData: []
  2025. }, {
  2026. room: '',
  2027. tableData: []
  2028. }];
  2029. this.pagination.currentPage = val;
  2030. this.roomDataPagination(this.pagination.currentPage, this.pagination.pageSize, this.currentData
  2031. .allRooms,
  2032. this.currentData.school, this.currentData.building, this.currentData.floor);
  2033. this.listLoading = false;
  2034. },
  2035. /**
  2036. * 设置表格单元格样式
  2037. */
  2038. setCellStyle() {
  2039. return `
  2040. color: #53575A;
  2041. font-size: 14px;
  2042. font-family: Microsoft YaHei-3970(82674968);
  2043. background-color: #ECF1F8;
  2044. border-bottom: 1px solid #DBE0E7;
  2045. `
  2046. },
  2047. /**
  2048. * 设置表格头部单元格样式
  2049. */
  2050. setHeaderSellStyle({
  2051. row,
  2052. column,
  2053. rowIndex,
  2054. columnIndex
  2055. }) {
  2056. if (columnIndex === 0) {
  2057. return `
  2058. background: #FFFFFF;
  2059. color: #53575A;
  2060. font-size: 14px;
  2061. font-family: Microsoft YaHei-3970(82674968);
  2062. border-radius: 6px 0 0 6px;
  2063. `
  2064. } else if (columnIndex === 6) {
  2065. return `
  2066. background: #FFFFFF;
  2067. color: #53575A;
  2068. font-size: 14px;
  2069. font-family: Microsoft YaHei-3970(82674968);
  2070. border-radius: 0 6px 6px 0;
  2071. `
  2072. } else {
  2073. return `
  2074. background: #FFFFFF;
  2075. color: #53575A;
  2076. font-size: 14px;
  2077. font-family: Microsoft YaHei-3970(82674968);
  2078. `
  2079. }
  2080. }
  2081. },
  2082. }
  2083. </script>
  2084. <style scoped lang="scss">
  2085. .app-container {
  2086. background-color: #EFF2F7;
  2087. padding: 10px;
  2088. .el-row {
  2089. .nav-class {
  2090. .nav-box {
  2091. height: 788px;
  2092. overflow-x: hidden;
  2093. overflow-y: scroll;
  2094. }
  2095. .nav-box::-webkit-scrollbar {
  2096. display: none;
  2097. }
  2098. }
  2099. .el-col {
  2100. .nav-box {
  2101. margin: 10px 5px 0 10px;
  2102. padding: 20px 0;
  2103. border-radius: 10px;
  2104. background-color: #FFFFFF;
  2105. font-size: 18px;
  2106. // box-shadow: 5px 5px 15px #979797;
  2107. box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
  2108. .item-school {
  2109. margin-top: 0px;
  2110. .school {
  2111. display: flex;
  2112. justify-content: space-between;
  2113. align-items: center;
  2114. padding: 10px;
  2115. background: #2B4CFE;
  2116. font-family: Microsoft YaHei-3970(82674968);
  2117. font-weight: bold;
  2118. color: #EDF0F5;
  2119. cursor: pointer;
  2120. white-space: nowrap;
  2121. }
  2122. .item-loudong {
  2123. display: flex;
  2124. flex-direction: column;
  2125. padding: 10px 0 0 0;
  2126. .loudong {
  2127. display: flex;
  2128. justify-content: space-between;
  2129. align-items: center;
  2130. padding: 10px 10px 10px 20px;
  2131. background: #EDF0F5;
  2132. font-family: Microsoft YaHei-3970(82674968);
  2133. font-weight: bold;
  2134. color: #2B4CFE;
  2135. cursor: pointer;
  2136. .louidong_text {
  2137. white-space: nowrap;
  2138. width: 260px;
  2139. overflow: hidden;
  2140. text-overflow: ellipsis;
  2141. }
  2142. }
  2143. .item-louceng {
  2144. display: flex;
  2145. flex-direction: column;
  2146. margin-left: 40px;
  2147. .louceng {
  2148. display: flex;
  2149. align-items: center;
  2150. justify-content: space-between;
  2151. padding: 10px;
  2152. height: 30px;
  2153. font-size: 18px;
  2154. cursor: pointer;
  2155. }
  2156. .louceng:hover {
  2157. background-color: #5c8aff;
  2158. color: #FFFFFF;
  2159. }
  2160. .louceng-clicked {
  2161. font-size: 20px;
  2162. font-weight: bold;
  2163. background-color: #3e5afe;
  2164. color: #FFFFFF;
  2165. }
  2166. }
  2167. .loudong-add-louceng {
  2168. display: flex;
  2169. align-items: center;
  2170. padding: 10px 0 10px 30px;
  2171. cursor: pointer;
  2172. .loudong-add-louceng-txt {
  2173. margin-left: 5px;
  2174. }
  2175. }
  2176. }
  2177. }
  2178. .item-school .item-loudong:nth-child(2) {
  2179. padding: 0;
  2180. }
  2181. .add-loudong {
  2182. display: flex;
  2183. align-items: center;
  2184. padding: 10px 0 0 20px;
  2185. cursor: pointer;
  2186. .add-loudong-txt {
  2187. margin-left: 5px;
  2188. }
  2189. }
  2190. }
  2191. .cell {
  2192. margin: 10px 10px 10px 0;
  2193. padding: 20px;
  2194. border-radius: 10px;
  2195. background-color: #FFFFFF;
  2196. // box-shadow: 5px 5px 15px #979797;
  2197. box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
  2198. .cell-title {
  2199. display: flex;
  2200. justify-content: space-between;
  2201. align-items: center;
  2202. margin-bottom: 20px;
  2203. padding-bottom: 18px;
  2204. border-bottom: 1px solid #CCCCCC;
  2205. .title-left {
  2206. width: 88%;
  2207. display: flex;
  2208. justify-content: space-between;
  2209. align-items: center;
  2210. white-space: nowrap;
  2211. .title {
  2212. font-size: 22px;
  2213. font-family: Microsoft YaHei-3970(82674968);
  2214. font-weight: bold;
  2215. color: #1A202B;
  2216. }
  2217. .title-detail {
  2218. margin-left: 16px;
  2219. font-size: 18px;
  2220. font-family: Microsoft YaHei-3970(82674968);
  2221. color: #1A202B;
  2222. }
  2223. }
  2224. .title-right {
  2225. display: flex;
  2226. justify-content: space-between;
  2227. align-items: center;
  2228. .el-button {
  2229. width: 110px;
  2230. height: 46px;
  2231. background: #2B4CFE;
  2232. font-size: 18px;
  2233. color: #FFFFFF;
  2234. font-family: Microsoft YaHei-3970(82674968);
  2235. border-radius: 5px;
  2236. }
  2237. .el-button--warning {
  2238. background: #F88A64;
  2239. }
  2240. }
  2241. }
  2242. .cell-body {
  2243. .cell-body-top-btns {
  2244. display: flex;
  2245. align-items: center;
  2246. margin-bottom: 20px;
  2247. .btn-active {
  2248. display: flex;
  2249. justify-content: center;
  2250. align-items: center;
  2251. width: 66px;
  2252. height: 36px;
  2253. border-radius: 18px;
  2254. font-size: 18px;
  2255. font-family: Microsoft YaHei-3970(82674968);
  2256. background: #2B4CFE;
  2257. color: #FEFEFE;
  2258. margin-right: 10px;
  2259. }
  2260. .btn-no-active {
  2261. display: flex;
  2262. justify-content: center;
  2263. align-items: center;
  2264. width: 66px;
  2265. height: 36px;
  2266. border: none;
  2267. font-size: 18px;
  2268. font-family: Microsoft YaHei-3970(82674968);
  2269. background: none;
  2270. color: #53575A;
  2271. margin-right: 10px;
  2272. }
  2273. }
  2274. .el-row {
  2275. height: 286px;
  2276. .el-col {
  2277. .panel-left,
  2278. .panel-right {
  2279. background: #ECF1F8;
  2280. border-radius: 10px;
  2281. margin: 0 0 10px 0;
  2282. }
  2283. .panel-left,
  2284. .panel-right {
  2285. .panel-header {
  2286. display: flex;
  2287. justify-content: space-between;
  2288. align-items: center;
  2289. padding: 5px 20px;
  2290. margin-bottom: 10px;
  2291. border-bottom: 1px solid #D9D9D9;
  2292. .panel-title-caption {
  2293. display: flex;
  2294. justify-content: space-between;
  2295. align-items: center;
  2296. .panel-title-icon {
  2297. color: #2B4CFE;
  2298. font-size: 20px;
  2299. margin-right: 8px;
  2300. }
  2301. .panel-title {
  2302. font-size: 20px;
  2303. }
  2304. }
  2305. .panel-title-btns {
  2306. .panel-title-btn {
  2307. margin-left: 20px;
  2308. font-size: 16px;
  2309. font-family: Microsoft YaHei-3970(82674968);
  2310. color: #2B4CFE;
  2311. }
  2312. }
  2313. }
  2314. .panel-body {
  2315. /*将表格每一行的背景色去掉*/
  2316. .el-table,
  2317. .el-table__expanded-cell,
  2318. .el-table tr {
  2319. background-color: transparent;
  2320. }
  2321. ::v-deep .el-table td,
  2322. ::v-deep .el-table th {
  2323. padding: 6px 0;
  2324. }
  2325. .el-table {
  2326. margin: 0 3px;
  2327. width: calc(100% - 6px);
  2328. .txt-cell-blue,
  2329. .btn-cell-blue {
  2330. color: #2B4CFE;
  2331. border: none;
  2332. font-size: 14px;
  2333. cursor: pointer;
  2334. }
  2335. .btn-cell-blue {
  2336. border: 1px solid #2B4CFE;
  2337. }
  2338. .power-icon-on {
  2339. font-size: 22px;
  2340. cursor: pointer;
  2341. color: #00ff00;
  2342. }
  2343. .power-icon-off {
  2344. font-size: 22px;
  2345. cursor: pointer;
  2346. color: #ff0000;
  2347. }
  2348. }
  2349. }
  2350. .panel-footer {
  2351. display: flex;
  2352. align-items: center;
  2353. padding: 10px 30px 15px 25px;
  2354. color: #2B4CFE;
  2355. cursor: pointer;
  2356. .panel-footer-txt {
  2357. margin-left: 5px;
  2358. }
  2359. }
  2360. }
  2361. .panel-right {
  2362. margin-right: 0px;
  2363. margin-left: 10px;
  2364. }
  2365. }
  2366. }
  2367. .pagination-table {
  2368. display: flex;
  2369. justify-content: flex-end;
  2370. align-items: center;
  2371. height: 30px;
  2372. margin-top: 5px;
  2373. padding-right: 100px;
  2374. ::v-deep .el-pagination {
  2375. display: flex;
  2376. justify-content: flex-end;
  2377. align-items: center;
  2378. }
  2379. ::v-deep .el-pagination ul {
  2380. display: flex;
  2381. }
  2382. ::v-deep .el-pagination button,
  2383. ::v-deep .el-pagination li {
  2384. display: flex;
  2385. justify-content: center;
  2386. align-items: center;
  2387. width: 50px;
  2388. height: 36px;
  2389. border: 1px solid #626262;
  2390. border-radius: 3px;
  2391. font-size: 14px;
  2392. margin: 0 5px;
  2393. }
  2394. ::v-deep .el-pagination span {
  2395. margin-left: 10px;
  2396. }
  2397. ::v-deep .el-pagination .el-pagination__jump {
  2398. font-size: 16px;
  2399. }
  2400. ::v-deep .el-pagination .el-pagination__editor {
  2401. width: 50px;
  2402. height: 36px;
  2403. margin: 0 5px;
  2404. }
  2405. ::v-deep .el-pagination .el-input__inner {
  2406. width: 50px;
  2407. height: 36px;
  2408. border: 1px solid #626262;
  2409. margin: -4px 0 0 0;
  2410. }
  2411. }
  2412. }
  2413. }
  2414. }
  2415. }
  2416. ::v-deep .el-dialog {
  2417. margin: 0 !important;
  2418. width: 400px;
  2419. height: 320px;
  2420. background: #FFFFFF;
  2421. box-shadow: 0px 0px 13px 0px rgba(0, 0, 0, 0.29);
  2422. border-radius: 10px;
  2423. position: absolute;
  2424. top: 50%;
  2425. left: 50%;
  2426. transform: translate(-50%, -50%);
  2427. .el-dialog__header {
  2428. display: flex;
  2429. align-items: center;
  2430. width: 100%;
  2431. height: 58px;
  2432. padding: 30px;
  2433. background: #E6EBFE;
  2434. border-radius: 10px 10px 0px 0px;
  2435. font-weight: bold;
  2436. }
  2437. .el-dialog__body {
  2438. padding-bottom: 0;
  2439. .el-form-item {
  2440. .el-form-item__label,
  2441. .el-form-item__content {
  2442. font-size: 16px;
  2443. font-family: Microsoft YaHei-3970(82674968);
  2444. color: #53575A;
  2445. }
  2446. .el-input__inner {
  2447. width: 180px;
  2448. }
  2449. }
  2450. // 删除对话框的样式
  2451. .del-air-body {
  2452. display: flex;
  2453. flex-direction: column;
  2454. justify-content: center;
  2455. align-items: center;
  2456. height: 180px;
  2457. img {
  2458. width: 72px;
  2459. }
  2460. .del-air-body-txt {
  2461. height: 58px;
  2462. line-height: 58px;
  2463. font-size: 18px;
  2464. font-family: Microsoft YaHei-3970(82674968);
  2465. color: #333333;
  2466. white-space: nowrap;
  2467. }
  2468. }
  2469. }
  2470. .el-dialog__footer {
  2471. padding-bottom: 0 !important;
  2472. text-align: center;
  2473. .el-button.el-button--default {
  2474. width: 75px;
  2475. height: 40px;
  2476. border: 1px solid #2B4CFE;
  2477. border-radius: 6px;
  2478. font-size: 16px;
  2479. font-family: Microsoft YaHei-3970(82674968);
  2480. color: #2B4CFE;
  2481. }
  2482. .el-button.el-button--primary {
  2483. width: 75px;
  2484. height: 40px;
  2485. background: #2B4CFE;
  2486. border-radius: 6px;
  2487. font-size: 16px;
  2488. font-family: Microsoft YaHei-3970(82674968);
  2489. color: #FFFFFF;
  2490. margin-left: 60px;
  2491. }
  2492. }
  2493. }
  2494. }
  2495. </style>
  2496. <style>
  2497. .el-dialog-add-loudong {
  2498. height: 300px !important;
  2499. }
  2500. .el-dialog-add-room {
  2501. height: 420px !important;
  2502. }
  2503. .el-dialog-modify-room {
  2504. height: 420px !important;
  2505. }
  2506. .el-dialog-add-louceng {
  2507. height: 360px !important;
  2508. }
  2509. .el-dialog-operator_details {
  2510. height: 300px !important;
  2511. }
  2512. .el-dialog-delete-room {
  2513. height: fit-content !important;
  2514. width: fit-content !important;
  2515. }
  2516. .el-dialog-add-device {
  2517. height: fit-content !important;
  2518. width: fit-content !important;
  2519. }
  2520. .el-dialog-delete-air {
  2521. height: fit-content !important;
  2522. width: fit-content !important;
  2523. }
  2524. .dialog-footer {
  2525. height: 68px !important;
  2526. }
  2527. .el-dialog-delete-room .el-dialog__header,
  2528. .el-dialog-delete-air .el-dialog__header {
  2529. display: none !important;
  2530. }
  2531. </style>