7b36231410caaac18a5294e70f21cc2d585c0c71.svn-base 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div class="app-content">
  3. <div class="search">
  4. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="操作模块" class="filter-item" style="width: 120px;" clearable>
  5. <el-option v-for="item in operationModuleList" :key="item.id" :label="item.name" :value="item.id" />
  6. </el-select>
  7. <el-input v-model="table.getdataListParm.parammaps.rolename" placeholder="操作内容" style="width: 180px;" class="filter-item" clearable />
  8. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="操作人" class="filter-item" style="width: 120px;" clearable>
  9. <el-option v-for="item in operationModuleList" :key="item.id" :label="item.name" :value="item.id" />
  10. </el-select>
  11. <el-date-picker ref="inputDatetime" v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  12. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  13. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  14. </div>
  15. <div class="table">
  16. <el-table
  17. :key="table.tableKey"
  18. v-loading="table.listLoading"
  19. element-loading-text="给我一点时间"
  20. :data="table.list"
  21. border
  22. fit
  23. highlight-current-row
  24. style="width: 100%;"
  25. :row-style="rowStyle"
  26. :cell-style="cellStyle"
  27. class="elTable table-fixed"
  28. >
  29. <el-table-column label="序号" align="center" type="index" width="50px">
  30. <template slot-scope="scope">
  31. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="操作模块" min-width="130px" align="center" prop="rolename" />
  35. <el-table-column label="操作内容" min-width="130px" align="center" prop="rolename" />
  36. <el-table-column label="操作人" min-width="130px" align="center" prop="rolename" />
  37. <el-table-column label="操作时间" min-width="130px" align="center" prop="rolename" />
  38. <el-table-column label="操作" align="center" width="50px" class-name="small-padding fixed-width" fixed="right">
  39. <template slot-scope="{row}">
  40. <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee(row)" />
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  45. </div>
  46. <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="30%">
  47. <div class="app-add">
  48. <el-form :model="see.temp" label-position="right" label-width="110px" style="width: 90%;margin:0 auto 50px">
  49. <el-row>
  50. <el-col :span="24">
  51. <el-form-item label="操作模块:" prop="rolename">
  52. <span>{{ see.temp.rolename }}</span>
  53. </el-form-item>
  54. </el-col>
  55. </el-row>
  56. <el-row>
  57. <el-col :span="24">
  58. <el-form-item label="操作内容:" prop="rolename">
  59. <span>{{ see.temp.rolename }}</span>
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="24">
  65. <el-form-item label="操作人:" prop="rolename">
  66. <span>{{ see.temp.rolename }}</span>
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. <el-row>
  71. <el-col :span="24">
  72. <el-form-item label="操作时间:" prop="rolename">
  73. <span>{{ see.temp.rolename }}</span>
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. <el-row>
  78. <el-col :span="24">
  79. <el-form-item label="操作详情:" prop="rolename">
  80. <span>{{ see.temp.rolename }}</span>
  81. </el-form-item>
  82. </el-col>
  83. </el-row>
  84. </el-form>
  85. <div slot="footer" class="dialog-footer">
  86. <el-button class="cancelClose cancelClose1" @click="see.dialogFormVisible = false; ">关闭</el-button>
  87. </div>
  88. </div>
  89. </el-dialog>
  90. </div>
  91. </template>
  92. <script>
  93. import { GetDataByName } from '@/api/common'
  94. import Cookies from 'js-cookie'
  95. import { parseTime } from '@/utils/index.js'
  96. import Pagination from '@/components/Pagination'
  97. export default {
  98. name: 'Operation',
  99. components: { Pagination },
  100. data() {
  101. return {
  102. operationModuleList: [], // 操作模块
  103. table: {
  104. getdataListParm: {
  105. name: 'getRoleList',
  106. page: 1,
  107. offset: 1,
  108. pagecount: parseInt(Cookies.get('pageCount')),
  109. returntype: 'Map',
  110. parammaps: {
  111. pastureid: Cookies.get('pastureid'),
  112. rolename: '',
  113. createmp: '',
  114. enable: '',
  115. startTime: '',
  116. stopTime: '',
  117. inputDatetime: ''
  118. }
  119. },
  120. tableKey: 0,
  121. list: [],
  122. total: 0,
  123. listLoading: true,
  124. temp: {}
  125. },
  126. see: {
  127. dialogFormVisible: false,
  128. dialogStatus: '',
  129. temp: {}
  130. },
  131. textMap: {
  132. see: '操作详情'
  133. },
  134. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  135. cellStyle: { padding: 0 + 'px' }
  136. }
  137. },
  138. created() {
  139. this.getList()
  140. },
  141. methods: {
  142. getList() {
  143. this.table.listLoading = true
  144. GetDataByName(this.table.getdataListParm).then(response => {
  145. console.log('table数据', response.data.list)
  146. if (response.data.list !== null) {
  147. this.table.list = response.data.list
  148. this.table.pageNum = response.data.pageNum
  149. this.table.pageSize = response.data.pageSize
  150. this.table.total = response.data.total
  151. } else {
  152. this.table.list = []
  153. }
  154. setTimeout(() => {
  155. this.table.listLoading = false
  156. }, 100)
  157. })
  158. },
  159. handleSearch() {
  160. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  161. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  162. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  163. } else {
  164. this.table.getdataListParm.parammaps.inputDatetime = ''
  165. this.table.getdataListParm.parammaps.startTime = ''
  166. this.table.getdataListParm.parammaps.stopTime = ''
  167. }
  168. this.table.getdataListParm.offset = 1
  169. this.getList()
  170. },
  171. handleRefresh() {
  172. console.log('点击了重置')
  173. },
  174. handleSee(row) {
  175. this.see.dialogStatus = 'see'
  176. this.see.dialogFormVisible = true
  177. this.see.temp = Object.assign({}, row)
  178. }
  179. }
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. .search{margin-top:10px;}
  184. .table{margin-top:10px;}
  185. </style>