index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <el-card class="content-z">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-form-item>
  7. <a-form-item>
  8. <a-input
  9. v-model="queryParam.sdmc"
  10. style="width: 150px"
  11. placeholder="输入隧道名称"
  12. />
  13. </a-form-item>
  14. <j-list-select-tag
  15. v-model="queryParam.lineId"
  16. style="width: 150px"
  17. placeholder="选择线别"
  18. dict-code="line"
  19. />
  20. </a-form-item>
  21. <a-form-item>
  22. <j-list-select-tag
  23. v-model="queryParam.stationId"
  24. style="width: 150px"
  25. placeholder="选择区间站场"
  26. dict-code="station"
  27. />
  28. </a-form-item>
  29. <a-form-item>
  30. <a-tree-select
  31. v-model="queryParam.deptId"
  32. style="width: 150px"
  33. :show-search="true"
  34. allow-clear
  35. placeholder="选择部门"
  36. :tree-data="treeData"
  37. tree-node-filter-prop="label"
  38. :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
  39. />
  40. </a-form-item>
  41. <a-form-item>
  42. <a-button type="primary" @click="searchQuery">查询</a-button>
  43. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  44. </a-form-item>
  45. </a-form>
  46. </div>
  47. <!-- 操作按钮区域 -->
  48. <div class="table-operator" style="margin: 15px 0">
  49. <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
  50. <!-- <a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>-->
  51. <!-- <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="url.importExcelUrl" @change="handleImportExcel">-->
  52. <!-- <a-button ghost type="danger" icon="import">导入</a-button>-->
  53. <!-- </a-upload>-->
  54. <a-dropdown v-if="selectedRowKeys.length > 0">
  55. <a-menu slot="overlay">
  56. <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
  57. </a-menu>
  58. <a-button style="margin-left: 8px">
  59. 批量操作 <a-icon type="down" />
  60. </a-button>
  61. </a-dropdown>
  62. </div>
  63. <!-- table区域-begin -->
  64. <div>
  65. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  66. <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
  67. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  68. </div>
  69. <a-table
  70. ref="table"
  71. size="middle"
  72. bordered
  73. row-key="id"
  74. :columns="columns"
  75. :data-source="dataSource"
  76. :pagination="ipagination"
  77. :loading="loading"
  78. :row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  79. @change="handleTableChange"
  80. >
  81. <span slot="action" slot-scope="text, record">
  82. <a-button size="small" type="primary" @click="handleEdit(record)">
  83. 编辑
  84. </a-button>
  85. <a-divider type="vertical" />
  86. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  87. <a-button size="small" type="danger">
  88. 删除
  89. </a-button>
  90. </a-popconfirm>
  91. </span>
  92. </a-table>
  93. <check-and-edit-model ref="modalForm" @ok="modalFormOk" />
  94. </div>
  95. <!-- table区域-end -->
  96. <!-- 表单区域 -->
  97. </el-card>
  98. </template>
  99. <script>
  100. import { listMixin } from '@/mixin/listMixin'
  101. import columns from './indexColumns'
  102. import CheckAndEditModel from './CheckAndEditModel'
  103. import { getAction } from '@/api/request'
  104. export default {
  105. components: {
  106. CheckAndEditModel
  107. },
  108. mixins: [listMixin],
  109. data() {
  110. return {
  111. // 查询条件
  112. queryParam: {},
  113. // 表头
  114. treeData: [],
  115. columns: columns(this),
  116. url: {
  117. list: '/business/catenary/bus/sdtz/list',
  118. delete: '/business/catenary/bus/sdtz/',
  119. exportXlsUrl: '/exportXlsUrl',
  120. tree: '/system/dept/treeSelect',
  121. importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
  122. }
  123. }
  124. },
  125. created() {
  126. this.loadTree()
  127. },
  128. methods: {
  129. loadTree() {
  130. this.treeData = []
  131. getAction(this.url.tree).then((res) => {
  132. if (res.code === 200) {
  133. this.treeData = res.data
  134. }
  135. })
  136. }
  137. }
  138. }
  139. </script>
  140. <style scoped>
  141. @import '~@/assets/less/common.less'
  142. </style>