Browse Source

修改bug

tangning 2 năm trước cách đây
mục cha
commit
93b8ce24df

+ 2 - 2
src/locales/lang/en/code.ts

@@ -14,6 +14,6 @@ export default {
     '4014': '必须迁移至相同的类型的相机下面!',
     '4015': '权益类型不存在!',
     '4016': '"权益不存在!',
-    '4017': '权益数量不足!',
-  },
+    '4017': '权益数量不足!'
+  }
 };

+ 2 - 2
src/locales/lang/zh-CN/code.ts

@@ -14,6 +14,6 @@ export default {
     '4014': '必须迁移至相同的类型的相机下面!',
     '4015': '权益类型不存在!',
     '4016': '"权益不存在!',
-    '4017': '权益数量不足!',
-  },
+    '4017': '权益数量不足!'
+  }
 };

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

@@ -9,6 +9,7 @@ export default {
   invoiceTime:'开票申请时间',
   money:'开票金额',
   id:'权益ID',
+  dowmCount:'下载次数',
   timeList:'授权时间',
   expiryTime: '到期日期', 
   newTime:'最新授权时间',

+ 1 - 0
src/locales/lang/zh_CN.ts

@@ -3,6 +3,7 @@ import antdLocale from 'ant-design-vue/es/locale/zh_CN';
 import momentLocale from 'moment/dist/locale/zh-cn';
 
 const modules = import.meta.globEager('./zh-CN/**/*.ts');
+console.log('modules',modules)
 export default {
   message: {
     ...genMessage(modules, 'zh-CN'),

+ 0 - 1
src/store/modules/user.ts

@@ -123,7 +123,6 @@ export const useUserStore = defineStore({
       if (!this.getToken) return null;
       // get user info
       const userInfo = await this.getUserInfoAction();
-      console.log('getUserInfoAction',userInfo)
       const sessionTimeout = this.sessionTimeout;
       if (sessionTimeout) {
         this.setSessionTimeout(false);

+ 3 - 4
src/utils/http/axios/index.ts

@@ -20,7 +20,7 @@ import { useUserStoreWithOut } from '/@/store/modules/user';
 const globSetting = useGlobSetting();
 const urlPrefix = globSetting.urlPrefix;
 const { createMessage, createErrorModal } = useMessage();
-const { t } = useI18n();
+
 /**
  * @description: 数据处理,方便区分多种处理方式
  */
@@ -29,6 +29,7 @@ const transform: AxiosTransform = {
    * @description: 处理请求数据。如果数据不是预期格式,可直接抛出错误
    */
   transformRequestHook: (res: AxiosResponse<Result>, options: RequestOptions) => {
+    const { t } = useI18n();
     const { isTransformResponse, isReturnNativeResponse } = options;
     // 是否返回原生响应头 比如:需要获取响应头时使用该属性
     if (isReturnNativeResponse) {
@@ -66,14 +67,12 @@ const transform: AxiosTransform = {
         userStore.logout(true);
         break;
       default:
-        console.log('codeStr',t(`code.apiCode.4009`))
         if(code){
-          timeoutMsg = t('code.apiCode.'+code);
+          timeoutMsg = t(`code.apiCode.${code}`);
         }else if (message) {
           timeoutMsg = message;
         }
     }
-
     // errorMessageMode=‘modal’的时候会显示modal错误弹窗,而不是消息提示,用于一些比较重要的错误
     // errorMessageMode='none' 一般是调用时明确表示不希望自动弹出错误提示
     if (options.errorMessageMode === 'modal') {

+ 2 - 2
src/views/device/index.vue

@@ -78,11 +78,11 @@
           width: 180,
         },
         {
-          title: t('routes.device.activatedTime'),
+          title: t('routes.device.userName'),
           dataIndex: 'userName',
           width: 180,
           customRender({ record }) {
-            return record.userName?record.userName:t('routes.device.activatedTime')
+            return record.userName?record.userName:'-'
           },
         },
       ];

+ 9 - 2
src/views/equity/DownModal.vue

@@ -93,7 +93,7 @@
             suffix:`剩余可售 ${agent.value.downSubNum} 个`,
             componentProps:{
               max:agent.value.downSubNum,
-              min:0,
+              min:1,
             },
             colProps: {
               span: 19,
@@ -101,7 +101,7 @@
           },
       ];
 
-      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
+      const [registerForm, { validate, resetFields, updateSchema }] = useForm({
         labelWidth: 120,
         schemas:schemas,
         showActionButtonGroup: false,
@@ -113,6 +113,13 @@
       let addListFunc = () => {};
       const [register, { closeModal }] = useModalInner((data) => {
         resetFields();
+        updateSchema([
+          {field: 'count',suffix:`剩余可售 ${agent.value.downSubNum} 个`,
+            componentProps:{
+              max:agent.value.downSubNum,
+              min:1,
+            },}
+        ])
         // data && onDataReceive(data);
       });
       async function onDataReceive() {

+ 5 - 1
src/views/equity/InvoiceModal.vue

@@ -127,7 +127,7 @@
             },
             componentProps: {
               max:agent.value.majorSubNum,
-              min:0,
+              min:1,
             },
             colProps: {
               span: 19,
@@ -173,6 +173,10 @@
           {field: 'shipNum',ifShow:fileFlow.type == 3,},
           {field: 'email',ifShow:fileFlow.type == 2,},
           {field: 'file',ifShow:fileFlow.type == 2,},
+          {field: 'count',suffix:`剩余可售 ${agent.value.majorSubNum} 个`,componentProps:{
+              max:agent.value.majorSubNum,
+              min:1,
+            }},
         ])
       }
       const handleSubmit = async () => {

+ 18 - 17
src/views/equity/data.tsx

@@ -4,18 +4,19 @@ import { h } from 'vue';
 import { FormSchema } from '/@/components/Form/index';
 import { useI18n } from '/@/hooks/web/useI18n';
 const { t } = useI18n();
-export const columnsDown: BasicColumn[] = [
+import { dincrementList } from '/@/api/equity'
+  export const columnsDown: BasicColumn[] = [
   {
-    title: '用户账号',
+    title: t('routes.equity.count'),
     dataIndex: 'userName',
   },
   {
-    title: '下载次数',
+    title: t('routes.equity.dowmCount'),
     dataIndex: 'count',
     // slots: { customRender: 'orderStatus' },
   },
   {
-    title: '下载次数',
+    title: t('routes.equity.timeList'),
     dataIndex: 'createTime',
     // slots: { customRender: 'orderStatus' },
   },
@@ -111,25 +112,25 @@ export const searchForm: Partial<FormProps> = {
     },
     {
       field: 'incrementTypeId',
-      component: 'Select',
+      component: 'ApiSelect',
       label: t('routes.equity.Type'),
       colProps: {
         xl: 6,
         xxl: 6,
       },
       componentProps: {
-        options: [
-          {
-            label: t('routes.equity.equityType.0'),
-            value: 0,
-            key: '0',
-          },{
-            label: t('routes.equity.equityType.1'),
-            value: 1,
-            key: '1',
-          }
-        ],
-      },
+        maxLength: 50,
+        api: async function () {
+          const list = await dincrementList();
+          return list.map(ele => {
+            return {name:t(`routes.finance.equityType.${ele.id}`),value:ele.id}
+          });
+        },
+        numberToString: true,
+        labelField: 'name',
+        valueField: 'value',
+        immediate: true,
+        },
     },
   ],
 };

+ 2 - 2
src/views/equity/index.vue

@@ -80,7 +80,7 @@
       const { t } = useI18n();
       const userStore = useUserStore();
       const permissionStore = usePermissionStore();
-      const { afterLoginAction } = userStore
+      const { getUserInfoAction } = userStore
       const agent = computed(() => userStore.getAgent);
       const { getCheckPerm } = permissionStore;
       const incrementTypeId = ref<number>(0); //0看看 、1看见、2深时
@@ -166,7 +166,7 @@
     }
     function reload(value){
       if(value){
-        afterLoginAction()
+        getUserInfoAction()
       }
       if(incrementTypeId.value == 0){
         reloadEqiuty()

+ 18 - 15
src/views/finance/data.tsx

@@ -4,6 +4,7 @@ import { h } from 'vue';
 import { FormSchema } from '/@/components/Form/index';
 import { useI18n } from '/@/hooks/web/useI18n';
 const { t } = useI18n();
+import { dincrementList } from '/@/api/equity'
 
 export const columns: BasicColumn[] = [
         
@@ -67,24 +68,26 @@ export const searchForm: Partial<FormProps> = {
     {
       field: 'giveType',
       label: t('routes.equity.Type'),
-      component: 'Select',
+      component: 'ApiSelect',
       componentProps: {
-        options: [
-          {
-            label: t('routes.finance.equityType.0'),
-            value: 0,
-            key: '0',
-          },{
-            label: t('routes.finance.equityType.1'),
-            value: 1,
-            key: '1',
-          },{
-            label: t('routes.finance.equityType.2'),
+        maxLength: 50,
+        api: async function () {
+          const list = await dincrementList();
+          list.map(ele => {
+            return {name:t(`routes.finance.equityType.${ele.id}`),value:ele.id}
+          });
+          list.push({
+            name: t('routes.finance.equityType.2'),
             value: 3,
             key: '3',
-          },
-        ],
-      },
+          })
+          return list
+        },
+        numberToString: true,
+        labelField: 'name',
+        valueField: 'value',
+        immediate: true,
+        },
       colProps: {
         xl: 5,
         xxl: 5,