瀏覽代碼

feat(api): update api 25

gemercheung 3 年之前
父節點
當前提交
c8559fc2cf
共有 1 個文件被更改,包括 43 次插入26 次删除
  1. 43 26
      src/views/devices/AddModal.vue

+ 43 - 26
src/views/devices/AddModal.vue

@@ -64,27 +64,28 @@
             options: [4, 1, 9, 10, 6].map((ele) => {
               return { value: ele, key: ele, label: rendercameraTypeLabel(ele) };
             }),
-            onChange: function (val) {
-              console.log('appendSchemaByField', val);
-              if (val !== 6) {
-                appendSchemaByField(
-                  {
-                    field: 'snCode',
-                    component: 'Input',
-                    label: t('routes.devices.snCode'),
-                    required: true,
-                    colProps: {
-                      span: 24,
-                    },
-                  },
-                  'address',
-                );
-              } else {
-                removeSchemaByFiled('snCode');
-              }
-            },
+            // onChange: function (val) {
+            //   console.log('appendSchemaByField', val);
+            //   if (val !== 6) {
+            //     appendSchemaByField(
+            //       {
+            //         field: 'snCode',
+            //         component: 'Input',
+            //         label: t('routes.devices.snCode'),
+            //         required: true,
+            //         colProps: {
+            //           span: 24,
+            //         },
+            //       },
+            //       'address',
+            //     );
+            //   } else {
+            //     removeSchemaByFiled('snCode');
+            //   }
+            // },
           },
         },
+
         {
           field: 'childName',
           component: 'Input',
@@ -98,6 +99,7 @@
           field: 'wifiName',
           component: 'Input',
           label: t('routes.devices.wifiName'),
+          required: true,
           colProps: {
             span: 24,
           },
@@ -105,28 +107,43 @@
         {
           field: 'address',
           component: 'Input',
+          required: true,
           label: t('routes.devices.address'),
           colProps: {
             span: 24,
           },
         },
         {
-          field: 'balance',
+          field: 'snCode',
           component: 'Input',
-          label: t('routes.devices.balance'),
+          label: t('routes.devices.snCode'),
+          required: true,
+          ifShow: ({ model }) => {
+            console.log('record', model.cameraType);
+
+            return model.cameraType && model.cameraType !== 6;
+          },
           colProps: {
             span: 24,
           },
         },
         {
-          field: 'orderSn',
+          field: 'balance',
           component: 'Input',
-          label: t('routes.devices.orderSn'),
+          label: t('routes.devices.balance'),
           colProps: {
             span: 24,
           },
-          required: true,
         },
+        // {
+        //   field: 'orderSn',
+        //   component: 'Input',
+        //   label: t('routes.devices.orderSn'),
+        //   colProps: {
+        //     span: 24,
+        //   },
+        //   required: true,
+        // },
         {
           field: 'companyId',
           component: 'ApiSelect',
@@ -152,8 +169,8 @@
         {
           getFieldsValue,
           validateFields,
-          appendSchemaByField,
-          removeSchemaByFiled,
+          // appendSchemaByField,
+          // removeSchemaByFiled,
           // setFieldsValue,
           // setProps
         },