list.vue 11 KB

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