space.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <a-card title="空间管理" >
  3. <a-row justify="space-between" >
  4. <a-col><a-space><InputTsx placeholder="请输入空间名称进行搜索" /> <a-button type="primary">搜索</a-button> </a-space></a-col>
  5. <a-col><a-button type="primary" @click="openModal">创建空间</a-button></a-col>
  6. </a-row>
  7. <StepModal
  8. :step="step"
  9. :steps="steps"
  10. :visible="visible"
  11. >
  12. <a-form :labelCol="{span: 10}" :wrapperCol="{span: 14}" >
  13. <a-form-item label="空间名称" v-bind="validateInfos.edgeName" >
  14. <InputTsx allowClear v-model:value="spaceState.edgeName" />
  15. </a-form-item>
  16. </a-form>
  17. </StepModal>
  18. </a-card>
  19. </template>
  20. <script lang='ts' setup >
  21. import { StepModal } from '@/components/StepModal'
  22. import { InputTsx } from '@/components/MicroComponents/index'
  23. import { ref, reactive } from 'vue'
  24. import { Form, message } from 'ant-design-vue'
  25. const useForm = Form.useForm
  26. const steps = [{ title: '空间基本信息' }, { title: '空间配置' }, { title: '选择计费类型' }, { title: '确认订单' }]
  27. const step = ref(0)
  28. const visible = ref<boolean>(false)
  29. const columns = [
  30. {
  31. title: '空间ID',
  32. dataIndex: 'spaceId',
  33. key: 'spaceId'
  34. },
  35. {
  36. title: '空间名称',
  37. dataIndex: 'spaceName',
  38. key: 'spaceName'
  39. },
  40. {
  41. title: '空间类型',
  42. dataIndex: 'type',
  43. key: 'type'
  44. },
  45. {
  46. title: '接入节点',
  47. dataIndex: 'edgeName',
  48. key: 'edgeName'
  49. },
  50. {
  51. title: '设备数量',
  52. dataIndex: 'deviceCount',
  53. key: 'deviceCount'
  54. },
  55. {
  56. title: '状态',
  57. dataIndex: 'status',
  58. key: 'status'
  59. },
  60. {
  61. title: '描述',
  62. dataIndex: 'description',
  63. key: 'description'
  64. },
  65. {
  66. title: '操作',
  67. dataIndex: 'action',
  68. key: 'action'
  69. }
  70. ]
  71. const spaceState = reactive<CVS.space>({
  72. description: '',
  73. deviceCount: null,
  74. deviceMode: '',
  75. edgeId: null,
  76. edgeName: '',
  77. serialId: '',
  78. spaceId: null,
  79. status: '',
  80. type: ''
  81. })
  82. const { resetFields, validate, validateInfos } = useForm(spaceState, {
  83. edgeName: [{ required: true, message: '请填写空间名称' }]
  84. })
  85. const openModal = () => visible.value = true
  86. const closeModal = () => visible.value = false
  87. </script>
  88. <style lang='less' scoped >
  89. </style>