detail.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652
  1. <template>
  2. <div class="safetyList">
  3. <customHeader>监控分站管理详情</customHeader>
  4. <div class="content">
  5. <a-tabs class="tab-box" v-model:activeKey="activeKey" @change="onChangeTab">
  6. <a-tab-pane tab="分站监测" key="device" />
  7. <a-tab-pane tab="历史数据" key="history" />
  8. <a-tab-pane tab="监测详情" key="manageAuto" />
  9. <a-tab-pane tab="操作记录" key="operationRecord" />
  10. </a-tabs>
  11. <div class="box-content">
  12. <!-- 分站监测 -->
  13. <div class="now-content" v-if="activeKey == 'device'">
  14. <div class="left-box">
  15. <div class="left-title">
  16. <div class="title-fz">
  17. <span>分站:</span>
  18. <span>
  19. [通讯正常]
  20. <span class="zd-open">{{ openNum || 0 }}</span>
  21. </span>
  22. <span>
  23. [通讯中断]
  24. <span class="zd-close">{{ clsoeNum || 0 }}</span>
  25. </span>
  26. </div>
  27. <div class="title-btn" style="margin-left: 55%">
  28. <a-button type="primary" size="small" @click="getAllShow">显示全部</a-button>
  29. </div>
  30. </div>
  31. <div class="left-content">
  32. <div class="card-box" v-for="(item, index) in cardList" :key="index">
  33. <div :class="[
  34. 'card-item',
  35. {
  36. selected: selectedIndex === index,
  37. 'card-itemN': item.isNewAccess,
  38. 'card-itemL': !item.isNewAccess && item.linkstatus,
  39. 'card-itemD': !item.isNewAccess && !item.linkstatus,
  40. },
  41. ]" @click="cardClick(item, index)">
  42. <div class="card-item-label">{{ item.strname }}</div>
  43. </div>
  44. <div :class="activeIndex % 4 == 3 ? 'card-modal1' : 'card-modal'" v-if="activeIndex == index && isShow">
  45. <div class="modal-name">站点名称:</div>
  46. <a-input v-model:value="stationName" size="small" placeholder="请输入" @blur="changeName" />
  47. <div class="modal-lj">连接状态:</div>
  48. <a-radio-group v-model:value="stationStatus" size="small" :options="ljList" @change="changeStatus" />
  49. <a-popconfirm title="删除内容无法恢复,是否删除" ok-text="确定" cancel-text="取消" @confirm="handleDelStation"
  50. @cancel="handleCancelDelStation">
  51. <a-button type="primary" preIcon="ant-design:delete-outlined" size="mini"
  52. class="down-btn">删除</a-button>
  53. </a-popconfirm>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="right-box">
  59. <div class="right-title">详细信息:</div>
  60. <a-table size="small" :scroll="{ y: 680 }" :columns="columns" :data-source="tableData"
  61. :pagination="pagination" @change="pageChange">
  62. <template #action="{ record }">
  63. <a-button v-if="!record.devInfoList" type="primary" :disabled="record.linkId != '0'" size="small"
  64. @click="handlerunDeviceMonitor(record, '启动')">启动</a-button>
  65. <a-button type="success" size="small" style="margin: 0px 10px"
  66. @click="handlerunDeviceMonitor(record, '编辑')">编辑</a-button>
  67. <a-popconfirm title="删除内容无法恢复,是否删除" ok-text="确定" cancel-text="取消"
  68. @confirm="handlerunDeviceMonitor(record, '删除')" @cancel="handleCancelDelStation">
  69. <a-button v-if="!record.devInfoList" type="success" size="small"
  70. style="margin-right:10px">删除</a-button>
  71. </a-popconfirm>
  72. <a-button type="primary" v-if="!record.devInfoList" size="small" @click="debugClick(record)">{{
  73. record.debugTitle }}</a-button>
  74. </template>
  75. <template #bodyCell="{ column, text }">
  76. <template v-if="column.dataIndex === 'valueJc' && text">
  77. <div v-for="item in text.split(',')" :key="item">
  78. <span
  79. v-if="item.substring(item.indexOf(':') + 1) && !isNaN(parseFloat(item.substring(item.indexOf(':') + 1)))"
  80. style="display: inline-block; width: 42%; text-align: right; color: rgb(0, 242, 255); margin-right: 5px">{{
  81. item.substring(0, item.indexOf(':') + 1) }}</span>
  82. <span
  83. v-if="item.substring(item.indexOf(':') + 1) && !isNaN(parseFloat(item.substring(item.indexOf(':') + 1)))"
  84. style="display: inline-block; width: 52%; text-align: left; color: #fff">{{
  85. item.substring(item.indexOf(':') + 1) === '1'
  86. ? '正风'
  87. : item.substring(item.indexOf(':') + 1) === '2'
  88. ? '反风'
  89. : item.substring(item.indexOf(':') + 1)
  90. }}
  91. </span>
  92. </div>
  93. </template>
  94. </template>
  95. </a-table>
  96. <!-- 一键启动弹窗 -->
  97. <a-modal style="top: 300px; left: 360px" v-model:visible="visibleModal" :width="450" title="一键启动"
  98. @ok="handleOk" @cancel="handleCancel">
  99. <a-form :model="startupData" labelAlign="right" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
  100. <a-form-item label="安装位置">
  101. <a-input v-model:value="startupData.address" placeholder="请输入" style="width: 260px" />
  102. </a-form-item>
  103. </a-form>
  104. </a-modal>
  105. <!-- 编辑弹窗 -->
  106. <a-modal style="top: 300px; left: 360px" v-model:visible="visibleModalEdit" :width="450" title="编辑信息"
  107. @ok="handleOkEdit" @cancel="handleCancelEdit">
  108. <a-form :model="startupDataEdit" labelAlign="right" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
  109. <a-form-item label="安装位置">
  110. <a-input v-model:value="startupDataEdit.address" placeholder="请输入" style="width: 260px" />
  111. </a-form-item>
  112. </a-form>
  113. </a-modal>
  114. <!-- 调试弹窗 -->
  115. <a-modal style="top: 300px; left: 360px" v-model:visible="visibleModalDebug" :width="450" title="调试信息"
  116. @ok="handleOkDebug" @cancel="handleCancelDebug">
  117. <a-form :model="startupDataDebug" labelAlign="right" :label-col="{ span: 12 }"
  118. :wrapper-col="{ span: 12 }">
  119. <a-form-item label="风速">
  120. <a-input type="number" v-model:value="startupDataDebug.speed" placeholder="请输入"
  121. style="width: 260px" />
  122. </a-form-item>
  123. <a-form-item label="风向">
  124. <a-select v-model:value="startupDataDebug.direction" style="width: 260px">
  125. <a-select-option v-for="file in derictList" :key="file.label" :value="file.value">{{ file.label
  126. }}</a-select-option>
  127. </a-select>
  128. </a-form-item>
  129. <a-form-item label="密码">
  130. <a-input type="password" v-model:value="startupDataDebug.pwd" placeholder="请输入"
  131. style="width: 260px" />
  132. </a-form-item>
  133. <a-form-item label="浮动范围">
  134. <a-input type="number" v-model:value="startupDataDebug.range" placeholder="请输入"
  135. style="width: 260px" />
  136. </a-form-item>
  137. </a-form>
  138. </a-modal>
  139. <!-- 结束调试弹窗 -->
  140. <a-modal style="top: 300px; left: 360px" v-model:visible="visibleModalDebugEnd" :width="450" title="调试信息"
  141. @ok="handleOkDebugEnd" @cancel="handleCancelDebugEnd">
  142. <a-form :model="startupDataDebugEnd" labelAlign="right" :label-col="{ span: 12 }"
  143. :wrapper-col="{ span: 12 }">
  144. <a-form-item label="密码">
  145. <a-input type="password" v-model:value="startupDataDebugEnd.pwd" placeholder="请输入"
  146. style="width: 260px" />
  147. </a-form-item>
  148. </a-form>
  149. </a-modal>
  150. </div>
  151. </div>
  152. <!-- 历史数据 -->
  153. <div class="history-content" v-if="activeKey == 'history'">
  154. <div class="left-box">
  155. <div class="left-title">
  156. <div class="title-fz">
  157. <span>分站:</span>
  158. <span>
  159. [通讯正常]
  160. <span class="zd-open">{{ openNum || 0 }}</span>
  161. </span>
  162. <span>
  163. [通讯中断]
  164. <span class="zd-close">{{ clsoeNum || 0 }}</span>
  165. </span>
  166. </div>
  167. </div>
  168. <div class="left-content">
  169. <div class="card-box" v-for="(item, index) in cardList" :key="index">
  170. <div :class="[
  171. 'card-item',
  172. {
  173. selected: selectedIndex === index,
  174. 'card-itemN': item.isNewAccess,
  175. 'card-itemL': !item.isNewAccess && item.linkstatus,
  176. 'card-itemD': !item.isNewAccess && !item.linkstatus,
  177. },
  178. ]" @click="cardClick(item, index)">
  179. <div class="card-item-label">{{ item.strname }}</div>
  180. </div>
  181. <div :class="activeIndex % 4 == 3 ? 'card-modal1' : 'card-modal'" v-if="activeIndex == index && isShow">
  182. <div class="modal-name">站点名称:</div>
  183. <a-input v-model:value="stationName" size="small" placeholder="请输入" @blur="changeName" />
  184. <div class="modal-lj">连接状态:</div>
  185. <a-radio-group v-model:value="stationStatus" size="small" :options="ljList" @change="changeStatus" />
  186. <a-popconfirm title="删除内容无法恢复,是否删除" ok-text="确定" cancel-text="取消" @confirm="handleDelStation"
  187. @cancel="handleCancelDelStation">
  188. <a-button type="primary" preIcon="ant-design:delete-outlined" size="mini"
  189. class="down-btn">删除</a-button>
  190. </a-popconfirm>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <div class="right-box">
  196. <HistoryTable class="historytable" :scroll="scroll" :historyColumns="historyColumns"
  197. :stationId="stationId" />
  198. </div>
  199. </div>
  200. <!-- 监测详情 -->
  201. <div class="detail-content" v-if="activeKey == 'manageAuto'">
  202. <a-table size="small" :scroll="{ y: 710 }" :row-key="(record) => record.stationId"
  203. :expandedRowKeys="expandedRowKeys" :columns="columnsDetail" :data-source="tableData1" @expand="tableExpand">
  204. <template #action="{ record }">
  205. <a-button v-if="hasPermission('operateRecord:return') && record.deviceList" type="primary" size="small"
  206. @click="handleEdit(record)">编辑</a-button>
  207. </template>
  208. <template #bodyCell="{ column, text }"></template>
  209. <template #expandedRowRender="{ record }">
  210. <a-table :columns="deviceColumns" :data-source="record.deviceList" :pagination="false" maxWidth="340"
  211. :scroll="{ x: 'max-content', y: 200 }">
  212. <!-- <template #action="{ record }"></template>
  213. <template #bodyCell="{ column }"></template> -->
  214. </a-table>
  215. </template>
  216. </a-table>
  217. <!-- 编辑弹窗 -->
  218. <a-modal v-model:visible="visibleModalEdit1" :width="1100" @cancel="cancenModal"
  219. :bodyStyle="{ display: 'flex', height: '680px', 'overflow-y': 'auto', 'margin-bottom': '15px' }"
  220. title="编辑信息" :footer="null">
  221. <a-form :model="formView" labelAlign="right" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
  222. <a-form-item label="第一路风速风向:">
  223. <a-input v-model:value="formView.dylfsfx" placeholder="请输入" disabled
  224. style="width: 260px; margin-right: 10px" />
  225. </a-form-item>
  226. <a-form-item label="第一路报警状态:">
  227. <a-input v-model:value="formView.dylbjzt" placeholder="请输入" disabled
  228. style="width: 260px; margin-right: 10px" />
  229. </a-form-item>
  230. <a-form-item label="第一路1发2收AD值:">
  231. <a-input v-model:value="formView.dyl1f2sADz" placeholder="请输入" disabled
  232. style="width: 260px; margin-right: 10px" />
  233. </a-form-item>
  234. <a-form-item label="第一路2发1收AD值:">
  235. <a-input v-model:value="formView.dyl2f1sADz" placeholder="请输入" disabled
  236. style="width: 260px; margin-right: 10px" />
  237. </a-form-item>
  238. <a-form-item label="通风量:">
  239. <a-input v-model:value="formView.tfl" placeholder="请输入" disabled
  240. style="width: 260px; margin-right: 10px" />
  241. </a-form-item>
  242. <a-form-item label="硬件版本:">
  243. <a-input v-model:value="formView.yjbb" placeholder="请输入" disabled
  244. style="width: 260px; margin-right: 10px" />
  245. </a-form-item>
  246. <a-form-item label="软件版本:">
  247. <a-input v-model:value="formView.rjbb" placeholder="请输入" disabled
  248. style="width: 260px; margin-right: 10px" />
  249. </a-form-item>
  250. <a-form-item label="在线离线标志:">
  251. <a-input v-model:value="formView.zxlxbz" placeholder="请输入" disabled
  252. style="width: 260px; margin-right: 10px" />
  253. </a-form-item>
  254. <a-form-item label="日期和时间:">
  255. <a-input v-model:value="formView.rqsj" placeholder="请输入" disabled
  256. style="width: 260px; margin-right: 10px" />
  257. </a-form-item>
  258. </a-form>
  259. <a-form :model="formEdit" labelAlign="right" :label-col="{ span: 7 }" :wrapper-col="{ span: 17 }">
  260. <a-form-item label="传感器设备:">
  261. <a-select v-model:value="formEdit.cgq" @change="changeCgq" style="width: 260px; margin-right: 10px">
  262. <a-select-option v-for="(file, index) in cgqList" :key="index" :value="file.value">{{ file.label
  263. }}</a-select-option>
  264. </a-select>
  265. <a-button type="success" @click="getDeviceList">读取</a-button>
  266. </a-form-item>
  267. <a-form-item label="RS485_MODBUS地址:">
  268. <a-input v-model:value="formEdit.rs485modbusdz" placeholder="请输入"
  269. style="width: 260px; margin-right: 10px" />
  270. <a-button class="down-btn" type="primary" @click="handleClick('RS485_MODBUS地址')">下发</a-button>
  271. </a-form-item>
  272. <a-form-item label="探头安装距离:">
  273. <a-input v-model:value="formEdit.ttazjl" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  274. <a-button class="down-btn" type="primary" @click="handleClick('探头安装距离')">下发</a-button>
  275. </a-form-item>
  276. <a-form-item label="基线距离:">
  277. <a-input v-model:value="formEdit.jxjl" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  278. <a-button class="down-btn" type="primary" @click="handleClick('基线距离')">下发</a-button>
  279. </a-form-item>
  280. <a-form-item label="安装角度:">
  281. <a-input v-model:value="formEdit.azjd" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  282. <a-button class="down-btn" type="primary" @click="handleClick('安装角度')">下发</a-button>
  283. </a-form-item>
  284. <a-form-item label="设置时长:">
  285. <a-input v-model:value="formEdit.szsz" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  286. <a-button class="down-btn" type="primary" @click="handleClick('设置时长')">下发</a-button>
  287. </a-form-item>
  288. <a-form-item label="数据平均周期:">
  289. <a-input v-model:value="formEdit.sjpjzq" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  290. <a-button class="down-btn" type="primary" @click="handleClick('数据平均周期')">下发</a-button>
  291. </a-form-item>
  292. <a-form-item label="第一路一发二收PG值:">
  293. <a-input v-model:value="formEdit.dylyfesPGz" placeholder="请输入"
  294. style="width: 260px; margin-right: 10px" />
  295. <a-button class="down-btn" type="primary" @click="handleClick('第一路一发二收PG值')">下发</a-button>
  296. </a-form-item>
  297. <a-form-item label="第一路二发一收PG值:">
  298. <a-input v-model:value="formEdit.dylefysPGz" placeholder="请输入"
  299. style="width: 260px; margin-right: 10px" />
  300. <a-button class="down-btn" type="primary" @click="handleClick('第一路二发一收PG值')">下发</a-button>
  301. </a-form-item>
  302. <a-form-item label="风道截面积:">
  303. <a-input v-model:value="formEdit.fdjmj" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  304. <a-button class="down-btn" type="primary" @click="handleClick('风道截面积')">下发</a-button>
  305. </a-form-item>
  306. <a-form-item label="第一路整体系数k:">
  307. <a-input v-model:value="formEdit.dylztxsk" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  308. <a-button class="down-btn" type="primary" @click="handleClick('第一路整体系数k')">下发</a-button>
  309. </a-form-item>
  310. <a-form-item label="第一路第一段系数:">
  311. <a-input v-model:value="formEdit.dyldydxs1" placeholder="请输入"
  312. style="width: 260px; margin-right: 10px" />
  313. <a-button class="down-btn" type="primary" @click="handleClick('第一路第一段系数')">下发</a-button>
  314. </a-form-item>
  315. <a-form-item label="第一路第二段系数:">
  316. <a-input v-model:value="formEdit.dyldedxs2" placeholder="请输入"
  317. style="width: 260px; margin-right: 10px" />
  318. <a-button class="down-btn" type="primary" @click="handleClick('第一路第二段系数')">下发</a-button>
  319. </a-form-item>
  320. <a-form-item label="第一路第三段系数:">
  321. <a-input v-model:value="formEdit.dyldsdxs3" placeholder="请输入"
  322. style="width: 260px; margin-right: 10px" />
  323. <a-button class="down-btn" type="primary" @click="handleClick('第一路第三段系数')">下发</a-button>
  324. </a-form-item>
  325. <a-form-item label="第一路第四段系数:">
  326. <a-input v-model:value="formEdit.dyldsdxs4" placeholder="请输入"
  327. style="width: 260px; margin-right: 10px" />
  328. <a-button class="down-btn" type="primary" @click="handleClick('第一路第四段系数')">下发</a-button>
  329. </a-form-item>
  330. <a-form-item label="第一路第五段系数:">
  331. <a-input v-model:value="formEdit.dyldwdxs5" placeholder="请输入"
  332. style="width: 260px; margin-right: 10px" />
  333. <a-button class="down-btn" type="primary" @click="handleClick('第一路第五段系数')">下发</a-button>
  334. </a-form-item>
  335. <a-form-item label="第一路第六段系数:">
  336. <a-input v-model:value="formEdit.dyldldxs6" placeholder="请输入"
  337. style="width: 260px; margin-right: 10px" />
  338. <a-button class="down-btn" type="primary" @click="handleClick('第一路第六段系数')">下发</a-button>
  339. </a-form-item>
  340. <a-form-item label="系数KB:">
  341. <a-input v-model:value="formEdit.xsKB" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  342. <a-button class="down-btn" type="primary" @click="handleClick('系数KB')">下发</a-button>
  343. </a-form-item>
  344. <a-form-item label="系数KB符号:">
  345. <a-input v-model:value="formEdit.xsKBfh" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  346. <a-button class="down-btn" type="primary" @click="handleClick('系数KB符号')">下发</a-button>
  347. </a-form-item>
  348. <a-form-item label="高报警阈值:">
  349. <a-input v-model:value="formEdit.gbjyz" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  350. <a-button class="down-btn" type="primary" @click="handleClick('高报警阈值')">下发</a-button>
  351. </a-form-item>
  352. <a-form-item label="低报警阈值:">
  353. <a-input v-model:value="formEdit.dbjyz" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  354. <a-button class="down-btn" type="primary" @click="handleClick('低报警阈值')">下发</a-button>
  355. </a-form-item>
  356. <a-form-item label="报警使能:">
  357. <a-input v-model:value="formEdit.bjsn" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  358. <a-button class="down-btn" type="primary" @click="handleClick('报警使能')">下发</a-button>
  359. </a-form-item>
  360. <a-form-item label="第一路485波特率:">
  361. <a-input v-model:value="formEdit.dyl485btl" placeholder="请输入"
  362. style="width: 260px; margin-right: 10px" />
  363. <a-button class="down-btn" type="primary" @click="handleClick('第一路485波特率')">下发</a-button>
  364. </a-form-item>
  365. <a-form-item label="四个字节保存密码:">
  366. <a-input v-model:value="formEdit.sgzjbcmm" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  367. <a-button class="down-btn" type="primary" @click="handleClick('四个字节保存密码')">下发</a-button>
  368. </a-form-item>
  369. <a-form-item label="复位:">
  370. <a-input v-model:value="formEdit.fw" placeholder="请输入" style="width: 260px; margin-right: 10px" />
  371. <a-button class="down-btn" type="primary" @click="handleClick('复位')">下发</a-button>
  372. </a-form-item>
  373. </a-form>
  374. </a-modal>
  375. </div>
  376. <!-- 操作记录 -->
  377. <div class="detail-content" v-if="activeKey == 'operationRecord'">
  378. <operateRecord :operationData="operationData" @getSearchRecord="getSearchRecord"></operateRecord>
  379. </div>
  380. </div>
  381. </div>
  382. </div>
  383. </template>
  384. <script setup lang="ts">
  385. import { ref, nextTick, reactive, onMounted, onUnmounted, inject } from 'vue';
  386. import { usePermission } from '/@/hooks/web/usePermission';
  387. import {
  388. subStationList,
  389. getList,
  390. getListAll,
  391. getEdit,
  392. runDeviceMonitor,
  393. update158DevName,
  394. updateDebugStatus,
  395. get158StationData,
  396. set158StationDevicesRead,
  397. set158StationData,
  398. get158StationDevices,
  399. set158StationRead,
  400. remove158Substation,
  401. get158SetLog,
  402. remove158Device
  403. } from '../safetyList.api';
  404. import { historyColumns } from '../historyLsit.data';
  405. import { columnsDetail, columns, deviceColumns } from '../safetyList.data';
  406. import HistoryTable from './HistoryTable.vue';
  407. import customHeader from '/@/components/vent/customHeader.vue';
  408. import operateRecord from './operateRecord.vue'
  409. import { AesEncryption } from '/@/utils/cipher';
  410. import { loginCipher } from '/@/settings/encryptionSetting';
  411. import { message } from 'ant-design-vue';
  412. let expandedRowKeys = reactive<any[]>([])
  413. const { hasPermission } = usePermission();
  414. let activeKey = ref('device');
  415. let cardList = ref<any[]>([]);
  416. let activeIndex = ref(null);
  417. let isShow = ref(false);
  418. let stationName = ref('');
  419. let stationStatus = ref(null);
  420. let ljList = reactive<any[]>([
  421. { value: 0, label: '断开' },
  422. { value: 1, label: '连接' },
  423. ]);
  424. let selectedIndex = ref(0);
  425. let openNum = ref(0);
  426. let clsoeNum = ref(0);
  427. let tableData = ref<any[]>([]);
  428. let tableData1 = ref<any[]>([]);
  429. //分页参数配置
  430. let pagination = reactive({
  431. current: 1, // 当前页码
  432. pageSize: 20, // 每页显示条数
  433. total: 0, // 总条目数,后端返回
  434. // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
  435. showSizeChanger: true, // 是否可改变每页显示条数
  436. pageSizeOptions: ['10', '20', '30', '40', '50', '100'], // 可选的每页显示条数
  437. });
  438. let visibleModalEdit = ref(false);
  439. let visibleModalEdit1 = ref(false);
  440. let formEdit = reactive({
  441. id: '',
  442. cgq: '',
  443. rs485modbusdz: '',
  444. ttazjl: '',
  445. jxjl: '',
  446. azjd: '',
  447. szsz: '',
  448. sjpjzq: '',
  449. dylyfesPGz: '',
  450. dylefysPGz: '',
  451. fdjmj: '',
  452. dylztxsk: '',
  453. dyldydxs1: '',
  454. dyldedxs2: '',
  455. dyldsdxs3: '',
  456. dyldsdxs4: '',
  457. dyldwdxs5: '',
  458. dyldldxs6: '',
  459. xsKB: '',
  460. xsKBfh: '',
  461. gbjyz: '',
  462. dbjyz: '',
  463. bjsn: '',
  464. dyl485btl: '',
  465. sgzjbcmm: '',
  466. fw: '',
  467. });
  468. let formView = reactive({
  469. dylfsfx: '',
  470. dylbjzt: '',
  471. dyl1f2sADz: '',
  472. dyl2f1sADz: '',
  473. tfl: '',
  474. yjbb: '',
  475. rjbb: '',
  476. zxlxbz: '',
  477. rqsj: '',
  478. });
  479. let cgqList = reactive<any[]>([]);
  480. let devId = ref('');
  481. let startupDataEdit = reactive({
  482. address: '',
  483. });
  484. //一键启动弹窗
  485. let visibleModal = ref(false);
  486. let startupData = reactive({
  487. address: '',
  488. });
  489. let paramId = ref('');
  490. let startupDataDebug = reactive({
  491. speed: '',
  492. direction: '',
  493. pwd: '',
  494. range: '',
  495. });
  496. let visibleModalDebug = ref(false);
  497. let debugFlag = ref('');
  498. let debugStationId = ref('');
  499. let debugDeviceId = ref('');
  500. let derictList = reactive<any[]>([
  501. { label: '正向', value: '0' },
  502. { label: '反向', value: '1' },
  503. ]);
  504. let devStationId = ref('');
  505. let stationId = ref('');
  506. const scroll = reactive({
  507. y: 680,
  508. });
  509. //结束调试弹窗相关信息
  510. let visibleModalDebugEnd = ref(false);
  511. let startupDataDebugEnd = reactive({
  512. pwd: '',
  513. });
  514. let operationData = ref<any[]>([])//操作记录列表
  515. let timer: null | NodeJS.Timeout = null;
  516. /**
  517. * 获取监控数据并设置轮询定时器
  518. * @param flag - 是否立即执行(true为立即执行,false为延迟3秒执行)
  519. */
  520. function getMonitor(flag = false) {
  521. timer = setTimeout(
  522. async () => {
  523. await getSubStationList();
  524. if (activeKey.value == 'device') {
  525. await getStationList1();
  526. }
  527. if (timer) {
  528. timer = null;
  529. }
  530. getMonitor();
  531. },
  532. flag ? 0 : 3000
  533. );
  534. }
  535. let timer1: null | NodeJS.Timeout = null;
  536. function getMonitor1(flag = false) {
  537. timer1 = setTimeout(
  538. async () => {
  539. await getStationList();
  540. if (timer1) {
  541. timer1 = null;
  542. }
  543. getMonitor1();
  544. },
  545. flag ? 0 : 3000
  546. );
  547. }
  548. let timer2: null | NodeJS.Timeout = null;
  549. function getMonitor2(flag = false) {
  550. timer2 = setTimeout(
  551. async () => {
  552. await getShowReadList();
  553. if (timer2) {
  554. timer2 = null;
  555. }
  556. getMonitor2();
  557. },
  558. flag ? 0 : 3000
  559. );
  560. }
  561. let timer3: null | NodeJS.Timeout = null;
  562. function getMonitor3(flag = false) {
  563. timer3 = setTimeout(
  564. async () => {
  565. await getStationListAll();
  566. if (timer3) {
  567. timer3 = null;
  568. }
  569. getMonitor3();
  570. },
  571. flag ? 0 : 3000
  572. );
  573. }
  574. /**
  575. * 获取设备列表数据
  576. * 调用站点读取接口获取设备信息,成功后刷新监测数据
  577. */
  578. async function getDeviceList() {
  579. let res = await set158StationRead({ stationId: devStationId.value, deviceId: formEdit.cgq });
  580. if (res) {
  581. getMonitor2(true)
  582. }
  583. }
  584. /**
  585. * 获取并显示158站点数据
  586. * 从158站点数据列表中筛选出当前设备站点对应的数据,
  587. * 将相关测量值(电压、流量、液位、报警等)赋值到表单视图对象
  588. */
  589. async function getShowReadList() {
  590. let data = await get158StationData();
  591. if (data && data.length) {
  592. let list = data.find((v) => v.stationId == devStationId.value);
  593. if (list) {
  594. const { dylfsfx, dyl1f2sADz, dyl2f1sADz, tfl, yjbb, rjbb, zxlxbz, rqsj } = list;
  595. Object.assign(formView, { dylfsfx, dyl1f2sADz, dyl2f1sADz, tfl, yjbb, rjbb, zxlxbz, rqsj });
  596. }
  597. }
  598. }
  599. /**
  600. * 表格展开/收起处理函数
  601. *
  602. * @param expaned - 是否展开,true为展开,false为收起
  603. * @param record - 当前行的记录数据,包含stationId字段
  604. * @returns Promise<void>
  605. */
  606. async function tableExpand(expaned, record) {
  607. let res = await set158StationDevicesRead({ stationId: record.stationId })
  608. if (res && expaned) {
  609. // expandedRowKeys.length=0
  610. let data = await get158StationData();
  611. tableData1.value = data
  612. expandedRowKeys.push(record.stationId)
  613. } else {
  614. expandedRowKeys.length = 0
  615. }
  616. }
  617. /**
  618. * 标签页切换处理函数
  619. *
  620. * 根据选中的标签页类型执行相应的数据加载操作:
  621. * - device: 加载设备监控数据
  622. * - history: 加载子站点列表、站点列表及监控数据
  623. * - manageAuto: 加载站点列表及监控数据1
  624. * - operationRecord: 加载操作记录
  625. *
  626. * 切换时会清空定时器并重置站点ID
  627. *
  628. * @param {string} tab - 切换到的标签页标识
  629. * @returns {Promise<void>}
  630. */
  631. async function onChangeTab(tab) {
  632. activeKey.value = tab;
  633. stationId.value = '';
  634. [timer, timer1, timer2, timer3].forEach((t) => t && clearTimeout(t));
  635. if (activeKey.value === 'device') {
  636. getMonitor();
  637. } else if (activeKey.value === 'history') {
  638. await getSubStationList();
  639. await getStationList();
  640. getMonitor();
  641. } else if (activeKey.value === 'manageAuto') {
  642. await getStationList();
  643. getMonitor1(true);
  644. } else if (activeKey.value === 'operationRecord') {
  645. await getSearchRecord({ stationId: '', deviceId: '' });
  646. }
  647. }
  648. /**
  649. * 取消模态框
  650. * 清除表单编辑数据和查看数据,重置所有字段为空字符串
  651. */
  652. function cancenModal() {
  653. clearTimeout(timer2);
  654. Object.assign(formEdit, {
  655. id: '',
  656. cgq: '',
  657. rs485modbusdz: '',
  658. ttazjl: '',
  659. jxjl: '',
  660. azjd: '',
  661. szsz: '',
  662. sjpjzq: '',
  663. dylyfesPGz: '',
  664. dylefysPGz: '',
  665. fdjmj: '',
  666. dylztxsk: '',
  667. dyldydxs1: '',
  668. dyldedxs2: '',
  669. dyldsdxs3: '',
  670. dyldsdxs4: '',
  671. dyldwdxs5: '',
  672. dyldldxs6: '',
  673. xsKB: '',
  674. xsKBfh: '',
  675. gbjyz: '',
  676. dbjyz: '',
  677. bjsn: '',
  678. dyl485btl: '',
  679. sgzjbcmm: '',
  680. fw: '',
  681. });
  682. Object.assign(formView, {
  683. dylfsfx: '',
  684. dylbjzt: '',
  685. dyl1f2sADz: '',
  686. dyl2f1sADz: '',
  687. tfl: '',
  688. yjbb: '',
  689. rjbb: '',
  690. zxlxbz: '',
  691. rqsj: '',
  692. });
  693. }
  694. /**
  695. * 获取158协议站点列表数据
  696. * 调用接口获取站点数据,并对数据进行转换处理:
  697. * - 将连接状态布尔值转换为中文文本
  698. * - 设置唯一键值
  699. */
  700. async function getStationList() {
  701. let res = await get158StationData();
  702. tableData1.value = res.map((el) => {
  703. el.linkstatusC = el.linkstatus ? '连接' : '断开';
  704. el.key = el.stationId;
  705. return el;
  706. });
  707. }
  708. /**
  709. * 传感器选项切换
  710. * @param {any} val - 选中的传感器值
  711. */
  712. function changeCgq(val) {
  713. formEdit.cgq = val;
  714. }
  715. /**
  716. * 打开编辑弹窗并加载站点设备列表
  717. * @param {Object} record - 包含站点信息的记录对象
  718. * @param {string|number} record.stationId - 站点ID
  719. */
  720. async function handleEdit(record) {
  721. cgqList.length = 0;
  722. visibleModalEdit1.value = true;
  723. devStationId.value = record.stationId;
  724. let res = await get158StationDevices({ stationId: devStationId.value });
  725. if (res.length != 0) {
  726. res.forEach((el) => {
  727. cgqList.push({ label: el.strinstallpos, value: el.id });
  728. });
  729. }
  730. }
  731. /**
  732. * 下发配置项数据到站点
  733. *
  734. * 根据传入的配置项类型,将对应的配置数据下发给指定站点的设备,
  735. * 下发成功后关闭弹窗并刷新站点列表
  736. *
  737. * @param data - 配置项类型,支持以下类型:
  738. * - 'RS485_MODBUS地址'
  739. * - '探头安装距离'
  740. * - '基线距离'
  741. * - '安装角度'
  742. * - '设置时长'
  743. * - '数据平均周期'
  744. * - '第一路一发二收PG值'
  745. * - '第一路二发一收PG值'
  746. * - '风道截面积'
  747. * - '第一路整体系数k'
  748. * - '第一路第一段系数'
  749. * - '第一路第二段系数'
  750. * - '第一路第三段系数'
  751. * - '第一路第四段系数'
  752. * - '第一路第五段系数'
  753. * - '第一路第六段系数'
  754. * - '系数KB'
  755. * - '系数KB符号'
  756. * - '高报警阈值'
  757. * - '低报警阈值'
  758. * - '报警使能'
  759. * - '第一路485波特率'
  760. * - '四个字节保存密码'
  761. * - '复位'
  762. * @returns 无返回值
  763. */
  764. async function handleClick(data) {
  765. switch (data) {
  766. case 'RS485_MODBUS地址':
  767. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'rs485modbusdz', value: formEdit.rs485modbusdz });
  768. visibleModalEdit1.value = false;
  769. cancenModal()
  770. getStationList();
  771. break;
  772. case '探头安装距离':
  773. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'ttazjl', value: formEdit.ttazjl });
  774. visibleModalEdit1.value = false;
  775. cancenModal()
  776. getStationList();
  777. break;
  778. case '基线距离':
  779. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'jxjl', value: formEdit.jxjl });
  780. visibleModalEdit1.value = false;
  781. cancenModal()
  782. getStationList();
  783. break;
  784. case '安装角度':
  785. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'azjd', value: formEdit.azjd });
  786. visibleModalEdit1.value = false;
  787. cancenModal()
  788. getStationList();
  789. break;
  790. case '设置时长':
  791. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'szsz', value: formEdit.szsz });
  792. visibleModalEdit1.value = false;
  793. cancenModal()
  794. getStationList();
  795. break;
  796. case '数据平均周期':
  797. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'sjpjzq', value: formEdit.sjpjzq });
  798. visibleModalEdit1.value = false;
  799. cancenModal()
  800. getStationList();
  801. break;
  802. case '第一路一发二收PG值':
  803. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylyfesPGz', value: formEdit.dylyfesPGz });
  804. visibleModalEdit1.value = false;
  805. cancenModal()
  806. getStationList();
  807. break;
  808. case '第一路二发一收PG值':
  809. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylefysPGz', value: formEdit.dylefysPGz });
  810. visibleModalEdit1.value = false;
  811. cancenModal()
  812. getStationList();
  813. break;
  814. case '风道截面积':
  815. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'fdjmj', value: formEdit.fdjmj });
  816. visibleModalEdit1.value = false;
  817. cancenModal()
  818. getStationList();
  819. break;
  820. case '第一路整体系数k':
  821. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylztxsk', value: formEdit.dylztxsk });
  822. visibleModalEdit1.value = false;
  823. cancenModal()
  824. getStationList();
  825. break;
  826. case '第一路第一段系数':
  827. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldydxs1', value: formEdit.dyldydxs1 });
  828. visibleModalEdit1.value = false;
  829. cancenModal()
  830. getStationList();
  831. break;
  832. case '第一路第二段系数':
  833. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldedxs2', value: formEdit.dyldedxs2 });
  834. visibleModalEdit1.value = false;
  835. cancenModal()
  836. getStationList();
  837. break;
  838. case '第一路第三段系数':
  839. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldsdxs3', value: formEdit.dyldsdxs3 });
  840. visibleModalEdit1.value = false;
  841. cancenModal()
  842. getStationList();
  843. break;
  844. case '第一路第四段系数':
  845. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldsdxs4', value: formEdit.dyldsdxs4 });
  846. visibleModalEdit1.value = false;
  847. cancenModal()
  848. getStationList();
  849. break;
  850. case '第一路第五段系数':
  851. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldwdxs5', value: formEdit.dyldwdxs5 });
  852. visibleModalEdit1.value = false;
  853. cancenModal()
  854. getStationList();
  855. break;
  856. case '第一路第六段系数':
  857. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldldxs6', value: formEdit.dyldldxs6 });
  858. visibleModalEdit1.value = false;
  859. cancenModal()
  860. getStationList();
  861. break;
  862. case '系数KB':
  863. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'xsKB', value: formEdit.xsKB });
  864. visibleModalEdit1.value = false;
  865. cancenModal()
  866. getStationList();
  867. break;
  868. case '系数KB符号':
  869. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'xsKBfh', value: formEdit.xsKBfh });
  870. visibleModalEdit1.value = false;
  871. cancenModal()
  872. getStationList();
  873. break;
  874. case '高报警阈值':
  875. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'gbjyz', value: formEdit.gbjyz });
  876. visibleModalEdit1.value = false;
  877. cancenModal()
  878. getStationList();
  879. break;
  880. case '低报警阈值':
  881. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dbjyz', value: formEdit.dbjyz });
  882. visibleModalEdit1.value = false;
  883. cancenModal()
  884. getStationList();
  885. break;
  886. case '报警使能':
  887. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'bjsn', value: formEdit.bjsn });
  888. visibleModalEdit1.value = false;
  889. cancenModal()
  890. getStationList();
  891. break;
  892. case '第一路485波特率':
  893. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyl485btl', value: formEdit.dyl485btl });
  894. visibleModalEdit1.value = false;
  895. cancenModal()
  896. getStationList();
  897. break;
  898. case '四个字节保存密码':
  899. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'sgzjbcmm', value: formEdit.sgzjbcmm });
  900. visibleModalEdit1.value = false;
  901. cancenModal()
  902. getStationList();
  903. break;
  904. case '复位':
  905. await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'fw', value: formEdit.fw });
  906. visibleModalEdit1.value = false;
  907. cancenModal()
  908. getStationList();
  909. break;
  910. }
  911. }
  912. /**
  913. * 获取子站列表数据
  914. * 调用modbus类型接口获取子站列表,并更新相关状态
  915. */
  916. async function getSubStationList() {
  917. let res = await subStationList({ strtype: 'modbus', reqparam: '158' });
  918. if (res.length != 0) {
  919. cardList.value = res;
  920. stationId.value = stationId.value ? stationId.value : cardList.value[0].id
  921. openNum.value = cardList.value?.filter((v) => v.linkstatus == 1)['length'];
  922. clsoeNum.value = cardList.value?.filter((v) => v.linkstatus == 0)['length'];
  923. } else {
  924. cardList.value = [];
  925. }
  926. }
  927. /**
  928. * 分站站点选项点击事件处理
  929. * @param item - 站点数据对象
  930. * @param index - 站点索引
  931. */
  932. function cardClick(item, index) {
  933. clearTimeout(timer3)
  934. clearTimeout(timer)
  935. selectedIndex.value = index; // 更新选中索引
  936. activeIndex.value = item.isNewAccess || !item.linkstatus ? index : null;
  937. stationName.value = item.strname;
  938. stationStatus.value = item.linkstatus;
  939. stationId.value = item.id;
  940. isShow.value = true;
  941. getStationList1();
  942. getMonitor()
  943. }
  944. //分站站点名称编辑
  945. function changeName(val) {
  946. getChangeStation();
  947. }
  948. /**
  949. * @description 更新站点信息并刷新列表
  950. */
  951. async function getChangeStation() {
  952. let res = await getEdit({ id: stationId.value, strname: stationName.value, linkstatus: stationStatus.value });
  953. getSubStationList();
  954. isShow.value = false;
  955. }
  956. //站点连接状态修改
  957. function changeStatus(val) {
  958. getChangeStation();
  959. }
  960. /**
  961. * 获取站点列表数据
  962. *
  963. * @returns {Promise<void>}
  964. */
  965. async function getStationList1() {
  966. let res = await getList({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize });
  967. if (res && res.length != 0) {
  968. res.forEach((el) => {
  969. el.key = el.id;
  970. el.linkIdC = el.linkId || '';
  971. el.stripC = el.strip || '';
  972. el.linkstatusC = el.linkstatus ? '连接' : '断开';
  973. el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : '';
  974. el.children = el.devInfoList;
  975. el.children.forEach((v) => {
  976. v.key = v.id;
  977. v.debugTitle = v.deviceType == 'windrect_ds_25x' || v.deviceType == 'windrect_ds_two' ? v.status === 1 ? '结束调试' : v.status === 0 ? '调试' : '' : ''
  978. v.stripC = v.strserno || '';
  979. v.linkstatusC = v.netStatus ? '连接' : '断开';
  980. v.linkIdC = v.linkId == '0' ? '未启用' : v.linkId == '1' ? '启用' : v.linkId == '2' ? '设备异常' : '';
  981. v.updateTime = v.time;
  982. v.gdmsC = v.gdms == '1' ? '直流供电' : v.gdms == '0' ? '交流供电' : '';
  983. v.gd5 = `温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,绝压:${v.pa || ''}Pa,压差:${v.yacha || ''
  984. }Pa,密度:${v.density || ''}kg/m³`;
  985. v.common = `风向:${v.forward || ''},风量:${v.m3 || ''}m³/min,风速:${v.windSpeed || ''}m/s,气压:${v.pa || ''}Pa,压差:${v.difPress || ''
  986. }Pa,温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,断面积:${v.area || ''}㎡`
  987. v.valueJc = v.deviceType == 'modelsensor_gd5' ? v.gd5 : v.common
  988. });
  989. });
  990. }
  991. tableData.value = res;
  992. pagination.total = res.total;
  993. }
  994. /**
  995. * 获取所有站点列表并进行数据格式化
  996. * 调用API获取站点数据,对站点及子设备进行中文标签转换,
  997. * 生成表格展示所需的各类状态文本和传感器数据字符串
  998. */
  999. async function getStationListAll() {
  1000. let res = await getListAll();
  1001. res.forEach((el) => {
  1002. el.key = el.id;
  1003. el.linkIdC = el.linkId || '';
  1004. el.stripC = el.strip || '';
  1005. el.linkstatusC = el.linkstatus ? '连接' : '断开';
  1006. el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : '';
  1007. el.children = el.devInfoList;
  1008. el.children.forEach((v) => {
  1009. v.key = v.id;
  1010. v.debugTitle = v.deviceType == 'windrect_ds_25x' || v.deviceType == 'windrect_ds_two' ? v.status === 1 ? '结束调试' : v.status === 0 ? '调试' : '' : ''
  1011. v.stripC = v.strserno || '';
  1012. v.linkstatusC = v.netStatus ? '连接' : '断开';
  1013. v.linkIdC = v.linkId == '0' ? '未启用' : v.linkId == '1' ? '启用' : v.linkId == '2' ? '设备异常' : '';
  1014. v.updateTime = v.time;
  1015. v.gdmsC = v.gdms == '1' ? '直流供电' : v.gdms == '0' ? '交流供电' : '';
  1016. v.gd5 = `温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,绝压:${v.pa || ''}Pa,压差:${v.yacha || ''
  1017. }Pa,密度:${v.density || ''}kg/m³`;
  1018. v.common = `风向:${v.forward || ''},风量:${v.m3 || ''}m³/min,风速:${v.windSpeed || ''}m/s,气压:${v.pa || ''}Pa,压差:${v.difPress || ''
  1019. }Pa,温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,断面积:${v.area || ''}㎡`
  1020. v.valueJc = v.deviceType == 'modelsensor_gd5' ? v.gd5 : v.common
  1021. });
  1022. });
  1023. tableData.value = res;
  1024. // pagination.total = res.total;
  1025. }
  1026. //显示全部
  1027. function getAllShow() {
  1028. clearTimeout(timer)
  1029. clearTimeout(timer3)
  1030. getStationListAll()
  1031. getMonitor3()
  1032. }
  1033. //启动新设备
  1034. async function handlerunDeviceMonitor(record, val) {
  1035. devId.value = record.id;
  1036. switch (val) {
  1037. case '编辑':
  1038. visibleModalEdit.value = true;
  1039. startupDataEdit.address = record.strinstallpos;
  1040. paramId.value = record.devInfoList ? 'subId' : 'devId';
  1041. break;
  1042. case '启动':
  1043. visibleModal.value = true;
  1044. startupData.address = record.strinstallpos;
  1045. break;
  1046. case '删除':
  1047. await remove158Device({ devId: devId.value })
  1048. getStationList1()
  1049. break;
  1050. }
  1051. }
  1052. //分站,设备调试
  1053. function debugClick(record) {
  1054. if (record.debugTitle == '调试') {
  1055. //正在调试中
  1056. startupDataDebug.speed = '';
  1057. startupDataDebug.direction = '';
  1058. startupDataDebug.pwd = ''
  1059. startupDataDebug.range = ''
  1060. visibleModalDebug.value = true;
  1061. debugFlag.value = 'device';
  1062. debugDeviceId.value = record.id;
  1063. tableData.value.forEach((el) => {
  1064. el.devInfoList.forEach((v) => {
  1065. if (v.id == debugDeviceId.value) {
  1066. debugStationId.value = el.id;
  1067. }
  1068. });
  1069. });
  1070. // record.debugTitle = '结束调试';
  1071. } else if (record.debugTitle == '结束调试') {
  1072. debugFlag.value = 'device';
  1073. debugDeviceId.value = record.id;
  1074. visibleModalDebugEnd.value = true
  1075. startupDataDebugEnd.pwd = ''
  1076. tableData.value.forEach((el) => {
  1077. el.devInfoList.forEach((v) => {
  1078. if (v.id == debugDeviceId.value) {
  1079. debugStationId.value = el.id;
  1080. }
  1081. });
  1082. });
  1083. // record.debugTitle = '调试';
  1084. }
  1085. }
  1086. //确定结束调试
  1087. async function handleOkDebugEnd() {
  1088. const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
  1089. let res = await updateDebugStatus({ pwd: encryption.encryptByAES(startupDataDebugEnd.pwd), stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' });
  1090. if (res.code == 500) {
  1091. message.error(res.message);
  1092. } else {
  1093. visibleModalDebugEnd.value = false;
  1094. getStationList1();
  1095. }
  1096. }
  1097. //取消结束调试
  1098. function handleCancelDebugEnd() {
  1099. visibleModalDebugEnd.value = false;
  1100. debugFlag.value = '';
  1101. debugStationId.value = '';
  1102. debugDeviceId.value = '';
  1103. }
  1104. async function handleOk() {
  1105. let res = await runDeviceMonitor({ devId: devId.value, devName: startupData.address });
  1106. visibleModal.value = false;
  1107. getStationList1();
  1108. }
  1109. function handleCancel() {
  1110. visibleModal.value = false;
  1111. startupData.address = '';
  1112. }
  1113. //编辑
  1114. async function handleOkEdit() {
  1115. if (paramId.value == 'subId') {
  1116. let res = await update158DevName({ subId: devId.value, devName: startupDataEdit.address });
  1117. visibleModalEdit.value = false;
  1118. getStationList1();
  1119. } else {
  1120. let res = await update158DevName({ devId: devId.value, devName: startupDataEdit.address });
  1121. visibleModalEdit.value = false;
  1122. getStationList1();
  1123. }
  1124. }
  1125. //取消编辑
  1126. function handleCancelEdit() {
  1127. visibleModalEdit.value = false;
  1128. startupDataEdit.address = '';
  1129. }
  1130. //调试确认
  1131. async function handleOkDebug() {
  1132. const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
  1133. let res = await updateDebugStatus({
  1134. stationId: debugStationId.value,
  1135. deviceId: debugDeviceId.value,
  1136. speed: startupDataDebug.speed,
  1137. direction: startupDataDebug.direction,
  1138. range: startupDataDebug.range,
  1139. pwd: encryption.encryptByAES(startupDataDebug.pwd),
  1140. debugFlag: '1',
  1141. });
  1142. if (res.code == 500) {
  1143. message.error(res.message);
  1144. } else {
  1145. visibleModalDebug.value = false;
  1146. getStationList1();
  1147. }
  1148. }
  1149. //调试取消
  1150. function handleCancelDebug() {
  1151. visibleModalDebug.value = false;
  1152. debugFlag.value = '';
  1153. debugStationId.value = '';
  1154. debugDeviceId.value = '';
  1155. }
  1156. //分页切换
  1157. function pageChange(val) {
  1158. pagination.current = val.current;
  1159. pagination.pageSize = val.pageSize;
  1160. getStationList1();
  1161. }
  1162. //删除左侧分站
  1163. async function handleDelStation() {
  1164. let res = await remove158Substation({ stationId: stationId.value })
  1165. if (res) {
  1166. getSubStationList();
  1167. getStationList1();
  1168. }
  1169. }
  1170. //取消删除左侧分站
  1171. function handleCancelDelStation() { }
  1172. //操作记录查询
  1173. async function getSearchRecord(param) {
  1174. let res = await get158SetLog({ stationType: '158', ...param })
  1175. if (res && res.length != 0) {
  1176. operationData.value = res.records
  1177. }
  1178. }
  1179. onMounted(async () => {
  1180. await getSubStationList();
  1181. await getStationList1();
  1182. getMonitor();
  1183. });
  1184. onUnmounted(() => {
  1185. [timer, timer1, timer2, timer3].forEach((t) => t && clearTimeout(t));
  1186. timer = timer1 = timer2 = timer3 = undefined;
  1187. });
  1188. </script>
  1189. <style lang="less" scoped>
  1190. .safetyList {
  1191. width: calc(100% - 20px);
  1192. height: calc(100% - 80px);
  1193. position: relative;
  1194. margin: 70px 10px 10px 10px;
  1195. .content {
  1196. position: relative;
  1197. width: 100%;
  1198. height: 100%;
  1199. .tab-box {
  1200. display: flex;
  1201. color: #fff;
  1202. position: relative;
  1203. background: linear-gradient(#001325, #012e4f);
  1204. :deep(.zxm-tabs-nav) {
  1205. margin: 0 !important;
  1206. .zxm-tabs-tab {
  1207. width: 180px;
  1208. height: 45px;
  1209. background: url('/@/assets/images/top-btn.png') center no-repeat;
  1210. background-size: cover;
  1211. display: flex;
  1212. justify-content: center;
  1213. font-size: 16px;
  1214. }
  1215. .zxm-tabs-tab-active {
  1216. width: 180px;
  1217. position: relative;
  1218. background: url('/@/assets/images/top-btn-select.png') center no-repeat;
  1219. background-size: cover;
  1220. .zxm-tabs-tab-btn {
  1221. color: #fff !important;
  1222. }
  1223. }
  1224. .zxm-tabs-ink-bar {
  1225. width: 0 !important;
  1226. }
  1227. .zxm-tabs-tab+.zxm-tabs-tab {
  1228. margin: 0 !important;
  1229. }
  1230. }
  1231. }
  1232. .box-content {
  1233. height: calc(100% - 50px);
  1234. padding-top: 10px;
  1235. box-sizing: border-box;
  1236. .now-content {
  1237. position: relative;
  1238. width: 100%;
  1239. height: 100%;
  1240. display: flex;
  1241. justify-content: space-between;
  1242. align-items: center;
  1243. .left-box {
  1244. width: 40%;
  1245. height: 100%;
  1246. margin-right: 15px;
  1247. padding: 10px;
  1248. box-sizing: border-box;
  1249. background: url('/@/assets/images/fire/bj1.png') no-repeat center;
  1250. background-size: 100% 100%;
  1251. .left-title {
  1252. display: flex;
  1253. height: 30px;
  1254. align-items: center;
  1255. font-size: 14px;
  1256. margin-bottom: 10px;
  1257. span {
  1258. color: #fff;
  1259. }
  1260. .zd-open {
  1261. color: rgb(0, 242, 255);
  1262. }
  1263. .zd-close {
  1264. color: #ff0000;
  1265. }
  1266. .title-fz {
  1267. margin-right: 25px;
  1268. }
  1269. }
  1270. .left-content {
  1271. display: flex;
  1272. justify-content: flex-start;
  1273. align-items: flex-start;
  1274. flex-wrap: wrap;
  1275. height: calc(100% - 40px);
  1276. overflow-y: auto;
  1277. .card-box {
  1278. position: relative;
  1279. // width: 242px;
  1280. width: 182px;
  1281. height: 120px;
  1282. margin-bottom: 15px;
  1283. display: flex;
  1284. justify-content: center;
  1285. .card-itemN {
  1286. position: relative;
  1287. width: 85px;
  1288. height: 120px;
  1289. background: url('/@/assets/images/zd-2.png') no-repeat center;
  1290. background-size: 100% 100%;
  1291. cursor: pointer;
  1292. .card-item-label {
  1293. width: 100%;
  1294. position: absolute;
  1295. bottom: 5px;
  1296. font-size: 12px;
  1297. color: #fff;
  1298. text-align: center;
  1299. }
  1300. }
  1301. .card-itemL {
  1302. position: relative;
  1303. width: 85px;
  1304. height: 120px;
  1305. background: url('/@/assets/images/zd-3.png') no-repeat center;
  1306. background-size: 100% 100%;
  1307. cursor: pointer;
  1308. .card-item-label {
  1309. width: 100%;
  1310. position: absolute;
  1311. bottom: 5px;
  1312. font-size: 12px;
  1313. color: #fff;
  1314. text-align: center;
  1315. }
  1316. }
  1317. .card-itemD {
  1318. position: relative;
  1319. width: 85px;
  1320. height: 120px;
  1321. background: url('/@/assets/images/zd-1.png') no-repeat center;
  1322. background-size: 100% 100%;
  1323. cursor: pointer;
  1324. .card-item-label {
  1325. width: 100%;
  1326. position: absolute;
  1327. bottom: 5px;
  1328. font-size: 12px;
  1329. color: #fff;
  1330. text-align: center;
  1331. }
  1332. }
  1333. .card-modal {
  1334. width: 86px;
  1335. position: absolute;
  1336. left: 140px;
  1337. color: #fff;
  1338. top: 50%;
  1339. transform: translate(0, -50%);
  1340. font-size: 12px;
  1341. }
  1342. .card-modal1 {
  1343. width: 86px;
  1344. position: absolute;
  1345. left: -42px;
  1346. color: #fff;
  1347. top: 50%;
  1348. transform: translate(0, -50%);
  1349. font-size: 12px;
  1350. }
  1351. }
  1352. }
  1353. }
  1354. .right-box {
  1355. width: calc(60% - 15px);
  1356. height: 100%;
  1357. padding: 10px;
  1358. box-sizing: border-box;
  1359. background: url('/@/assets/images/fire/bj1.png') no-repeat center;
  1360. background-size: 100% 100%;
  1361. .right-title {
  1362. display: flex;
  1363. height: 30px;
  1364. align-items: center;
  1365. font-size: 14px;
  1366. color: #fff;
  1367. margin-bottom: 10px;
  1368. }
  1369. }
  1370. }
  1371. .detail-content {
  1372. width: 100%;
  1373. height: 100%;
  1374. }
  1375. .history-content {
  1376. position: relative;
  1377. width: 100%;
  1378. height: 100%;
  1379. display: flex;
  1380. justify-content: space-between;
  1381. align-items: center;
  1382. background: url('/@/assets/images/fire/bj1.png') no-repeat center;
  1383. background-size: 100% 100%;
  1384. color: #fff;
  1385. .left-box {
  1386. width: 40%;
  1387. height: 100%;
  1388. margin-right: 15px;
  1389. padding: 10px;
  1390. box-sizing: border-box;
  1391. background: url('/@/assets/images/fire/bj1.png') no-repeat center;
  1392. background-size: 100% 100%;
  1393. .left-title {
  1394. display: flex;
  1395. height: 30px;
  1396. align-items: center;
  1397. font-size: 14px;
  1398. margin-bottom: 10px;
  1399. span {
  1400. color: #fff;
  1401. }
  1402. .zd-open {
  1403. color: rgb(0, 242, 255);
  1404. }
  1405. .zd-close {
  1406. color: #ff0000;
  1407. }
  1408. .title-fz {
  1409. margin-right: 25px;
  1410. }
  1411. }
  1412. .left-content {
  1413. display: flex;
  1414. justify-content: flex-start;
  1415. align-items: flex-start;
  1416. flex-wrap: wrap;
  1417. height: calc(100% - 40px);
  1418. overflow-y: auto;
  1419. .card-box {
  1420. position: relative;
  1421. // width: 242px;
  1422. width: 182px;
  1423. height: 120px;
  1424. margin-bottom: 15px;
  1425. display: flex;
  1426. justify-content: center;
  1427. .card-itemN {
  1428. position: relative;
  1429. width: 85px;
  1430. height: 120px;
  1431. background: url('/@/assets/images/zd-2.png') no-repeat center;
  1432. background-size: 100% 100%;
  1433. cursor: pointer;
  1434. .card-item-label {
  1435. width: 100%;
  1436. position: absolute;
  1437. bottom: 5px;
  1438. font-size: 12px;
  1439. color: #fff;
  1440. text-align: center;
  1441. }
  1442. }
  1443. .card-itemL {
  1444. position: relative;
  1445. width: 85px;
  1446. height: 120px;
  1447. background: url('/@/assets/images/zd-3.png') no-repeat center;
  1448. background-size: 100% 100%;
  1449. cursor: pointer;
  1450. .card-item-label {
  1451. width: 100%;
  1452. position: absolute;
  1453. bottom: 5px;
  1454. font-size: 12px;
  1455. color: #fff;
  1456. text-align: center;
  1457. }
  1458. }
  1459. .card-itemD {
  1460. position: relative;
  1461. width: 85px;
  1462. height: 120px;
  1463. background: url('/@/assets/images/zd-1.png') no-repeat center;
  1464. background-size: 100% 100%;
  1465. cursor: pointer;
  1466. .card-item-label {
  1467. width: 100%;
  1468. position: absolute;
  1469. bottom: 5px;
  1470. font-size: 12px;
  1471. color: #fff;
  1472. text-align: center;
  1473. }
  1474. }
  1475. .card-modal {
  1476. width: 86px;
  1477. position: absolute;
  1478. left: 140px;
  1479. color: #fff;
  1480. top: 50%;
  1481. transform: translate(0, -50%);
  1482. font-size: 12px;
  1483. }
  1484. .card-modal1 {
  1485. width: 86px;
  1486. position: absolute;
  1487. left: -42px;
  1488. color: #fff;
  1489. top: 50%;
  1490. transform: translate(0, -50%);
  1491. font-size: 12px;
  1492. }
  1493. }
  1494. }
  1495. }
  1496. .right-box {
  1497. width: calc(60% - 15px);
  1498. height: 100%;
  1499. padding: 10px;
  1500. box-sizing: border-box;
  1501. background: url('/@/assets/images/fire/bj1.png') no-repeat center;
  1502. background-size: 100% 100%;
  1503. .historytable {
  1504. height: 100%;
  1505. }
  1506. .right-title {
  1507. display: flex;
  1508. height: 30px;
  1509. align-items: center;
  1510. font-size: 14px;
  1511. color: #fff;
  1512. margin-bottom: 10px;
  1513. }
  1514. }
  1515. }
  1516. }
  1517. }
  1518. }
  1519. .down-btn {
  1520. line-height: 15px;
  1521. height: 20px;
  1522. padding: 0px 17px;
  1523. font-size: 12px;
  1524. }
  1525. .zxm-form {
  1526. width: 50%;
  1527. height: 100%;
  1528. padding-top: 20px !important;
  1529. box-sizing: border-box;
  1530. }
  1531. .zxm-picker,
  1532. .zxm-input {
  1533. border: 1px solid #3ad8ff77 !important;
  1534. background-color: #ffffff !important;
  1535. color: #fff !important;
  1536. }
  1537. .card-item.selected {
  1538. border: 2px solid #3ad8ff77;
  1539. /* 选中时的边框颜色 */
  1540. }
  1541. ::v-deep(.zxm-radio-wrapper) {
  1542. font-size: 12px;
  1543. }
  1544. ::v-deep(.zxm-input) {
  1545. font-size: 12px;
  1546. }
  1547. ::v-deep(.zxm-select:not(.zxm-select-customize-input) .zxm-select-selector) {
  1548. border: 1px solid #3ad8ff77 !important;
  1549. }
  1550. // ::v-deep(.zxm-select-selection-item) {
  1551. // color: #fff ;
  1552. // }
  1553. // ::v-deep(.zxm-form-item-label > label) {
  1554. // color: #fff !important;
  1555. // }</style>
  1556. <style>
  1557. div[aria-hidden='true'] {
  1558. display: none !important;
  1559. }
  1560. </style>
  1561. //
  1562. //
  1563. <style lang="less" scoped>
  1564. // // .search-area {
  1565. // // width: 100%;
  1566. // // padding: 5px;
  1567. // // margin: 10px;
  1568. // // box-sizing: border-box;
  1569. // // }
  1570. // // .card-item.selected {
  1571. // // border: 2px solid #3ad8ff77;
  1572. // // /* 选中时的边框颜色 */
  1573. // // }
  1574. // // </style>