approveOperationLogManagement.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <!--审核操作日志管理-->
  2. <template>
  3. <div class="systemBase">
  4. <div>
  5. <div style="margin-top: 10px; border-bottom: 1px solid #d5d5d5;">
  6. <el-form ref="searchData1" :inline="true" :model="search" :rules="ruleValidateSearch">
  7. <!-- <el-form-item label-width="80px" >
  8. <div style="font-size: 16px; padding: 0px 20px;">计量操作日志管理
  9. </div>
  10. </el-form-item> -->
  11. <el-form-item prop="operator" label="操作人" >
  12. <el-input v-model="search.operator" clearable filterable collapse-tags size="small"
  13. style="width:120px;"></el-input>
  14. </el-form-item>
  15. <el-form-item label="创建日期" prop="times">
  16. <el-date-picker v-model="search.times[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  17. placeholder="开始日期" size="mini" style="width: 140px" :default-time="'00:00:00'">
  18. </el-date-picker>
  19. <span>至</span>
  20. <el-date-picker v-model="search.times[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  21. placeholder="结束日期" size="mini" style="width: 140px" :default-time="'23:59:59'">
  22. </el-date-picker>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button icon="el-icon-search" type="primary" size="mini" @click="searchDatas" style="margin-right: 10px;"
  26. >查询</el-button>
  27. <el-button icon="el-icon-refresh" type="info" plain size="mini" :disable="disSearch"
  28. @click="reset">重置</el-button>
  29. </el-form-item>
  30. </el-form>
  31. </div>
  32. <el-row>
  33. <el-col :span="24">
  34. <div class="common-table-div">
  35. <el-table v-loading="dataLoading" :row-class-name="tableRowClassName" ref="dataTable" highlight-current-row
  36. border :height="tableHeight" @selection-change="handleSelectionChange" :data="table.list"
  37. :icore-filter-flag="icoreFilterFlag"
  38. :exchangeFilterMap="{ 'meterNoteSource': { '0': '智能计量终端', '1': '自助取码终端', '2': '计量监控终端', '3': '微信小程序', '4': '远程计量终端' } }">
  39. <el-table-column type="index" label="序号" fixed="left" align="center"></el-table-column>
  40. <!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
  41. <el-table-column sortable :show-overflow-tooltip="true" prop="operationModule" label="操作模块"
  42. min-width="200" align="center"></el-table-column>
  43. <el-table-column sortable :show-overflow-tooltip="true" prop="operator" label="操作人" min-width="110"
  44. align="left"></el-table-column>
  45. <!-- <el-table-column sortable :show-overflow-tooltip="true" prop="operationDescription" label="操作描述"
  46. min-width="300" align="left"></el-table-column> -->
  47. <el-table-column sortable :show-overflow-tooltip="true" prop="operationTime" label="操作时间" min-width="160"
  48. align="center"></el-table-column>
  49. <el-table-column sortable :show-overflow-tooltip="true" prop="ipAddress" label="IP地址" min-width="110"
  50. align="left"></el-table-column>
  51. <el-table-column sortable :show-overflow-tooltip="true" prop="queryParams" label="报文参数" min-width="400"
  52. align="left"></el-table-column>
  53. </el-table>
  54. </div>
  55. <div class="common-foot-style">
  56. <el-pagination v-loading="dataLoading" @size-change="pageSizeChange" @current-change="pageCurrentChange"
  57. :current-page="page.pageNum" :page-sizes="[100, 500, 1000]" :page-size="page.pageSize"
  58. layout="total, sizes, prev, pager, next, jumper" :total="page.totalPage">
  59. </el-pagination>
  60. </div>
  61. </el-col>
  62. </el-row>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import { formatDate } from '@/utils/util.js';
  68. export default {
  69. data() {
  70. return {
  71. dataLoading: false,
  72. operateLoading: false,
  73. icoreFilterFlag: true,
  74. baseSpotNameItem: [],
  75. page: {
  76. pageSize: 500,
  77. pageNum: 1,
  78. totalPage: 0
  79. },
  80. table: {
  81. list: []
  82. },
  83. multipleSelection: [],
  84. tableHeight: 0,
  85. search: {
  86. operator: '',
  87. times: [null, null],
  88. },
  89. // ruleValidateSearch: {
  90. // envDate: [{
  91. // required: true,
  92. // validator: this.endTimeVerify,
  93. // trigger: 'blur'
  94. // }],
  95. // startTime: [{
  96. // required: true,
  97. // validator: this.strTimeVerify,
  98. // trigger: 'blur'
  99. // }]
  100. // },
  101. activeMenu: ''
  102. }
  103. },
  104. created() {
  105. this.tableHeight = (window.innerHeight - 220) > 400 ? window.innerHeight - 220 : 400
  106. this.activeMenu = window.top.localStorage.getItem('activeMenu')
  107. },
  108. mounted() {
  109. // this.getDataList();
  110. this.searchDatas()
  111. this.getBaseSpotNameItem()
  112. },
  113. methods: {
  114. endTimeVerify(rule, value, callback) {
  115. // if (this.search.strDate && !this.search.envDate) {
  116. // callback(new Error('结束时间不能为空!'));
  117. // } else
  118. if (this.search.endTime) {
  119. if (Date.parse(this.search.times[1]) > Date.parse(this.search.times[0])) {
  120. callback();
  121. } else {
  122. callback(new Error('结束时间不得早于开始时间!'));
  123. }
  124. } else {
  125. callback();
  126. }
  127. },
  128. strTimeVerify(rule, value, callback) {
  129. // if (this.search.envDate && !this.search.strDate) {
  130. // callback(new Error('开始时间不能为空!'));
  131. // } else {
  132. // callback()
  133. // }
  134. },
  135. searchDatas() {
  136. this.page.pageNum = 1;
  137. this.searchData()
  138. },
  139. searchData() {
  140. this.$refs['searchData1'].validate((valid) => {
  141. if (valid) {
  142. this.dataLoading = true;
  143. this.search.times[0] = this.search.times[0] === null ? null : (this.search.times[0] + ' 00:00:00')
  144. this.search.times[1] = this.search.times[1] === null ? null : (this.search.times[1] + ' 23:59:59')
  145. let obj = {
  146. operator: this.search.operator,
  147. startTime: this.search.times[0],
  148. endTime: this.search.times[1],
  149. pageIndex: this.page.pageNum,
  150. pageSize: this.page.pageSize
  151. }
  152. this.axios.post('pass/testManagement/v1/approveoperationlogs/queryLogPage', obj, { individualType: "json" })
  153. .then(res => {
  154. console.log('logmanagement......', res)
  155. this.dataLoading = false;
  156. this.table.list = res.data.list;
  157. this.page.totalPage = res.data.total;
  158. }).catch(e => {
  159. this.dataLoading = false;
  160. });
  161. }
  162. })
  163. },
  164. handleSelectionChange(val) {
  165. this.multipleSelection = val;
  166. },
  167. getTableHeight(dom) {
  168. return (window.innerHeight - dom.offsetTop);
  169. },
  170. pageSizeChange(size) {
  171. this.page.pageSize = size;
  172. this.searchData()
  173. },
  174. pageCurrentChange(index) {
  175. this.page.pageNum = index;
  176. this.searchData()
  177. },
  178. getDataList() {
  179. this.dataLoading = true;
  180. let obj ={
  181. pageIndex: this.page.pageNum,
  182. pageSize: this.page.pageSize,
  183. }
  184. this.axios.post('pass/testManagement/v1/approveoperationlogs/queryLogPage', obj, { individualType: "json" })
  185. .then(res => {
  186. this.dataLoading = false;
  187. this.table.list = res.data.list;
  188. this.page.totalPage = res.data.total;
  189. }).catch(e => {
  190. this.dataLoading = false;
  191. });
  192. },
  193. tableRowClassName({
  194. row,
  195. rowIndex
  196. }) {
  197. if (row.validFlag === '0') {
  198. return 'error-row2';
  199. }
  200. return '';
  201. },
  202. getBaseSpotNameItem() {
  203. this.axios.get('pass/systemBase/v1/meterbasespotinfos/noPage' + '?validFlag=1')
  204. .then(res => {
  205. this.baseSpotNameItem = res.data;
  206. })
  207. }
  208. }
  209. }
  210. </script>
  211. <style scoped></style>