lyc-dev #128

Merged
lyc merged 3 commits from lyc-dev into main 2024-12-13 09:47:58 +08:00
3 changed files with 12 additions and 13 deletions
Showing only changes of commit a379176496 - Show all commits

View File

@ -19,8 +19,8 @@
import { ref, reactive, onMounted, computed } from 'vue';
import { sessionStore } from '@/utils/store'
import { getSmarttalkPage } from '@/api/file'
import { getFileSuffix, urlToBase64 } from '@/utils/ruoyi.js'
import * as commUtils from '@/utils/comm.js'
import { getFileSuffix } from '@/utils/ruoyi.js'
const emit = defineEmits(['insertMaterial', 'close'])
@ -63,12 +63,9 @@ const fileUrl = computed(() => (item) =>{
//
const onInsert = async (item) =>{
const bolb = commUtils.base64ToBlob(item.fileFullPath)
const file = commutils.blobToFile(bolb, item.fileShowName)
const res = await fetch(item.fileFullPath)
const bolb = await res.blob()
const file = commUtils.blobToFile(bolb, item.fileShowName)
if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){
emit('insertMaterial',{ type: 'video', file })

View File

@ -292,8 +292,9 @@ const insertMaterial = (item: MaterialParams) =>{
else{
createImageElement(data)
}
materiaVisible.value = false
})
materiaVisible.value = false
}
//

View File

@ -482,10 +482,7 @@ export default {
//
async saveImage(resultIndex, index, url, resultItem) {
if(this.hasPPt){
this.$emit('insertImg', url)
return
}
this.buttonStates[resultIndex][index].disabled = true;
this.buttonStates[resultIndex][index].text = "正在保存...";
const numberIndex = url.indexOf('filename=');
@ -494,6 +491,7 @@ export default {
const finalPath = path.substring(0, pngIndex + 4);
try {
const blob = await this.getImageBlob(`https://ai.ysaix.com:7853/view?filename=${finalPath}&type=temp`);
const hash = CryptoJS.MD5(blob).toString();
@ -502,7 +500,10 @@ export default {
let file = new File([blob], `${resultItem}.png`, {
type: 'image/png'
})
if(this.hasPPt){
this.$emit('insertImg', file)
return
}
//
formData.append('md5', hash);
formData.append('file', file);