Преглед изворни кода

fix(bugs): 修改一些问题

tangning пре 3 година
родитељ
комит
d3266835d3

+ 5 - 0
src/components/Cropper/src/CopperModal.vue

@@ -198,6 +198,11 @@
 
       async function handleOk() {
         const uploadApi = props.uploadApi;
+
+        if (!previewSource.value) {
+          createMessage.error(t('component.upload.empty'));
+          return;
+        }
         if (uploadApi && isFunction(uploadApi)) {
           const blob = dataURLtoBlob(previewSource.value);
           try {

+ 1 - 0
src/locales/lang/ja/component.ts

@@ -121,6 +121,7 @@ export default {
     uploading: 'アップロード',
     uploadWait: 'ファイルのアップロードが完了するまでお待ちください',
     reUploadFailed: '失敗したファイルを再アップロードする',
+    empty: 'アップロードファイルが空です。もう一度アップロードしてください',
   },
   verify: {
     error: '検証に失敗しました!',

+ 1 - 0
src/locales/lang/ja/routes/devices.ts

@@ -50,6 +50,7 @@ export default {
   deviceCode: 'デバイスIDが重複しています。再入力してください',
   searchName: 'キーワード',
   searchNamePlaceholder: 'デバイスID、メールボックス、SNコード',
+  maxlength: '入力の長さ',
   // normalSales: '正常销售',
   // normalSales: '正常销售',
 };

+ 1 - 0
src/locales/lang/zh-CN/component.ts

@@ -121,6 +121,7 @@ export default {
     uploading: '上传中',
     uploadWait: '请等待文件上传结束后操作',
     reUploadFailed: '重新上传失败文件',
+    empty: '上传文件为空,请重新上传',
   },
   verify: {
     error: '验证失败!',

+ 1 - 0
src/locales/lang/zh-CN/routes/devices.ts

@@ -51,6 +51,7 @@ export default {
   deviceCode: '设备ID重复,请重新输入',
   searchName: '关键词',
   searchNamePlaceholder: '设备ID,邮箱,SN码',
+  maxlength: '输入超长',
   // normalSales: '正常销售',
   // normalSales: '正常销售',
 };

+ 4 - 2
src/views/corporation/AddModal.vue

@@ -26,8 +26,9 @@
       field: 'companyName',
       component: 'Input',
       label: t('common.fullName'),
+      labelWidth: 100,
       colProps: {
-        span: 24,
+        span: 20,
       },
       componentProps: {
         maxLength: 25,
@@ -36,6 +37,7 @@
     {
       field: 'managerPhone',
       component: 'Input',
+      labelWidth: 100,
       label: t('sys.login.email'),
       rules: [
         {
@@ -60,7 +62,7 @@
         },
       ],
       colProps: {
-        span: 24,
+        span: 20,
       },
     },
   ];

+ 10 - 7
src/views/corporation/SubaccountModal.vue

@@ -15,14 +15,10 @@
         <template #name="{ model, field }">
           {{ model[field] }}
         </template>
+        <!-- :disabled="model.subNum == 0" -->
         <template #addeduser="{ model, field }">
           {{ model[field] || 0 }}
-          <a-button
-            :disabled="model.subNum == 0"
-            @click="openTargetModal()"
-            type="primary"
-            preIcon="ic:outline-person-add"
-          >
+          <a-button @click="openTargetModal()" type="primary" preIcon="ic:outline-person-add">
             {{ t('routes.devices.add') }}{{ t('routes.devices.title') }}
           </a-button>
         </template>
@@ -93,7 +89,13 @@
           title: t('common.fullName'),
           dataIndex: 'nickName',
           edit: true,
-          editRule: true,
+          editRule: async (text) => {
+            console.log('editRule', text);
+            if (text && text.length > 25) {
+              return t('routes.devices.maxlength');
+            }
+            return '';
+          },
           width: 200,
         },
         {
@@ -127,6 +129,7 @@
           field: 'totalSubNum',
           component: 'InputNumber',
           label: `${t('routes.devices.subNum')} :`,
+          show: false,
           labelWidth: 200,
           componentProps: () => {
             return {

+ 1 - 1
src/views/devices/EditModal.vue

@@ -66,12 +66,12 @@
           field: 'cameraType',
           component: 'Select',
           label: t('routes.devices.cameraType'),
-
           required: true,
           colProps: {
             span: 24,
           },
           componentProps: {
+            disabled: true,
             options: [4, 1, 9, 10, 6].map((ele) => {
               return { value: ele, key: ele, label: rendercameraTypeLabel(ele) };
             }),

+ 1 - 0
src/views/scenes/downloadModal.vue

@@ -128,6 +128,7 @@
             finishDowloadUrl.value = res.url;
             downloadInfo.isDownloaded = true;
             downloadInfo.status = '获取成功';
+            handleSubmit();
           }
         }, 2000);
       }

+ 2 - 3
src/views/scenes/list.vue

@@ -242,10 +242,9 @@
       async function openSceneEditor(record: Recordable) {
         try {
           const token = userStore.getToken;
+          const langtext = isJA.value ? isJA.value : 'zh';
           console.log('token', token);
-          const url =
-            record.webSite.replace('smobile', 'epc') +
-            `&lang=${localeStore.getLocale}&token=${token}`;
+          const url = record.webSite.replace('smobile', 'epc') + `&lang=${langtext}&token=${token}`;
           console.log('record', record);
           // ('epc.html?m=t-JNg3ds4cxZ&lang=zh');