index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div>
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <!-- 操作按钮区域 -->
  6. <div class="table-operator" style="margin: 5px 0;float: right">
  7. <a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>
  8. <a-dropdown v-if="selectedRowKeys.length > 0">
  9. <a-menu slot="overlay">
  10. <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
  11. </a-menu>
  12. <a-button style="margin-left: 8px">
  13. 批量操作 <a-icon type="down" />
  14. </a-button>
  15. </a-dropdown>
  16. </div>
  17. <a-form layout="inline" @keyup.enter.native="searchQuery">
  18. <a-form-item>
  19. <a-tree-select
  20. v-model="queryParam.deptId"
  21. style="width: 150px"
  22. :show-search="true"
  23. allow-clear
  24. placeholder="选择车间"
  25. :tree-data="treeData"
  26. tree-node-filter-prop="label"
  27. :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
  28. />
  29. </a-form-item>
  30. <a-form-item>
  31. <j-list-select-tag
  32. v-model="queryParam.stationId"
  33. style="width: 150px"
  34. placeholder="选择站场区间"
  35. dict-code="station"
  36. />
  37. </a-form-item>
  38. <a-form-item>
  39. <a-input
  40. v-model="queryParam.zzh"
  41. style="width: 150px"
  42. placeholder="输入支柱号"
  43. />
  44. </a-form-item>
  45. <a-form-item>
  46. <a-input
  47. v-model="queryParam.jcr"
  48. style="width: 150px"
  49. placeholder="输入检查人"
  50. />
  51. </a-form-item>
  52. <a-form-item>
  53. <a-button type="primary" @click="searchQuery">查询</a-button>
  54. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  55. </a-form-item>
  56. </a-form>
  57. </div>
  58. <!-- table区域-begin -->
  59. <div>
  60. <div class="ant-alert ant-alert-info" style="margin: 16px 0;">
  61. <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
  62. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  63. </div>
  64. <a-table
  65. ref="table"
  66. size="middle"
  67. bordered
  68. row-key="id"
  69. :columns="columns"
  70. :data-source="dataSource"
  71. :pagination="ipagination"
  72. :loading="loading"
  73. :row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  74. @change="handleTableChange"
  75. />
  76. </div>
  77. <!-- table区域-end -->
  78. <!-- 表单区域 -->
  79. </div>
  80. </template>
  81. <script>
  82. import { listMixin } from '@/mixin/listMixin'
  83. import columns from './indexColumns'
  84. import { getAction } from '@/api/request'
  85. export default {
  86. components: {
  87. },
  88. mixins: [listMixin],
  89. data() {
  90. return {
  91. // 查询条件
  92. queryParam: {},
  93. treeData: [],
  94. // 表头
  95. columns: columns(this),
  96. url: {
  97. list: '/business/catenary/bus/jcb/dmcgyq/list',
  98. tree: '/system/dept/treeSelect',
  99. exportXlsUrl: '/exportXlsUrl'
  100. }
  101. }
  102. },
  103. created() {
  104. this.loadTree()
  105. },
  106. methods: {
  107. loadTree() {
  108. this.treeData = []
  109. getAction(this.url.tree).then((res) => {
  110. if (res.code === 200) {
  111. this.treeData = res.data
  112. }
  113. })
  114. }
  115. }
  116. }
  117. </script>
  118. <style scoped>
  119. @import '~@/assets/less/common.less'
  120. </style>