User.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <std-curd :columns="columns" :api="api" :disable_search="true"/>
  3. </template>
  4. <script lang="ts">
  5. import StdCurd from '@/components/StdDataDisplay/StdCurd.vue'
  6. import gettext from '@/gettext'
  7. const {$gettext} = gettext
  8. const columns = [{
  9. title: $gettext('Username'),
  10. dataIndex: 'name',
  11. sorter: true,
  12. pithy: true,
  13. edit: {
  14. type: 'input'
  15. }
  16. }, {
  17. title: $gettext('Password'),
  18. dataIndex: 'password',
  19. sorter: true,
  20. pithy: true,
  21. edit: {
  22. type: 'input',
  23. placeholder: $gettext('Leave blank for no change')
  24. },
  25. display: false
  26. }, {
  27. title: $gettext('Created at'),
  28. dataIndex: 'created_at',
  29. datetime: true,
  30. sorter: true,
  31. pithy: true
  32. }, {
  33. title: $gettext('Updated at'),
  34. dataIndex: 'updated_at',
  35. datetime: true,
  36. sorter: true,
  37. pithy: true
  38. }, {
  39. title: $gettext('Action'),
  40. dataIndex: 'action'
  41. }]
  42. export default {
  43. name: 'User',
  44. components: {StdCurd},
  45. data() {
  46. return {
  47. api: this.$api.user,
  48. columns
  49. }
  50. },
  51. methods: {}
  52. }
  53. </script>
  54. <style scoped>
  55. </style>