postConfig.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <a-row :gutter="10">
  3. <a-col :sm="24" style="margin-bottom: 20px">
  4. <a-card :bordered="false">
  5. <!-- 查询区域 -->
  6. <div class="table-page-search-wrapper">
  7. <!-- 搜索区域 -->
  8. <a-form layout="inline" @keyup.enter.native="searchQuery">
  9. <a-row :gutter="24">
  10. <a-col :md="12" :sm="8">
  11. <a-form-item label="岗位名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
  12. <a-input placeholder="" v-model="queryParam.itemText"></a-input>
  13. </a-form-item>
  14. </a-col>
  15. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  16. <a-col :md="12" :sm="24">
  17. <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
  18. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  19. </a-col>
  20. </span>
  21. </a-row>
  22. </a-form>
  23. </div>
  24. <!-- 操作按钮区域 -->
  25. <div class="table-operator" style="margin: 5px 0 10px 2px">
  26. <a-button @click="handleAdd" type="primary" icon="plus">新建数据</a-button>
  27. </div>
  28. <div style="margin-top: 15px">
  29. <a-table
  30. style="height:500px"
  31. ref="table"
  32. size="middle"
  33. bordered
  34. rowKey="id"
  35. :columns="columns"
  36. :dataSource="dataSource"
  37. :pagination="ipagination"
  38. :loading="loading"
  39. @change="handleTableChange">
  40. <span slot="action" slot-scope="text, record">
  41. <a-divider type="vertical"/>
  42. <a-dropdown>
  43. <a class="ant-dropdown-link">
  44. 更多 <a-icon type="down"/>
  45. </a>
  46. <a-menu slot="overlay">
  47. <a-menu-item>
  48. <a @click="handleEdit(record)">编辑</a>
  49. </a-menu-item>
  50. <a-menu-item>
  51. <a-popconfirm title="确定删除吗?" @confirm="() => dataDelete(record)">
  52. <a>删除</a>
  53. </a-popconfirm>
  54. </a-menu-item>
  55. </a-menu>
  56. </a-dropdown>
  57. </span>
  58. </a-table>
  59. </div>
  60. <!-- 右侧的角色权限配置 -->
  61. <user-role-modal ref="modalUserRole"></user-role-modal>
  62. <post-config-model ref="modalForm" @ok="modalFormOk"></post-config-model>
  63. </a-card>
  64. </a-col>
  65. </a-row>
  66. </template>
  67. <script>
  68. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  69. import { deleteAction, postAction, getAction } from '@/api/manage'
  70. import postConfigModel from './modules/postConfigModel'
  71. import moment from 'moment'
  72. import { adminCheck } from '@/api/api'
  73. export default {
  74. name: 'expireDateConfig',
  75. mixins: [JeecgListMixin],
  76. components: {
  77. postConfigModel,
  78. moment
  79. },
  80. data() {
  81. return {
  82. /* 数据源 */
  83. columns: [
  84. {
  85. title: '岗位',
  86. align: 'center',
  87. dataIndex: 'itemText',
  88. },
  89. {
  90. title: '创建时间',
  91. dataIndex: 'createTime',
  92. align:"center",
  93. // sorter: true,
  94. sorter:(a, b) => { return a.createTime>= b.createTime? 1 : -1 },
  95. customRender: (text) => {
  96. return moment(text).format('YYYY-MM-DD')
  97. }
  98. },
  99. {
  100. title: '操作',
  101. dataIndex: 'action',
  102. align: 'center',
  103. scopedSlots: { customRender: 'action' }
  104. }
  105. ],
  106. url: {
  107. list: "/sys/dictItem/listPost"
  108. }
  109. }
  110. },
  111. methods: {
  112. dataDelete(id) {
  113. var that = this;
  114. deleteAction("/sys/dictItem/delete", {id: id.id}).then((res) => {
  115. if (res.success) {
  116. that.$message.success('清空完成!');
  117. that.$emit('ok');
  118. } else {
  119. that.$message.warning('清空失败!');
  120. }
  121. });
  122. },
  123. }
  124. }
  125. </script>
  126. <style scoped>
  127. @import '~@assets/less/common.less';
  128. /** Button按钮间距 */
  129. .ant-btn {
  130. margin-left: 8px
  131. }
  132. </style>