calTable.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <!-- :bordered="false" -->
  3. <a-card>
  4. <!-- 查询 -->
  5. <div class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="searchQuery">
  7. <a-row :gutter="24">
  8. <a-col :md="6" :sm="8">
  9. <a-form-item label="标题">
  10. <a-input placeholder="请输入标题查询" v-model="queryParam.title" />
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="8">
  14. <a-form-item label="类型">
  15. <!-- <a-input placeholder="请选择状态查询" v-model="queryParam.status" /> -->
  16. <a-select
  17. v-decorator="['type', { rules: [{ required: false, message: '请选择状态查询' }] }]"
  18. placeholder="请选择状态查询"
  19. width="100%"
  20. >
  21. <a-select-option value="日常记录">日常记录</a-select-option>
  22. <a-select-option value="本周工作">本周工作</a-select-option>
  23. <a-select-option value="下周计划">下周计划</a-select-option>
  24. </a-select>
  25. </a-form-item>
  26. </a-col>
  27. <!-- <template> </template> -->
  28. <a-col :md="6" :sm="8">
  29. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  30. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  31. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  32. </span>
  33. </a-col>
  34. </a-row>
  35. </a-form>
  36. </div>
  37. <!-- 操作按钮区域 -->
  38. <div class="table-operator">
  39. <a-button @click="addPlan" type="primary">新增</a-button>
  40. <a-button type="primary" @click="myPlanExportXls('我的日程计划')">导出</a-button>
  41. <!---------------------------------------------------------------------
  42. :action="importExcelUrl" 上传的地址
  43. showUploadList 是否展示uploadList ,
  44. 可设为一个对象,用于单独设定showPreviewIcon和showRemoveIconf
  45. headers 设置上传的请求头部
  46. multiple 是否支持多选文件
  47. name 发达后台的文件参数名
  48. ----------------------------------------------------------------------->
  49. <a-upload
  50. name="planFile"
  51. :showUploadList="false"
  52. :multiple="false"
  53. :headers="tokenHeader"
  54. @change="myPlanImportExcel"
  55. >
  56. <a-button type="primary">导入</a-button>
  57. </a-upload>
  58. <!-- v-if="selectedRowKeys.length > 0" -->
  59. <a-dropdown>
  60. <a-menu slot="overlay">
  61. <a-menu-item key="1" @click="batchDel">
  62. <a-icon type="delete" />
  63. 删除
  64. </a-menu-item>
  65. </a-menu>
  66. <a-button style="margin-left: 8px">
  67. 批量操作
  68. <a-icon type="down" />
  69. </a-button>
  70. </a-dropdown>
  71. </div>
  72. <!-- table区域-begin -->
  73. <div>
  74. <a-alert type="info" showIcon style="margin-bottom: 16px;">
  75. <template slot="message">
  76. <span>已选择</span>
  77. <!-- {{ selectedRowKeys.length }} -->
  78. <a style="font-weight: 600;padding: 0 4px;">3</a>
  79. <span>项</span>
  80. <!-- v-if="selectedRowKeys.length > 0" -->
  81. <template>
  82. <a-divider type="vertical" />
  83. <a @click="onClearSelected">清空</a>
  84. </template>
  85. </template>
  86. </a-alert>
  87. <!-- table :loading="loading" -->
  88. <a-row>
  89. <a-table
  90. bordered
  91. :columns="columns"
  92. :dataSource="planDataList"
  93. :pagination="pagination"
  94. :row-key="record => record.id"
  95. :rowSelection="rowSelection"
  96. @change="handleTableChange"
  97. >
  98. <!-- 操作 -->
  99. <span slot="operationSlot" slot-scope="text, record">
  100. <a href="javascript:void(0);" @click="editPlan(record)"> 编辑 </a>
  101. <a-divider type="vertical" />
  102. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否">
  103. <a href="javascript:void(0);" @click="delPlan(record.id)" class="delRed"> 删除 </a>
  104. </a-popconfirm>
  105. </span>
  106. </a-table>
  107. </a-row>
  108. </div>
  109. </a-card>
  110. </template>
  111. <script>
  112. import JEllipsis from '@/components/jeecg/JEllipsis'
  113. // import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  114. // import SysCheckRuleModal from './modules/SysCheckRuleModal'
  115. // import SysCheckRuleTestModal from './modules/SysCheckRuleTestModal'
  116. export default {
  117. name: 'CalTable',
  118. // mixins: [JeecgListMixin],
  119. components: { JEllipsis },
  120. data () {
  121. return {
  122. tokenHeader: {},
  123. queryParam: {}, // 查询条件对象
  124. pagination: {}, // 分页
  125. // 表头
  126. columns: [
  127. {
  128. title: '标题',
  129. dataIndex: 'title',
  130. align: 'center'
  131. },
  132. {
  133. title: '类型',
  134. dataIndex: 'type',
  135. align: 'center'
  136. },
  137. {
  138. title: '紧急程度',
  139. dataIndex: 'degreeOfUrgency',
  140. align: 'center'
  141. },
  142. {
  143. title: '开始时间',
  144. dataIndex: 'startTime',
  145. align: 'center'
  146. },
  147. {
  148. title: '操作',
  149. dataIndex: 'operation',
  150. scopedSlots: { customRender: 'operationSlot' },
  151. align: 'center',
  152. width: '20%'
  153. }
  154. ],
  155. planDataList: [
  156. {
  157. id: '1',
  158. title: '11月19日的KPI考核(2)',
  159. type: '下周计划',
  160. degreeOfUrgency: '紧急',
  161. startTime: '2021/11/19',
  162. memo: '哈哈哈哈哈哈'
  163. },
  164. {
  165. id: '2',
  166. title: '12月17日的KPI考核(3)',
  167. type: '日程记录',
  168. degreeOfUrgency: '一般',
  169. startTime: '2021/12/17',
  170. memo: '呵呵呵呵'
  171. },
  172. {
  173. id: '3',
  174. title: 'AAAAAAA',
  175. type: '本周计划',
  176. degreeOfUrgency: '重要',
  177. startTime: '2022/01/30',
  178. memo: '呵呵呵呵'
  179. }
  180. ]
  181. }
  182. },
  183. computed: {
  184. // 选中项
  185. rowSelection () {
  186. return {
  187. onChange: (selectedRowKeys, selectedRows) => {
  188. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  189. },
  190. getCheckboxProps: record => ({
  191. props: {
  192. disabled: record.title === 'Disabled User',
  193. // Column configuration not to be checked
  194. title: record.title
  195. }
  196. })
  197. }
  198. }
  199. },
  200. methods: {
  201. // 查询按钮
  202. searchQuery () {
  203. // this.loading = true
  204. console.log('点击了查询按钮')
  205. // 根据
  206. },
  207. // 重置 输入的查询条件
  208. searchReset () {},
  209. // 新增日程计划 弹框
  210. addPlan () {},
  211. // 清空勾选
  212. onClearSelected () {},
  213. // 导出我的日程计划
  214. myPlanExportXls () {},
  215. // 导入
  216. myPlanImportExcel () {},
  217. // 批量删除
  218. batchDel () {},
  219. // 分页、排序、筛选变化时触发
  220. handleTableChange (pagination, filters, sorter) {},
  221. // 操作 编辑
  222. editPlan () {},
  223. // 操作 删除
  224. delPlan () {}
  225. }
  226. }
  227. </script>
  228. <style lang="less" scoped>
  229. @import '~@assets/less/common.less';
  230. </style>