feat(sj_1.0.0): 1、工作流导入导出优化 2、导入执行刷新页面
This commit is contained in:
parent
15d19f84c9
commit
6748d5bc24
@ -7,6 +7,12 @@ defineOptions({
|
|||||||
name: 'FileUpload'
|
name: 'FileUpload'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits<Emits>();
|
||||||
|
|
||||||
|
interface Emits {
|
||||||
|
(e: 'refresh'): void;
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
accept?: string;
|
accept?: string;
|
||||||
action?: string;
|
action?: string;
|
||||||
@ -51,6 +57,7 @@ const handleImport = ({
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
onFinish();
|
onFinish();
|
||||||
|
emit('refresh');
|
||||||
})
|
})
|
||||||
.catch(() => onError());
|
.catch(() => onError());
|
||||||
};
|
};
|
||||||
|
5
src/typings/api.d.ts
vendored
5
src/typings/api.d.ts
vendored
@ -894,6 +894,11 @@ declare namespace Api {
|
|||||||
Pick<Api.Workflow.Workflow, 'workflowName' | 'groupName' | 'workflowStatus'> & CommonSearchParams
|
Pick<Api.Workflow.Workflow, 'workflowName' | 'groupName' | 'workflowStatus'> & CommonSearchParams
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
type ExportWorkflow = Common.CommonRecord<{
|
||||||
|
workflowIds: String[];
|
||||||
|
}> &
|
||||||
|
WorkflowSearchParams;
|
||||||
|
|
||||||
/** workflow list */
|
/** workflow list */
|
||||||
type WorkflowList = Common.PaginatingQueryRecord<Workflow>;
|
type WorkflowList = Common.PaginatingQueryRecord<Workflow>;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ function handleExport() {
|
|||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
>
|
>
|
||||||
<template #addAfter>
|
<template #addAfter>
|
||||||
<FileUpload v-if="hasAuth('R_ADMIN')" action="/group/import" accept="application/json" />
|
<FileUpload v-if="hasAuth('R_ADMIN')" action="/group/import" accept="application/json" @refresh="getData" />
|
||||||
<NPopconfirm @positive-click="handleExport">
|
<NPopconfirm @positive-click="handleExport">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
||||||
|
@ -277,7 +277,7 @@ function handleExport() {
|
|||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
>
|
>
|
||||||
<template #addAfter>
|
<template #addAfter>
|
||||||
<FileUpload action="/job/import" accept="application/json" />
|
<FileUpload action="/job/import" accept="application/json" @refresh="getData" />
|
||||||
<NPopconfirm @positive-click="handleExport">
|
<NPopconfirm @positive-click="handleExport">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
||||||
|
@ -222,7 +222,7 @@ function handleExport() {
|
|||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
>
|
>
|
||||||
<template #addAfter>
|
<template #addAfter>
|
||||||
<FileUpload action="/scene-config/import" accept="application/json" />
|
<FileUpload action="/scene-config/import" accept="application/json" @refresh="getData" />
|
||||||
<NPopconfirm @positive-click="handleExport">
|
<NPopconfirm @positive-click="handleExport">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
||||||
|
@ -33,11 +33,11 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
|||||||
workflowStatus: null
|
workflowStatus: null
|
||||||
},
|
},
|
||||||
columns: () => [
|
columns: () => [
|
||||||
// {
|
{
|
||||||
// type: 'selection',
|
type: 'selection',
|
||||||
// align: 'center',
|
align: 'center',
|
||||||
// width: 48
|
width: 48
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
key: 'id',
|
key: 'id',
|
||||||
title: $t('common.index'),
|
title: $t('common.index'),
|
||||||
@ -251,8 +251,17 @@ async function execute(id: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function body(): Api.Workflow.ExportWorkflow {
|
||||||
|
return {
|
||||||
|
workflowIds: checkedRowKeys.value,
|
||||||
|
groupName: searchParams.groupName,
|
||||||
|
workflowName: searchParams.workflowName,
|
||||||
|
workflowStatus: searchParams.workflowStatus
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
downloadFetch('/workflow/export', checkedRowKeys.value, $t('page.workflow.title'));
|
downloadFetch('/workflow/export', body(), $t('page.workflow.title'));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -277,7 +286,7 @@ function handleExport() {
|
|||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
>
|
>
|
||||||
<template #addAfter>
|
<template #addAfter>
|
||||||
<FileUpload action="/workflow/import" accept="application/json" />
|
<FileUpload action="/workflow/import" accept="application/json" @refresh="getData" />
|
||||||
<NPopconfirm @positive-click="handleExport">
|
<NPopconfirm @positive-click="handleExport">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
||||||
|
@ -29,7 +29,7 @@ function search() {
|
|||||||
<template>
|
<template>
|
||||||
<SearchForm :model="model" @search="search" @reset="reset">
|
<SearchForm :model="model" @search="search" @reset="reset">
|
||||||
<NFormItemGi span="24 s:12 m:6" :label="$t('page.workflow.groupName')" path="groupName" class="pr-24px">
|
<NFormItemGi span="24 s:12 m:6" :label="$t('page.workflow.groupName')" path="groupName" class="pr-24px">
|
||||||
<SelectGroup v-model="model.groupName" />
|
<SelectGroup v-model:value="model.groupName" />
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi
|
<NFormItemGi
|
||||||
span="24 s:12 m:6"
|
span="24 s:12 m:6"
|
||||||
|
Loading…
Reference in New Issue
Block a user