minio文件地址签名功能(使用签名地址):
签章图片处理,桌面设计主页的图片显示地址
This commit is contained in:
@ -21,7 +21,7 @@
|
|||||||
:key="data.renderKey"
|
:key="data.renderKey"
|
||||||
>
|
>
|
||||||
<div class="item" v-for="(item, index) in data.dataSource" :key="index">
|
<div class="item" v-for="(item, index) in data.dataSource" :key="index">
|
||||||
<div class="image"><img :src="item.backgroundUrl" /></div>
|
<div class="image"><img :src="item.backgroundUrlFixed || item.backgroundUrl" /></div>
|
||||||
<div class="edit" @click.stop="handleEdit(item.id)">{{ t('设计') }}</div>
|
<div class="edit" @click.stop="handleEdit(item.id)">{{ t('设计') }}</div>
|
||||||
<div class="mark">
|
<div class="mark">
|
||||||
<a-switch
|
<a-switch
|
||||||
|
|||||||
@ -134,7 +134,7 @@
|
|||||||
align: 'left',
|
align: 'left',
|
||||||
customRender: ({ record }) => {
|
customRender: ({ record }) => {
|
||||||
return h(Image, {
|
return h(Image, {
|
||||||
src: record.fileUrl,
|
src: record.fileUrlFixed,
|
||||||
width: '60px',
|
width: '60px',
|
||||||
height: '22px',
|
height: '22px',
|
||||||
});
|
});
|
||||||
|
|||||||
@ -189,12 +189,15 @@
|
|||||||
};
|
};
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (props.id) {
|
if (props.id) {
|
||||||
data.info = { ...defaultInfo, ...cloneDeep(props.info) };
|
data.info = { ...defaultInfo, ...cloneDeep(props.info) };
|
||||||
if (data.info.fileType === StampFileTypeAttributes.UPLOAD_PICTURES) {
|
// 回显时使用fileUrlFixed(如果有),否则使用fileUrl(改了)
|
||||||
data.photoUrl = data.info.fileUrl;
|
const displayUrl = props.info.fileUrlFixed || props.info.fileUrl;
|
||||||
} else {
|
|
||||||
data.signUrl = data.info.fileUrl;
|
if (data.info.fileType === StampFileTypeAttributes.UPLOAD_PICTURES) {
|
||||||
}
|
data.photoUrl = displayUrl; // 显示用
|
||||||
|
} else {
|
||||||
|
data.signUrl = displayUrl; // 显示用
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
data.info = defaultInfo;
|
data.info = defaultInfo;
|
||||||
}
|
}
|
||||||
@ -221,9 +224,13 @@
|
|||||||
data.info.fileUrl = base64;
|
data.info.fileUrl = base64;
|
||||||
const blob = dataURLtoBlob(base64);
|
const blob = dataURLtoBlob(base64);
|
||||||
|
|
||||||
const fileUrl = await uploadBlobApi(blob, t('手写签名.png'));
|
const response = await uploadBlobApi(blob, t('手写签名.png'));
|
||||||
if (fileUrl) {
|
if (response) {
|
||||||
data.signUrl = fileUrl;
|
// 存储原始URL到info.fileUrl(用于提交)(改了)
|
||||||
|
data.info.fileUrl = response.fileUrl;
|
||||||
|
|
||||||
|
// 显示使用fileUrlFixed(如果有),否则使用fileUrl(改了)
|
||||||
|
data.signUrl = response.fileUrlFixed || response.fileUrl;
|
||||||
message.success(t('手写签章上传成功'));
|
message.success(t('手写签章上传成功'));
|
||||||
} else {
|
} else {
|
||||||
message.error(t('手写签章上传失败'));
|
message.error(t('手写签章上传失败'));
|
||||||
@ -283,7 +290,11 @@
|
|||||||
if (info.file && info.file.response && info.file.response.code == 0) {
|
if (info.file && info.file.response && info.file.response.code == 0) {
|
||||||
message.success(t(`{name}上传成功!`, { name: info.file.name }));
|
message.success(t(`{name}上传成功!`, { name: info.file.name }));
|
||||||
console.log(info, t('上传成功'));
|
console.log(info, t('上传成功'));
|
||||||
data.photoUrl = info.file.response.data.fileUrl;
|
// 存储原始URL到info.fileUrl(用于提交)(改了)
|
||||||
|
data.info.fileUrl = info.file.response.data.fileUrl;
|
||||||
|
|
||||||
|
// 显示使用fileUrlFixed(如果有),否则使用fileUrl (改了)
|
||||||
|
data.photoUrl = info.file.response.data.fileUrlFixed || info.file.response.data.fileUrl;
|
||||||
} else {
|
} else {
|
||||||
message.error(t('上传照片失败'));
|
message.error(t('上传照片失败'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user