✨ feat: 添加多语言可以追加
This commit is contained in:
parent
e3726755ef
commit
a47ff8d3e1
|
@ -8,8 +8,7 @@ import { usePublicHooks } from '@/views/hooks';
|
|||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
formInline: () => ({
|
||||
// 邮箱
|
||||
email: undefined,
|
||||
emailTemplate: undefined,
|
||||
email: '',
|
||||
// 密码
|
||||
password: undefined,
|
||||
// Host地址
|
||||
|
@ -18,6 +17,7 @@ const props = withDefaults(defineProps<FormProps>(), {
|
|||
port: undefined,
|
||||
// 邮箱协议
|
||||
smtpAgreement: undefined,
|
||||
openSSL: false,
|
||||
// 是否为默认邮件
|
||||
isDefault: false,
|
||||
}),
|
||||
|
|
|
@ -11,6 +11,7 @@ interface Props {
|
|||
type: string;
|
||||
file: any;
|
||||
fileType: string;
|
||||
isAppend: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -36,6 +37,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||
type: '',
|
||||
file: undefined,
|
||||
fileType: '',
|
||||
isAppend: true,
|
||||
}),
|
||||
});
|
||||
|
||||
|
@ -63,6 +65,10 @@ defineExpose({ formRef });
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('isAppend')" prop="isAppend">
|
||||
<el-switch v-model="form.isAppend" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('files')" prop="file">
|
||||
<el-upload ref="uploadRef" v-model:file-list="form.file" :autoUpload="false" :limit="1" :on-exceed="handleExceed" class="w-full mt-2" drag>
|
||||
<el-icon class="el-icon--upload">
|
||||
|
@ -75,6 +81,6 @@ defineExpose({ formRef });
|
|||
</el-form-item>
|
||||
|
||||
<!-- 更新提示 -->
|
||||
<el-text type="danger">{{ $t('update_tip') }}</el-text>
|
||||
<el-text type="danger">{{ $t('update_i18n_tip') }}</el-text>
|
||||
</el-form>
|
||||
</template>
|
||||
|
|
|
@ -23,18 +23,17 @@ export const downloadI18nSetting = (type: string) => {
|
|||
i18nStore.downloadI18nFile({ type });
|
||||
};
|
||||
|
||||
/* 下载多语言配置 */
|
||||
/* 上传多语言配置 */
|
||||
export const updateI18nSetting = (fileType: string) => {
|
||||
const uploadFormRef = ref();
|
||||
|
||||
addDialog({
|
||||
title: $t('update_multilingual'),
|
||||
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
props: { form: { type: undefined, file: undefined, fileType } },
|
||||
contentRenderer: () => h(I18NUploadDialog, { ref: uploadFormRef, form: { type: '', file: undefined, fileType } }),
|
||||
props: { form: { type: undefined, file: undefined, fileType, isAppend: true } },
|
||||
contentRenderer: () => h(I18NUploadDialog, { ref: uploadFormRef, form: { type: '', file: undefined, fileType, isAppend: true } }),
|
||||
beforeSure: async (done, { options }) => {
|
||||
uploadFormRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
@ -51,7 +50,6 @@ export const updateI18nSetting = (fileType: string) => {
|
|||
export const onAdd = () => {
|
||||
addDialog({
|
||||
title: $t('addMultilingual'),
|
||||
|
||||
props: { formInline: { keyName: '', translation: '', typeName: '' } },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
|
|
Loading…
Reference in New Issue