@skyfox2000/webui 1.5.4 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/modules/{baseLayout-BEy-FjcZ.js → baseLayout-DfTxHOFc.js} +7 -7
- package/lib/assets/modules/file-upload-DTOdV5vM.js +211 -0
- package/lib/assets/modules/index-BDoBUrYA.js +114 -0
- package/lib/assets/modules/{index-BTD6d1d_.js → index-BwMaOrJT.js} +1 -1
- package/lib/assets/modules/{index-BFxnKhwl.js → index-M1qERbea.js} +99 -99
- package/lib/assets/modules/{menuTabs-DUBWuf7t.js → menuTabs-DWaBSRNr.js} +42 -42
- package/lib/assets/modules/{toolIcon-DQLIuud3.js → toolIcon-BYnHhAy-.js} +1 -1
- package/lib/assets/modules/upload-template-BKm9mFq8.js +6764 -0
- package/lib/assets/modules/uploadList-CHvr6Hp1.js +472 -0
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +2 -2
- package/lib/es/Error403/index.js +14 -15
- package/lib/es/Error404/index.js +16 -17
- package/lib/es/ExcelForm/index.js +244 -244
- package/lib/es/MenuLayout/index.js +5 -5
- package/lib/es/TemplateFile/index.js +53 -54
- package/lib/es/UploadForm/index.js +61 -63
- package/lib/locales/default.d.ts +287 -103
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +1440 -1586
- package/package.json +1 -1
- package/src/components/common/icon/fullscreen.vue +1 -1
- package/src/components/content/dialog/excelForm.vue +32 -28
- package/src/components/content/dialog/index.vue +3 -3
- package/src/components/content/dialog/templateFile.vue +3 -2
- package/src/components/content/dialog/uploadForm.vue +5 -4
- package/src/components/content/drawer/index.vue +5 -3
- package/src/components/content/list/index.vue +2 -1
- package/src/components/content/list/listOperate.vue +6 -7
- package/src/components/content/search/index.vue +2 -2
- package/src/components/content/table/index.vue +2 -1
- package/src/components/content/table/tableOperate.vue +8 -9
- package/src/components/content/toolbar/icontool.vue +1 -5
- package/src/components/content/toolbar/index.vue +4 -5
- package/src/components/content/toolpanel/index.vue +20 -20
- package/src/components/error/error403.vue +2 -2
- package/src/components/error/error404.vue +2 -2
- package/src/components/form/input/index.vue +3 -1
- package/src/components/form/select/index.vue +3 -2
- package/src/components/form/textarea/index.vue +3 -1
- package/src/components/form/transfer/index.vue +2 -1
- package/src/components/form/upload/uploadList.vue +23 -19
- package/src/components/layout/header/headerExits.vue +5 -5
- package/src/components/layout/menu/menuTabs.vue +1 -1
- package/src/const/options.ts +17 -16
- package/src/locales/default.ts +297 -176
- package/src/stores/appInfo.ts +2 -1
- package/src/stores/userInfo.ts +6 -5
- package/src/utils/data.ts +9 -8
- package/src/utils/download.ts +5 -4
- package/src/utils/excel-preview.ts +4 -3
- package/src/utils/export-table.ts +7 -6
- package/src/utils/file-upload.ts +15 -14
- package/src/utils/form-csv.ts +4 -3
- package/src/utils/form-excel.ts +14 -13
- package/src/utils/form-validate.ts +18 -17
- package/src/utils/form.ts +6 -5
- package/src/utils/icon-loader.ts +3 -2
- package/src/utils/options.ts +2 -1
- package/src/utils/tools.ts +18 -17
- package/lib/assets/modules/file-upload-_mcZy7EK.js +0 -211
- package/lib/assets/modules/index-DyE2ppxB.js +0 -114
- package/lib/assets/modules/upload-template-DZuy1BOF.js +0 -6465
- package/lib/assets/modules/uploadList-CCquj3c_.js +0 -466
package/package.json
CHANGED
|
@@ -117,6 +117,7 @@ import {
|
|
|
117
117
|
UploadFile,
|
|
118
118
|
} from '@/index';
|
|
119
119
|
import { validateExcelUnified } from '@/utils/form-excel';
|
|
120
|
+
import { $t } from '@/locales/index';
|
|
120
121
|
import { loadPreviewFile } from '@/utils/excel-preview';
|
|
121
122
|
import { AnyData, ResStatus, IUrlInfo } from '@skyfox2000/fapi';
|
|
122
123
|
import message from 'vue-m-message';
|
|
@@ -224,19 +225,19 @@ const fileTypeTip = computed(() => {
|
|
|
224
225
|
const fileType = props.fileType || 'both';
|
|
225
226
|
switch (fileType) {
|
|
226
227
|
case 'excel':
|
|
227
|
-
return '
|
|
228
|
+
return $t('webui.components.content.dialog.chooseExcelFile');
|
|
228
229
|
case 'csv':
|
|
229
|
-
return '
|
|
230
|
+
return $t('webui.components.content.dialog.chooseCsvFile');
|
|
230
231
|
case 'both':
|
|
231
232
|
default:
|
|
232
|
-
return '
|
|
233
|
+
return $t('webui.components.content.dialog.chooseExcelOrCsvFile');
|
|
233
234
|
}
|
|
234
235
|
});
|
|
235
236
|
|
|
236
237
|
// Alert状态变量
|
|
237
|
-
const validationMsg = ref('
|
|
238
|
+
const validationMsg = ref($t('webui.components.content.dialog.validationRules'));
|
|
238
239
|
const validationType = ref<AlertType>('warning');
|
|
239
|
-
const duplicateMsg = ref('
|
|
240
|
+
const duplicateMsg = ref($t('webui.components.content.dialog.duplicateData'));
|
|
240
241
|
const duplicateType = ref<AlertType>('warning');
|
|
241
242
|
|
|
242
243
|
watch(
|
|
@@ -307,19 +308,19 @@ const dialogUpload = async () => {
|
|
|
307
308
|
|
|
308
309
|
const url = uploadUrl.value;
|
|
309
310
|
if (!url) {
|
|
310
|
-
message.error('
|
|
311
|
+
message.error($t('webui.components.content.excelForm.uploadAddressNotConfigured'));
|
|
311
312
|
return;
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
if (excelError.value) {
|
|
315
|
-
message.error('
|
|
316
|
+
message.error($t('webui.components.content.excelForm.validationError'));
|
|
316
317
|
return;
|
|
317
318
|
}
|
|
318
319
|
|
|
319
320
|
excelCtrl.isFormSaving.value = true;
|
|
320
321
|
try {
|
|
321
322
|
if (!excelBuffer.value || !fileName.value) {
|
|
322
|
-
message.warning('
|
|
323
|
+
message.warning($t('webui.components.content.excelForm.pleaseSelectFileFirst'));
|
|
323
324
|
excelCtrl.isFormSaving.value = false;
|
|
324
325
|
return;
|
|
325
326
|
}
|
|
@@ -352,12 +353,12 @@ const dialogUpload = async () => {
|
|
|
352
353
|
});
|
|
353
354
|
if (uploadRes.status === UploadStatus.Success) {
|
|
354
355
|
// 上传成功后调用 dialogSave 方法
|
|
355
|
-
message.success('
|
|
356
|
+
message.success($t('webui.components.content.excelForm.fileUploadSuccess'));
|
|
356
357
|
dialogSave(uploadFile);
|
|
357
358
|
}
|
|
358
359
|
} catch (error: any) {
|
|
359
360
|
console.error('上传处理错误:', error);
|
|
360
|
-
message.error('
|
|
361
|
+
message.error($t('webui.components.content.excelForm.uploadFailed') + (error?.message || $t('webui.components.content.excelForm.unknownError')));
|
|
361
362
|
} finally {
|
|
362
363
|
excelCtrl.isFormSaving.value = false;
|
|
363
364
|
}
|
|
@@ -424,7 +425,7 @@ const dialogSave = async (uploadFile: UploadFile) => {
|
|
|
424
425
|
}
|
|
425
426
|
} catch (error) {
|
|
426
427
|
console.error('保存错误:', error);
|
|
427
|
-
message.error('
|
|
428
|
+
message.error($t('webui.components.content.excelForm.dataSaveFailed'));
|
|
428
429
|
} finally {
|
|
429
430
|
excelCtrl.isFormSaving.value = false;
|
|
430
431
|
}
|
|
@@ -484,8 +485,8 @@ const performDataValidation = async (buffer: ArrayBuffer): Promise<void> => {
|
|
|
484
485
|
// 验证成功时,excelUrl会在beforeUpload中设置
|
|
485
486
|
}
|
|
486
487
|
} catch (error) {
|
|
487
|
-
validationMsg.value = '
|
|
488
|
-
duplicateMsg.value = '
|
|
488
|
+
validationMsg.value = $t('webui.components.content.dialog.validationException');
|
|
489
|
+
duplicateMsg.value = $t('webui.components.content.dialog.validationException');
|
|
489
490
|
validationType.value = 'error';
|
|
490
491
|
duplicateType.value = 'error';
|
|
491
492
|
}
|
|
@@ -515,16 +516,16 @@ const beforeUpload: UploadProps['beforeUpload'] = async (file) => {
|
|
|
515
516
|
switch (allowedType) {
|
|
516
517
|
case 'excel':
|
|
517
518
|
isValidType = isExcel;
|
|
518
|
-
errorMsg = '
|
|
519
|
+
errorMsg = $t('webui.components.content.excelForm.onlyExcelAllowed');
|
|
519
520
|
break;
|
|
520
521
|
case 'csv':
|
|
521
522
|
isValidType = isCsv;
|
|
522
|
-
errorMsg = '
|
|
523
|
+
errorMsg = $t('webui.components.content.excelForm.onlyCsvAllowed');
|
|
523
524
|
break;
|
|
524
525
|
case 'both':
|
|
525
526
|
default:
|
|
526
527
|
isValidType = isExcel || isCsv;
|
|
527
|
-
errorMsg = '
|
|
528
|
+
errorMsg = $t('webui.components.content.excelForm.onlyExcelOrCsvAllowed');
|
|
528
529
|
break;
|
|
529
530
|
}
|
|
530
531
|
|
|
@@ -553,7 +554,7 @@ const beforeUpload: UploadProps['beforeUpload'] = async (file) => {
|
|
|
553
554
|
const { csvToExcelView } = await import('@/utils/excel-view');
|
|
554
555
|
const excelResult = await csvToExcelView(csvText, file.name);
|
|
555
556
|
if (!excelResult.success) {
|
|
556
|
-
throw new Error(excelResult.error || '
|
|
557
|
+
throw new Error(excelResult.error || $t('webui.components.content.excelForm.csvProcessingFailed'));
|
|
557
558
|
}
|
|
558
559
|
|
|
559
560
|
// 获取Excel格式的ArrayBuffer用于验证
|
|
@@ -590,14 +591,14 @@ const beforeUpload: UploadProps['beforeUpload'] = async (file) => {
|
|
|
590
591
|
}
|
|
591
592
|
excelCtrl.isFormLoading.value = false;
|
|
592
593
|
} else {
|
|
593
|
-
message.error('
|
|
594
|
+
message.error($t('webui.components.content.excelForm.loadFileFailed'));
|
|
594
595
|
}
|
|
595
596
|
};
|
|
596
597
|
} catch (error) {
|
|
597
598
|
console.error('文件处理错误:', error);
|
|
598
|
-
message.error('
|
|
599
|
+
message.error($t('webui.components.content.excelForm.fileProcessingFailed'));
|
|
599
600
|
excelCtrl.isFormLoading.value = false;
|
|
600
|
-
validationMsg.value = '
|
|
601
|
+
validationMsg.value = $t('webui.components.content.excelForm.fileProcessingError');
|
|
601
602
|
validationType.value = 'error';
|
|
602
603
|
}
|
|
603
604
|
|
|
@@ -612,7 +613,7 @@ onMounted(() => {
|
|
|
612
613
|
if (pageCtrl && !isPreviewMode.value) {
|
|
613
614
|
// 只有在非预览模式下才检查上传地址
|
|
614
615
|
if (!uploadUrl.value) {
|
|
615
|
-
message.error('
|
|
616
|
+
message.error($t('webui.components.content.excelForm.uploadAddressNotConfigured'));
|
|
616
617
|
return;
|
|
617
618
|
}
|
|
618
619
|
|
|
@@ -646,9 +647,9 @@ const clearAll = () => {
|
|
|
646
647
|
|
|
647
648
|
// 重置验证状态
|
|
648
649
|
excelCtrl.isFormLoading.value = false;
|
|
649
|
-
validationMsg.value = '
|
|
650
|
+
validationMsg.value = $t('webui.components.content.dialog.validationRules');
|
|
650
651
|
validationType.value = 'warning';
|
|
651
|
-
duplicateMsg.value = '
|
|
652
|
+
duplicateMsg.value = $t('webui.components.content.dialog.duplicateData');
|
|
652
653
|
duplicateType.value = 'warning';
|
|
653
654
|
excelError.value = false;
|
|
654
655
|
duplicateError.value = false;
|
|
@@ -680,7 +681,7 @@ defineExpose({
|
|
|
680
681
|
});
|
|
681
682
|
</script>
|
|
682
683
|
<template>
|
|
683
|
-
<Modal :title="title ?? '
|
|
684
|
+
<Modal :title="title ?? $t('webui.components.content.dialog.fileUpload')" v-model:open="open"
|
|
684
685
|
:wrapClassName="['modal', 'mx-auto', $attrs.width ? 'w-[' + $attrs.width + ']' : ''].join(' ')" :width="940"
|
|
685
686
|
@close="dialogClose">
|
|
686
687
|
<slot></slot>
|
|
@@ -714,7 +715,8 @@ defineExpose({
|
|
|
714
715
|
<!-- 右侧验证条件和错误信息 -->
|
|
715
716
|
<div class="w-[22%] flex-grow overflow-hidden flex flex-col" v-if="validationRules.length > 0">
|
|
716
717
|
<div class="bg-gray-50 p-2 rounded border flex-grow flex flex-col">
|
|
717
|
-
<div v-if="validationRules.length === 0" class="text-gray-500"
|
|
718
|
+
<div v-if="validationRules.length === 0" class="text-gray-500">{{
|
|
719
|
+
$t('webui.components.content.dialog.noValidationRules') }}</div>
|
|
718
720
|
<div v-else class="flex flex-col">
|
|
719
721
|
<!-- 行验证规则 -->
|
|
720
722
|
<Alert :message="validationMsg" :type="validationType" show-icon class="mb-2" />
|
|
@@ -734,7 +736,8 @@ defineExpose({
|
|
|
734
736
|
<Alert :message="duplicateMsg" :type="duplicateType" show-icon class="mt-2 mb-2" />
|
|
735
737
|
<div class="text-[12px] text-gray-600 p-1">
|
|
736
738
|
<div class="text-[13px] text-gray-600">
|
|
737
|
-
|
|
739
|
+
{{ duplicateRules.length > 1 ? $t('webui.components.content.dialog.combinationMustBeUnique')
|
|
740
|
+
: $t('webui.components.content.dialog.fieldMustBeUnique', [duplicateRules.join(', ')]) }}
|
|
738
741
|
</div>
|
|
739
742
|
<ul class="pl-5 mt-1 mb-0">
|
|
740
743
|
<li class="text-[12px] text-gray-600">
|
|
@@ -750,11 +753,12 @@ defineExpose({
|
|
|
750
753
|
|
|
751
754
|
<template #footer>
|
|
752
755
|
<Space>
|
|
753
|
-
<Button @click="dialogClose">{{ cancelText ?? (isPreviewMode ? '
|
|
756
|
+
<Button @click="dialogClose">{{ cancelText ?? (isPreviewMode ? $t('webui.components.content.dialog.close') :
|
|
757
|
+
$t('webui.common.cancel')) }}</Button>
|
|
754
758
|
<Button v-if="!isPreviewMode" @click="dialogUpload" type="primary"
|
|
755
759
|
:loading="excelCtrl?.isFormSaving.value ?? false"
|
|
756
760
|
:disabled="!excelUrl || excelError || duplicateError || excelCtrl.isFormLoading.value">
|
|
757
|
-
{{ saveText ?? '
|
|
761
|
+
{{ saveText ?? $t('webui.components.content.dialog.uploadFile') }}
|
|
758
762
|
</Button>
|
|
759
763
|
</Space>
|
|
760
764
|
</template>
|
|
@@ -103,15 +103,15 @@ const doDialogClose = () => {
|
|
|
103
103
|
<slot name="footer">
|
|
104
104
|
<Space>
|
|
105
105
|
<Button @click="doDialogClose" v-if="cancelText !== ''">
|
|
106
|
-
{{ cancelText ?? '
|
|
106
|
+
{{ cancelText ?? $t('webui.common.cancel') }}
|
|
107
107
|
</Button>
|
|
108
108
|
<Button @click="doDialogSaveAs" v-if="saveAsText !== '' && editorCtrl?.saveAsBtnVisible !== false"
|
|
109
109
|
type="primary" :loading="editorCtrl?.isFormSaving.value">
|
|
110
|
-
{{ saveAsText ?? '
|
|
110
|
+
{{ saveAsText ?? $t('webui.common.saveAs') }}
|
|
111
111
|
</Button>
|
|
112
112
|
<Button @click="doDialogSave" v-if="saveText !== '' && editorCtrl?.saveBtnVisible !== false"
|
|
113
113
|
type="primary" :loading="editorCtrl?.isFormSaving.value">
|
|
114
|
-
{{ saveText ?? '
|
|
114
|
+
{{ saveText ?? $t('webui.common.save') }}
|
|
115
115
|
</Button>
|
|
116
116
|
</Space>
|
|
117
117
|
</slot>
|
|
@@ -6,6 +6,7 @@ import { MinioFile, UploadFile, UploadStatus } from '@/index';
|
|
|
6
6
|
import { httpPost, IUrlInfo, ResStatus } from '@skyfox2000/fapi';
|
|
7
7
|
import UploadList from '../../form/upload/uploadList.vue';
|
|
8
8
|
import { uploadTempOpener } from '../../../utils/upload-template';
|
|
9
|
+
import { $t } from '@/locales/index';
|
|
9
10
|
|
|
10
11
|
const props = defineProps({
|
|
11
12
|
/**
|
|
@@ -164,7 +165,7 @@ const dialogClose = () => {
|
|
|
164
165
|
};
|
|
165
166
|
</script>
|
|
166
167
|
<template>
|
|
167
|
-
<Modal title="
|
|
168
|
+
<Modal :title="$t('webui.components.content.dialog.templateFileManager')" v-model:open="open"
|
|
168
169
|
:wrapClassName="'modal mx-auto ' + ($attrs.width ? 'w-[' + $attrs.width + ']' : 'w-[500px]')"
|
|
169
170
|
@close="dialogClose">
|
|
170
171
|
<!-- 改为选择后自动上传 -->
|
|
@@ -173,7 +174,7 @@ const dialogClose = () => {
|
|
|
173
174
|
:show-delete="showDelete" />
|
|
174
175
|
<template #footer>
|
|
175
176
|
<Space>
|
|
176
|
-
<Button @click="dialogClose"
|
|
177
|
+
<Button @click="dialogClose">{{ $t('webui.common.close') }}</Button>
|
|
177
178
|
</Space>
|
|
178
179
|
</template>
|
|
179
180
|
</Modal>
|
|
@@ -7,6 +7,7 @@ import { AnyData, ApiResponse, IUrlInfo, ResStatus } from '@skyfox2000/fapi';
|
|
|
7
7
|
import UploadList from '../../form/upload/uploadList.vue';
|
|
8
8
|
import message from 'vue-m-message';
|
|
9
9
|
import { AsyncUploader } from '@/utils/file-upload';
|
|
10
|
+
import { $t } from '@/locales/index';
|
|
10
11
|
|
|
11
12
|
const props = defineProps<{
|
|
12
13
|
/**
|
|
@@ -188,7 +189,7 @@ onMounted(() => {
|
|
|
188
189
|
uploadUrl.value = uploadUrl.value ?? pageCtrl.urls.upload;
|
|
189
190
|
downloadUrl.value = downloadUrl.value ?? pageCtrl.urls.download;
|
|
190
191
|
if (!uploadUrl.value) {
|
|
191
|
-
message.error('
|
|
192
|
+
message.error($t('webui.components.content.excelForm.uploadAddressNotConfigured'));
|
|
192
193
|
return;
|
|
193
194
|
}
|
|
194
195
|
if (!uploadUrl.value.api) uploadUrl.value.api = pageCtrl.api;
|
|
@@ -214,7 +215,7 @@ const dialogClose = () => {
|
|
|
214
215
|
};
|
|
215
216
|
</script>
|
|
216
217
|
<template>
|
|
217
|
-
<Modal title="
|
|
218
|
+
<Modal :title="$t('webui.components.content.dialog.fileUpload')" v-model:open="open"
|
|
218
219
|
:wrapClassName="'modal mx-auto ' + ($attrs.width ? 'w-[' + $attrs.width + ']' : 'w-[500px]')"
|
|
219
220
|
@close="dialogClose">
|
|
220
221
|
<UploadList
|
|
@@ -226,9 +227,9 @@ const dialogClose = () => {
|
|
|
226
227
|
/>
|
|
227
228
|
<template #footer>
|
|
228
229
|
<Space>
|
|
229
|
-
<Button @click="dialogClose"
|
|
230
|
+
<Button @click="dialogClose">{{ $t('webui.common.cancel') }}</Button>
|
|
230
231
|
<Button @click="dialogSave" type="primary" :loading="uploadFormCtrl.isFormSaving.value">
|
|
231
|
-
|
|
232
|
+
{{ $t('webui.common.uploadSave') }}
|
|
232
233
|
</Button>
|
|
233
234
|
</Space>
|
|
234
235
|
</template>
|
|
@@ -7,6 +7,7 @@ const { token } = useToken();
|
|
|
7
7
|
import { EditorControl, onFormSave, onFormSaveAs, onFormClose, ProviderKeys } from '@/index';
|
|
8
8
|
import { AnyData } from '@skyfox2000/fapi';
|
|
9
9
|
import { ToolIcon } from '../../common';
|
|
10
|
+
import { $t } from '@/locales/index';
|
|
10
11
|
|
|
11
12
|
const open = ref<boolean>(false);
|
|
12
13
|
|
|
@@ -100,14 +101,15 @@ const doDrawerClose = () => {
|
|
|
100
101
|
<template #footer>
|
|
101
102
|
<slot name="footer">
|
|
102
103
|
<Space>
|
|
103
|
-
<Button @click="doDrawerClose" v-if="cancelText !== ''">{{ cancelText ??
|
|
104
|
+
<Button @click="doDrawerClose" v-if="cancelText !== ''">{{ cancelText ??
|
|
105
|
+
$t('webui.common.cancel') }}</Button>
|
|
104
106
|
<Button @click="doDrawerSaveAs" v-if="saveAsText !== '' && editorCtrl.saveAsBtnVisible !== false"
|
|
105
107
|
type="primary" :loading="editorCtrl.isFormSaving.value">
|
|
106
|
-
{{ saveAsText ?? '
|
|
108
|
+
{{ saveAsText ?? $t('webui.common.saveAs') }}
|
|
107
109
|
</Button>
|
|
108
110
|
<Button @click="doDrawerSave" v-if="saveText !== '' && editorCtrl.saveBtnVisible !== false"
|
|
109
111
|
type="primary" :loading="editorCtrl.isFormSaving.value">
|
|
110
|
-
{{ saveText ?? '
|
|
112
|
+
{{ saveText ?? $t('webui.common.save') }}
|
|
111
113
|
</Button>
|
|
112
114
|
</Space>
|
|
113
115
|
</slot>
|
|
@@ -14,6 +14,7 @@ import Toolbar from '../toolbar/index.vue';
|
|
|
14
14
|
import Switch from '../../form/switch/index.vue';
|
|
15
15
|
import { AnyData } from '@skyfox2000/fapi';
|
|
16
16
|
import { ProviderKeys } from '@/index';
|
|
17
|
+
import { $t } from '@/locales/index';
|
|
17
18
|
|
|
18
19
|
const props = withDefaults(defineProps<{
|
|
19
20
|
/**
|
|
@@ -76,7 +77,7 @@ const pagination: Ref<false | PaginationProps> = ref<false | PaginationProps>({
|
|
|
76
77
|
current: 1,
|
|
77
78
|
pageSize: curPageSize.value,
|
|
78
79
|
showTotal: (total: number) => {
|
|
79
|
-
return
|
|
80
|
+
return $t('webui.common.total', [total]);
|
|
80
81
|
},
|
|
81
82
|
onChange: (page: number, pageSize: number) => {
|
|
82
83
|
if (pagination.value !== false) {
|
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AppRouter,
|
|
4
4
|
ButtonTool,
|
|
5
|
-
getToolGroup,
|
|
6
|
-
getToolVisible,
|
|
7
|
-
getToolStatus,
|
|
8
|
-
onToolClicked,
|
|
9
5
|
onGridRowEdit,
|
|
10
6
|
onGridRowDelete,
|
|
11
7
|
GridControl,
|
|
12
8
|
ToolIcon,
|
|
13
9
|
} from '@/index';
|
|
10
|
+
import { getToolGroup, getToolVisible, getToolStatus, onToolClicked } from '@/utils/tools';
|
|
14
11
|
import { ConfigProvider, Space, DropdownButton, Menu, MenuItem, Popconfirm } from 'ant-design-vue';
|
|
15
12
|
import { computed } from 'vue';
|
|
13
|
+
import { $t } from '@/locales/index';
|
|
16
14
|
|
|
17
15
|
const props = defineProps<{
|
|
18
16
|
/**
|
|
@@ -52,7 +50,7 @@ const defaultOperates: ButtonTool[] = [
|
|
|
52
50
|
role: ['Super', 'Admin'],
|
|
53
51
|
permit: ':delete',
|
|
54
52
|
confirm: true,
|
|
55
|
-
confirmText: '
|
|
53
|
+
confirmText: $t('webui.components.content.table.confirmDelete'),
|
|
56
54
|
click: () => onGridRowDelete<T>(gridCtrl, props.record as T),
|
|
57
55
|
},
|
|
58
56
|
];
|
|
@@ -86,7 +84,8 @@ const disabled = (item: ButtonTool): boolean => {
|
|
|
86
84
|
<Space>
|
|
87
85
|
<template v-for="item in buttons" :key="item.key">
|
|
88
86
|
<Popconfirm v-if="getToolVisible(item, props.record)" :disabled="disabled(item) || !item.confirm"
|
|
89
|
-
cancelText="
|
|
87
|
+
:cancelText="$t('webui.common.no')" :okText="$t('webui.common.yes')" :title="item.confirmText"
|
|
88
|
+
:okButtonProps="{ size: 'small' }"
|
|
90
89
|
:cancelButtonProps="{ size: 'small' }"
|
|
91
90
|
@confirm="onToolClicked(item, gridCtrl.page, gridCtrl, props.record, true)">
|
|
92
91
|
<ToolIcon :key="item.key" :icon="item.icon" :danger="item.danger"
|
|
@@ -103,7 +102,7 @@ const disabled = (item: ButtonTool): boolean => {
|
|
|
103
102
|
|
|
104
103
|
<ConfigProvider :autoInsertSpaceInButton="false" v-if="record[gridCtrl.statusKey] == 1">
|
|
105
104
|
<DropdownButton v-if="menus.length > 0" size="small">
|
|
106
|
-
|
|
105
|
+
{{ $t('webui.components.content.table.more') }}
|
|
107
106
|
<template #overlay>
|
|
108
107
|
<Menu>
|
|
109
108
|
<template v-for="item in menus" :key="item.key">
|
|
@@ -143,8 +143,8 @@ const onReset = () => {
|
|
|
143
143
|
<SearchItem v-if="defaultSlots || gridCtrl?.searchBar" class="w-1/3 flex justify-end text-right pr-5"
|
|
144
144
|
:wrapper-col="{ flex: 'auto' }">
|
|
145
145
|
<Space>
|
|
146
|
-
<Button type="primary" @click="onSearch" icon="icon-search"
|
|
147
|
-
<Button @click="onReset" icon="icon-reset"
|
|
146
|
+
<Button type="primary" @click="onSearch" icon="icon-search">{{ $t('webui.common.search') }}</Button>
|
|
147
|
+
<Button @click="onReset" icon="icon-reset">{{ $t('webui.common.reset') }}</Button>
|
|
148
148
|
</Space>
|
|
149
149
|
</SearchItem>
|
|
150
150
|
</Form>
|
|
@@ -16,6 +16,7 @@ import Toolbar from '../toolbar/index.vue';
|
|
|
16
16
|
import Switch from '../../form/switch/index.vue';
|
|
17
17
|
import { AnyData } from '@skyfox2000/fapi';
|
|
18
18
|
import { ProviderKeys } from '@/index';
|
|
19
|
+
import { $t } from '@/locales/index';
|
|
19
20
|
|
|
20
21
|
const props = withDefaults(defineProps<{
|
|
21
22
|
/**
|
|
@@ -77,7 +78,7 @@ const pagination: Ref<false | PaginationProps> = ref<false | PaginationProps>({
|
|
|
77
78
|
current: 1,
|
|
78
79
|
pageSize: curPageSize.value,
|
|
79
80
|
showTotal: (total: number) => {
|
|
80
|
-
return
|
|
81
|
+
return $t('webui.common.total', [total]);
|
|
81
82
|
},
|
|
82
83
|
onChange: (page: number, pageSize: number) => {
|
|
83
84
|
if (pagination.value !== false) {
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AppRouter,
|
|
4
4
|
ButtonTool,
|
|
5
|
-
getToolGroup,
|
|
6
|
-
getToolVisible,
|
|
7
|
-
getToolStatus,
|
|
8
|
-
onToolClicked,
|
|
9
5
|
onGridRowEdit,
|
|
10
6
|
onGridRowDelete,
|
|
11
7
|
GridControl,
|
|
12
8
|
} from '@/index';
|
|
9
|
+
import { getToolGroup, getToolVisible, getToolStatus, onToolClicked } from '@/utils/tools';
|
|
13
10
|
import { ConfigProvider, Button, Space, DropdownButton, Menu, MenuItem, Popconfirm } from 'ant-design-vue';
|
|
14
11
|
import { computed } from 'vue';
|
|
12
|
+
import { $t } from '@/locales/index';
|
|
15
13
|
|
|
16
14
|
const props = defineProps<{
|
|
17
15
|
/**
|
|
@@ -33,7 +31,7 @@ const currentPath = computed(() => AppRouter.currentRoute.value.path);
|
|
|
33
31
|
const defaultOperates: ButtonTool[] = [
|
|
34
32
|
{
|
|
35
33
|
key: 'Edit',
|
|
36
|
-
label: '
|
|
34
|
+
label: $t('webui.common.edit'),
|
|
37
35
|
type: 'primary',
|
|
38
36
|
visible: true,
|
|
39
37
|
role: ['Super', 'Admin'],
|
|
@@ -42,14 +40,14 @@ const defaultOperates: ButtonTool[] = [
|
|
|
42
40
|
},
|
|
43
41
|
{
|
|
44
42
|
key: 'Delete',
|
|
45
|
-
label: '
|
|
43
|
+
label: $t('webui.common.delete'),
|
|
46
44
|
type: 'primary',
|
|
47
45
|
visible: true,
|
|
48
46
|
danger: true,
|
|
49
47
|
role: ['Super', 'Admin'],
|
|
50
48
|
permit: ':delete',
|
|
51
49
|
confirm: true,
|
|
52
|
-
confirmText: '
|
|
50
|
+
confirmText: $t('webui.components.content.table.confirmDelete'),
|
|
53
51
|
click: () => onGridRowDelete<T>(gridCtrl, props.record as T),
|
|
54
52
|
},
|
|
55
53
|
];
|
|
@@ -83,7 +81,8 @@ const disabled = (item: ButtonTool): boolean => {
|
|
|
83
81
|
<Space>
|
|
84
82
|
<template v-for="item in buttons" :key="item.key">
|
|
85
83
|
<Popconfirm v-if="getToolVisible(item, props.record)" :disabled="disabled(item) || !item.confirm"
|
|
86
|
-
cancelText="
|
|
84
|
+
:cancelText="$t('webui.common.no')" :okText="$t('webui.common.yes')" :title="item.confirmText"
|
|
85
|
+
:okButtonProps="{ size: 'small' }"
|
|
87
86
|
:cancelButtonProps="{ size: 'small' }"
|
|
88
87
|
@confirm="onToolClicked(item, gridCtrl.page, gridCtrl, props.record, true)">
|
|
89
88
|
<Button :key="item.key" :type="item.type ?? 'text'" :danger="item.danger"
|
|
@@ -99,7 +98,7 @@ const disabled = (item: ButtonTool): boolean => {
|
|
|
99
98
|
|
|
100
99
|
<ConfigProvider :autoInsertSpaceInButton="false" v-if="record[gridCtrl.statusKey] == 1">
|
|
101
100
|
<DropdownButton v-if="menus.length > 0" size="small">
|
|
102
|
-
|
|
101
|
+
{{ $t('webui.components.content.table.more') }}
|
|
103
102
|
<template #overlay>
|
|
104
103
|
<Menu>
|
|
105
104
|
<template v-for="item in menus" :key="item.key">
|
|
@@ -6,14 +6,10 @@ import {
|
|
|
6
6
|
AppRouter,
|
|
7
7
|
filterColumns,
|
|
8
8
|
onColumnVisibleChanged,
|
|
9
|
-
getToolStatus,
|
|
10
|
-
getToolByKey,
|
|
11
|
-
getToolVisible,
|
|
12
|
-
useToolFactory,
|
|
13
|
-
onToolClicked,
|
|
14
9
|
GridControl,
|
|
15
10
|
useSettingInfo,
|
|
16
11
|
} from '@/index';
|
|
12
|
+
import { getToolStatus, getToolByKey, getToolVisible, useToolFactory, onToolClicked } from '@/utils/tools';
|
|
17
13
|
import { Button, ToolIcon } from '../../common';
|
|
18
14
|
import { Dropdown, Menu, MenuItem } from 'ant-design-vue';
|
|
19
15
|
|
|
@@ -4,15 +4,14 @@ import {
|
|
|
4
4
|
ButtonTool,
|
|
5
5
|
EditorControl,
|
|
6
6
|
GridControl,
|
|
7
|
-
getToolGroup,
|
|
8
|
-
getToolStatus,
|
|
9
|
-
onToolClicked,
|
|
10
7
|
openNewForm,
|
|
11
8
|
} from '@/index';
|
|
9
|
+
import { getToolGroup, getToolStatus, onToolClicked } from '@/utils/tools';
|
|
12
10
|
import { Dropdown, Menu, MenuItem, Space } from 'ant-design-vue';
|
|
13
11
|
import { Button } from '../../common';
|
|
14
12
|
import IconTool from './icontool.vue';
|
|
15
13
|
import { ref, watch, computed } from 'vue';
|
|
14
|
+
import { $t } from '@/locales/index';
|
|
16
15
|
|
|
17
16
|
const props = defineProps<{
|
|
18
17
|
/**
|
|
@@ -35,7 +34,7 @@ const currentPath = computed(() => AppRouter.currentRoute.value.path);
|
|
|
35
34
|
const defaultButtons: ButtonTool[] = [
|
|
36
35
|
{
|
|
37
36
|
key: 'New',
|
|
38
|
-
label: '
|
|
37
|
+
label: $t('webui.common.add'),
|
|
39
38
|
type: 'primary',
|
|
40
39
|
icon: 'icon-new',
|
|
41
40
|
danger: true,
|
|
@@ -98,7 +97,7 @@ watch(
|
|
|
98
97
|
</MenuItem>
|
|
99
98
|
</Menu>
|
|
100
99
|
</template>
|
|
101
|
-
<Button>
|
|
100
|
+
<Button>{{ $t('webui.common.moreActions') }}</Button>
|
|
102
101
|
</Dropdown>
|
|
103
102
|
<!-- 空占位元素 -->
|
|
104
103
|
<span v-if="ToolbarButtons.length === 0 && ToolbarMenus.length === 0"></span>
|