index.vue 79 KB

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