From 2263222977a8deebc6cf6379fbbe34443c629299 Mon Sep 17 00:00:00 2001 From: lijing1 Date: Thu, 20 Nov 2025 16:07:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update:=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/tenant.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/system/tenant.ts b/src/api/system/tenant.ts index 812c8916..4094a6b3 100644 --- a/src/api/system/tenant.ts +++ b/src/api/system/tenant.ts @@ -1,4 +1,4 @@ -import { get, post } from '@/api/request'; +import { get, post, download } from '@/api/request'; const env = import.meta.env; const PREFIX = env.VITE_API_PREFIX_SYSTEM; @@ -27,3 +27,8 @@ export const tenantGetTenantDetailByIdApi = (params: any) => { export const tenantDeleteApi = (params: any) => { return get(`${PREFIX}tenant/delete`, params); }; + +// 租户列表导出 +export const tenantExportApi = (params: any) => { + return download(`${PREFIX}/tenant/export`, params); +}; From 0d5965b1c2789d851e8601498495d7c23fa447bc Mon Sep 17 00:00:00 2001 From: zhouyang Date: Thu, 20 Nov 2025 16:10:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E7=AE=97=E4=BE=8B=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/project/task.ts | 75 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/src/api/project/task.ts b/src/api/project/task.ts index 36118c72..c0a1304d 100644 --- a/src/api/project/task.ts +++ b/src/api/project/task.ts @@ -1,4 +1,4 @@ -import { post } from '@/api/request'; +import { post, upload } from '@/api/request'; const env = import.meta.env; const PREFIX = env.VITE_API_PREFIX_PROJECT; @@ -28,3 +28,76 @@ export const editTaskApi = (params: any) => { export const getTaskCountApi = (params: any) => { return post(`${PREFIX}task/count`, params); }; + +/** + * 获取项目任务下的算例信息 + * @param params + * @returns + */ +export const getTaskRunTreeApi = (params: any) => { + return post(`${PREFIX}run/getTaskRunTree`, params); +}; + +/** + * 获取用户工作负载信息 + * @param params + * @returns + */ +export const getListUserWorkloadsApi = (params: any) => { + return post(`${PREFIX}task/listUserWorkloads`, params); +}; + +/** + * 新建算例 + * @param params + * @returns + */ +export const addTaskRunApi = (params: any) => { + return post(`${PREFIX}run/addTaskRun`, params); +}; + +/** + * 查询算例信息 + * @param params + * @returns + */ +export const queryTaskRunApi = (params: any) => { + return post(`${PREFIX}run/queryTaskRun`, params); +}; + +/** + * 创建算例下的结果文件夹 + * @param params dirName文件夹名称 dirType文件夹类型默认2 uuId算例的uuid + * @returns + */ +export const createRunDirApi = (params: any) => { + return post(`${PREFIX}run/createRunDir`, params); +}; + +/** + * 查询算例结果文件夹及文件 + * @param params uuId算例的uuid size 10 current 1 + * @returns + */ +export const queryRunDirApi = (params: any) => { + return post(`${PREFIX}run/queryRunDir`, params); +}; + +/** + * 上传算例结果文件 + * @param params file文件 dirId文件夹id fileName文件名称 + * @returns + */ +export const uploadRunFilesApi = (params: any) => { + return upload(`${PREFIX}run/uploadRunFiles`, params); +}; + +/** + * 删除算例 + * @param params runId 算例的id + * @returns + */ +export const deleteTaskRunApi = (params: any) => { + return post(`${PREFIX}run/deleteTaskRun`, params); + +}; \ No newline at end of file From 1c7081befc695ab81de108d04f7451cedba6a534 Mon Sep 17 00:00:00 2001 From: lijing1 Date: Thu, 20 Nov 2025 20:11:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?update:=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/tenant.ts | 4 ++-- src/components/common/table/baseTable.vue | 21 +++++++++++++----- src/components/common/table/treeEditItem.vue | 2 +- src/components/common/table/treeTable.vue | 21 +++++++++++++----- src/stores/common.ts | 7 +++++- src/utils/file.ts | 23 ++++++++++++++++++++ src/views/system/tenant/index.vue | 7 +++++- 7 files changed, 70 insertions(+), 15 deletions(-) diff --git a/src/api/system/tenant.ts b/src/api/system/tenant.ts index 4094a6b3..987a89a0 100644 --- a/src/api/system/tenant.ts +++ b/src/api/system/tenant.ts @@ -29,6 +29,6 @@ export const tenantDeleteApi = (params: any) => { }; // 租户列表导出 -export const tenantExportApi = (params: any) => { - return download(`${PREFIX}/tenant/export`, params); +export const tenantExportApi = (params: any, filename: string) => { + return download(`${PREFIX}/tenant/export`, params, filename); }; diff --git a/src/components/common/table/baseTable.vue b/src/components/common/table/baseTable.vue index da9037b5..89ca1cc4 100644 --- a/src/components/common/table/baseTable.vue +++ b/src/components/common/table/baseTable.vue @@ -22,6 +22,8 @@
+ {{ $t('表格.导出') }} + {{ $t('表格.导入') }}
@@ -45,8 +47,6 @@
- {{ $t('表格.导出') }} - {{ $t('表格.导入') }}
@@ -67,14 +67,14 @@ }" > - + @@ -149,12 +149,16 @@ import TableSearch from './tableSearch.vue'; import TableFormDia from './tableFormDia.vue'; import { getFormConfigureApi } from '@/api/system/systemData'; import { formOptionsFormat } from './lib'; +import { exportFile } from '@/utils/file'; const emit = defineEmits(['searchChange', 'load', 'update:viewType']); interface Props { tableName?: string; api?: (params: ApiParams) => Promise | undefined; + exportApi?: any; + exportFileName?: string; + exportDict?: any; render?: (data: any, cb: (cbData: any) => void) => void | undefined; params?: any; head?: any; @@ -175,6 +179,9 @@ interface Props { const props = withDefaults(defineProps(), { tableName: '', api: undefined, + exportApi: undefined, + exportFileName: '', + exportDict: {}, render: undefined, params: () => {}, head: null, @@ -400,6 +407,10 @@ const actionClickFun = (row: any, action: any) => { } }; +const exportFun = () => { + exportFile(props.exportApi, props.tableName, props.exportFileName, {}, props.exportDict); +}; + watch(() => props.tableName, () => { initFun(); }); diff --git a/src/components/common/table/treeEditItem.vue b/src/components/common/table/treeEditItem.vue index fd35fe82..eec79fe2 100644 --- a/src/components/common/table/treeEditItem.vue +++ b/src/components/common/table/treeEditItem.vue @@ -33,7 +33,7 @@ withDefaults(defineProps(), { .tip { display: flex; align-items: center; - justify-content: center; + justify-content: flex-start; font-size: 12px; color: var(--el-text-color-secondary); .text { diff --git a/src/components/common/table/treeTable.vue b/src/components/common/table/treeTable.vue index 19b00d9b..c612a29e 100644 --- a/src/components/common/table/treeTable.vue +++ b/src/components/common/table/treeTable.vue @@ -22,6 +22,8 @@
+ {{ $t('表格.导出') }} + {{ $t('表格.导入') }}
@@ -29,8 +31,6 @@
- {{ $t('表格.导出') }} - {{ $t('表格.导入') }}
@@ -65,14 +65,14 @@ }" > - + @@ -172,11 +172,15 @@ import TableFormDia from './tableFormDia.vue'; import { getFormConfigureApi } from '@/api/system/systemData'; import { formOptionsFormat } from './lib'; import { uniqBy, cloneDeep } from 'lodash-es'; +import { exportFile } from '@/utils/file'; const emit = defineEmits(['searchChange', 'load']); interface Props { tableName: string; + exportApi?: any; + exportFileName?: string; + exportDict?: any; params?: any; head?: any; searchItems?: any[]; @@ -195,6 +199,9 @@ interface Props { const props = withDefaults(defineProps(), { tableName: '', + exportApi: undefined, + exportFileName: '', + exportDict: {}, params: () => {}, head: null, searchItems: () => [] as any[], @@ -470,6 +477,10 @@ const actionClickFun = (row: any, action: any) => { } }; +const exportFun = () => { + exportFile(props.exportApi, props.tableName, props.exportFileName, {}, props.exportDict); +}; + watch(() => props.tableName, () => { initFun(); }); diff --git a/src/stores/common.ts b/src/stores/common.ts index fc70cd96..e809f2c8 100644 --- a/src/stores/common.ts +++ b/src/stores/common.ts @@ -40,7 +40,12 @@ export const CommonStore = defineStore('common', { }, getDictData(key: string) { if (this.dictData[key]) { - return this.dictData[key] ; + return this.dictData[key]; + } else { + return { + A: [], + O: {}, + }; } }, }, diff --git a/src/utils/file.ts b/src/utils/file.ts index 99cb3698..a9a40271 100644 --- a/src/utils/file.ts +++ b/src/utils/file.ts @@ -1,7 +1,10 @@ import { getKKFileViewURLFromMinioApi } from '@/api/data/data'; +import { getFormConfigureApi } from '@/api/system/systemData'; import { ElMessage } from 'element-plus'; import * as XLSX from 'xlsx'; import { cloneDeep } from 'lodash-es'; +import { CommonStore } from '@/stores/common'; +import dayjs from 'dayjs'; const env = import.meta.env; @@ -173,3 +176,23 @@ export class FileUtil { } } +// 导出文件 +export const exportFile = (api: any, tableName: string, fileName: string, params: any, dict: any) => { + getFormConfigureApi({ formName: tableName }).then((res: any) => { + if (res.code === 200) { + const formConfig = JSON.parse(res.data.formConfig); + const listData = formConfig.filter((item: any) => item.isShow).map((item: any) => { + const val: any = { + key: item.key, + title: item.title, + }; + if (dict[item.key] && CommonStore().getDictData(dict[item.key])) { + val.dictCode = dict[item.key]; + val.dictData = CommonStore().getDictData(dict[item.key]).O; + } + return val; + }); + api(listData, `${dayjs().format('YYYYMMDDHHmmss')}_${fileName || tableName}.xlsx`); + } + }); +}; diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue index d575da6f..9b8bb5c8 100644 --- a/src/views/system/tenant/index.vue +++ b/src/views/system/tenant/index.vue @@ -5,6 +5,11 @@ ref="baseTableRef" tableName="SYSTEM_TENANT" :api="tenantListApi" + :exportApi="tenantExportApi" + exportFileName="租户列表" + :exportDict="{ + status: 'TENANT_STATUS' + }" >