log.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', '操作日志')
  4. <style>
  5. .panel{
  6. margin-bottom:10px!important;
  7. border-radius: 10px;
  8. padding-left: 20px;
  9. }
  10. .panel .active a {
  11. background-color: #29ba9c!important;
  12. border-radius: 18px!important;
  13. color:#fff;
  14. }
  15. .panel a{
  16. border:none!important;
  17. background-color:#fff!important;
  18. }
  19. .content{
  20. background: #eff3f6;
  21. padding: 10px!important;
  22. }
  23. .con{
  24. padding-bottom:20px;
  25. position:relative;
  26. border-radius: 8px;
  27. min-height:100vh;
  28. background-color:#fff;
  29. }
  30. .con .setting .block{
  31. padding:10px;
  32. background-color:#fff;
  33. border-radius: 8px;
  34. margin-bottom:10px;
  35. }
  36. .con .setting .block .title{
  37. font-size:18px;
  38. margin-bottom:32px;
  39. display:flex;
  40. align-items:center;
  41. justify-content:space-between;
  42. }
  43. b{
  44. font-size:14px;
  45. }
  46. .el-table--border::after, .el-table--group::after, .el-table::before{
  47. background-color:#fff;
  48. }
  49. </style>
  50. <div id='re_content' >
  51. @include('layouts.newTabs')
  52. <div class="con">
  53. <div class="setting">
  54. <el-form ref="form" :model="search_form" >
  55. <div class="block">
  56. <div class="title"><div style="display:flex;align-items:center;"><div style="display:flex;align-items:center;"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>操作日志</b><span style="color: #999999;font-size:12px;display:inline-block;margin-left:16px;">操作日志只包含部分系统操作日志,并非系统所有操作都记录日志,请悉知!</span></div><span></div></div>
  57. <el-form-item label="" style="position:relative;">
  58. <el-input v-model="search_form.user_name" style="width:15%;margin-right:16px;" placeholder="操作员"></el-input>
  59. <el-input v-model="search_form.mark" style="width:15%;margin-right:16px;" placeholder="模块id"></el-input>
  60. <el-date-picker v-model="search_form.activity_time" value-format="timestamp" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
  61. <el-button type="primary" @click="search" style="margin-left:16px;">搜索</el-button>
  62. <div style="position:absolute;right:0;top:0;">
  63. <el-button type="primary" @click="Del" style="margin-right:16px;">删除</el-button>
  64. <el-date-picker v-model="Del_time.del" value-format="timestamp" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
  65. </div>
  66. </el-form-item>
  67. </div>
  68. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  69. <div class="block">
  70. <div class="title"><div style="display:flex;align-items:center;"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>操作日志列表</b><span style="color: #999999;font-size:12px;display:inline-block;margin-left:16px;"></div></div>
  71. <template >
  72. <el-table
  73. v-loading="loading"
  74. element-loading-text="加载中"
  75. :data="tableData"
  76. style="width: 100%">
  77. <el-table-column
  78. prop="id"
  79. align="center"
  80. label="日志ID"
  81. width="100">
  82. </el-table-column>
  83. <el-table-column
  84. prop="user_name"
  85. align="center"
  86. label="操作人 "
  87. label="100">
  88. </el-table-column>
  89. <el-table-column
  90. prop="modules_name"
  91. align="center"
  92. label="模块名 "
  93. label="100">
  94. </el-table-column>
  95. <el-table-column
  96. prop="mark"
  97. align="center"
  98. label="模块ID "
  99. label="100">
  100. </el-table-column>
  101. <el-table-column
  102. prop="type_name"
  103. align="center"
  104. label="类别"
  105. label="100">
  106. </el-table-column>
  107. <el-table-column
  108. prop="field_name"
  109. align="center"
  110. label="名称"
  111. label="100">
  112. </el-table-column>
  113. <el-table-column
  114. prop="old_content"
  115. align="center"
  116. label="修改前内容"
  117. label="100">
  118. </el-table-column>
  119. <el-table-column
  120. prop="new_content"
  121. align="center"
  122. label="修改后内容"
  123. label="100">
  124. </el-table-column>
  125. <el-table-column
  126. prop="ip"
  127. align="center"
  128. label="操作IP"
  129. label="100">
  130. </el-table-column>
  131. <el-table-column
  132. prop="created_at"
  133. align="center"
  134. label="操作时间"
  135. label="100">
  136. </el-table-column>
  137. </el-table>
  138. </template>
  139. <el-row style="background-color:#fff;">
  140. <el-col :span="24" align="center" migra style="padding:15px 5% 15px 0">
  141. <el-pagination background @current-change="currentChange"
  142. :page-size="page_size"
  143. layout="prev, pager, next"
  144. :current-page="current_page" :total="page_total"></el-pagination>
  145. </el-col>
  146. </el-row>
  147. </div>
  148. </div>
  149. </el-form>
  150. </div>
  151. </div>
  152. <script>
  153. var vm = new Vue({
  154. el: "#re_content",
  155. delimiters: ['[[', ']]'],
  156. data() {
  157. let data = {!! $data ?: '[]' !!}
  158. return {
  159. Del_time:{},
  160. activeName: 'one',
  161. loading:false,
  162. search_loading:false,
  163. all_loading:false,
  164. page_total:0,
  165. page_size:0,
  166. current_page:0,
  167. search_form:{
  168. },
  169. real_search_form:{},
  170. loading:false,
  171. search_loading:false,
  172. search_form:{},
  173. real_search_form:{},
  174. value:'',
  175. tableData: [],
  176. data: data,
  177. }
  178. },
  179. created(){
  180. this.getData();
  181. },
  182. mounted () {
  183. },
  184. methods: {
  185. currentChange(val) {
  186. this.loading = true;
  187. this.$http.post('{!! yzWebFullUrl('setting.operation-log.index') !!}',{page:val,search:this.real_search_form}).then(function (response){
  188. if (response.data.result){
  189. let datas = response.data.data.list;
  190. this.tableData=datas.data
  191. this.page_total = datas.total;
  192. this.page_size = datas.per_page;
  193. this.current_page = datas.current_page;
  194. this.loading = false;
  195. } else {
  196. this.$message({message: response.data.msg,type: 'error'});
  197. }
  198. },function (response) {
  199. console.log(response);
  200. this.loading = false;
  201. }
  202. );
  203. },
  204. getData(){
  205. this.loading = true
  206. this.$http.post('{!! yzWebFullUrl('setting.operation-log.index') !!}').then(function (response){
  207. if (response.data.result) {
  208. let datas = response.data.data.list;
  209. this.tableData=datas.data
  210. this.page_total = datas.total;
  211. this.page_size = datas.per_page;
  212. this.current_page = datas.current_page;
  213. this.loading = false;
  214. }else{
  215. this.$message({message: response.data.msg,type: 'error'});
  216. }
  217. },function (response) {
  218. this.$message({message: response.data.msg,type: 'error'});
  219. })
  220. },
  221. search() {
  222. this.search_loading = true;
  223. if(this.search_form.is_time != 0 && this.search_form.activity_time){
  224. this.search_form.start = Math.round(this.search_form.activity_time[0]/1000).valueOf();
  225. this.search_form.end= Math.round(this.search_form.activity_time[1]/1000).valueOf();
  226. }
  227. this.$http.post('{!! yzWebFullUrl('setting.operation-log.index') !!}',{search:this.search_form}
  228. ).then(function (response) {
  229. if (response.data.result){
  230. let data = response.data.data.list;
  231. this.page_total = data.total;
  232. this.tableData = data.data;
  233. this.page_size = data.per_page;
  234. this.current_page = data.current_page;
  235. this.loading = false;
  236. this.real_search_form=Object.assign({},this.search_form);
  237. }
  238. else {
  239. this.$message({message: response.data.msg,type: 'error'});
  240. }
  241. this.search_loading = false;
  242. },function (response) {
  243. this.search_loading = false;
  244. this.$message({message: response.data.msg,type: 'error'});
  245. }
  246. );
  247. },
  248. Del() {
  249. this.Del_time.start = Math.round(this.Del_time.del[0]/1000).valueOf();
  250. this.Del_time.end= Math.round(this.Del_time.del[1]/1000).valueOf();
  251. this.$http.post('{!! yzWebFullUrl('setting.operation-log.del') !!}',{start:this.Del_time.start,end:this.Del_time.end}
  252. ).then(function (response) {
  253. if (response.data.result){
  254. this.$message({message: response.data.msg,type: 'error'});
  255. }
  256. else {
  257. this.$message({message: response.data.msg,type: 'error'});
  258. }
  259. },function (response) {
  260. this.search_loading = false;
  261. this.$message({message: response.data.msg,type: 'error'});
  262. }
  263. );
  264. },
  265. },
  266. });
  267. </script>
  268. @endsection