Sfoglia il codice sorgente

feat(组件): 修复bug

tangning 2 anni fa
parent
commit
ad07ee0d5a

+ 1 - 0
src/api/order/index.ts

@@ -131,6 +131,7 @@ export const InvoiceList = (params: PageParams) =>
 export const InvoiceExport = (params: PageParams) =>
   defHttp.downloadFile<FileStream>({
     url: Api.exportInvoice,
+    method:'POST',
     params,
     headers: {
       // @ts-ignore

+ 6 - 1
src/api/staff/list.ts

@@ -1,6 +1,7 @@
 import { defHttp } from '/@/utils/http/axios';
 import { PageParams, ListGetResultModel, DelParams, roleParams } from './model';
 import { Result } from '/#/axios';
+import { encodeStr } from '/@/utils/encodeUtil';
 
 enum Api {
   pageList = '/service/manage/sysUser/list',
@@ -119,7 +120,11 @@ export const checkUserApi = (params) =>
 export const saveApi = (params) =>
   defHttp.post<Result>({
     url: Api.staffSave,
-    params,
+    params:{
+        ...params,
+        userName:params.username,
+        password: encodeStr(window.btoa(params.password))
+    },
     headers: {
       // @ts-ignore
       ignoreCancelToken: true,

+ 41 - 11
src/utils/http/axios/Axios.ts

@@ -129,7 +129,7 @@ export class VAxios {
     } else {
       formData.append(customFilename, params.file);
     }
-
+    
     if (params.data) {
       Object.keys(params.data).forEach((key) => {
         const value = params.data![key];
@@ -144,15 +144,45 @@ export class VAxios {
       });
     }
 
-    return this.axiosInstance.request<T>({
-      ...config,
-      method: 'POST',
-      data: formData,
-      headers: {
-        'Content-type': ContentTypeEnum.FORM_DATA,
-        // @ts-ignore
-        ignoreCancelToken: true,
-      },
+    return new Promise((resolve, reject) => {
+      const transform = this.getTransform();
+  
+      const { requestOptions } = this.options;
+  
+      const opt: RequestOptions = Object.assign({}, requestOptions,);
+  
+      const { requestCatchHook, transformRequestHook } = transform || {};
+      this.axiosInstance.request<any, AxiosResponse<Result>>({
+        ...config,
+        method: 'POST',
+        data: formData,
+        headers: {
+          'Content-type': ContentTypeEnum.FORM_DATA,
+          // @ts-ignore
+          ignoreCancelToken: true,
+        },
+      }).then((res: AxiosResponse<Result>) => {
+          if (transformRequestHook && isFunction(transformRequestHook)) {
+            try {
+              const ret = transformRequestHook(res, opt);
+              resolve(ret);
+            } catch (err) {
+              reject(err || new Error('request error!'));
+            }
+            return;
+          }
+          resolve(res as unknown as Promise<T>);
+        })
+        .catch((e: Error | AxiosError) => {
+          if (requestCatchHook && isFunction(requestCatchHook)) {
+            reject(requestCatchHook(e, opt));
+            return;
+          }
+          if (axios.isAxiosError(e)) {
+            // rewrite error message from axios in here
+          }
+          reject(e);
+        });
     });
   }
 
@@ -161,7 +191,7 @@ export class VAxios {
    * @description:  File Upload
    */
    downloadFile<T = any>(config: AxiosRequestConfig) {
-    return this.axiosInstance.request<T>({
+    return this.request({
       ...config,
       headers: {
         'Content-type': ContentTypeEnum.JSON,

+ 1 - 0
src/utils/http/axios/index.ts

@@ -43,6 +43,7 @@ const transform: AxiosTransform = {
     // 错误的时候返回
 
     const { data } = res;
+    console.log('message',res)
     if (!data) {
       // return '[HTTP] Request has no return value';
       throw new Error(t('sys.api.apiRequestFailed'));

+ 3 - 3
src/views/dashboard/analysis/index.vue

@@ -113,7 +113,7 @@ async function getData() {
         title: '上月权益订单数',
         icon: 'fxemoji:notchedrightsemi3dot',
         value: preMonThPowCount,
-        unit: '',
+        unit: '',
         color: 'blue',
         action: '月',
       },
@@ -121,7 +121,7 @@ async function getData() {
         title: '上月下载订单数',
         icon: 'download-count|svg',
         value: preMonThDownCount,
-        unit: '',
+        unit: '',
         color: 'orange',
         action: '月',
       },
@@ -129,7 +129,7 @@ async function getData() {
         title: '上月配件订单数',
         icon: 'transaction|svg',
         value: preMonThPartCount,
-        unit: '',
+        unit: '',
         color: 'blue',
         action: '月',
       },

+ 17 - 5
src/views/operate/data.tsx

@@ -91,17 +91,29 @@ export const agentSchema: BasicColumn[] = [
     dataIndex: 'noteContent',
   },
 ];
-
+let industryListObj = {
+  1:'测绘或激光扫描',
+  2:'建筑、工程和施工',
+  3:'石油和天然气',
+  4:'软件和IT服务',
+  5:'学术界',
+  6:'其他',
+}
 export const DMegaSchema: BasicColumn[] = [
   {
     title: '公司名称',
     width: 150,
-    dataIndex: 'name',
+    dataIndex: 'company',
   },
   {
     title: '行业',
     width: 150,
-    dataIndex: 'content',
+    dataIndex: 'job',
+    customRender: ({ record }) => {
+      return (
+        record.job &&industryListObj[record.job]
+      );
+    },
   },
   {
     title: '国家与地区',
@@ -111,7 +123,7 @@ export const DMegaSchema: BasicColumn[] = [
   {
     title: '申请人姓名',
     width: 150,
-    dataIndex: 'content',
+    dataIndex: 'phone',
   },
   {
     title: '申请人电话',
@@ -121,7 +133,7 @@ export const DMegaSchema: BasicColumn[] = [
   {
     title: '申请人邮箱',
     width: 150,
-    dataIndex: 'content',
+    dataIndex: 'email',
   },
   {
     title: '提交时间',

+ 15 - 2
src/views/product/firmware/AddModal.vue

@@ -2,13 +2,13 @@
   <BasicModal
     v-bind="$attrs"
     @register="register"
-    title="新增相机"
+    title="新增版本"
     @visible-change="handleVisibleChange"
     @cancel="resetFields"
     @ok="handleSubmit"
   >
     <div class="pt-2px pr-3px">
-      <BasicForm @register="registerForm" :model="model" >
+      <BasicForm @register="registerForm">
         <template #text="{ model, field }">
           {{ model[field]  }}
         </template>
@@ -56,6 +56,10 @@
           colProps: {
             span: 24,
           },
+          componentProps:{
+            maxLength: 15,
+            placeholder:t('common.inputText')+t('routes.product.version'),
+          },
           rules: [
             {
               required: true,
@@ -85,6 +89,10 @@
           component: 'Input',
           label: t('routes.product.minVersion'),
           required: true,
+          componentProps:{
+            maxLength: 15,
+            placeholder:t('common.inputText')+t('routes.product.version'),
+          },
           rules: [
             {
               required: true,
@@ -115,6 +123,10 @@
           colProps: {
             span: 24,
           },
+          componentProps:{
+            placeholder:t('common.inputText')+t('routes.product.description'),
+            maxLength: 200,
+          },
         },
         {
           field: 'file',
@@ -218,6 +230,7 @@
       }
       function onDataReceive(data) {
         modelRef.value = data
+        console.log('renderOwnTypeLabel',data)
         resetFields();
         setFieldsValue({
           type:renderOwnTypeLabel(Number(data)),

+ 1 - 1
src/views/product/sdk/index.vue

@@ -31,7 +31,7 @@
               },
               {
                 label: '下架',
-                ifShow: getTypeCheckPerm('sdk-update') && record.status == 1,
+                ifShow: getTypeCheckPerm('sdk-lower') && record.status == 1,
                 icon: 'akar-icons:statistic-down',
                 onClick: handleOff.bind(null, record),
               },

+ 2 - 2
src/views/productOperation/cameraScene.vue

@@ -170,9 +170,9 @@
           width: 180,
           customRender: ({ record }) => {
             return (
-              record.createTime &&
+              record.algorithmTime &&
               h(Time, {
-                value: record.createTime,
+                value: record.algorithmTime,
                 mode: 'datetime',
               })
             );

+ 3 - 3
src/views/statistics/order/index.vue

@@ -58,7 +58,7 @@
         title: '上月权益订单数',
         icon: 'fxemoji:notchedrightsemi3dot',
         value: preMonThPowCount,
-        unit: '',
+        unit: '',
         color: 'blue',
         action: '月',
       },
@@ -66,7 +66,7 @@
         title: '上月下载订单数',
         icon: 'download-count|svg',
         value: preMonThDownCount,
-        unit: '',
+        unit: '',
         color: 'orange',
         action: '月',
       },
@@ -74,7 +74,7 @@
         title: '上月配件订单数',
         icon: 'transaction|svg',
         value: preMonThPartCount,
-        unit: '',
+        unit: '',
         color: 'blue',
         action: '月',
       },

+ 3 - 3
src/views/statistics/scene/index.vue

@@ -66,7 +66,7 @@ async function getData() {
         title: '上月权益订单数',
         icon: 'fxemoji:notchedrightsemi3dot',
         value: preMonThPowCount,
-        unit: '',
+        unit: '',
         color: 'blue',
         action: '月',
       },
@@ -74,7 +74,7 @@ async function getData() {
         title: '上月下载订单数',
         icon: 'download-count|svg',
         value: preMonThDownCount,
-        unit: '',
+        unit: '',
         color: 'orange',
         action: '月',
       },
@@ -82,7 +82,7 @@ async function getData() {
         title: '上月配件订单数',
         icon: 'transaction|svg',
         value: preMonThPartCount,
-        unit: '',
+        unit: '',
         color: 'blue',
         action: '月',
       },

+ 3 - 3
src/views/system/menu/menu.data.ts

@@ -85,8 +85,8 @@ export const columns: BasicColumn[] = [
     dataIndex: 'isShow',
     width: 80,
     customRender: ({ record }) => {
-      const status = record.status;
-      const enable = ~~status === 0;
+      const isShow = record.isShow;
+      const enable = ~~isShow == 1;
       const color = enable ? 'green' : 'red';
       const text = enable ? t('routes.system.enable') : t('routes.system.stopUsing');
       return h(Tag, { color: color }, () => text);
@@ -161,7 +161,7 @@ export const formSchema: FormSchema[] = [
     label: t('routes.system.menuName'),
     component: 'Input',
     componentProps: {
-      maxLength: 50,
+      maxLength: 15,
     },
     rules: [
       {

+ 6 - 0
src/views/system/role/role.data.ts

@@ -82,6 +82,9 @@ export const formSchema: FormSchema[] = [
     label: t('common.roleNameText'),
     required: true,
     component: 'Input',
+    componentProps:{
+      maxLength: 15,
+    }
   },
   // {
   //   field: 'companyId',
@@ -135,6 +138,9 @@ export const formSchema: FormSchema[] = [
     label: t('routes.system.description'),
     field: 'description',
     component: 'InputTextArea',
+    componentProps:{
+      maxLength: 200,
+    }
   },
   // {
   //   label: ' ',