v3.9.0 里程碑版本发布

This commit is contained in:
JEECG
2025-11-26 11:25:35 +08:00
parent 1f73837b7d
commit 9919ae2bc5
380 changed files with 11450 additions and 4555 deletions

View File

@ -61,16 +61,14 @@ export function useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs,
.catch((e) => {
if (e.error === VALIDATE_FAILED) {
// 如果有未通过表单验证的子表就自动跳转到它所在的tab
//update-begin-author:taoyan date:2022-11-22 for: VUEN-2866【代码生成】Tab风格 一对多子表校验不通过时,点击提交表单空白了,流程附加页面也有此问题
// 代码逻辑说明: VUEN-2866【代码生成】Tab风格 一对多子表校验不通过时,点击提交表单空白了,流程附加页面也有此问题
if(e.paneKey){
activeKey.value = e.paneKey
}else{
//update-begin-author:liusq date:2024-06-12 for: TV360X-478 一对多tab校验未通过时tab没有跳转
// 代码逻辑说明: TV360X-478 一对多tab校验未通过时tab没有跳转
activeKey.value = e.subIndex == null ? (e.index == null ? unref(activeKey) : refKeys.value[e.index]) : Object.keys(tableRefs)[e.subIndex];
//update-end-author:liusq date:2024-06-12 for: TV360X-478 一对多tab校验未通过时tab没有跳转
}
//update-end-author:taoyan date:2022-11-22 for: VUEN-2866【代码生成】Tab风格 一对多子表校验通过时,点击提交表单空白了,流程附加页面也有此问题
//update-begin---author:wangshuai---date:2024-06-17---for:【TV360X-1064】非原生提交表单滚动校验没通过的项---
// 代码逻辑说明: 【TV360X-1064】非原生提交表单滚动校验通过的项---
if (e?.errorFields) {
const firstField = e.errorFields[0];
if (firstField) {
@ -78,7 +76,6 @@ export function useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs,
}
}
return Promise.reject(e?.errorFields);
//update-end---author:wangshuai---date:2024-06-17---for:【TV360X-1064】非原生提交表单滚动校验没通过的项---
} else {
console.error(e);
}
@ -104,7 +101,6 @@ export function useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs,
return [handleChangeTabs, handleSubmit, requestSubTableData, formRef];
}
//update-begin-author:taoyan date:2022-6-16 for: 代码生成-原生表单用
/**
* 校验多个表单和子表table用于原生的antd-vue的表单
* @param activeKey 子表表单/vxe-table 所在tabs的 activeKey
@ -194,4 +190,3 @@ export function useValidateAntFormAndTable(activeKey, refMap) {
transformData,
};
}
//update-end-author:taoyan date:2022-6-16 for: 代码生成-原生表单用

View File

@ -29,9 +29,8 @@ interface ListPageOptions {
};
// 导入配置
importConfig?: {
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
// 代码逻辑说明: erp代码生成 子表 导入地址是动态的
url: string | (() => string);
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
// 导出成功后的回调
success?: (fileInfo?: any) => void;
};
@ -60,42 +59,37 @@ export function useListPage(options: ListPageOptions) {
const tableContext = useListTable(options.tableProps);
const [, { getForm, reload, setLoading }, { selectedRowKeys }] = tableContext;
const [, { getForm, reload, setLoading, getColumns }, { selectedRowKeys }] = tableContext;
// 导出 excel
async function onExportXls() {
//update-begin---author:wangshuai ---date:20220411 for导出新增自定义参数------------
// 代码逻辑说明: 导出新增自定义参数------------
let { url, name, params } = options?.exportConfig ?? {};
let realUrl = typeof url === 'function' ? url() : url;
if (realUrl) {
let title = typeof name === 'function' ? name() : name;
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
// 代码逻辑说明: erp代码生成 子表 导出报错,原因未知-
let paramsForm:any = {};
try {
//update-begin-author:liusq---date:2025-03-20--for: [QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
//当useSearchFor不等于false的时候才去触发validate
if (options?.tableProps?.useSearchForm !== false) {
paramsForm = await getForm().validate();
console.log('paramsForm', paramsForm);
}
//update-end-author:liusq---date:2025-03-20--for:[QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
} catch (e) {
console.warn(e);
}
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
//update-begin-author:liusq date:20230410 for:[/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
// 代码逻辑说明: [/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
if(!paramsForm?.column){
Object.assign(paramsForm,{column:'createTime',order:'desc'});
}
//update-begin-author:liusq date:20230410 for: [/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
//如果参数不为空,则整合到一起
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId
// 代码逻辑说明: erp代码生成 子表 导出动态设置mainId
if (params) {
//update-begin-author:liusq---date:2025-03-20--for: [QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
// 代码逻辑说明: [QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
const realParams = isFunction(params) ? await params() : { ...(params || {}) };
//update-end-author:liusq---date:2025-03-20--for:[QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
Object.keys(realParams).map((k) => {
let temp = (realParams as object)[k];
if (temp) {
@ -103,27 +97,62 @@ export function useListPage(options: ListPageOptions) {
}
});
}
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId
if (selectedRowKeys.value && selectedRowKeys.value.length > 0) {
paramsForm['selections'] = selectedRowKeys.value.join(',');
}
console.log()
//是否显示表格设置
if(options?.tableProps?.showTableSetting !== false){
//是否显示配置字段
if(options?.tableProps?.tableSetting?.setting !== false){
await exportColumns(paramsForm)
}
}
return handleExportXls(title as string, realUrl, filterObj(paramsForm));
//update-end---author:wangshuai ---date:20220411 for导出新增自定义参数--------------
} else {
$message.createMessage.warn('没有传递 exportConfig.url 参数');
return Promise.reject();
}
}
/**
* 设置导出的列
*
* @param paramsForm
*/
async function exportColumns(paramsForm: any) {
//获取表格的列
let columns = getColumns();
if(columns && columns.length >0){
//需要导出的字段
let exportFields:any = [];
//是否有隐藏列
let hiddenColumns = false;
for (const column of columns) {
if(!column.defaultHidden){
let dataIndex = column?.dataIndex;
if(column?.dataIndex!.toString().indexOf('_dictText')){
dataIndex = column?.dataIndex!.toString().replace('_dictText','')
}
exportFields.push(dataIndex);
} else {
hiddenColumns = true;
}
}
if(hiddenColumns){
paramsForm['exportFields'] = exportFields.join(",");
}
}
}
// 导入 excel
function onImportXls(file) {
let { url, success } = options?.importConfig ?? {};
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
// 代码逻辑说明: erp代码生成 子表 导入地址是动态的
let realUrl = typeof url === 'function' ? url() : url;
if (realUrl) {
return handleImportXls(file, realUrl, success || reload);
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
} else {
$message.createMessage.warn('没有传递 importConfig.url 参数');
return Promise.reject();
@ -286,11 +315,10 @@ export function useListTable(tableProps: TableProps): [
};
// 合并用户个性化配置
if (tableProps) {
//update-begin---author:wangshuai---date:2024-04-28---for:【issues/6180】前端代码配置表变查询条件显示列不生效---
// 代码逻辑说明: 【issues/6180】前端代码配置表变查询条件显示列不生效---
if(tableProps.formConfig){
setTableProps(tableProps.formConfig);
}
//update-end---author:wangshuai---date:2024-04-28---for:【issues/6180】前端代码配置表变查询条件显示列不生效---
// merge 方法可深度合并对象
merge(defaultTableProps, tableProps);
}

View File

@ -19,15 +19,24 @@ export function useMethods() {
* 导出xls
* @param name
* @param url
* @param params
* @param isXlsx
* @param timeout 超时时间(毫秒),默认 60000
*/
async function exportXls(name, url, params, isXlsx = false) {
//update-begin---author:wangshuai---date:2024-01-25---for:【QQYUN-8118】导出超时时间设置长点---
async function exportXls(name, url, params, isXlsx = false, timeout = 60000) {
// 代码逻辑说明: 【JHHB-794】用户管理跨页全选后点击用户导出没反应---
if(params?.selections){
let split = params.selections.split(",");
if(split && split.length > 100){
createMessage.warning('最多可选择 100 项进行导出!');
return;
}
}
// 修改为返回原生 response便于获取 headers
const response = await defHttp.get(
{ url: url, params: params, responseType: 'blob', timeout: 60000 },
{ url: url, params: params, responseType: 'blob', timeout: timeout },
{ isTransformResponse: false, isReturnNativeResponse: true }
);
//update-end---author:wangshuai---date:2024-01-25---for:【QQYUN-8118】导出超时时间设置长点---
if (!response || !response.data) {
createMessage.warning('文件下载失败');
return;
@ -39,13 +48,13 @@ export function useMethods() {
isXlsxByHeader = true;
}
const data = response.data;
//update-begin---author:wangshuai---date:2024-04-18---for: 导出excel失败提示不进行导出---
// 代码逻辑说明: 导出excel失败提示不进行导出---
let reader = new FileReader()
reader.readAsText(data, 'utf-8')
reader.onload = async () => {
if(reader.result){
if(reader.result.toString().indexOf("success") !=-1){
// update-begin---author:liaozhiyang---date:2025-02-11---for:【issues/7738】文件中带"success"导出报错 ---
// 代码逻辑说明: 【issues/7738】文件中带"success"导出报错 ---
try {
const { success, message } = JSON.parse(reader.result.toString());
if (!success) {
@ -57,11 +66,9 @@ export function useMethods() {
} catch (error) {
exportExcel(name, isXlsxByHeader, data);
}
// update-end---author:liaozhiyang---date:2025-02-11---for:【issues/7738】文件中带"success"导出报错 ---
}
}
exportExcel(name, isXlsxByHeader, data);
//update-end---author:wangshuai---date:2024-04-18---for: 导出excel失败提示不进行导出---
}
}
@ -88,10 +95,9 @@ export function useMethods() {
<span>具体详情请<a href = ${href} download = ${fileName}> 点击下载 </a> </span>
</div>`,
});
//update-begin---author:wangshuai ---date:20221121 for[VUEN-2827]导入无权限,提示图标错误------------
// 代码逻辑说明: [VUEN-2827]导入无权限,提示图标错误------------
} else if (fileInfo.code === 500 || fileInfo.code === 510) {
createMessage.error(fileInfo.message || `${data.file.name} 导入失败`);
//update-end---author:wangshuai ---date:20221121 for[VUEN-2827]导入无权限,提示图标错误------------
} else {
createMessage.success(fileInfo.message || `${data.file.name} 文件上传成功`);
}
@ -105,9 +111,9 @@ export function useMethods() {
}
return {
handleExportXls: (name: string, url: string, params?: object) => exportXls(name, url, params),
handleExportXls: (name: string, url: string, params?: object, timeout?: number) => exportXls(name, url, params, false, timeout),
handleImportXls: (data, url, success) => importXls(data, url, success),
handleExportXlsx: (name: string, url: string, params?: object) => exportXls(name, url, params, true),
handleExportXlsx: (name: string, url: string, params?: object, timeout?: number) => exportXls(name, url, params, true, timeout),
};
/**

View File

@ -68,15 +68,13 @@ export function useThirdLogin() {
} else {
createMessage.warning('不识别的信息传递');
}
// update-begin--author:liaozhiyang---date:20240717---for【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
// 代码逻辑说明: 【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
if (openWin?.closed) {
window.removeEventListener('message', receiveMessage, false);
}
// update-end--author:liaozhiyang---date:20240717---for【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
};
// update-begin--author:liaozhiyang---date:20240717---for【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
// 代码逻辑说明: 【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
window.removeEventListener('message', receiveMessage, false);
// update-end--author:liaozhiyang---date:20240717---for【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
window.addEventListener('message', receiveMessage, false);
}
// 根据token执行登录