This commit is contained in:
2024-12-25 14:32:02 +08:00
parent e9d234c2cb
commit 1f5f9e257b
8 changed files with 172 additions and 148 deletions

View File

@@ -131,7 +131,7 @@
:action="baseUrl+'api/Preaccept/up_img_mainImage'"
:show-file-list="false"
name="mainImage"
accept=".jpg,.jpeg,.png"
accept=".jpg,.jpeg,.png,.tif"
:on-success="handleAvatarSuccess"
:on-error="handleAvatarError"
:before-upload="beforeAvatarUpload"
@@ -174,7 +174,7 @@
@updateChange="(res) => updateChange(res, 'title')"
:value="lineStyle.title"
class="paste-area text-container"
toolbar="bold italic subscript superscript clearButton"
toolbar="bold italic subscript superscript clearButton"
height="120"
></tinymce>
</el-form-item>
@@ -262,7 +262,7 @@
@getContent="getContent"
:value="currentContent.content"
class="paste-area text-container"
toolbar="bold italic subscript superscript clearButton"
toolbar="bold italic forecolor subscript superscript clearButton"
style=""
></tinymce>
</el-form-item>
@@ -392,19 +392,19 @@ export default {
computed: {
combinedValue() {
// 将两个值组合成一个新的值,可以是字符串、数组、对象等
return `${this.isFirstComponentLoaded}-${this.isWordComponentLoaded}`;
// return `${this.isFirstComponentLoaded}-${this.isWordComponentLoaded}`;
}
},
watch: {
// 监听计算属性
combinedValue(newVal, oldVal) {
console.log('value1 或 value2 发生变化');
console.log('新值:', newVal);
console.log('旧值:', oldVal);
// combinedValue(newVal, oldVal) {
// console.log('value1 或 value2 发生变化');
// console.log('新值:', newVal);
// console.log('旧值:', oldVal);
// 处理任意一个值变化的逻辑
this.updateWordTiffImage(newVal);
}
// // 处理任意一个值变化的逻辑
// this.updateWordTiffImage(newVal);
// }
},
directives: {
@@ -431,23 +431,23 @@ export default {
this.isWordComponentLoaded = true;
},
// 监听第一个兄弟组件加载完毕
onFirstComponentLoaded(imagesList) {
this.imagesList = [...imagesList];
this.isFirstComponentLoaded = true;
},
updateWordTiffImage(data) {
console.log('updateWordTiffImage at line 423:', data);
// onFirstComponentLoaded(imagesList) {
// this.imagesList = [...imagesList];
// this.isFirstComponentLoaded = true;
// },
// updateWordTiffImage(data) {
// console.log('updateWordTiffImage at line 423:', data);
if (this.isFirstComponentLoaded && this.isWordComponentLoaded) {
this.imagesList.forEach((e) => {
if (e.dataUrl) {
this.$nextTick(() => {
this.$refs.commonWord.replacePlaceholderImage(e.ami_id, e.dataUrl);
});
}
});
}
},
// if (this.isFirstComponentLoaded && this.isWordComponentLoaded) {
// this.imagesList.forEach((e) => {
// if (e.dataUrl) {
// this.$nextTick(() => {
// this.$refs.commonWord.replacePlaceholderImage(e.ami_id, e.dataUrl);
// });
// }
// });
// }
// },
handleSaveContent() {
this.$refs.tinymceChild.getContent('content');
},
@@ -937,8 +937,8 @@ export default {
},
// 获取数据
async getDate() {
this.isFirstComponentLoaded = false;
this.isWordComponentLoaded = false;
// this.isFirstComponentLoaded = false;
// this.isWordComponentLoaded = false;
this.imagesList = [];
let urlLInk = '';
let urlTask = {};
@@ -1277,7 +1277,7 @@ export default {
// this.$message.error('Picture size cannot exceed 10M!');
// }
// return isLt2M;
const isValidFormat = ['image/jpeg', 'image/png'].includes(file.type);
const isValidFormat = ['image/jpeg', 'image/png', 'image/tiff'].includes(file.type);
if (!isValidFormat) {
this.$message.error(this.$t('commonTable.uploadImageInfo'));
}