feat(sj_1.0.0): 导出、导入添加确认导出提示
1、 涉及定时任务、重试场景、组配置 2、组配置导入只限管理员导入 3、普通用户只能选择导出,管理员可以全部导出
This commit is contained in:
parent
61e24330b6
commit
bea1d3f85c
@ -27,9 +27,10 @@ const local: App.I18n.Schema = {
|
|||||||
checkUploadType: 'Only JSON format files can be uploaded, please re-upload',
|
checkUploadType: 'Only JSON format files can be uploaded, please re-upload',
|
||||||
second: 's',
|
second: 's',
|
||||||
millisecond: 'ms',
|
millisecond: 'ms',
|
||||||
import: 'import',
|
import: 'Import',
|
||||||
export: 'export',
|
export: 'Export',
|
||||||
batchCopy: 'BatchCopy',
|
exportAll: 'Are you sure to export all?',
|
||||||
|
exportPar: 'Are you sure to export {num} pieces of data?',
|
||||||
edit: 'Edit',
|
edit: 'Edit',
|
||||||
detail: 'Detail',
|
detail: 'Detail',
|
||||||
index: 'Index',
|
index: 'Index',
|
||||||
|
@ -29,7 +29,8 @@ const local: App.I18n.Schema = {
|
|||||||
millisecond: '毫秒',
|
millisecond: '毫秒',
|
||||||
import: '导入',
|
import: '导入',
|
||||||
export: '导出',
|
export: '导出',
|
||||||
batchCopy: '批量复制',
|
exportAll: '确认全部导出吗?',
|
||||||
|
exportPar: '确认导出{num}条数据吗?',
|
||||||
edit: '编辑',
|
edit: '编辑',
|
||||||
detail: '详情',
|
detail: '详情',
|
||||||
index: '序号',
|
index: '序号',
|
||||||
|
3
src/typings/app.d.ts
vendored
3
src/typings/app.d.ts
vendored
@ -279,7 +279,8 @@ declare namespace App {
|
|||||||
millisecond: string;
|
millisecond: string;
|
||||||
import: string;
|
import: string;
|
||||||
export: string;
|
export: string;
|
||||||
batchCopy: string;
|
exportAll: string;
|
||||||
|
exportPar: string;
|
||||||
edit: string;
|
edit: string;
|
||||||
detail: string;
|
detail: string;
|
||||||
index: string;
|
index: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { NButton, NTag } from 'naive-ui';
|
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useBoolean } from '@sa/hooks';
|
import { useBoolean } from '@sa/hooks';
|
||||||
import { fetchGetGroupConfigList, fetchUpdateGroupStatus } from '@/service/api';
|
import { fetchGetGroupConfigList, fetchUpdateGroupStatus } from '@/service/api';
|
||||||
@ -30,6 +30,11 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
|||||||
groupName: null
|
groupName: null
|
||||||
},
|
},
|
||||||
columns: () => [
|
columns: () => [
|
||||||
|
{
|
||||||
|
type: 'selection',
|
||||||
|
align: 'center',
|
||||||
|
width: 48
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'index',
|
key: 'index',
|
||||||
title: $t('common.index'),
|
title: $t('common.index'),
|
||||||
@ -182,13 +187,24 @@ function handleExport() {
|
|||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
>
|
>
|
||||||
<template #addAfter>
|
<template #addAfter>
|
||||||
<FileUpload action="/group/import" accept="application/json" />
|
<FileUpload v-if="hasAuth('R_ADMIN')" action="/group/import" accept="application/json" />
|
||||||
<NButton size="small" ghost type="primary" @click="handleExport">
|
<NPopconfirm @positive-click="handleExport">
|
||||||
<template #icon>
|
<template #trigger>
|
||||||
<IconPajamasExport class="text-icon" />
|
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
||||||
|
<template #icon>
|
||||||
|
<IconPajamasExport class="text-icon" />
|
||||||
|
</template>
|
||||||
|
{{ $t('common.export') }}
|
||||||
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
{{ $t('common.export') }}
|
<template #default>
|
||||||
</NButton>
|
{{
|
||||||
|
checkedRowKeys.length === 0
|
||||||
|
? $t('common.exportAll')
|
||||||
|
: $t('common.exportPar', { num: checkedRowKeys.length })
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</NPopconfirm>
|
||||||
</template>
|
</template>
|
||||||
</TableHeaderOperation>
|
</TableHeaderOperation>
|
||||||
</template>
|
</template>
|
||||||
|
@ -44,7 +44,7 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP
|
|||||||
key: 'index',
|
key: 'index',
|
||||||
title: $t('common.index'),
|
title: $t('common.index'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 120
|
width: 48
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'jobName',
|
key: 'jobName',
|
||||||
@ -278,12 +278,23 @@ function handleExport() {
|
|||||||
>
|
>
|
||||||
<template #addAfter>
|
<template #addAfter>
|
||||||
<FileUpload action="/job/import" accept="application/json" />
|
<FileUpload action="/job/import" accept="application/json" />
|
||||||
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0" @click="handleExport">
|
<NPopconfirm @positive-click="handleExport">
|
||||||
<template #icon>
|
<template #trigger>
|
||||||
<IconPajamasExport class="text-icon" />
|
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
||||||
|
<template #icon>
|
||||||
|
<IconPajamasExport class="text-icon" />
|
||||||
|
</template>
|
||||||
|
{{ $t('common.export') }}
|
||||||
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
{{ $t('common.export') }}
|
<template #default>
|
||||||
</NButton>
|
{{
|
||||||
|
checkedRowKeys.length === 0
|
||||||
|
? $t('common.exportAll')
|
||||||
|
: $t('common.exportPar', { num: checkedRowKeys.length })
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</NPopconfirm>
|
||||||
</template>
|
</template>
|
||||||
</TableHeaderOperation>
|
</TableHeaderOperation>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { NButton, NTag } from 'naive-ui';
|
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useBoolean } from '@sa/hooks';
|
import { useBoolean } from '@sa/hooks';
|
||||||
import { fetchGetRetryScenePageList, fetchUpdateSceneStatus } from '@/service/api';
|
import { fetchGetRetryScenePageList, fetchUpdateSceneStatus } from '@/service/api';
|
||||||
@ -9,9 +9,11 @@ import { useTable, useTableOperate } from '@/hooks/common/table';
|
|||||||
import { DelayLevel, backOffRecord, routeKeyRecord } from '@/constants/business';
|
import { DelayLevel, backOffRecord, routeKeyRecord } from '@/constants/business';
|
||||||
import StatusSwitch from '@/components/common/status-switch.vue';
|
import StatusSwitch from '@/components/common/status-switch.vue';
|
||||||
import { downloadFetch } from '@/utils/download';
|
import { downloadFetch } from '@/utils/download';
|
||||||
|
import { useAuth } from '@/hooks/business/auth';
|
||||||
import SceneOperateDrawer from './modules/scene-operate-drawer.vue';
|
import SceneOperateDrawer from './modules/scene-operate-drawer.vue';
|
||||||
import SceneSearch from './modules/scene-search.vue';
|
import SceneSearch from './modules/scene-search.vue';
|
||||||
import SceneDetailDrawer from './modules/scene-detail-drawer.vue';
|
import SceneDetailDrawer from './modules/scene-detail-drawer.vue';
|
||||||
|
const { hasAuth } = useAuth();
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
@ -212,12 +214,23 @@ function handleExport() {
|
|||||||
>
|
>
|
||||||
<template #addAfter>
|
<template #addAfter>
|
||||||
<FileUpload action="/scene-config/import" accept="application/json" />
|
<FileUpload action="/scene-config/import" accept="application/json" />
|
||||||
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0" @click="handleExport">
|
<NPopconfirm @positive-click="handleExport">
|
||||||
<template #icon>
|
<template #trigger>
|
||||||
<IconPajamasExport class="text-icon" />
|
<NButton size="small" ghost type="primary" :disabled="checkedRowKeys.length === 0 && hasAuth('R_USER')">
|
||||||
|
<template #icon>
|
||||||
|
<IconPajamasExport class="text-icon" />
|
||||||
|
</template>
|
||||||
|
{{ $t('common.export') }}
|
||||||
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
{{ $t('common.export') }}
|
<template #default>
|
||||||
</NButton>
|
{{
|
||||||
|
checkedRowKeys.length === 0
|
||||||
|
? $t('common.exportAll')
|
||||||
|
: $t('common.exportPar', { num: checkedRowKeys.length })
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</NPopconfirm>
|
||||||
</template>
|
</template>
|
||||||
</TableHeaderOperation>
|
</TableHeaderOperation>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user