detail-130.vue 56 KB

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