TemplateDataDocumentView.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div class="full-height page-container">
  3. <vxe-grid
  4. v-bind="tableProps"
  5. :tree-config="treeConfig"
  6. :columns="columns"
  7. :size="tableSizeConfig"
  8. highlight-hover-row
  9. height="auto"
  10. stripe
  11. border
  12. />
  13. </div>
  14. </template>
  15. <script lang="ts">
  16. import { defineComponent, onMounted } from 'vue';
  17. import { useVxeTable } from '@/hooks/web/useCrud';
  18. import { tableBooleanColumn } from '@/components/SmartTable';
  19. import { ApiServiceEnum, defHttp } from '@/utils/http/axios';
  20. import { useSizeSetting } from '@/hooks/setting/UseSizeSetting';
  21. const { tableSizeConfig } = useSizeSetting();
  22. const doLoadData = () => {
  23. return defHttp.post({
  24. service: ApiServiceEnum.SMART_CODE,
  25. url: 'db/code/main/getTemplateDataDocument',
  26. });
  27. };
  28. export default defineComponent({
  29. name: 'TemplateDataDocumentView',
  30. setup() {
  31. const { tableProps, loadData } = useVxeTable(doLoadData, {
  32. paging: false,
  33. });
  34. onMounted(loadData);
  35. return {
  36. tableProps,
  37. };
  38. },
  39. data() {
  40. return {
  41. treeConfig: {
  42. childrenField: 'fieldList',
  43. },
  44. tableSizeConfig,
  45. columns: [
  46. {
  47. title: '属性',
  48. field: 'name',
  49. width: 240,
  50. fixed: 'left',
  51. treeNode: true,
  52. },
  53. {
  54. title: '说明',
  55. field: 'remark',
  56. minWidth: 240,
  57. },
  58. {
  59. title: '参数|返回值',
  60. field: 'type',
  61. width: 120,
  62. },
  63. {
  64. title: '可选值',
  65. field: 'optional',
  66. width: 180,
  67. },
  68. {
  69. title: '默认值',
  70. field: 'defaultValue',
  71. width: 200,
  72. },
  73. {
  74. ...tableBooleanColumn(this.$t, '是否可null', 'nullable').createColumn(),
  75. width: 120,
  76. },
  77. ],
  78. };
  79. },
  80. });
  81. </script>
  82. <style scoped></style>