noticelist.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <div class="table_item">
  3. <s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.sctime" bordered>
  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="code">
  28. <a-input v-model:value="searchFormState.code" placeholder="请输入接收人" /> </a-form-item
  29. ></a-col>
  30. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  31. <a-form-item label="通知类型" name="jkdmc">
  32. <a-select v-model:value="searchFormState.jkdmc" placeholder="请选择通知类型">
  33. <a-select-option value="1">短信报警</a-select-option>
  34. <a-select-option value="2">电话报警</a-select-option>
  35. <a-select-option value="3">微信报警</a-select-option>
  36. <a-select-option value="4">邮件报警</a-select-option>
  37. <a-select-option value="5">弹出报警</a-select-option>
  38. <a-select-option value="6">音乐报警</a-select-option>
  39. </a-select>
  40. </a-form-item></a-col
  41. >
  42. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  43. <a-form-item label="状态" name="jkdmc">
  44. <a-select v-model:value="searchFormState.jkdmc" placeholder="请选择状态">
  45. <a-select-option value="1">发送成功</a-select-option>
  46. <a-select-option value="2">未发送</a-select-option>
  47. <a-select-option value="3">发送失败</a-select-option>
  48. <a-select-option value="4">非报警时间记录</a-select-option>
  49. </a-select>
  50. </a-form-item></a-col
  51. >
  52. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  53. ><a-form-item label="对象编码" name="code">
  54. <a-input v-model:value="searchFormState.code" placeholder="请输入对象编码" /> </a-form-item
  55. ></a-col>
  56. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  57. ><a-form-item label="对象名称" name="bjyy">
  58. <a-input v-model:value="searchFormState.bjyy" placeholder="请输入对象名称" /> </a-form-item
  59. ></a-col>
  60. </a-form>
  61. </a-row>
  62. </div>
  63. <div class="table-search-buttons">
  64. <a-button type="primary" @click="tableRef.refresh(true)">查询</a-button>
  65. <a-button class="xn-mg08" @click="reset">重置</a-button>
  66. </div>
  67. </div>
  68. <!-- 其他操作区域 -->
  69. <div class="table-head-btn">
  70. <div class="btn-right">
  71. <a-button>
  72. <template #icon><download-outlined /></template>导出
  73. </a-button>
  74. </div>
  75. </div>
  76. </template>
  77. <template #bodyCell="{ column, index }">
  78. <!-- 序号 -->
  79. <template v-if="column.dataIndex === 'index'">{{ index + 1 }} </template>
  80. </template>
  81. </s-table>
  82. </div>
  83. </template>
  84. <script setup>
  85. import tool from '@/utils/tool'
  86. import jobApi from '@/api/dev/jobApi'
  87. const searchFormRef = ref()
  88. const searchFormState = ref({})
  89. const tableRef = ref()
  90. const columns = [
  91. {
  92. title: '序号',
  93. dataIndex: 'index',
  94. align: 'center',
  95. width: 50
  96. },
  97. {
  98. title: '生成时间',
  99. dataIndex: 'sctime',
  100. align: 'center',
  101. ellipsis: true
  102. },
  103. {
  104. title: '发送时间',
  105. dataIndex: 'fstime',
  106. align: 'center',
  107. ellipsis: true
  108. },
  109. {
  110. title: '接收人',
  111. dataIndex: 'jsr',
  112. align: 'center',
  113. ellipsis: true
  114. },
  115. {
  116. title: '对象编码',
  117. dataIndex: 'dxcpde',
  118. align: 'center',
  119. ellipsis: true
  120. },
  121. {
  122. title: '对象名称',
  123. dataIndex: 'name',
  124. align: 'center',
  125. ellipsis: true
  126. },
  127. {
  128. title: '发送内容',
  129. dataIndex: 'fsnr',
  130. align: 'center',
  131. ellipsis: true,
  132. width: '20%'
  133. },
  134. {
  135. title: '通知类型',
  136. dataIndex: 'type',
  137. align: 'center',
  138. ellipsis: true
  139. },
  140. {
  141. title: '短信',
  142. dataIndex: 'dx',
  143. align: 'center',
  144. ellipsis: true
  145. },
  146. {
  147. title: '电话',
  148. dataIndex: 'dh',
  149. align: 'center',
  150. ellipsis: true
  151. },
  152. {
  153. title: '微信',
  154. dataIndex: 'wx',
  155. align: 'center',
  156. ellipsis: true
  157. },
  158. {
  159. title: '邮件',
  160. dataIndex: 'yj',
  161. align: 'center',
  162. ellipsis: true
  163. },
  164. {
  165. title: '状态',
  166. dataIndex: 'zt',
  167. align: 'center',
  168. ellipsis: true
  169. },
  170. {
  171. title: '故障原因',
  172. dataIndex: 'gzyy',
  173. align: 'center',
  174. ellipsis: true
  175. }
  176. ]
  177. const loadData = (parameter) => {
  178. if (searchFormState.value.searchKey) {
  179. searchFormState.value.startCreateTime = searchFormState.value.searchKey[0]
  180. searchFormState.value.endCreateTime = searchFormState.value.searchKey[1]
  181. delete searchFormState.value.searchKey
  182. }
  183. return jobApi.jobPage(Object.assign(parameter, searchFormState.value)).then((res) => {
  184. // return res
  185. const obj = {
  186. current: 1,
  187. pages: 1,
  188. records: [
  189. {
  190. sctime: '2024-08-28 07:03:24',
  191. fstime: '2024-08-28 09:03:42',
  192. jsr: '周小杰',
  193. dxcpde: '',
  194. name: '-21度冰箱',
  195. fsnr: '广州海关基数中心-[-20度冰箱]报警;温度超过上限:-7.7℃',
  196. type: '短信报警',
  197. dx: '13578945780',
  198. dh: '/',
  199. wx: '/',
  200. yj: '/',
  201. zt: '发送成功',
  202. gzyy: ''
  203. },
  204. {
  205. sctime: '2024-08-28 11:32:12',
  206. fstime: '2024-08-28 11:52:42',
  207. jsr: '周小杰',
  208. dxcpde: '',
  209. name: '-22度冰箱',
  210. fsnr: '广州海关基数中心-[-20度冰箱]报警;温度超过上限:-7.7℃',
  211. type: '短信报警',
  212. dx: '13578945780',
  213. dh: '/',
  214. wx: '/',
  215. yj: '/',
  216. zt: '发送成功',
  217. gzyy: ''
  218. },
  219. {
  220. sctime: '2024-08-28 13:07:34',
  221. fstime: '2024-08-28 13:10:12',
  222. jsr: '周小杰',
  223. dxcpde: '',
  224. name: '-23度冰箱',
  225. fsnr: '广州海关基数中心-[-20度冰箱]报警;温度超过上限:-7.7℃',
  226. type: '短信报警',
  227. dx: '13578945780',
  228. dh: '/',
  229. wx: '/',
  230. yj: '/',
  231. zt: '发送成功',
  232. gzyy: ''
  233. },
  234. {
  235. sctime: '2024-08-28 15:41:04',
  236. fstime: '2024-08-28 15:55:51',
  237. jsr: '周小杰',
  238. dxcpde: '',
  239. name: '-24度冰箱',
  240. fsnr: '广州海关基数中心-[-20度冰箱]报警;温度超过上限:-7.7℃',
  241. type: '短信报警',
  242. dx: '13578945780',
  243. dh: '/',
  244. wx: '/',
  245. yj: '/',
  246. zt: '发送成功',
  247. gzyy: ''
  248. },
  249. {
  250. sctime: '2024-08-28 16:43:14',
  251. fstime: '2024-08-28 16:57:32',
  252. jsr: '周小杰',
  253. dxcpde: '',
  254. name: '-25度冰箱',
  255. fsnr: '广州海关基数中心-[-20度冰箱]报警;温度超过上限:-7.7℃',
  256. type: '短信报警',
  257. dx: '13578945780',
  258. dh: '/',
  259. wx: '/',
  260. yj: '/',
  261. zt: '发送成功',
  262. gzyy: ''
  263. },
  264. {
  265. sctime: '2024-08-28 18:21:33',
  266. fstime: '2024-08-28 18:33:12',
  267. jsr: '周小杰',
  268. dxcpde: '',
  269. name: '-26度冰箱',
  270. fsnr: '广州海关基数中心-[-20度冰箱]报警;温度超过上限:-7.7℃',
  271. type: '短信报警',
  272. dx: '13578945780',
  273. dh: '/',
  274. wx: '/',
  275. yj: '/',
  276. zt: '发送成功',
  277. gzyy: ''
  278. }
  279. ],
  280. size: 10,
  281. total: 6
  282. }
  283. return obj
  284. })
  285. }
  286. // 重置
  287. const reset = () => {
  288. searchFormRef.value.resetFields()
  289. tableRef.value.refresh(true)
  290. }
  291. </script>
  292. <style lang="less" scoped>
  293. .table_item {
  294. padding: 15px 20px;
  295. }
  296. :deep(.ant-table-pagination-right) {
  297. justify-content: center !important;
  298. }
  299. </style>