Commit 7a84572e5a31f7edf12e5fed4425af7bfc5ebab7

Authored by fengtao
1 parent c6e448ba

feat:设备列表新增字段

... ... @@ -4,6 +4,12 @@ import { deviceProfile, getGATEWAYdevice } from '/@/api/device/deviceManager';
4 4 import { getOrganizationList } from '/@/api/system/system';
5 5 import { copyTransFun } from '/@/utils/fnUtils';
6 6
  7 +export enum TypeEnum {
  8 + IS_GATEWAY = 'GATEWAY',
  9 +}
  10 +export const isGateWay = (type: string) => {
  11 + return type === TypeEnum.IS_GATEWAY;
  12 +};
7 13 // 第一步的表单
8 14 export const step1Schemas: FormSchema[] = [
9 15 {
... ... @@ -45,6 +51,27 @@ export const step1Schemas: FormSchema[] = [
45 51 },
46 52 },
47 53 {
  54 + field: 'field7',
  55 + component: 'RadioGroup',
  56 + label: '选择厂家',
  57 + colProps: {
  58 + span: 8,
  59 + },
  60 + componentProps: {
  61 + options: [
  62 + {
  63 + label: '自定义厂家',
  64 + value: '1',
  65 + },
  66 + {
  67 + label: 'TBox边缘网关',
  68 + value: '2',
  69 + },
  70 + ],
  71 + },
  72 + ifShow: ({ values }) => isGateWay(values.deviceType),
  73 + },
  74 + {
48 75 field: 'profileId',
49 76 label: '设备配置',
50 77 required: true,
... ...
... ... @@ -120,7 +120,7 @@
120 120
121 121 const [register, { validate, resetFields, setFieldsValue, getFieldsValue, updateSchema }] =
122 122 useForm({
123   - labelWidth: 100,
  123 + labelWidth: 120,
124 124 schemas: step1Schemas,
125 125 actionColOptions: {
126 126 span: 14,
... ... @@ -387,4 +387,7 @@
387 387 width: 450px;
388 388 margin: 0 auto;
389 389 }
  390 + :deep(.ant-radio-group) {
  391 + width: 15vw;
  392 + }
390 393 </style>
... ...
... ... @@ -52,7 +52,13 @@
52 52 <div class="mt-4">
53 53 <a-button type="primary" class="mr-4" @click="copyTbDeviceId">复制设备ID</a-button>
54 54 <a-button type="primary" class="mr-4" @click="copyDeviceToken">复制访问令牌</a-button>
55   - <a-button type="primary" @click="manageDeviceToken">管理设备凭证</a-button>
  55 + <a-button type="primary" class="mr-4" @click="manageDeviceToken">管理设备凭证</a-button>
  56 + <a-button
  57 + type="primary"
  58 + v-if="deviceDetail.deviceType == 'GATEWAY'"
  59 + @click="remoteConnectiondGateway"
  60 + >远程连接边缘网关</a-button
  61 + >
56 62 <ManageDeviceTokenModal @register="registerModal" />
57 63 </div>
58 64 <div v-if="deviceDetail?.deviceInfo?.address" class="mt-4">
... ... @@ -160,6 +166,7 @@
160 166 };
161 167
162 168 const [registerTopicModal, { openModal: openTopicModal }] = useModal();
  169 + const remoteConnectiondGateway = () => {};
163 170
164 171 return {
165 172 wrapRef,
... ... @@ -173,6 +180,7 @@
173 180 registerTopicModal,
174 181 DeviceTypeEnum,
175 182 copyTopic,
  183 + remoteConnectiondGateway,
176 184 };
177 185 },
178 186 });
... ...