添加附件上传显示提示以及配置项

This commit is contained in:
825299534@qq.com
2025-07-17 14:56:20 +08:00
parent c1966414ab
commit fcdde6291c
3 changed files with 12 additions and 1 deletions

View File

@ -37,6 +37,9 @@
</a-popover> </a-popover>
</a-input-group> </a-input-group>
</a-upload> </a-upload>
<div v-if="VITE_GLOB_UPLOAD_ALERT_TIP?.trim()" style="color: red; margin-top: 8px;">
{{VITE_GLOB_UPLOAD_ALERT_TIP}}
</div>
<a-modal <a-modal
:bodyStyle="bodyStyle" :bodyStyle="bodyStyle"
:width="800" :width="800"
@ -60,7 +63,7 @@
import { Icon } from '/@/components/Icon'; import { Icon } from '/@/components/Icon';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { getAppEnvConfig } from '/@/utils/env'; import { getAppEnvConfig } from '/@/utils/env';
const { VITE_GLOB_UPLOAD_ALERT_TIP } = getAppEnvConfig();
const props = defineProps({ const props = defineProps({
value: String, value: String,
showTip: { type: Boolean, default: true }, showTip: { type: Boolean, default: true },

View File

@ -15,6 +15,9 @@
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'components'"> {{ t('上传') }} </template> <template v-if="column.dataIndex === 'components'"> {{ t('上传') }} </template>
<div v-if="VITE_GLOB_UPLOAD_ALERT_TIP?.trim()" style="color: red; margin-top: 8px;">
{{VITE_GLOB_UPLOAD_ALERT_TIP}}
</div>
<template v-if="column.dataIndex === 'operation'"> <template v-if="column.dataIndex === 'operation'">
<div class="flex"> <div class="flex">
<a-button size="small" type="primary" class="mr-2" @click="preview(record.fileUrl)">{{ <a-button size="small" type="primary" class="mr-2" @click="preview(record.fileUrl)">{{
@ -52,6 +55,7 @@
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { getAppEnvConfig } from '/@/utils/env'; import { getAppEnvConfig } from '/@/utils/env';
const { t } = useI18n(); const { t } = useI18n();
const { VITE_GLOB_UPLOAD_ALERT_TIP } = getAppEnvConfig();
const props = withDefaults(defineProps<{ processId: string }>(), { const props = withDefaults(defineProps<{ processId: string }>(), {
processId: '', processId: '',
}); });

View File

@ -96,6 +96,9 @@
> >
<img v-if="data.photoUrl" :src="data.photoUrl" /> <img v-if="data.photoUrl" :src="data.photoUrl" />
<div v-else>{{ t('点击上传照片') }}</div> <div v-else>{{ t('点击上传照片') }}</div>
<div v-if="VITE_GLOB_UPLOAD_ALERT_TIP?.trim()" style="color: red; margin-top: 8px;">
{{VITE_GLOB_UPLOAD_ALERT_TIP}}
</div>
</a-upload> </a-upload>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
@ -141,6 +144,7 @@
import { StampType, StampFileTypeAttributes } from '/@/enums/workflowEnum'; import { StampType, StampFileTypeAttributes } from '/@/enums/workflowEnum';
import { dataURLtoBlob } from '/@/utils/file/base64Conver'; import { dataURLtoBlob } from '/@/utils/file/base64Conver';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
const { VITE_GLOB_UPLOAD_ALERT_TIP } = getAppEnvConfig();
const { t } = useI18n(); const { t } = useI18n();
let props = defineProps(['id', 'type', 'info']); let props = defineProps(['id', 'type', 'info']);
const formRef = ref(); const formRef = ref();