index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <script setup>
  2. import InfrastructureCrudPage from '../components/InfrastructureCrudPage.vue'
  3. import {
  4. addFireHydrant,
  5. delFireHydrant,
  6. getFireHydrant,
  7. listFireHydrant,
  8. updateFireHydrant
  9. } from '@/api/pipeNetwork/facilities'
  10. const queryFields = [
  11. { prop: 'hydrantCode', label: '消火栓编号' },
  12. { prop: 'hydrantName', label: '消火栓名称' },
  13. { prop: 'hydrantType', label: '消火栓类型', type: 'dict', dictType: 'water_fire_hydrant_type' },
  14. { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' }
  15. ]
  16. const columns = [
  17. { prop: 'hydrantCode', label: '消火栓编号', width: 140 },
  18. { prop: 'hydrantName', label: '消火栓名称', width: 160 },
  19. { prop: 'hydrantType', label: '消火栓类型', width: 140, dictType: 'water_fire_hydrant_type' },
  20. { prop: 'model', label: '型号', width: 110 },
  21. { prop: 'inletPipeDiameter', label: '进水主管管径', width: 130 },
  22. { prop: 'outletSpec', label: '出水口规格', width: 110 },
  23. { prop: 'location', label: '地址', width: 180 },
  24. { prop: 'ownershipUnit', label: '产权单位', width: 150 },
  25. { prop: 'maintenanceUnit', label: '管护单位', width: 150 },
  26. { prop: 'principal', label: '责任人', width: 100 },
  27. { prop: 'contactPhone', label: '联系电话', width: 120 },
  28. { prop: 'status', label: '状态', width: 90, dictType: 'infrastructure_status' }
  29. ]
  30. const formFields = [
  31. { prop: 'hydrantCode', label: '消火栓编号', required: true },
  32. { prop: 'hydrantName', label: '消火栓名称', required: true },
  33. { prop: 'hydrantType', label: '消火栓类型', type: 'dict', dictType: 'water_fire_hydrant_type', required: true },
  34. { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' },
  35. { prop: 'model', label: '型号' },
  36. { prop: 'inletPipeDiameter', label: '进水主管管径' },
  37. { prop: 'outletSpec', label: '出水口规格' },
  38. { prop: 'ownershipUnit', label: '产权单位' },
  39. { prop: 'maintenanceUnit', label: '管护单位' },
  40. { prop: 'principal', label: '责任人' },
  41. { prop: 'contactPhone', label: '联系电话' },
  42. { prop: 'location', label: '地址', span: 24 },
  43. { prop: 'remark', label: '备注', type: 'textarea', span: 24 }
  44. ]
  45. const api = {
  46. page: listFireHydrant,
  47. detail: getFireHydrant,
  48. save: addFireHydrant,
  49. update: updateFireHydrant,
  50. remove: (ids) => delFireHydrant(ids)
  51. }
  52. </script>
  53. <template>
  54. <InfrastructureCrudPage
  55. title="消火栓信息"
  56. add-text="新增消火栓"
  57. id-field="hydrantId"
  58. :query-fields="queryFields"
  59. :columns="columns"
  60. :form-fields="formFields"
  61. :api="api"
  62. show-import
  63. show-export
  64. import-url="/api/infrastructure/fireHydrant/importData"
  65. template-url="/api/infrastructure/fireHydrant/importTemplate"
  66. export-url="/api/infrastructure/fireHydrant/export"
  67. export-file-name="消火栓信息"
  68. dict-hint="消火栓类型、状态请从模板下拉框中选择中文"
  69. />
  70. </template>