AlarmModalList.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <div class="alarm-list">
  3. <a-modal
  4. v-model="visible"
  5. title="故障警告"
  6. :footer="null"
  7. width="46%">
  8. <div class="table-page-search-wrapper">
  9. <a-form layout="inline" @keyup.enter.native="searchQuery">
  10. <a-row :gutter="24">
  11. <a-col :lg="18" :md="12">
  12. <a-form-item label="报警时间">
  13. <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
  14. <!-- <j-input placeholder="输入账号模糊查询" v-model="queryParam.Time"></j-input> -->
  15. <j-date placeholder="请选择报警时间" v-model="queryParam.Time" :show-time="true" date-format="YY/MM/DD HH:mm:ss" style="width: 100%" />
  16. </a-form-item>
  17. </a-col>
  18. <a-col :lg="6" :md="12">
  19. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  20. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  21. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  22. </span>
  23. </a-col>
  24. </a-row>
  25. </a-form>
  26. </div>
  27. <a-table
  28. ref="table"
  29. size="middle"
  30. bordered
  31. :rowKey="(record, index) => { return index }"
  32. :columns="columns"
  33. :dataSource="dataSource"
  34. :pagination="ipagination"
  35. :loading="loading"
  36. @change="tableChange"
  37. class="j-table-force-nowrap alarm-list-table">
  38. <!-- :scroll="{x:true}" -->
  39. <template>
  40. <div>
  41. </div>
  42. </template>
  43. </a-table>
  44. </a-modal>
  45. </div>
  46. </template>
  47. <script>
  48. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  49. import { getAction } from '@/api/manage'
  50. export default {
  51. name: '',
  52. mixins: [JeecgListMixin],
  53. data () {
  54. return {
  55. ipagination:{
  56. current: 1,
  57. pageSize: 10,
  58. pageSizeOptions: ['10', '20', '30'],
  59. showTotal: (total, range) => {
  60. return range[0] + "-" + range[1] + " 共" + total + "条"
  61. },
  62. showQuickJumper: false,
  63. showSizeChanger: true,
  64. total: 0,
  65. },
  66. visible: false,
  67. queryParam: {},
  68. columns: [
  69. {
  70. title: '',
  71. dataIndex: '',
  72. key: 'rowIndex',
  73. width: 40,
  74. align: "center",
  75. customRender: function (t,r,index) {
  76. return parseInt(index)+1;
  77. }
  78. },
  79. {
  80. title: '报警时间',
  81. align: "center",
  82. dataIndex: 'Time',
  83. customRender: (text, record) => {
  84. return {
  85. children: text,
  86. attrs: {
  87. style: 'color: #D4DC8C',
  88. },
  89. };
  90. },
  91. },
  92. {
  93. title: '故障描述',
  94. align: "center",
  95. dataIndex: 'Desc',
  96. customRender: (text, record) => {
  97. return {
  98. children: text,
  99. attrs: {
  100. style: 'color: #D4DC8C',
  101. },
  102. };
  103. },
  104. },
  105. {
  106. title: '恢复时间',
  107. align: "center",
  108. dataIndex: 'updateTime',
  109. customRender: (text, record) => {
  110. return {
  111. children: text,
  112. attrs: {
  113. style: 'color: #2da873',
  114. },
  115. };
  116. },
  117. },
  118. ],
  119. dataSource: [
  120. {
  121. createTime1: '2023-12-28 13:25:22',
  122. createTime2: '2023-12-28 13:25:22',
  123. createTime3: '2023-12-28 13:25:22',
  124. },
  125. {
  126. createTime1: '2023-12-28 13:25:22',
  127. createTime2: '2023-12-28 13:25:22',
  128. createTime3: '2023-12-28 13:25:22',
  129. },
  130. {
  131. createTime1: '2023-12-28 13:25:22',
  132. createTime2: '2023-12-28 13:25:22',
  133. createTime3: '2023-12-28 13:25:22',
  134. },
  135. {
  136. createTime1: '2023-12-28 13:25:22',
  137. createTime2: '2023-12-28 13:25:22',
  138. createTime3: '2023-12-28 13:25:22',
  139. },
  140. {
  141. createTime1: '2023-12-28 13:25:22',
  142. createTime2: '2023-12-28 13:25:22',
  143. createTime3: '2023-12-28 13:25:22',
  144. },
  145. {
  146. createTime1: '2023-12-28 13:25:22',
  147. createTime2: '2023-12-28 13:25:22',
  148. createTime3: '2023-12-28 13:25:22',
  149. },
  150. {
  151. createTime1: '2023-12-28 13:25:22',
  152. createTime2: '2023-12-28 13:25:22',
  153. createTime3: '2023-12-28 13:25:22',
  154. },
  155. {
  156. createTime1: '2023-12-28 13:25:22',
  157. createTime2: '2023-12-28 13:25:22',
  158. createTime3: '2023-12-28 13:25:22',
  159. },
  160. ],
  161. url: {
  162. list: "/datacoll/webaccess/getAlarmLog",
  163. // exportXlsUrl: "/sys/user/exportXls",
  164. },
  165. }
  166. },
  167. created () {
  168. },
  169. mounted () {
  170. },
  171. methods: {
  172. loadData(arg) {
  173. if(!this.url.list){
  174. this.$message.error("请设置url.list属性!")
  175. return
  176. }
  177. //加载数据 若传入参数1则加载第一页的内容
  178. if (arg === 1) {
  179. this.ipagination.current = 1;
  180. }
  181. var params = this.getQueryParams();//查询条件
  182. this.loading = true;
  183. console.log(9999,params)
  184. getAction(this.url.list, params).then((res) => {
  185. if (res.success) {
  186. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  187. // this.dataSource = [];
  188. this.dataSource = res.result.AlarmTagList;
  189. if(res.result.total)
  190. {
  191. this.ipagination.total = res.result.total;
  192. this.ipagination.current = res.result.current;
  193. this.ipagination.pageSize = res.result.size;
  194. }else{
  195. this.ipagination.total = 0;
  196. }
  197. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  198. }else{
  199. this.$message.warning(res.message)
  200. }
  201. }).finally(() => {
  202. this.loading = false
  203. })
  204. },
  205. tableChange(pagination){
  206. this.ipagination.current = pagination.current
  207. this.ipagination.pageSize = pagination.pageSize
  208. this.loadData()
  209. },
  210. }
  211. }
  212. </script>
  213. <style scoped>
  214. @import '~@/assets/less/uStyle.less';
  215. </style>
  216. <style lang="less" scoped>
  217. .alarm-list{
  218. }
  219. // 弹窗样式
  220. .ant-modal-root{
  221. /deep/ .ant-modal-title{
  222. color: #fff !important;
  223. }
  224. /deep/ .ant-modal-header {
  225. border-bottom-color: #295085;
  226. }
  227. /deep/ .ant-modal-close{
  228. i{
  229. color: #fff !important;
  230. }
  231. }
  232. /deep/ .ant-modal-content{
  233. width: 100%;
  234. height: calc(100% - 26px);
  235. border: 1px solid #000;
  236. border-width: 8px 0 0 6px;
  237. /* 变相设置边距 */
  238. border-image: url('~@/assets/visualization/moduleBdBg.png') 4 4 fill;
  239. border-image-repeat: stretch;
  240. position: relative;
  241. background-color: rgba(15, 57, 91, .4);
  242. .ant-modal-header{
  243. background-color: transparent;
  244. }
  245. }
  246. }
  247. // 表单
  248. .ant-form{
  249. /deep/ .ant-form-item-label{
  250. label{
  251. color: #fff !important;
  252. }
  253. }
  254. /deep/ .ant-input{
  255. background: rgba(6,23,48,.5);
  256. color: #fff;
  257. }
  258. /deep/ .ant-btn-primary{
  259. background: transparent;
  260. // background: #0b2243d9;
  261. // border-color: #fff;
  262. }
  263. }
  264. // 表格样式
  265. .alarm-list-table{
  266. /deep/ .ant-table-placeholder{
  267. background-color: transparent;
  268. border: none;
  269. // border-color: #044b90 !important;
  270. }
  271. /deep/ .ant-table-bordered .ant-table-thead > tr > th{
  272. border-color: #044b90 !important;
  273. }
  274. /deep/.ant-table-bordered .ant-table-tbody > tr > td{
  275. border-color: #044b90 !important;
  276. padding: 6px !important;
  277. }
  278. /deep/ .ant-table-bordered .ant-table-body > table{
  279. border-color: #044b90 !important;
  280. }
  281. /deep/ .ant-table-content{
  282. background: rgba(2,8,20, .5);
  283. // background: rgba(15, 57, 91, .5);
  284. color: #fff;
  285. }
  286. /deep/ .ant-table-thead > tr > th{
  287. background: transparent;
  288. color: #fff;
  289. }
  290. }
  291. // 分页样式
  292. /deep/ .ant-pagination{
  293. color: #fff !important;
  294. // 箭头
  295. .ant-pagination-prev a, .ant-pagination-next a{
  296. color: #fff;
  297. }
  298. /deep/ .ant-pagination-disabled a{
  299. color: #fff;
  300. }
  301. // 页数
  302. .ant-pagination-item{
  303. a{
  304. color: #fff;
  305. }
  306. }
  307. .ant-pagination-item-active{
  308. background: #05162f;
  309. border-color: transparent;
  310. a{
  311. color: #fff;
  312. }
  313. }
  314. /deep/ .ant-pagination-options-quick-jumper{
  315. input{
  316. background: #05162f !important;
  317. color: #fff !important;
  318. }
  319. }
  320. // 每页选择
  321. .ant-select-selection{
  322. background: #05162f;
  323. color: #fff;
  324. border-color: transparent;
  325. }
  326. // .ant-select-dropdown{
  327. // background: #05162f;
  328. // border-color: transparent;
  329. // .ant-select-dropdown-menu-item{
  330. // color: #fff;
  331. // }
  332. // }
  333. }
  334. // a-table暂无数据
  335. ::v-deep .ant-empty-normal{
  336. color: #fff;
  337. }
  338. </style>