statisticalManagement.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <!-- 统计分析管理 -->
  3. <div>
  4. <actionBar :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
  5. @searchProtocol="searchProtocol"></actionBar>
  6. <div class="card_content_interior">
  7. <div class="left_interior">
  8. <div style="display: flex;margin-bottom: 10px;">
  9. <el-checkbox :indeterminate="isIndeterminate" v-model="checked" @change="checkAll">全选</el-checkbox>
  10. <div class="title_invert center_in" @click="Inverse">反选</div>
  11. </div>
  12. <el-checkbox-group v-model="checkedList" @change="checkboxChange">
  13. <el-checkbox class="card_checkbox_analyse" :label="item.code" :key="index" :checked="item.checked"
  14. v-for="(item,index) in list">
  15. <div class="analyse_title">
  16. <div class="item_title1">{{item.title}}</div>
  17. <div class="item_title2">{{item.code}}</div>
  18. </div>
  19. </el-checkbox>
  20. </el-checkbox-group>
  21. </div>
  22. <div class="right_interior">
  23. <!-- 表单 -->
  24. <tables :tableList="tableList" :tableData="tableData" @buttonData="buttonData"></tables>
  25. <!-- 分页 -->
  26. <div v-if="Total">
  27. <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
  28. @changeCurrent="changeCurrent">
  29. </pagination>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import actionBar from '@/components/actionBar'
  37. import tables from '@/components/tables'
  38. import pagination from '@/components/pagination'
  39. import {
  40. employee,
  41. } from "./statistics.js";
  42. export default {
  43. name: 'statisticalManagement',
  44. components: {
  45. actionBar,
  46. tables,
  47. pagination
  48. },
  49. data() {
  50. return {
  51. operateList: [{
  52. type: 'add',
  53. title: '导出Excel',
  54. icon: 'el-icon-plus',
  55. colour: 'warning'
  56. }, {
  57. type: 'import',
  58. title: '下载PDF',
  59. icon: 'el-icon-upload',
  60. }],
  61. formList: [{
  62. type: 'input',
  63. label: '名称',
  64. field: 'name',
  65. placeholder: '请输入名称',
  66. }, {
  67. type: 'input',
  68. label: 'SN',
  69. field: 'sn',
  70. placeholder: 'SN',
  71. }],
  72. searchRuleForm: {
  73. name: '',
  74. sn: '',
  75. status: '',
  76. },
  77. searchValue: {},
  78. checked: '',
  79. checkedList: [],
  80. list: [],
  81. Pagination: {
  82. PageIndex: 1,
  83. PageSize: 10,
  84. },
  85. Total: 1,
  86. tableData: [],
  87. tableList: employee(),
  88. isIndeterminate: true,
  89. }
  90. },
  91. methods: {
  92. // 搜索
  93. searchProtocol(value) {
  94. this.Pagination.PageIndex = 1
  95. this.searchValue = value
  96. // this.getList()
  97. },
  98. openModel(type) {},
  99. buttonData(row, type) {},
  100. checkboxChange(value) {
  101. let checkedCount = value.length;
  102. for (let i = 0; i < this.list.length; i++) {
  103. let flag = value.includes(this.list[i].code);
  104. if (flag) {
  105. this.list[i].checked = true
  106. } else {
  107. this.list[i].checked = false
  108. }
  109. }
  110. this.checkedList = value;
  111. this.isIndeterminate = checkedCount > 0 && checkedCount < this.list.length;
  112. },
  113. // 全选
  114. checkAll() {
  115. this.checkedList = []
  116. for (let i = 0; i < this.list.length; i++) {
  117. this.$set(this.list[i], 'checked', true)
  118. }
  119. this.list.forEach(item => {
  120. if (item.checked) {
  121. this.checkedList.push(item.code)
  122. }
  123. })
  124. this.isIndeterminate = false;
  125. },
  126. // 反选
  127. Inverse() {
  128. this.checkedList = []
  129. for (let i = 0; i < this.list.length; i++) {
  130. let flag = this.list[i].checked;
  131. this.$set(this.list[i], 'checked', !flag)
  132. }
  133. this.list.forEach(item => {
  134. if (item.checked) {
  135. this.checkedList.push(item.code)
  136. }
  137. })
  138. },
  139. changeSize(val) {
  140. this.Pagination.PageSize = val
  141. // this.getList()
  142. },
  143. changeCurrent(val) {
  144. this.Pagination.PageIndex = val
  145. // this.getList()
  146. },
  147. }
  148. }
  149. </script>
  150. <style lang="scss">
  151. .card_content_interior {
  152. display: flex;
  153. background-color: #fff;
  154. border-radius: 5px;
  155. box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
  156. margin-top: 15px;
  157. }
  158. .left_interior {
  159. width: 20%;
  160. padding: 10px;
  161. }
  162. .right_interior {
  163. width: 80%;
  164. }
  165. .span-ellipsis {
  166. width: 100%;
  167. overflow: hidden;
  168. white-space: nowrap;
  169. text-overflow: ellipsis;
  170. margin-right: 20px;
  171. }
  172. .card_checkbox_analyse {
  173. width: 100%;
  174. padding: 10px 0px;
  175. margin-right: 0px !important;
  176. }
  177. .analyse_title {
  178. display: flex;
  179. margin-left: 20rpx;
  180. flex-direction: column;
  181. .item_title1 {
  182. font-size: 16px;
  183. }
  184. .item_title2 {
  185. font-size: 14px;
  186. margin-top: 5px;
  187. }
  188. }
  189. .title_invert {
  190. font-size: 14px;
  191. cursor: pointer;
  192. color: red;
  193. margin-left: 10px;
  194. }
  195. </style>