Jelajahi Sumber

添加设备类型

tangning 2 tahun lalu
induk
melakukan
59411f8685

+ 21 - 4
src/views/product/updataTips/AddModal.vue

@@ -43,6 +43,18 @@
       const { createMessage } = useMessage();
       const schemas: FormSchema[] = [
         {
+          field: 'typeText',
+          component: 'Input',
+          label: '设备类型',
+          required: true,
+          slot:'text',
+          componentProps: {
+            maxLength: 15,
+          },
+          colProps: {
+            span: 20,
+          },
+        },{
           field: 'version',
           component: 'Input',
           label: '版本号',
@@ -259,12 +271,16 @@
       });
       function renderOwnTypeLabel(type: number): string {
         switch (type) {
-          case 2:
-            return t('routes.product.sdkType.2');
+          case 0:
+            return '四维看看';
           case 1:
-            return t('routes.product.sdkType.1');
+            return '四维深时'
+          case 2:
+            return '四维全景';
           case 3:
-            return t('routes.product.type.3');
+            return '四维带看';
+          case 4:
+            return '四维深光';
           default:
             return '';
         }
@@ -290,6 +306,7 @@
         fileFlow.type = data
         resetFields();
         setFieldsValue({
+          type:data,
           typeText:renderOwnTypeLabel(Number(data)),
         });
       }

+ 21 - 4
src/views/product/updataTips/EditModal.vue

@@ -48,6 +48,18 @@
           component: 'Input',
           label: 'id',
           show: false,
+        },{
+          field: 'typeText',
+          component: 'Input',
+          label: '设备类型',
+          required: true,
+          slot:'text',
+          componentProps: {
+            maxLength: 15,
+          },
+          colProps: {
+            span: 20,
+          },
         },
         {
           field: 'version',
@@ -266,12 +278,16 @@
       });
       function renderOwnTypeLabel(type: number): string {
         switch (type) {
-          case 2:
-            return t('routes.product.sdkType.2');
+          case 0:
+            return '四维看看';
           case 1:
-            return t('routes.product.sdkType.1');
+            return '四维深时'
+          case 2:
+            return '四维全景';
           case 3:
-            return t('routes.product.type.3');
+            return '四维带看';
+          case 4:
+            return '四维深光';
           default:
             return '';
         }
@@ -298,6 +314,7 @@
         resetFields();
         setFieldsValue({
           ...data,
+          typeText:renderOwnTypeLabel(Number(data.type)),
           imageUrl:data.imageUrl?[data.imageUrl]:[],
           imageUrlEn:data.imageUrlEn?[data.imageUrlEn]:[],
         });