list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <div class="table_item">
  3. <s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.dxbh">
  4. <template #operator>
  5. <!-- 搜索区域 -->
  6. <div class="table-search">
  7. <div class="table-search-form">
  8. <a-row :gutter="10">
  9. <a-form
  10. ref="searchFormRef"
  11. name="advanced_search"
  12. layout="inline"
  13. :label-col="{ style: { width: '70px', justifyContent: 'end' } }"
  14. :model="searchFormState"
  15. class="ant-advanced-search-form"
  16. >
  17. <a-col :xs="24" :sm="24" :md="24" :lg="12" :xl="8">
  18. <a-form-item label="报警时间" name="searchKey">
  19. <a-range-picker
  20. v-model:value="searchFormState.searchKey"
  21. value-format="YYYY/MM/DD"
  22. style="width: 100%"
  23. />
  24. </a-form-item>
  25. </a-col>
  26. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  27. <a-form-item label="报警状态" name="jkdmc">
  28. <a-select v-model:value="searchFormState.jkdmc" placeholder="请选择报警状态">
  29. <a-select-option value="1">已处理</a-select-option>
  30. <a-select-option value="2">未处理</a-select-option>
  31. <a-select-option value="3">处理中</a-select-option>
  32. </a-select>
  33. </a-form-item></a-col
  34. >
  35. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  36. ><a-form-item label="对象编码" name="code">
  37. <a-input v-model:value="searchFormState.code" placeholder="请输入对象编码" /> </a-form-item
  38. ></a-col>
  39. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  40. ><a-form-item label="对象名称" name="code">
  41. <a-input v-model:value="searchFormState.code" placeholder="请输入对象名称" /> </a-form-item
  42. ></a-col>
  43. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  44. ><a-form-item label="发生时间" name="syzt">
  45. <a-select v-model:value="searchFormState.syzt" placeholder="请选择发生时间">
  46. <a-select-option value="1">>10分钟</a-select-option>
  47. <a-select-option value="2">>30分钟</a-select-option>
  48. <a-select-option value="3">>1小时</a-select-option>
  49. <a-select-option value="4">>5小时</a-select-option>
  50. </a-select>
  51. </a-form-item></a-col
  52. >
  53. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  54. <a-form-item label="报警类型" name="jkdmc">
  55. <a-select v-model:value="searchFormState.jkdmc" placeholder="请选择报警类型">
  56. <a-select-option value="1">超限报警</a-select-option>
  57. <a-select-option value="2">传感器故障</a-select-option>
  58. <a-select-option value="3">电池报警</a-select-option>
  59. <a-select-option value="4">断线报警</a-select-option>
  60. <a-select-option value="5">其他报警</a-select-option>
  61. <a-select-option value="6">外部电源断开</a-select-option>
  62. </a-select>
  63. </a-form-item></a-col
  64. >
  65. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  66. ><a-form-item label="报警原因" name="bjyy">
  67. <a-input v-model:value="searchFormState.bjyy" placeholder="请输入报警原因" /> </a-form-item
  68. ></a-col>
  69. </a-form>
  70. </a-row>
  71. </div>
  72. <div class="table-search-buttons">
  73. <a-button type="primary" @click="tableRef.refresh(true)">查询</a-button>
  74. <a-button class="xn-mg08" @click="reset">重置</a-button>
  75. </div>
  76. </div>
  77. <!-- 其他操作区域 -->
  78. <div class="table-head-btn">
  79. <div class="btn-right">
  80. <a-button class="xn-mg08">
  81. <template #icon><logout-outlined /></template>处理
  82. </a-button>
  83. <a-button class="xn-mg08">
  84. <template #icon><logout-outlined /></template>全部处理
  85. </a-button>
  86. <a-button>
  87. <template #icon><download-outlined /></template>导出
  88. </a-button>
  89. </div>
  90. </div>
  91. </template>
  92. <template #bodyCell="{ column, record }">
  93. <template v-if="column.dataIndex === 'clzt'">
  94. <span style="cursor: pointer">
  95. <a-tag color="#cd201f" v-if="record.clzt == '1'" @click="formRef.onOpen(record)">
  96. <template #icon>
  97. <form-outlined />
  98. </template>
  99. {{ record.clztValue }}
  100. </a-tag>
  101. <a-tag v-else-if="record.clzt == '2'" color="#87d068">
  102. {{ record.clztValue }}
  103. </a-tag>
  104. </span>
  105. </template>
  106. </template>
  107. <template #expandedRowRender="{ record }">
  108. <a-tabs v-model:activeKey="record.activeKey" size="small" type="card">
  109. <a-tab-pane key="1" tab="处理过程">
  110. <!-- 报警信息 -->
  111. <div class="list">
  112. <div class="title">报警信息</div>
  113. <div class="info">
  114. <div class="info-row">
  115. <div class="label">报警时间:</div>
  116. <div class="text">{{ record.zjbjsj }}</div>
  117. </div>
  118. <div class="info-row">
  119. <div class="label">报警类型:</div>
  120. <div class="text">{{ record.bjlx }}</div>
  121. </div>
  122. <div class="info-row">
  123. <div class="label">设备名称:</div>
  124. <div class="text">{{ record.sbmc }}</div>
  125. </div>
  126. </div>
  127. </div>
  128. <!-- 报警通知 -->
  129. <div class="list">
  130. <div class="title">报警通知</div>
  131. <div class="info">
  132. <div class="info-row">
  133. <div class="label">接收人:</div>
  134. <div class="text">{{ record.jsr }}</div>
  135. </div>
  136. <div class="info-row">
  137. <div class="label">报警方式:</div>
  138. <div class="text">{{ record.type }}</div>
  139. </div>
  140. <div class="info-row">
  141. <div class="label">详情:</div>
  142. <div class="text">{{ record.xq }}</div>
  143. </div>
  144. </div>
  145. </div>
  146. <!-- 解决过程 -->
  147. <div class="list">
  148. <div class="title">解决过程</div>
  149. <div class="info">
  150. <div class="info-row">
  151. <div class="label">响应时间:</div>
  152. <div class="text">{{ record.xysj }}</div>
  153. </div>
  154. <div class="info-row">
  155. <div class="label">处理人:</div>
  156. <div class="text">{{ record.clr }}</div>
  157. </div>
  158. <div class="info-row">
  159. <div class="label">处理时间:</div>
  160. <div class="text">{{ record.clsj }}</div>
  161. </div>
  162. <div class="info-row">
  163. <div class="label">报警原因:</div>
  164. <div class="text">{{ record.bjyy }}</div>
  165. </div>
  166. <div class="info-row">
  167. <div class="label">异常原因:</div>
  168. <div class="text">{{ record.ycyy }}</div>
  169. </div>
  170. <div class="info-row">
  171. <div class="label">处理措施:</div>
  172. <div class="text">{{ record.clcs }}</div>
  173. </div>
  174. </div>
  175. </div>
  176. </a-tab-pane>
  177. <a-tab-pane key="2" tab="监控信息">
  178. <!-- 基本信息 -->
  179. <div class="list">
  180. <div class="title">基本信息</div>
  181. <div class="info">
  182. <div class="info-row">
  183. <div class="label">对象名称</div>
  184. <div class="text">{{ record.dxmc }}</div>
  185. </div>
  186. <div class="info-row">
  187. <div class="label">对象编号:</div>
  188. <div class="text">{{ record.dxbh }}</div>
  189. </div>
  190. <div class="info-row">
  191. <div class="label">对象类型:</div>
  192. <div class="text">{{ record.dxlx }}</div>
  193. </div>
  194. <div class="info-row">
  195. <div class="label">购置日期:</div>
  196. <div class="text">{{ record.gzrq }}</div>
  197. </div>
  198. <div class="info-row">
  199. <div class="label">品牌:</div>
  200. <div class="text">{{ record.pp }}</div>
  201. </div>
  202. <div class="info-row">
  203. <div class="label">型号:</div>
  204. <div class="text">{{ record.xh }}</div>
  205. </div>
  206. </div>
  207. </div>
  208. <!-- 归属信息 -->
  209. <div class="list">
  210. <div class="title">归属信息</div>
  211. <div class="info">
  212. <div class="info-row">
  213. <div class="label">所属部门:</div>
  214. <div class="text">{{ record.ssbm }}</div>
  215. </div>
  216. <div class="info-row">
  217. <div class="label">对象编码:</div>
  218. <div class="text">{{ record.dxbh }}</div>
  219. </div>
  220. </div>
  221. </div>
  222. </a-tab-pane>
  223. </a-tabs>
  224. </template>
  225. </s-table>
  226. <Form ref="formRef" @successful="tableRef.refresh(true)" />
  227. </div>
  228. </template>
  229. <script setup>
  230. import tool from '@/utils/tool'
  231. import jobApi from '@/api/dev/jobApi'
  232. import Form from './form.vue'
  233. const formRef = ref()
  234. const searchFormRef = ref()
  235. const searchFormState = ref({})
  236. const tableRef = ref()
  237. const columns = [
  238. {
  239. title: '处理状态',
  240. dataIndex: 'clzt',
  241. align: 'center',
  242. ellipsis: true,
  243. sorter: true,
  244. width: '10%'
  245. },
  246. {
  247. title: '报警开始时间',
  248. dataIndex: 'bjkssj',
  249. align: 'center',
  250. ellipsis: true,
  251. sorter: true
  252. },
  253. {
  254. title: '最近报警时间',
  255. dataIndex: 'zjbjsj',
  256. align: 'center',
  257. ellipsis: true,
  258. sorter: true
  259. },
  260. {
  261. title: '所属部门',
  262. dataIndex: 'ssbm',
  263. align: 'center',
  264. ellipsis: true
  265. },
  266. {
  267. title: '对象编码',
  268. dataIndex: 'dxbh',
  269. align: 'center',
  270. ellipsis: true,
  271. sorter: true
  272. },
  273. {
  274. title: '对象名称',
  275. dataIndex: 'dxmc',
  276. align: 'center',
  277. ellipsis: true
  278. },
  279. {
  280. title: '报警类型',
  281. dataIndex: 'bjlx',
  282. align: 'center',
  283. ellipsis: true
  284. },
  285. {
  286. title: '报警原因',
  287. dataIndex: 'bjyy',
  288. align: 'center',
  289. ellipsis: true
  290. },
  291. {
  292. title: '恢复正常时间',
  293. dataIndex: 'hfzcsj',
  294. align: 'center',
  295. ellipsis: true
  296. },
  297. {
  298. title: '相应时间',
  299. dataIndex: 'xysj',
  300. align: 'center',
  301. ellipsis: true,
  302. sorter: true
  303. },
  304. {
  305. title: '处理时间',
  306. dataIndex: 'clsj',
  307. align: 'center',
  308. ellipsis: true,
  309. sorter: true
  310. },
  311. {
  312. title: '处理人',
  313. dataIndex: 'clr',
  314. align: 'center',
  315. ellipsis: true,
  316. sorter: true
  317. },
  318. {
  319. title: '异常原因',
  320. dataIndex: 'ycyy',
  321. align: 'center',
  322. ellipsis: true,
  323. sorter: true
  324. },
  325. {
  326. title: '处理措施',
  327. dataIndex: 'clcs',
  328. align: 'center',
  329. ellipsis: true,
  330. sorter: true
  331. }
  332. ]
  333. const activeKey = ref('1')
  334. const loadData = (parameter) => {
  335. if (searchFormState.value.searchKey) {
  336. searchFormState.value.startCreateTime = searchFormState.value.searchKey[0]
  337. searchFormState.value.endCreateTime = searchFormState.value.searchKey[1]
  338. delete searchFormState.value.searchKey
  339. }
  340. return jobApi.jobPage(Object.assign(parameter, searchFormState.value)).then((res) => {
  341. // return res
  342. const obj = {
  343. current: 1,
  344. pages: 1,
  345. records: [
  346. {
  347. clzt: '1',
  348. clztValue: '未处理',
  349. bjkssj: '2024-08-28 07:03:24',
  350. zjbjsj: '2024-08-28 09:03:42',
  351. ssbm: '上海海关技术中心',
  352. dxbh: '1111',
  353. dxmc: '-20度冰箱',
  354. jsr: '周小杰',
  355. bjlx: '超限报警1',
  356. bjyy: '温度超上限',
  357. bjyy: '温度超上限',
  358. hfzcsj: '',
  359. xysj: '',
  360. clsj: '2024-08-30 09:27:56',
  361. clr: '',
  362. ycyy: '',
  363. clcs: '',
  364. name: '-21度冰箱',
  365. fsnr: '广州海关基数中心-[-20度冰箱]报警;温度超过上限:-7.7℃',
  366. type: '短信报警1',
  367. dx: '13578945780',
  368. dh: '/',
  369. wx: '/',
  370. yj: '/',
  371. zt: '发送成功',
  372. clcs: '',
  373. sbmc: '冰箱',
  374. xq: '2024-08-28 09:03:42 短信报警',
  375. xysj: '2024-08-28 09:03:42',
  376. clr: '周小杰',
  377. dxlx: '冰箱',
  378. gzrq: '2024-05-30 14:27:03',
  379. pp: '海尔',
  380. xh: '68'
  381. },
  382. {
  383. clzt: '2',
  384. clztValue: '已处理',
  385. bjkssj: '2024-08-31 09:24:56',
  386. zjbjsj: '2024-08-31 11:15:10',
  387. ssbm: '广州海关技术中心',
  388. dxbh: '2222',
  389. dxmc: '-56度冰箱',
  390. jsr: '欧阳天添',
  391. bjlx: '超限报警2',
  392. bjyy: '温度超上限',
  393. bjyy: '温度超上限',
  394. hfzcsj: '',
  395. xysj: '',
  396. clsj: '2024-09-01 11:56:01',
  397. clr: '',
  398. ycyy: '',
  399. clcs: '',
  400. name: '-21度冰箱',
  401. fsnr: '广州海关基数中心-[-56度冰箱]报警;温度超过上限:-7.7℃',
  402. type: '电话报警',
  403. dx: '15464789745',
  404. dh: '/',
  405. wx: '/',
  406. yj: '/',
  407. zt: '发送成功',
  408. clcs: '',
  409. sbmc: '冰箱',
  410. xq: '2024-08-31 11:15:10 电话报警',
  411. xysj: '2024-08-31 11:15:10',
  412. clr: '欧阳天添',
  413. dxlx: '冰箱',
  414. gzrq: '2024-05-30 14:27:03',
  415. pp: '海尔',
  416. xh: '68'
  417. }
  418. ],
  419. size: 10,
  420. total: 1
  421. }
  422. return obj
  423. })
  424. }
  425. // 重置
  426. const reset = () => {
  427. searchFormRef.value.resetFields()
  428. tableRef.value.refresh(true)
  429. }
  430. </script>
  431. <style lang="less" scoped>
  432. .table_item {
  433. padding: 15px 20px;
  434. }
  435. :deep(.ant-table-pagination-right) {
  436. justify-content: center !important;
  437. }
  438. .list {
  439. width: 60%;
  440. margin: 10px 0;
  441. border: 1px solid #e4e4e4;
  442. // 标题
  443. .title {
  444. width: 100%;
  445. padding: 10px;
  446. font-weight: bold;
  447. color: #802f76;
  448. }
  449. // 信息区域
  450. .info {
  451. width: 100%;
  452. display: flex;
  453. flex-wrap: wrap;
  454. align-items: center;
  455. border-bottom: none;
  456. .info-row {
  457. display: flex;
  458. flex: 1 1 33%;
  459. width: 100%;
  460. height: 45px;
  461. line-height: 45px;
  462. border: 1px solid #e4e4e4;
  463. .label {
  464. width: 100px;
  465. text-align-last: justify;
  466. padding: 0 10px;
  467. color: #802f76;
  468. font-weight: bold;
  469. border-right: 1px solid #e4e4e4;
  470. }
  471. .text {
  472. flex: 1;
  473. white-space: nowrap;
  474. overflow: hidden;
  475. text-overflow: ellipsis;
  476. padding: 0 10px;
  477. }
  478. }
  479. }
  480. .info:last-child {
  481. border-right: none;
  482. }
  483. }
  484. </style>