v3.7.2 版本代码合并

This commit is contained in:
JEECG
2024-12-09 15:10:46 +08:00
parent 64b29f47e0
commit b0c4194602
118 changed files with 12729 additions and 1596 deletions

View File

@ -3,6 +3,7 @@ import type { GlobEnvConfig } from '/#/config';
import { warn } from '/@/utils/log';
import pkg from '../../package.json';
import { getConfigFileName } from '../../build/getConfigFileName';
import { getGlobal } from "@/qiankun/micro";
export function getCommonStoragePrefix() {
const { VITE_GLOB_APP_SHORT_NAME } = getAppEnvConfig();
@ -17,10 +18,12 @@ export function getStorageShortName() {
export function getAppEnvConfig() {
const ENV_NAME = getConfigFileName(import.meta.env);
const global = getGlobal();
const ENV = (import.meta.env.DEV
? // Get the global configuration (the configuration will be extracted independently when packaging)
(import.meta.env as unknown as GlobEnvConfig)
: window[ENV_NAME as any]) as unknown as GlobEnvConfig;
: global[ENV_NAME as any]) as unknown as GlobEnvConfig;
const {
VITE_GLOB_APP_TITLE,
@ -33,6 +36,10 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_CAS_BASE_URL,
VITE_GLOB_DOMAIN_URL,
VITE_GLOB_ONLINE_VIEW_URL,
// 【JEECG作为乾坤子应用】
VITE_GLOB_QIANKUN_MICRO_APP_NAME,
VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
} = ENV;
// if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
@ -52,6 +59,10 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_CAS_BASE_URL,
VITE_GLOB_DOMAIN_URL,
VITE_GLOB_ONLINE_VIEW_URL,
// 【JEECG作为乾坤子应用】
VITE_GLOB_QIANKUN_MICRO_APP_NAME,
VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
};
}

View File

@ -140,6 +140,15 @@ const transform: AxiosTransform = {
config.params = undefined;
}
}
// update-begin--author:sunjianlei---date:220241019---for【JEECG作为乾坤子应用】作为乾坤子应用启动时拼接请求路径
if (globSetting.isQiankunMicro) {
if (config.url && config.url.startsWith('/')) {
config.url = globSetting.qiankunMicroAppEntry + config.url
}
}
// update-end--author:sunjianlei---date:220241019---for【JEECG作为乾坤子应用】作为乾坤子应用启动时拼接请求路径
return config;
},

View File

@ -4,7 +4,7 @@ import type { FormSchema } from "@/components/Form";
import { unref } from 'vue';
import { isObject } from '/@/utils/is';
import Big from 'big.js';
// update-begin--author:sunjianlei---date:20220408---for: 【VUEN-656】配置外部网址打不开原因是带了#号,需要替换一下
export const URL_HASH_TAB = `__AGWE4H__HASH__TAG__PWHRG__`;
// update-end--author:sunjianlei---date:20220408---for: 【VUEN-656】配置外部网址打不开原因是带了#号,需要替换一下
@ -123,7 +123,7 @@ export function cloneObject(obj) {
export const withInstall = <T>(component: T, alias?: string) => {
//console.log("---初始化---", component)
const comp = component as any;
comp.install = (app: App) => {
// @ts-ignore
@ -254,7 +254,9 @@ export function numToUpper(value) {
}
};
let lth = value.toString().length;
value *= 100;
// update-begin--author:liaozhiyang---date:20241202---for【issues/7493】numToUpper方法返回解决错误
value = new Big(value).times(100);
// update-end--author:liaozhiyang---date:20241202---for【issues/7493】numToUpper方法返回解决错误
value += '';
let length = value.length;
if (lth <= 8) {
@ -520,6 +522,10 @@ export function useConditionFilter() {
data.view = 'number';
}
switch (data.view) {
case 'file':
case 'image':
case 'password':
return commonConditionOptions;
case 'text':
case 'textarea':
case 'umeditor':
@ -550,3 +556,22 @@ export function useConditionFilter() {
};
return { filterCondition };
}
// 获取url中的参数
export const getUrlParams = (url) => {
const result = {
url: '',
params: {},
};
const list = url.split('?');
result.url = list[0];
const params = list[1];
if (params) {
const list = params.split('&');
list.forEach((ele) => {
const dic = ele.split('=');
const label = dic[0];
result.params[label] = dic[1];
});
}
return result;
};