Compare commits

...

3 Commits

Author SHA1 Message Date
lyc f2637c7b15 Merge pull request 'lyc-dev' (#95) from lyc-dev into main 2024-12-09 10:56:53 +08:00
lyc 93fa916084 Merge branch 'main' into lyc-dev 2024-12-09 10:56:20 +08:00
lyc 24d6d5887f pptlist edit 2024-12-09 10:56:04 +08:00
5 changed files with 34 additions and 10 deletions

5
env.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
declare module '*.vue' {
import { ComponentOptions } from 'vue'
const componentOptions: ComponentOptions
export default componentOptions
}

View File

@ -125,7 +125,8 @@ import {
User,
Switch,
More,
Material
Material,
AddPicture
} from '@icon-park/vue-next'
export interface Icons {
@ -256,7 +257,8 @@ export const icons: Icons = {
IconUser: User,
IconSwitch: Switch,
IconMore: More,
IconMaterial: Material
IconMaterial: Material,
IconAddPicture: AddPicture
}
export default {

View File

@ -11,6 +11,7 @@
</div>
<el-button type="primary" @click="onInsert(item)">插入</el-button>
</div>
<el-empty description="暂无素材" v-if="!list.length" />
</div>
</template>
@ -93,11 +94,9 @@ const GetUrlParameters = (parameters) => {
}
}
}
return resData;
}
const proxyToBase64 = (url)=> {
const dourl = GetUrlParameters(url)
console.log(dourl,'dourl')

View File

@ -83,6 +83,7 @@
</Popover>
<IconPreviewOpen class="handler-item" v-tooltip="'插入试题'" @click="classWorkTaskVisible = true" />
<IconMaterial class="handler-item" v-tooltip="'插入素材'" @click="materiaVisible = true"/>
<IconAddPicture class="handler-item" v-tooltip="'文生图'" @click="imgVisible = true" />
</div>
<div class="right-handler">
@ -121,14 +122,18 @@
@update="data => { onhtml2canvas(data); classWorkTaskVisible = false }"
/>
</el-dialog>
<!--插入素材-->
<Modal
v-model:visible="materiaVisible"
:width="880">
<MaterialDialog @close="materiaVisible = false" @insertMaterial="insertMaterial"/>
</Modal>
<!--文生图-->
<Modal
v-model:visible="imgVisible"
:width="1300">
<TextCreateImg hasPPt @insertImg="(url: string) => { createImageElement(url); imgVisible = false }" />
</Modal>
</div>
</template>
@ -156,6 +161,7 @@ import Popover from '../../../components/Popover.vue'
import PopoverMenuItem from '../../../components/PopoverMenuItem.vue'
import QuestToPPTist from '@/views/classTask/newClassTaskAssign/questToPPTist/index.vue'
import MaterialDialog from './MaterialDialog.vue'
import TextCreateImg from '@/components/ai-kolors/index.vue'
const mainStore = useMainStore()
const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore)
@ -269,8 +275,10 @@ const insertMaterial = (item: MaterialParams) =>{
createImageElement(data)
}
materiaVisible.value = false
}
//
const imgVisible = ref(false)
</script>
<style lang="scss" scoped>

View File

@ -144,8 +144,14 @@ import { convertTextToPicture, getQueue, getPromptId, getPicture, chattoprompt,
import CryptoJS from 'crypto-js'
import { useRoute } from 'vue-router'
export default {
props: {
hasPPt: {
type: Boolean,
default: false
}
},
data() {
return {
form: {
ratio: "512",
@ -384,7 +390,7 @@ export default {
urls.push(url0)
buttonState.push({
disabled: false,
text: "插入本课素材资源库",
text: this.hasPPt ? '插入' : "插入本课素材资源库",
})
}
this.skeletonNumber = 0
@ -476,6 +482,10 @@ 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=');