| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584 |
- <template>
- <div class="app-container">
- <el-row>
- <el-col :span="4" class="nav-class" v-loading="navLoading">
- <div class="nav-box">
- <div class="item-school" v-for="(item0, index0) in navData" :key="index0">
- <div class="school" @click="school_toggle(item0.id, item0.label)">
- <div>{{item0.label}}</div>
- <i v-if="item0.isShow" class="el-icon-arrow-down"></i>
- <i v-else class="el-icon-arrow-right"></i>
- </div>
- <div class="item-loudong" v-for="(item1, index1) in item0.children" :key="index1"
- :style="{display: item0.isShow ? '' : 'none'}">
- <div class="loudong"
- @click="loudong_toggle(item1.id + '|' + item0.id, item1.label + '|'+ item0.label)">
- <div class="louidong_text" :title="item1.label">{{item1.label}}</div>
- <i v-if="item1.isShow" class="el-icon-arrow-down"></i>
- <i v-else class="el-icon-arrow-right"></i>
- </div>
- <div class="item-louceng" v-for="(item2, index2) in item1.children" :key="index2"
- :style="{display: item1.isShow ? '' : 'none'}">
- <div :id="`louceng${index0}${index1}${index2}`" class="louceng"
- :class="louceng_click_id == item2.id ? 'louceng-clicked' : '' "
- @click="louceng_click($event, item2.id + '|' + item1.id + '|' + item0.id, item2.label + '|' + item1.label + '|'+ item0.label, item2.rooms)">
- {{item2.label}}
- </div>
- </div>
- <div class="loudong-add-louceng" :style="{display: item1.isShow ? '' : 'none'}"
- @click="add_louceng(item1.id + '|' + item0.id, item1.label + '|'+ item0.label)">
- <i class="el-icon-circle-plus-outline"></i>
- <div class="loudong-add-louceng-txt">添加楼层</div>
- </div>
- </div>
- <div class="add-loudong" @click="add_loudong(item0.id, item0.label)"
- :style="{display: item0.isShow ? '' : 'none'}">
- <i class="el-icon-circle-plus-outline"></i>
- <div class="add-loudong-txt">添加楼栋</div>
- </div>
- </div>
- </div>
- </el-col>
- <el-col :span="20">
- <div class="cell">
- <div class="cell-title">
- <div class="title-left">
- <div class="title">{{currentData.title_any_where}} 空调管理</div>
- <div class="title-detail">房间数:{{room_number}}间</div>
- <div class="title-detail">设备:{{device_number}}台</div>
- <div class="title-detail">已开启:{{open_number}}台</div>
- <div class="title-detail">预警台数:{{warning_number}}台</div>
- </div>
- <div class="title-right">
- <el-button type="primary" @click="add_room">新增房间</el-button>
- </div>
- </div>
- <div class="cell-body" v-loading="listLoading">
- <div class="cell-body-top-btns">
- <el-button :class="btnActive == 'all' ? 'btn-active':'btn-no-active'" type="primary"
- size="medium" round @click="top_btn_click('all')">全部</el-button>
- <el-button :class="btnActive == 'powerOn' ? 'btn-active':'btn-no-active'" type="primary"
- size="medium" round @click="top_btn_click('powerOn')">开机</el-button>
- <el-button :class="btnActive == 'powerOff' ? 'btn-active':'btn-no-active'" type="primary"
- size="medium" round @click="top_btn_click('powerOff')">关机</el-button>
- <el-button :class="btnActive == 'abnormal' ? 'btn-active':'btn-no-active'" type="primary"
- size="medium" round @click="top_btn_click('abnormal')">异常</el-button>
- </div>
- <el-row>
- <el-col :span="12">
- <div class="panel-left"
- :style="{display: currentData.rooms[0].room == '' ? 'none' : ''}">
- <div class="panel-header">
- <div class="panel-title-caption">
- <svg-icon icon-class="panel-home" class="panel-title-icon" />
- <div class="panel-title">{{currentData.rooms[0].room}}</div>
- </div>
- <div class="panel-title-btns">
- <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
- @click="operate_modify_room(currentData.rooms[0].room)">编辑</el-button>
- <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
- @click="operate_delete_room(currentData.rooms[0].room)">删除
- </el-button>
- </div>
- </div>
- <div class="panel-body">
- <el-table :data="currentData.rooms[0].tableData" height="170"
- v-loading="airsLoading[0].loading"
- :element-loading-text="airsLoading[0].text"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
- :header-cell-style="setHeaderSellStyle">
- <el-table-column label="名称" align="center" width="160">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="ID" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.ip }}</span>
- </template>
- </el-table-column>
- <el-table-column label="类型" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.device }}</span>
- </template>
- </el-table-column>
- <el-table-column label="使用时长" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.userTime }}</span>
- </template>
- </el-table-column>
- <el-table-column label="告警状态" align="center">
- <template slot-scope="scope">
- <span
- v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
- <span v-else @click="alarm_status_click(scope.$index, scope.row)"
- class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
- </template>
- </el-table-column>
- <el-table-column label="开关状态" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.onOffStatus == 0"
- @click="open_close_airs(0, scope.$index, scope.row, 'open')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- <span v-else class="txt-cell-blue"
- @click="open_close_airs(0, scope.$index, scope.row, 'close')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button class="btn-cell-blue" size="mini" round
- @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[0].room)">
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="panel-footer" @click="">
- <i class="el-icon-circle-plus-outline"></i>
- <div class="panel-footer-txt" @click="add_device(currentData.rooms[0].room)">
- 添加设备</div>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="panel-right"
- :style="{display: currentData.rooms[1].room == '' ? 'none' : ''}">
- <div class="panel-header">
- <div class="panel-title-caption">
- <svg-icon icon-class="panel-home" class="panel-title-icon" />
- <div class="panel-title">{{currentData.rooms[1].room}}</div>
- </div>
- <div class="panel-title-btns">
- <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
- @click="operate_modify_room(currentData.rooms[1].room)">编辑</el-button>
- <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
- @click="operate_delete_room(currentData.rooms[1].room)">删除
- </el-button>
- </div>
- </div>
- <div class="panel-body">
- <el-table :data="currentData.rooms[1].tableData" height="170"
- v-loading="airsLoading[1].loading"
- :element-loading-text="airsLoading[1].text"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
- :header-cell-style="setHeaderSellStyle">
- <el-table-column label="名称" align="center" width="160">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="ID" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.ip }}</span>
- </template>
- </el-table-column>
- <el-table-column label="类型" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.device }}</span>
- </template>
- </el-table-column>
- <el-table-column label="使用时长" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.userTime }}</span>
- </template>
- </el-table-column>
- <el-table-column label="告警状态" align="center">
- <template slot-scope="scope">
- <span
- v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
- <span v-else @click="alarm_status_click(scope.$index, scope.row)"
- class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
- </template>
- </el-table-column>
- <el-table-column label="开关状态" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.onOffStatus == 0"
- @click="open_close_airs(1, scope.$index, scope.row, 'open')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- <span v-else class="txt-cell-blue"
- @click="open_close_airs(1, scope.$index, scope.row, 'close')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button class="btn-cell-blue" size="mini" round
- @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[1].room)">
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="panel-footer" @click="">
- <i class="el-icon-circle-plus-outline"></i>
- <div class="panel-footer-txt" @click="add_device(currentData.rooms[1].room)">
- 添加设备</div>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <div class="panel-left"
- :style="{display: currentData.rooms[2].room == '' ? 'none' : ''}">
- <div class="panel-header">
- <div class="panel-title-caption">
- <svg-icon icon-class="panel-home" class="panel-title-icon" />
- <div class="panel-title">{{currentData.rooms[2].room}}</div>
- </div>
- <div class="panel-title-btns">
- <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
- @click="operate_modify_room(currentData.rooms[2].room)">编辑</el-button>
- <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
- @click="operate_delete_room(currentData.rooms[2].room)">删除
- </el-button>
- </div>
- </div>
- <div class="panel-body">
- <el-table :data="currentData.rooms[2].tableData" height="170"
- v-loading="airsLoading[2].loading"
- :element-loading-text="airsLoading[2].text"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
- :header-cell-style="setHeaderSellStyle">
- <el-table-column label="名称" align="center" width="160">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="ID" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.ip }}</span>
- </template>
- </el-table-column>
- <el-table-column label="类型" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.device }}</span>
- </template>
- </el-table-column>
- <el-table-column label="使用时长" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.userTime }}</span>
- </template>
- </el-table-column>
- <el-table-column label="告警状态" align="center">
- <template slot-scope="scope">
- <span
- v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
- <span v-else @click="alarm_status_click(scope.$index, scope.row)"
- class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
- </template>
- </el-table-column>
- <el-table-column label="开关状态" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.onOffStatus == 0"
- @click="open_close_airs(2, scope.$index, scope.row, 'open')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- <span v-else class="txt-cell-blue"
- @click="open_close_airs(2, scope.$index, scope.row, 'close')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button class="btn-cell-blue" size="mini" round
- @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[2].room)">
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="panel-footer" @click="">
- <i class="el-icon-circle-plus-outline"></i>
- <div class="panel-footer-txt" @click="add_device(currentData.rooms[2].room)">
- 添加设备</div>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="panel-right"
- :style="{display: currentData.rooms[3].room == '' ? 'none' : ''}">
- <div class="panel-header">
- <div class="panel-title-caption">
- <svg-icon icon-class="panel-home" class="panel-title-icon" />
- <div class="panel-title">{{currentData.rooms[3].room}}</div>
- </div>
- <div class="panel-title-btns">
- <el-button class="panel-title-btn" type="text" icon="el-icon-edit-outline"
- @click="operate_modify_room(currentData.rooms[3].room)">编辑</el-button>
- <el-button class="panel-title-btn" type="text" icon="el-icon-delete"
- @click="operate_delete_room(currentData.rooms[3].room)">删除
- </el-button>
- </div>
- </div>
- <div class="panel-body">
- <el-table :data="currentData.rooms[3].tableData" height="170"
- v-loading="airsLoading[3].loading"
- :element-loading-text="airsLoading[3].text"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
- :header-cell-style="setHeaderSellStyle">
- <el-table-column label="名称" align="center" width="160">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="ID" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.ip }}</span>
- </template>
- </el-table-column>
- <el-table-column label="类型" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.device }}</span>
- </template>
- </el-table-column>
- <el-table-column label="使用时长" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.userTime }}</span>
- </template>
- </el-table-column>
- <el-table-column label="告警状态" align="center">
- <template slot-scope="scope">
- <span
- v-if="scope.row.alarmStatus == '正常'">{{ scope.row.alarmStatus }}</span>
- <span v-else @click="alarm_status_click(scope.$index, scope.row)"
- class="txt-cell-blue">{{ scope.row.alarmStatus }}</span>
- </template>
- </el-table-column>
- <el-table-column label="开关状态" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.onOffStatus == 0"
- @click="open_close_airs(3, scope.$index, scope.row, 'open')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- <span v-else class="txt-cell-blue"
- @click="open_close_airs(3, scope.$index, scope.row, 'close')">
- <svg-icon icon-class="power" class="power-icon" />
- </span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button class="btn-cell-blue" size="mini" round
- @click="operate_delete_air(scope.$index, scope.row, currentData.rooms[3].room)">
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="panel-footer" @click="">
- <i class="el-icon-circle-plus-outline"></i>
- <div class="panel-footer-txt" @click="add_device(currentData.rooms[3].room)">
- 添加设备</div>
- </div>
- </div>
- </el-col>
- </el-row>
- <div class="pagination-table">
- <el-pagination @current-change="currentPageChange"
- :current-page.sync="pagination.currentPage" :page-size="pagination.pageSize"
- layout="prev, pager, next, jumper" :total="pagination.total">
- </el-pagination>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- <!-- 添加楼栋 -->
- <el-dialog title="添加楼栋" custom-class="el-dialog-add-loudong" :visible.sync="dialog_add_loudong"
- :close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_add_loudong')">
- <!-- <el-form :model="form_add_loudong" ref="add_loudong_form" :rules="form_add_loudong_rules"> -->
- <el-form :model="form_add_loudong" ref="add_loudong_form">
- <el-form-item label="校区:" :label-width="formLabelWidth">
- <span>{{form_add_loudong.school}}</span>
- </el-form-item>
- <el-form-item label="楼栋:" :label-width="formLabelWidth" prop="building" :required="true">
- <el-input v-model="form_add_loudong.building" autocomplete="off" placeholder="请输入楼栋名称"
- ref="ref_loudong" maxlength="15"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialog_add_loudong = false">取 消</el-button>
- <el-button type="primary" @click="dialog_add_loudong_click">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 添加楼层 -->
- <el-dialog title="添加楼层" custom-class="el-dialog-add-louceng" :visible.sync="dialog_add_louceng"
- :close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_add_louceng')">
- <el-form :model="form_add_louceng" ref="add_louceng_form" :rules="form_add_louceng_rules">
- <el-form-item label="校区:" :label-width="formLabelWidth">
- <div>{{form_add_louceng.school}}</div>
- </el-form-item>
- <el-form-item label="楼栋:" :label-width="formLabelWidth">
- <div>{{form_add_louceng.building}}</div>
- </el-form-item>
- <el-form-item label="楼层:" :label-width="formLabelWidth" prop="floor" :required="true">
- <el-input v-model="form_add_louceng.floor" autocomplete="off" placeholder="请输入楼层号" ref="ref_louceng"
- maxlength="1" @keydown.enter.native="dialog_add_louceng_click"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialog_add_louceng = false">取 消</el-button>
- <el-button type="primary" @click="dialog_add_louceng_click">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 操作员详情 -->
- <el-dialog title="操作员详情" custom-class="el-dialog-operator_details" :visible.sync="dialog_operator_details"
- @close="dialog_close('form_operator_details')">
- <el-form :model="form_operator_details">
- <el-form-item label="姓 名:" :label-width="formLabelWidth">
- <div>{{form_operator_details.name}}</div>
- </el-form-item>
- <el-form-item label="联系方式:" :label-width="formLabelWidth">
- <div>{{form_operator_details.contact}}</div>
- </el-form-item>
- </el-form>
- </el-dialog>
- <!-- 添加房间 -->
- <el-dialog title="新增房间" custom-class="el-dialog-add-room" :visible.sync="dialog_add_room"
- :close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_add_room')">
- <!-- <el-form :model="form_add_room" ref="add_room_form" :rules="form_add_room_rules"> -->
- <el-form :model="form_add_room" ref="add_room_form">
- <el-form-item label="校区:" :label-width="formLabelWidth">
- <div>{{form_add_room.school}}</div>
- </el-form-item>
- <el-form-item label="楼栋:" :label-width="formLabelWidth">
- <div>{{form_add_room.building}}</div>
- </el-form-item>
- <el-form-item label="楼层:" :label-width="formLabelWidth">
- <div>{{form_add_room.floor}}</div>
- </el-form-item>
- <el-form-item label="房间:" :label-width="formLabelWidth" :required="true" prop="room">
- <el-input v-model="form_add_room.room" autocomplete="off" placeholder="请输入房间名称" ref="ref_add_room"
- maxlength="10" @keydown.enter.native="dialog_add_room_click"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialog_add_room = false">取 消</el-button>
- <el-button type="primary" @click="dialog_add_room_click">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 添加空调设备 -->
- <el-dialog :title="currentData.addDevice + '房间 添加设备'" custom-class="el-dialog-add-device"
- :visible.sync="dialog_add_device" :close-on-click-modal="false" :close-on-press-escape="false"
- @close="dialog_close('form_add_device')">
- <el-form :model="form_add_device" ref="add_device_form" :rules="form_add_device_rules">
- <el-form-item label="当前坐标:" :label-width="formLabelWidth">
- <div>{{form_add_device.school + ' / ' + form_add_device.build + ' / ' + form_add_device.floors}}
- </div>
- </el-form-item>
- <el-form-item label="操作员:" :label-width="formLabelWidth" prop="cao" :required="true">
- <el-input v-model="form_add_device.cao" autocomplete="off" placeholder="请输入操作员" ref="ref_cao"
- maxlength="10"></el-input>
- </el-form-item>
- <el-form-item label="手机号码:" :label-width="formLabelWidth" prop="contact" :required="true">
- <el-input v-model="form_add_device.contact" autocomplete="off" placeholder="请输入手机号码"
- ref="ref_contact" maxlength="11"></el-input>
- </el-form-item>
- <el-form-item label="设备名称:" :label-width="formLabelWidth" prop="deviceName" :required="true">
- <el-input v-model="form_add_device.deviceName" autocomplete="off" placeholder="请输入设备名称"
- ref="ref_deviceName" maxlength="10"></el-input>
- </el-form-item>
- <el-form-item label="设备IP/ID:" :label-width="formLabelWidth" prop="deviceIp" :required="true">
- <el-input v-model="form_add_device.deviceIp" autocomplete="off" placeholder="请输入设备IP/ID"
- maxlength="4">
- </el-input>
- </el-form-item>
- <el-form-item label="设备类型:" :label-width="formLabelWidth" prop="checkedDevice" :required="true">
- <el-checkbox-group v-model="form_add_device.checkedDevice" :min="0" :max="1">
- <el-checkbox v-for="(device, index) in form_add_device.devices" :label="device" :key="index">
- {{device}}
- </el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialog_add_device = false">取 消</el-button>
- <el-button type="primary" @click="dialog_add_air_click">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 编辑房间 -->
- <el-dialog title="编辑房间" custom-class="el-dialog-modify-room" :visible.sync="dialog_modify_room"
- :close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_modify_room')">
- <!-- <el-form :model="form_modify_room" ref="modify_room_form" :rules="form_modify_room_rules"> -->
- <el-form :model="form_modify_room" ref="modify_room_form">
- <el-form-item label="校区:" :label-width="formLabelWidth">
- <div>{{form_modify_room.school}}</div>
- </el-form-item>
- <el-form-item label="楼栋:" :label-width="formLabelWidth">
- <div>{{form_modify_room.building}}</div>
- </el-form-item>
- <el-form-item label="楼层:" :label-width="formLabelWidth">
- <div>{{form_modify_room.floor}}</div>
- </el-form-item>
- <el-form-item label="房间:" :label-width="formLabelWidth" :required="true" prop="room">
- <el-input v-model="form_modify_room.room" autocomplete="off" placeholder="请输入房间号"
- ref="ref_modi_room" maxlength="10"
- @keydown.enter.native="dialog_modify_room_click(show_modify_room)"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialog_modify_room = false">取 消</el-button>
- <el-button type="primary" @click="dialog_modify_room_click(show_modify_room)">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 删除房间 -->
- <el-dialog custom-class="el-dialog-delete-room" :visible.sync="dialog_delete_room" :close-on-click-modal="false"
- :close-on-press-escape="false" :show-close="false">
- <div slot="" class="del-air-body">
- <img src="../../icons/serveAC/del_warning.png" alt="">
- <div class="del-air-body-txt">是否确定将该房间【{{ show_delete_room }}】从列表中移除?</div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialog_delete_room = false"> 否 </el-button>
- <el-button type="primary" @click="dialog_delete_rooms_click(show_delete_room)"> 是 </el-button>
- </div>
- </el-dialog>
- <!-- 删除空调 -->
- <el-dialog custom-class="el-dialog-delete-air" :visible.sync="dialog_delete_air" :close-on-click-modal="false"
- :close-on-press-escape="false" :show-close="false">
- <div slot="" class="del-air-body">
- <img src="../../icons/serveAC/del_warning.png" alt="">
- <div class="del-air-body-txt">是否确定刪除IP/ID为【{{delAir.deleteAirIp}}】的空调?</div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialog_delete_air = false"> 否 </el-button>
- <el-button type="primary" @click="dialog_delete_air_click"> 是 </el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- getBuildingData,
- addBuild,
- addFloors,
- addRooms,
- addAirs,
- getRoomAirs,
- deleteAirs,
- getRoomsAndAirs,
- getOpeningAndAbnomal,
- updateRooms,
- delRooms,
- startAirs,
- stopAirs,
- selAirsStatus
- } from '@/api/serveAC'
- const deviceOptions = ['1匹', '1.5匹', '2匹', '3匹', '天花机器(3匹)'];
- export default {
- data() {
- // var checkloudong = (rule, value, callback) => {
- // if (!value) {
- // return callback(new Error('请输入楼栋名称'));
- // }
- // setTimeout(() => {
- // var reg = /^[a-zA-Z0-9_\u4e00-\u9fa5]{2,10}$/
- // if (!reg.test(value)) {
- // callback(new Error('必须为2-10个汉字、数字、字母或下划线!'));
- // } else {
- // callback();
- // }
- // }, 100);
- // }
- var checklouceng = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入数字楼层号'));
- }
- setTimeout(() => {
- var reg = /^[1-9]{1}$/
- if (!reg.test(value)) {
- callback(new Error('楼层只能输入 1 到 9 的数字'));
- } else {
- callback();
- }
- }, 100);
- }
- // var checkroom = (rule, value, callback) => {
- // if (!value) {
- // return callback(new Error('请输入房间号'));
- // }
- // setTimeout(() => {
- // var regH = /[\d]$/g;
- // var floor = this.currentData.floor.replace(regH, '');
- // var reg = /[1-9]{1}[0-9]{2,3}$/
- // if (value.indexOf(floor)) {
- // callback(new Error('房间号数字部分,必须以楼层号开头!'));
- // } else if (!reg.test(value)) {
- // callback(new Error('房间号数字部分,为3-4个数字,非0开头!栋号不需要添加!'));
- // } else {
- // callback();
- // }
- // }, 100);
- // }
- var checkCao = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入操作员'));
- }
- setTimeout(() => {
- var reg = /^[\u4e00-\u9fa5]{2,10}$/
- if (!reg.test(value)) {
- callback(new Error('必须为2-10个汉字!'));
- } else {
- callback();
- }
- }, 100);
- }
- var checkcontact = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入手机号码'));
- }
- setTimeout(() => {
- var reg =
- /^((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}$/
- if (!reg.test(value)) {
- callback(new Error('手机号码输入不规范!'));
- } else {
- callback();
- }
- }, 100);
- }
- var checkDeviceName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入设备名称'));
- }
- setTimeout(() => {
- var reg = /^[a-zA-Z0-9_\u4e00-\u9fa5]{2,10}$/
- if (!reg.test(value)) {
- callback(new Error('必须为2-10个汉字、数字、字母或下划线!'));
- } else {
- callback();
- }
- }, 100);
- }
- var checkDeviceIp = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请输入设备IP/ID'));
- }
- setTimeout(() => {
- var reg = /^[0-9]{4}$/
- if (!reg.test(value)) {
- callback(new Error('必须为4位数字!'));
- } else {
- callback();
- }
- }, 100);
- }
- var checkCheckedDevice = (rule, value, callback) => {
- if (!value[0]) {
- return callback(new Error('请选择设备类型'));
- } else {
- callback();
- }
- }
- return {
- room_number: 0, // 房间数量
- device_number: 0, // 设备数量
- open_number: 0, // 已开启
- warning_number: 0, // 预警台数
- search_datatime: '',
- // 添加楼栋
- dialog_add_loudong: false, // 显示 或 隐藏 添加楼栋对话框
- form_add_loudong: { // 添加楼栋数据
- school: '',
- building: ''
- },
- // form_add_loudong_rules: { // 添加楼栋表单验证
- // building: [{
- // validator: checkloudong
- // }]
- // },
- // 添加楼层
- dialog_add_louceng: false,
- form_add_louceng: { // 添加楼层数据
- school: '',
- building: '',
- floor: ''
- },
- form_add_louceng_rules: { // 添加楼层表单验证
- floor: [{
- validator: checklouceng
- }]
- },
- // 新增房间
- dialog_add_room: false,
- form_add_room: { // 新增房间数据
- school: '',
- building: '',
- floor: '',
- room: ''
- },
- // form_add_room_rules: { // 添加房间表单验证
- // room: [{
- // validator: checkroom
- // }]
- // },
- // 修改房间
- dialog_modify_room: false,
- form_modify_room: { // 修改房间数据
- school: '',
- building: '',
- floor: '',
- room: ''
- },
- // form_modify_room_rules: { // 修改房间表单验证
- // room: [{
- // validator: checkroom
- // }]
- // },
- // 添加设备
- dialog_add_device: false,
- form_add_device: { // 添加设备数据
- school: '',
- build: '',
- floors: '',
- room: '',
- deviceName: '',
- deviceIp: '',
- checkedDevice: [],
- devices: deviceOptions,
- duration_use: 0.00, // 使用时长
- is_normal: '1', // 是否正常
- is_on: '0', // 是否开启
- cao: '', // 操作员
- contact: ''
- },
- form_add_device_rules: {
- deviceName: [{
- validator: checkDeviceName
- }],
- deviceIp: [{
- validator: checkDeviceIp
- }],
- checkedDevice: [{
- validator: checkCheckedDevice
- }],
- cao: [{
- validator: checkCao
- }],
- contact: [{
- validator: checkcontact
- }]
- },
- dialog_operator_details: false, // 操作员详情
- form_operator_details: { // 操作员详情数据
- name: '',
- contact: ''
- },
- dialog_delete_room: false, // 删除房间
- show_delete_room: '', // 记录需要删除的房间
- dialog_delete_air: false, // 删除空调
- show_modify_room: '', // 记录需要修改的房间
- btnActive: 'all',
- louceng_click_id: '',
- // 左侧导航数据:校区,楼栋,楼层
- navData: [],
- form: {
- status: '',
- name: '',
- building: '',
- floor: '',
- room: '',
- device: ''
- },
- formLabelWidth: '120px',
- // 保存当前页数据
- currentData: {
- school: '',
- building: '',
- floor: '',
- allRooms: [],
- rooms: [{
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }],
- addDevice: '',
- title_any_where: '',
- clickElement: ''
- },
- // 分页参数
- pagination: {
- pageSize: 4,
- currentPage: 1,
- total: 0
- },
- delAir: {
- deleteAirIp: '',
- room: ''
- },
- navLoading: false, // 加载
- listLoading: false,
- airsLoading: [{
- loading: false,
- text: ''
- }, {
- loading: false,
- text: ''
- }, {
- loading: false,
- text: ''
- }, {
- loading: false,
- text: ''
- }]
- }
- },
- created() {
- // 获取消费记录,表格数据
- this.get_loudong_data()
- // 默认选中第一个房间
- let auto_click = setInterval(() => {
- let louchen_first = document.getElementById("louceng000");
- if (louchen_first !== null) {
- louchen_first.click();
- clearInterval(auto_click);
- }
- }, 200);
- },
- mounted() {
- document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
- },
- methods: {
- /**
- * 开关空调
- * @param {Object} roomIndex
- * @param {Object} rowIndex
- */
- open_close_airs(roomIndex, rowIndex, row, open_close) {
- // console.log(roomIndex, rowIndex, row, open_close);
- // console.log(this.currentData.rooms[roomIndex].tableData[rowIndex]);
- // console.log(row);
- let air_ip = this.currentData.rooms[roomIndex].tableData[rowIndex].ip;
- if (open_close == 'open') {
- this.$set(this.airsLoading[roomIndex], 'loading', true);
- this.$set(this.airsLoading[roomIndex], 'text', row.name + ' ' + row.device + ' 正在【开机】中...');
- let user = this.$store.state.user;
- startAirs({
- admin_name: user.name,
- password: user.pwd,
- air_ip: air_ip
- }).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex], 'onOffStatus',
- res
- .is_on)
- if (res.is_normal == 1) {
- this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
- 'alarmStatus',
- '正常')
- } else {
- this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
- 'alarmStatus',
- '异常')
- }
- // let _this = this;
- // setTimeout(() => {
- // _this.getAirsStatus(roomIndex, rowIndex, air_ip)
- // }, 4000)
- } else {
- this.$message.error(res.message)
- }
- this.$set(this.airsLoading[roomIndex], 'loading', false);
- }).catch((err) => {
- // console.log(err);
- // this.$message.error(err.message)
- this.$set(this.airsLoading[roomIndex], 'loading', false);
- })
- } else if (open_close == 'close') {
- this.$set(this.airsLoading[roomIndex], 'loading', true);
- this.$set(this.airsLoading[roomIndex], 'text', row.name + ' ' + row.device + ' 正在【关机】中...');
- stopAirs({
- air_ip: air_ip
- }).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex], 'onOffStatus',
- res
- .is_on)
- if (res.is_normal == 1) {
- this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
- 'alarmStatus',
- '正常')
- } else {
- this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
- 'alarmStatus',
- '异常')
- }
- // let _this = this;
- // setTimeout(() => {
- // _this.getAirsStatus(roomIndex, rowIndex, air_ip)
- // }, 4000)
- } else {
- this.$message.error(res.message)
- }
- this.$set(this.airsLoading[roomIndex], 'loading', false);
- }).catch((err) => {
- // console.log(err);
- // this.$message.error(err.message)
- this.$set(this.airsLoading[roomIndex], 'loading', false);
- })
- }
- },
- /**
- * 获取空调状态
- * @param {Object} roomIndex
- * @param {Object} rowIndex
- * @param {Object} air_ip
- */
- getAirsStatus(roomIndex, rowIndex, air_ip) {
- console.log(roomIndex, rowIndex);
- selAirsStatus({
- air_ip: air_ip
- }).then((res) => {
- console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.currentData.rooms[roomIndex].tableData[rowIndex].onOffStatus == res.is_on
- this.currentData.rooms[roomIndex].tableData[rowIndex].alarmStatus == res.is_normal
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- },
- /**
- * 编辑修改房间
- */
- dialog_modify_room_click(room) {
- updateRooms({
- school: this.form_modify_room.school,
- build: this.form_modify_room.building,
- floors: this.form_modify_room.floor,
- dom: this.form_modify_room.room,
- old_dom: room
- }).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- // 隐藏删除对话框
- this.dialog_modify_room = false
- // 更新本地变量中的房间
- let tmp = this.navData
- for (var i = 0; i < tmp.length; i++) {
- if (tmp[i].label == this.form_modify_room.school && typeof tmp[i].children !==
- 'undefined' && tmp[i].children.length > 0) {
- let tmp1 = tmp[i].children;
- for (var j = 0; j < tmp1.length; j++) {
- if (tmp1[j].label == this.form_modify_room.building && typeof tmp1[j]
- .children !== 'undefined' && tmp1[j].children.length > 0) {
- let tmp2 = tmp1[j].children;
- for (var k = 0; k < tmp2.length; k++) {
- if (tmp2[k].label == this.form_modify_room.floor &&
- typeof tmp2[k]
- .rooms !== 'undefined' && tmp2[k].rooms.length > 0) {
- let tmp3 = tmp2[k].rooms;
- for (var p = 0; p < tmp3.length; p++) {
- if (tmp3[p] == room) {
- this.navData[i].children[j].children[k].rooms[p] =
- this
- .form_modify_room.building + '-' + this
- .form_modify_room.room;
- }
- }
- this.navData[i].children[j].children[k].rooms.sort();
- }
- }
- }
- }
- }
- }
- // 自动点击
- this.currentData.clickElement.click()
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- },
- /**
- * 删除房间
- * @param {Object} room
- */
- dialog_delete_rooms_click(room) {
- let data = this.currentData.title_any_where.split('-')
- delRooms({
- school: data[0],
- build: data[1],
- floors: data[2],
- dom: room
- }).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- // 隐藏删除对话框
- this.dialog_delete_room = false
- // 更新本地变量中的房间
- let tmp = this.navData
- for (var i = 0; i < tmp.length; i++) {
- if (tmp[i].label == data[0] && typeof tmp[i].children !== 'undefined' && tmp[i]
- .children.length > 0) {
- let tmp1 = tmp[i].children
- for (var j = 0; j < tmp1.length; j++) {
- if (tmp1[j].label == data[1] && typeof tmp1[j].children !==
- 'undefined' && tmp1[j].children.length > 0) {
- let tmp2 = tmp1[j].children
- for (var k = 0; k < tmp2.length; k++) {
- if (tmp2[k].label == data[2] && typeof tmp2[k].rooms !==
- 'undefined' && tmp2[k].rooms.length > 0) {
- let tmp3 = tmp2[k].rooms
- for (var p = 0; p < tmp3.length; p++) {
- if (tmp3[p] == room) {
- this.navData[i].children[j].children[k].rooms
- .splice(p, 1)
- }
- }
- this.navData[i].children[j].children[k].rooms.sort()
- }
- }
- }
- }
- }
- }
- // 自动点击
- this.currentData.clickElement.click()
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- },
- /**
- * 获取楼栋信息
- */
- get_loudong_data() {
- this.navLoading = true;
- getBuildingData().then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!');
- return;
- }
- // console.log(res.data);
- if (typeof res.data == 'undefined' || res.data == '') {
- this.$message.error('返回数据格式问题,data未获取到!');
- return;
- }
- // 校区
- let school = JSON.parse(res.data);
- // console.log('school', school);
- if (school.length > 0) {
- this.navData = []
- let tmpSchool = []
- for (var i = 0; i < school.length; i++) {
- let nData = []
- let builds = school[i].builds
- for (var j = 0; j < builds.length; j++) {
- let tmpBuilds = {}
- let tmpFloors = []
- let floors = builds[j]['floors']
- for (var k = 0; k < floors.length; k++) {
- let floor = {
- id: floors[k].id,
- label: floors[k].floor,
- rooms: floors[k].rooms
- }
- // 房间排序
- floor.rooms.sort();
- tmpFloors.push(floor);
- }
- // 楼层排序
- tmpFloors.sort((a, b) => {
- return (a.label - b.label)
- })
- tmpBuilds.id = builds[j].id
- tmpBuilds.label = builds[j].building
- tmpBuilds.isShow = true
- tmpBuilds.children = []
- tmpBuilds.children = tmpFloors
- nData.push(tmpBuilds)
- }
- // 楼栋排序
- nData.sort((a, b) => a.label.localeCompare(b.label))
- tmpSchool.push({
- id: school[i].id,
- label: school[i].school,
- isShow: true,
- children: nData
- })
- }
- // 校区排序
- tmpSchool.sort((a, b) => b.label.localeCompare(a.label))
- this.navData = tmpSchool
- // console.log(JSON.stringify(this.navData));
- } else {
- this.navData = []
- this.$message.warning('没有符合条件的数据!')
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- });
- this.navLoading = false;
- },
- /**
- * 获取房间数据
- * @param {Object} school
- * @param {Object} build
- * @param {Object} floors
- * @param {Object} room
- * @param {Object} index
- */
- get_room_airs_data(school, build, floors, room, index) {
- // console.log(school, build, floors, room, index);
- let param = {
- school: school,
- build: build,
- floors: floors,
- dom: room
- }
- getRoomAirs(param).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- let data = res.data
- // 有设备数据
- if (typeof data !== 'undefined' && data !== '') {
- let tmpTableData = []
- for (var i = 0; i < data.length; i++) {
- let room = {}
- let param = this.btnActive
- if (param == 'all') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- } else if (param == 'powerOn' && data[i].is_on == '1') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- } else if (param == 'powerOff' && data[i].is_on == '0') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- } else if (param == 'abnormal' && data[i].is_normal == '0') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- }
- if (JSON.stringify(room) !== '{}') {
- // 每个房间的设备循环添加
- tmpTableData.push(room)
- }
- }
- if (tmpTableData.length > 0) {
- tmpTableData.sort((a, b) => a.ip.localeCompare(b.ip))
- this.currentData.rooms[index].tableData = tmpTableData
- }
- } else {
- // this.$message.warning(room + ' 没有设备的数据!')
- }
- this.currentData.rooms[index].room = room
- } else {
- this.$message.error('异常!请检查数据!')
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- },
- /**
- * 选项的展开与收起,进行切换,递归调用
- * @param {Object} obj
- * @param {Object} id
- */
- toggle_item(obj, id) {
- for (var i = 0; i < obj.length; i++) {
- if (obj[i].id == id) {
- if (obj[i].isShow) {
- obj[i].isShow = false
- } else {
- obj[i].isShow = true
- }
- return
- }
- if (typeof obj[i].children != 'undefined' && obj[i].children.length > 0) {
- this.toggle_item(obj[i].children, id)
- }
- }
- },
- /**
- * 选项的展开与收起,进行切换
- * @param {Object} e
- */
- school_toggle(id, label) {
- // console.log(id);
- // console.log(label);
- // 获取id
- this.toggle_item(this.navData, id)
- },
- /**
- * 单击楼栋
- * @param {Object} e
- */
- loudong_toggle(id, label) {
- let ids = id.split('|')
- let labels = label.split('|')
- // console.log(ids);
- // console.log(labels);
- // 获取id
- this.toggle_item(this.navData, ids[0])
- },
- /**
- * 单击楼层
- * @param {Object} e
- * @param {Object} id
- * @param {Object} label
- * @param {Object} rooms
- */
- louceng_click(e, id, label, rooms) {
- this.listLoading = true;
- let ids = id.split('|');
- let labels = label.split('|');
- // console.log(ids);
- // console.log(labels);
- // console.log(rooms);
- // 清空数据
- this.currentData = {
- school: '',
- building: '',
- floor: '',
- allRooms: [],
- rooms: [{
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }],
- addDevice: '',
- title_any_where: '',
- clickElement: e.target
- };
- // 点击的楼层id
- this.louceng_click_id = ids[0];
- // 填充数据
- this.currentData.school = labels[2];
- this.currentData.building = labels[1];
- this.currentData.floor = labels[0];
- // 给右侧窗口标题赋值
- this.currentData.title_any_where = this.currentData.school + '-' + this.currentData
- .building + '-' + this.currentData.floor;
- // 获取开机、关机、异常的房间,空的不显示
- this.open_close_abnormal(this.currentData.school, this.currentData.building, this.currentData.floor,
- rooms);
- // 某层房间空调数
- this.getRoomsAndAirs(this.currentData.school, this.currentData.building, this.currentData.floor);
- // 某层空调开启和异常统计
- this.getOpeningAndAbnomal(this.currentData.school, this.currentData.building, this.currentData
- .floor);
- setTimeout(() => {
- this.listLoading = false;
- }, 500);
- },
- /**
- * 获取开机、关机、异常房间数
- * @param {Object} school
- * @param {Object} build
- * @param {Object} floors
- * @param {Object} rooms
- */
- open_close_abnormal(school, build, floors, rooms) {
- let _this = this,
- len = rooms.length;
- for (var i = 0; i < len; i++) {
- // 延时执行
- (function(t, school, build, floors, room, len) { // 注意这里是形参
- setTimeout(function() {
- _this.get_rooms(t, school, build, floors, room, len)
- }, 50 * t); // 还是0.05执行一次,不是累加的
- })(i, school, build, floors, rooms[i], len - 1); // 注意这里是实参,这里把要用的参数传进去
- }
- },
- /**
- * 获取房间数量
- * @param {Object} school
- * @param {Object} build
- * @param {Object} floors
- * @param {Object} room
- */
- get_rooms(index, school, build, floors, room, len) {
- // console.log(index, school, build, floors, room, len);
- if (this.btnActive == 'all') {
- this.currentData.allRooms.push(room);
- if (index == len) {
- // console.log(this.currentData);
- this.pagination_showData()
- }
- } else {
- let param = {
- school: school,
- build: build,
- floors: floors,
- dom: room
- }
- getRoomAirs(param).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- // this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- let data = res.data
- // 有设备数据
- if (typeof data !== 'undefined' && data !== '') {
- let tmpTableData = []
- for (var i = 0; i < data.length; i++) {
- let room = {}
- let param = this.btnActive
- if (param == 'all') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- } else if (param == 'powerOn' && data[i].is_on == '1') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- } else if (param == 'powerOff' && data[i].is_on == '0') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- } else if (param == 'abnormal' && data[i].is_normal == '0') {
- room = {
- name: data[i].air_name, // 名称
- ip: data[i].air_ip, // 空调ip或id
- building: data[i].build, // 楼栋
- device: data[i].air_config, // 空调配置
- userTime: data[i].duration_use, // 使用时长
- alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
- onOffStatus: data[i].is_on, // 是否开启
- userName: data[i].cao, // 操作员
- contact: '待接口返回,待优化' // 联系方式
- }
- }
- if (JSON.stringify(room) !== '{}') {
- // 每个房间的设备循环添加
- tmpTableData.push(room)
- }
- }
- if (tmpTableData.length > 0) {
- this.currentData.allRooms.push(room)
- }
- } else {
- // this.$message.warning(room + ' 没有设备的数据!')
- }
- } else {
- this.$message.error('异常!请检查数据!')
- }
- if (index == len) {
- // console.log(this.currentData);
- this.pagination_showData()
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- });
- }
- },
- /**
- * 分页显示数据
- */
- pagination_showData() {
- // 赋值分页数据
- this.pagination.total = this.currentData.allRooms.length;
- // 最后一页删除后已经空了,则显示前一页或第1页
- let size = Math.ceil(this.pagination.total / 4);
- if (size != 0 && this.pagination.currentPage > size) {
- this.pagination.currentPage = size;
- }
- // 进行分页处理
- this.roomDataPagination(this.pagination.currentPage, this.pagination.pageSize, this
- .currentData.allRooms, this.currentData.school, this.currentData.building, this
- .currentData.floor);
- },
- /**
- * 某层空调开启和异常统计
- * @param {Object} school
- * @param {Object} build
- * @param {Object} floors
- */
- getOpeningAndAbnomal(school, build, floors) {
- getOpeningAndAbnomal({
- school,
- build,
- floors
- }).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- // 填充数据
- this.open_number = res.onNum
- this.warning_number = res.stateNum
- } else {
- // this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- },
- /**
- * 某层房间空调数
- * @param {Object} school
- * @param {Object} build
- * @param {Object} floors
- */
- getRoomsAndAirs(school, build, floors) {
- getRoomsAndAirs({
- school,
- build,
- floors
- }).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- // 填充数据
- this.room_number = res.domNum
- this.device_number = res.airNum
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- },
- /**
- * 实现分页
- * @param {Object} currentPage
- * @param {Object} pageSize
- * @param {Object} rooms
- */
- roomDataPagination(currentPage, pageSize, rooms, school, build, floors) {
- // console.log(currentPage, pageSize, rooms, school, build, floors);
- let startRecord = (currentPage - 1) * pageSize
- // 避免最后一页不满4个的情况
- let len = rooms.length
- if (startRecord + pageSize < rooms.length) {
- len = startRecord + pageSize
- }
- let _this = this
- let index = 0
- for (var i = startRecord; i < len; i++) {
- // 延时执行
- (function(t, school, build, floors, room, index) { // 注意这里是形参
- setTimeout(function() {
- _this.get_room_airs_data(school, build, floors, room, index)
- }, 50 * t); // 还是0.05执行一次,不是累加的
- })(i, school, build, floors, rooms[i], index); // 注意这里是实参,这里把要用的参数传进去
- index = index + 1
- }
- },
- /**
- * 添加房间
- */
- add_room() {
- if (this.currentData.school == '' || this.currentData.building == '' || this.currentData.floor ==
- '') {
- this.$message.warning('请选择楼层后,再添加房间!')
- return
- }
- // 填充数据
- this.form_add_room.school = this.currentData.school
- this.form_add_room.building = this.currentData.building
- this.form_add_room.floor = this.currentData.floor
- // 显示添加房间
- this.dialog_add_room = true
- setTimeout(() => {
- this.$nextTick(() => {
- this.$refs.ref_add_room.focus()
- })
- }, 500)
- },
- /**
- * 添加楼层
- * @param {Object} e
- */
- add_louceng(id, label) {
- // let ids = id.split('|')
- let labels = label.split('|')
- // console.log(ids);
- // console.log(labels);
- this.form_add_louceng.school = labels[1]
- this.form_add_louceng.building = labels[0]
- // 显示添加楼层
- this.dialog_add_louceng = true
- setTimeout(() => {
- this.$nextTick(() => {
- this.$refs.ref_louceng.focus()
- })
- }, 500)
- },
- /**
- * 告警状态: 异常
- * @param {Object} index
- * @param {Object} row
- */
- alarm_status_click(index, row) {
- console.log(index, row);
- this.form_operator_details.name = row.userName
- this.form_operator_details.contact = row.contact
- // 显示操作详情
- this.dialog_operator_details = true
- },
- /**
- * 添加楼栋
- */
- add_loudong(id, label) {
- // console.log(id);
- // console.log(label);
- this.form_add_loudong.school = label
- // 显示添加楼栋
- this.dialog_add_loudong = true
- setTimeout(() => {
- this.$nextTick(() => {
- this.$refs.ref_loudong.focus()
- })
- }, 500)
- },
- /**
- * 添加楼栋对话框
- */
- dialog_add_loudong_click() {
- this.$refs["add_loudong_form"].validate(validate => {
- if (validate) {
- // console.log(this.form_add_loudong);
- addBuild(this.form_add_loudong).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.get_loudong_data()
- this.$message.success('楼栋添加成功!')
- this.dialog_add_loudong = false
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- } else {
- this.$message.error('验证不通过')
- return false
- }
- })
- },
- /**
- * 添加楼层对话框
- */
- dialog_add_louceng_click() {
- this.$refs["add_louceng_form"].validate(validate => {
- if (validate) {
- // console.log(this.form_add_louceng);
- addFloors(this.form_add_louceng).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.get_loudong_data()
- this.$message.success('楼层添加成功!')
- this.dialog_add_louceng = false
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- } else {
- this.$message.error('验证不通过')
- return false
- }
- })
- },
- /**
- * 添加房间对话框
- */
- dialog_add_room_click() {
- this.$refs["add_room_form"].validate(validate => {
- if (validate) {
- // console.log(this.form_add_room);
- addRooms(this.form_add_room).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.get_loudong_data()
- this.$message.success('房间添加成功!')
- this.dialog_add_room = false
- let _this = this
- setTimeout(() => {
- _this.currentData.clickElement.click()
- }, 1000)
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- } else {
- this.$message.error('验证不通过')
- return false
- }
- })
- },
- /**
- * 添加空调对话框
- */
- dialog_add_air_click() {
- this.$refs["add_device_form"].validate(validate => {
- if (validate) {
- // console.log(this.form_add_device);
- addAirs(this.form_add_device).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.get_loudong_data()
- this.$message.success('空调设备添加成功!')
- this.dialog_add_device = false
- let _this = this
- setTimeout(() => {
- _this.currentData.clickElement.click()
- }, 1000)
- setTimeout(() => {
- }, 300)
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- } else {
- this.$message.error('验证不通过')
- return false
- }
- })
- },
- /**
- * 刪除空调对话框
- */
- dialog_delete_air_click() {
- let delAir = {
- school: this.currentData.school,
- build: this.currentData.building,
- floors: this.currentData.floor,
- dom: this.delAir.room,
- air_ip: this.delAir.deleteAirIp
- }
- // console.log(delAir);
- deleteAirs(delAir).then((res) => {
- // console.log(res);
- if (typeof res.code == 'undefined' || res.code == '') {
- this.$message.error('返回数据格式问题,code未获取到!')
- return
- }
- if (res.code == 200) {
- this.get_loudong_data()
- this.$message.success('空调 ' + delAir.air_ip + ' 删除成功!')
- this.dialog_delete_air = false
- let _this = this
- setTimeout(() => {
- _this.currentData.clickElement.click()
- }, 1000)
- } else {
- this.$message.error(res.message)
- }
- }).catch((err) => {
- // console.log(err);
- this.$message.error(err.message)
- })
- },
- // 主题部分按钮的单击事件
- top_btn_click(param) {
- this.btnActive = param;
- if (param == 'all') {
- this.currentData.clickElement.click();
- } else if (param == 'powerOn') {
- this.currentData.clickElement.click();
- } else if (param == 'powerOff') {
- this.currentData.clickElement.click();
- } else if (param == 'abnormal') {
- this.currentData.clickElement.click();
- } else {
- this.$message.error('点击按钮出错!');
- }
- },
- /**
- * 添加空调设备
- * @param {Object} room
- */
- add_device(room) {
- // this.$message.success(room)
- this.currentData.addDevice = room
- // 填充数据
- this.form_add_device.school = this.currentData.school
- this.form_add_device.build = this.currentData.building
- this.form_add_device.floors = this.currentData.floor
- this.form_add_device.room = room
- // 显示对话框
- this.dialog_add_device = true
- setTimeout(() => {
- this.$nextTick(() => {
- this.$refs.ref_cao.focus()
- })
- }, 500)
- },
- /**
- * 操作编辑修改房间
- * @param {Object} room
- */
- operate_modify_room(room) {
- let tmpData = this.currentData.title_any_where.split('-');
- this.form_modify_room.school = tmpData[0]
- this.form_modify_room.building = tmpData[1]
- this.form_modify_room.floor = tmpData[2]
- this.form_modify_room.room = room.split('-')[1]
- this.show_modify_room = room
- this.dialog_modify_room = true
- setTimeout(() => {
- this.$nextTick(() => {
- this.$refs.ref_modi_room.focus()
- })
- }, 500)
- },
- /**
- * 操作删除房间
- */
- operate_delete_room(room) {
- this.show_delete_room = room
- this.dialog_delete_room = true
- },
- /**
- * 操作删除空调
- * @param {Object} index
- * @param {Object} row
- */
- operate_delete_air(index, row, room) {
- // console.log(index, row, row.ip, room);
- this.delAir.deleteAirIp = row.ip
- this.delAir.room = room
- this.dialog_delete_air = true
- },
- /**
- * 对话框关闭时清理数据
- */
- dialog_close(param) {
- if (param == 'form_add_loudong') {
- this.form_add_loudong = {
- school: '',
- building: ''
- }
- }
- if (param == 'form_add_louceng') {
- this.form_add_louceng = {
- school: '',
- building: '',
- floor: ''
- }
- }
- if (param == 'form_add_room') {
- this.form_add_room = {
- school: '',
- building: '',
- floor: '',
- room: ''
- }
- }
- if (param == 'form_modify_room') {
- this.form_modify_room = {
- school: '',
- building: '',
- floor: '',
- room: ''
- }
- }
- if (param == 'form_add_device') {
- this.form_add_device = {
- school: '',
- build: '',
- floors: '',
- room: '',
- deviceName: '',
- deviceIp: '',
- checkedDevice: [],
- devices: deviceOptions,
- duration_use: 0.00, // 使用时长
- is_normal: '0', // 是否正常
- is_on: '0', // 是否开启
- cao: '' // 操作员
- }
- }
- if (param == 'form_operator_details') {
- this.form_operator_details = {
- name: '',
- contact: ''
- }
- }
- },
- /**
- * currentPage 改变时会触发
- * @param {Object} val
- */
- currentPageChange(val) {
- this.listLoading = true;
- // console.log('当前页:' + val);
- // 清理一下当前数据中的rooms
- this.currentData.rooms = [{
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }, {
- room: '',
- tableData: []
- }];
- this.pagination.currentPage = val;
- this.roomDataPagination(this.pagination.currentPage, this.pagination.pageSize, this.currentData
- .allRooms,
- this.currentData.school, this.currentData.building, this.currentData.floor);
- this.listLoading = false;
- },
- /**
- * 设置表格单元格样式
- */
- setCellStyle() {
- return `
- color: #53575A;
- font-size: 14px;
- font-family: Microsoft YaHei-3970(82674968);
- background-color: #ECF1F8;
- border-bottom: 1px solid #DBE0E7;
- `
- },
- /**
- * 设置表格头部单元格样式
- */
- setHeaderSellStyle({
- row,
- column,
- rowIndex,
- columnIndex
- }) {
- if (columnIndex === 0) {
- return `
- background: #FFFFFF;
- color: #53575A;
- font-size: 14px;
- font-family: Microsoft YaHei-3970(82674968);
- border-radius: 6px 0 0 6px;
- `
- } else if (columnIndex === 6) {
- return `
- background: #FFFFFF;
- color: #53575A;
- font-size: 14px;
- font-family: Microsoft YaHei-3970(82674968);
- border-radius: 0 6px 6px 0;
- `
- } else {
- return `
- background: #FFFFFF;
- color: #53575A;
- font-size: 14px;
- font-family: Microsoft YaHei-3970(82674968);
- `
- }
- }
- },
- }
- </script>
- <style scoped lang="scss">
- .app-container {
- background-color: #EFF2F7;
- padding: 10px;
- .el-row {
- .nav-class {
- .nav-box {
- height: 788px;
- overflow-x: hidden;
- overflow-y: scroll;
- }
- .nav-box::-webkit-scrollbar {
- display: none;
- }
- }
- .el-col {
- .nav-box {
- margin: 10px 5px 0 10px;
- padding: 20px 0;
- border-radius: 10px;
- background-color: #FFFFFF;
- font-size: 18px;
- // box-shadow: 5px 5px 15px #979797;
- box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
- .item-school {
- margin-top: 0px;
- .school {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px;
- background: #2B4CFE;
- font-family: Microsoft YaHei-3970(82674968);
- font-weight: bold;
- color: #EDF0F5;
- cursor: pointer;
- white-space: nowrap;
- }
- .item-loudong {
- display: flex;
- flex-direction: column;
- padding: 10px 0 0 0;
- .loudong {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 10px 10px 20px;
- background: #EDF0F5;
- font-family: Microsoft YaHei-3970(82674968);
- font-weight: bold;
- color: #2B4CFE;
- cursor: pointer;
- .louidong_text {
- white-space: nowrap;
- width: 260px;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- .item-louceng {
- display: flex;
- flex-direction: column;
- margin-left: 40px;
- .louceng {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 10px;
- height: 30px;
- font-size: 18px;
- cursor: pointer;
- }
- .louceng:hover {
- background-color: #5c87ff;
- color: #FFFFFF;
- }
- .louceng-clicked {
- font-size: 20px;
- font-weight: bold;
- background-color: #5c87ff;
- color: #FFFFFF;
- }
- }
- .loudong-add-louceng {
- display: flex;
- align-items: center;
- padding: 10px 0 10px 30px;
- cursor: pointer;
- .loudong-add-louceng-txt {
- margin-left: 5px;
- }
- }
- }
- }
- .item-school .item-loudong:nth-child(2) {
- padding: 0;
- }
- .add-loudong {
- display: flex;
- align-items: center;
- padding: 10px 0 0 20px;
- cursor: pointer;
- .add-loudong-txt {
- margin-left: 5px;
- }
- }
- }
- .cell {
- margin: 10px 10px 10px 0;
- padding: 20px;
- border-radius: 10px;
- background-color: #FFFFFF;
- // box-shadow: 5px 5px 15px #979797;
- box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
- .cell-title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20px;
- padding-bottom: 18px;
- border-bottom: 1px solid #CCCCCC;
- .title-left {
- display: flex;
- align-items: center;
- .title {
- font-size: 22px;
- font-family: Microsoft YaHei-3970(82674968);
- font-weight: bold;
- color: #1A202B;
- }
- .title-detail {
- margin-left: 40px;
- font-size: 18px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #1A202B;
- }
- }
- .title-right {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .el-button {
- width: 110px;
- height: 46px;
- background: #2B4CFE;
- font-size: 18px;
- color: #FFFFFF;
- font-family: Microsoft YaHei-3970(82674968);
- border-radius: 5px;
- }
- .el-button--warning {
- background: #F88A64;
- }
- }
- }
- .cell-body {
- .cell-body-top-btns {
- display: flex;
- align-items: center;
- margin-bottom: 20px;
- .btn-active {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 66px;
- height: 36px;
- border-radius: 18px;
- font-size: 18px;
- font-family: Microsoft YaHei-3970(82674968);
- background: #2B4CFE;
- color: #FEFEFE;
- margin-right: 10px;
- }
- .btn-no-active {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 66px;
- height: 36px;
- border: none;
- font-size: 18px;
- font-family: Microsoft YaHei-3970(82674968);
- background: none;
- color: #53575A;
- margin-right: 10px;
- }
- }
- .el-row {
- height: 286px;
- .el-col {
- .panel-left,
- .panel-right {
- background: #ECF1F8;
- border-radius: 10px;
- margin: 0 0 10px 0;
- }
- .panel-left,
- .panel-right {
- .panel-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 5px 20px;
- margin-bottom: 10px;
- border-bottom: 1px solid #D9D9D9;
- .panel-title-caption {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .panel-title-icon {
- color: #2B4CFE;
- font-size: 20px;
- margin-right: 8px;
- }
- .panel-title {
- font-size: 20px;
- }
- }
- .panel-title-btns {
- .panel-title-btn {
- margin-left: 20px;
- font-size: 16px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #2B4CFE;
- }
- }
- }
- .panel-body {
- /*将表格每一行的背景色去掉*/
- .el-table,
- .el-table__expanded-cell,
- .el-table tr {
- background-color: transparent;
- }
- ::v-deep .el-table td,
- ::v-deep .el-table th {
- padding: 6px 0;
- }
- .el-table {
- margin: 0 3px;
- width: calc(100% - 6px);
- .txt-cell-blue,
- .btn-cell-blue {
- color: #2B4CFE;
- border: none;
- font-size: 14px;
- cursor: pointer;
- }
- .btn-cell-blue {
- border: 1px solid #2B4CFE;
- }
- .power-icon {
- font-size: 20px;
- cursor: pointer;
- }
- }
- }
- .panel-footer {
- display: flex;
- align-items: center;
- padding: 10px 30px 15px 25px;
- color: #2B4CFE;
- cursor: pointer;
- .panel-footer-txt {
- margin-left: 5px;
- }
- }
- }
- .panel-right {
- margin-right: 0px;
- margin-left: 10px;
- }
- }
- }
- .pagination-table {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- height: 30px;
- margin-top: 5px;
- padding-right: 100px;
- ::v-deep .el-pagination {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- }
- ::v-deep .el-pagination ul {
- display: flex;
- }
- ::v-deep .el-pagination button,
- ::v-deep .el-pagination li {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 50px;
- height: 36px;
- border: 1px solid #626262;
- border-radius: 3px;
- font-size: 14px;
- margin: 0 5px;
- }
- ::v-deep .el-pagination span {
- margin-left: 10px;
- }
- ::v-deep .el-pagination .el-pagination__jump {
- font-size: 16px;
- }
- ::v-deep .el-pagination .el-pagination__editor {
- width: 50px;
- height: 36px;
- margin: 0 5px;
- }
- ::v-deep .el-pagination .el-input__inner {
- width: 50px;
- height: 36px;
- border: 1px solid #626262;
- margin: -4px 0 0 0;
- }
- }
- }
- }
- }
- }
- ::v-deep .el-dialog {
- margin: 0 !important;
- width: 400px;
- height: 320px;
- background: #FFFFFF;
- box-shadow: 0px 0px 13px 0px rgba(0, 0, 0, 0.29);
- border-radius: 10px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- .el-dialog__header {
- display: flex;
- align-items: center;
- width: 100%;
- height: 58px;
- padding: 30px;
- background: #E6EBFE;
- border-radius: 10px 10px 0px 0px;
- font-weight: bold;
- }
- .el-dialog__body {
- padding-bottom: 0;
- .el-form-item {
- .el-form-item__label,
- .el-form-item__content {
- font-size: 16px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #53575A;
- }
- .el-input__inner {
- width: 180px;
- }
- }
- // 删除对话框的样式
- .del-air-body {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- height: 180px;
- img {
- width: 72px;
- }
- .del-air-body-txt {
- height: 58px;
- line-height: 58px;
- font-size: 18px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #333333;
- }
- }
- }
- .el-dialog__footer {
- padding-bottom: 0 !important;
- text-align: center;
- .el-button.el-button--default {
- width: 75px;
- height: 40px;
- border: 1px solid #2B4CFE;
- border-radius: 6px;
- font-size: 16px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #2B4CFE;
- }
- .el-button.el-button--primary {
- width: 75px;
- height: 40px;
- background: #2B4CFE;
- border-radius: 6px;
- font-size: 16px;
- font-family: Microsoft YaHei-3970(82674968);
- color: #FFFFFF;
- margin-left: 60px;
- }
- }
- }
- }
- </style>
- <style>
- .el-dialog-add-loudong {
- height: 300px !important;
- }
- .el-dialog-add-room {
- height: 420px !important;
- }
- .el-dialog-modify-room {
- height: 420px !important;
- }
- .el-dialog-add-louceng {
- height: 360px !important;
- }
- .el-dialog-operator_details {
- height: 300px !important;
- }
- .el-dialog-delete-room {
- height: 300px !important;
- width: 500px !important;
- }
- .el-dialog-add-device {
- height: 590px !important;
- width: 500px !important;
- }
- .el-dialog-delete-air {
- height: 300px !important;
- }
- .el-dialog-delete-room .el-dialog__header,
- .el-dialog-delete-air .el-dialog__header {
- display: none !important;
- }
- </style>
|