Compare commits
No commits in common. "2d0be935bf771457b57d9610a428c9fe68b742c9" and "e58cb334e4d5d1db5e54519d9221c179535c9eb6" have entirely different histories.
2d0be935bf
...
e58cb334e4
|
@ -23,6 +23,7 @@ export default () => {
|
|||
const resource = sessionStore.get('curr.resource') // apt 资源
|
||||
const smarttalk = sessionStore.get('curr.smarttalk') // 备课资源
|
||||
const execPlay = useExecPlay() // 播放控制
|
||||
|
||||
// 监听幻灯片内容变化
|
||||
watch(() => slidesStore.slides, (newVal, oldVal) => {
|
||||
PPTApi.updateSlides(newVal, oldVal) // 更新幻灯片内容
|
||||
|
@ -38,14 +39,7 @@ export default () => {
|
|||
watch(() => slidesStore.slideIndex, (newVal, oldVal) => {
|
||||
PPTApi.updateWorkList()
|
||||
})
|
||||
// 监听幻灯片下画布尺寸比例变化
|
||||
watch(() => slidesStore.viewportRatio, (newVal, oldVal) => {
|
||||
const width = slidesStore.viewportSize
|
||||
const widthandration={width, ratio:newVal}
|
||||
const data = { id: resource.id, parentContent: JSON.stringify(widthandration)}
|
||||
PPTApi.updateSlide(data)
|
||||
})
|
||||
|
||||
|
||||
// 消息监听ws
|
||||
// console.log('监听器已开启', ChatWs)
|
||||
if (!!ChatWs.ws) {
|
||||
|
|
|
@ -80,13 +80,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, nextTick, watch } from 'vue'
|
||||
import Divider from '../../../../../components/Divider.vue'
|
||||
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
|
||||
import { homeworklist } from '@/api/teaching/classwork'
|
||||
import { processList } from "@/hooks/useProcessList";
|
||||
import { listEntpcoursework } from "@/api/classTask/index";
|
||||
import { ElMessageBox,ElMessage } from 'element-plus'
|
||||
import NewClassTsakAssign from '@/views/classTask/newClassTaskAssign/index.vue'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { PPTApi } from '../../../../../api/index'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import {useSlidesStore} from '../../../../../store'
|
||||
import { updateEntpcoursefileNew } from '@/api/education/entpcoursefile'
|
||||
const slidesStore = useSlidesStore()
|
||||
const { slides, slideIndex, currentSlide, workItem } = storeToRefs(slidesStore)
|
||||
interface CourseNode {
|
||||
rootid: number;
|
||||
parentNode: { id: number };
|
||||
|
@ -104,6 +111,12 @@ interface CurrentCourse {
|
|||
worktype: string;
|
||||
}
|
||||
|
||||
interface Params {
|
||||
parentid: number;
|
||||
pageSize: number;
|
||||
orderby: string;
|
||||
}
|
||||
|
||||
interface WorkType {
|
||||
label: string;
|
||||
value: string;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 4723712 */
|
||||
src: url('iconfont.woff2?t=1734337029245') format('woff2'),
|
||||
url('iconfont.woff?t=1734337029245') format('woff'),
|
||||
url('iconfont.ttf?t=1734337029245') format('truetype');
|
||||
src: url('iconfont.woff2?t=1733880548695') format('woff2'),
|
||||
url('iconfont.woff?t=1733880548695') format('woff'),
|
||||
url('iconfont.ttf?t=1733880548695') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
@ -13,10 +13,6 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-yinle:before {
|
||||
content: "\e6c9";
|
||||
}
|
||||
|
||||
.icon-yuyin:before {
|
||||
content: "\e648";
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,13 +5,6 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "11819186",
|
||||
"name": "音乐",
|
||||
"font_class": "yinle",
|
||||
"unicode": "e6c9",
|
||||
"unicode_decimal": 59081
|
||||
},
|
||||
{
|
||||
"icon_id": "6338162",
|
||||
"name": "语音生成",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -41,7 +41,6 @@ const getFileTypeIcon = () => {
|
|||
airobot: 'icon-jiqirenfushi', // 数字人生成
|
||||
aiimg: 'icon-xiangmuicon_maobishufa', // 文生图片
|
||||
aidraw: 'icon-meishu-F', // 文生连环画
|
||||
aiyinyue: 'icon-yinle' //文生音乐
|
||||
}
|
||||
if (iconObj[name]) {
|
||||
return '#' + iconObj[name]
|
||||
|
|
|
@ -392,9 +392,9 @@ onMounted(() => {
|
|||
let data = sessionStore.get('subject.curNode')
|
||||
Object.assign(curNode, data);
|
||||
modeType.value = props.type == 1 ? '课标' : props.type == 2 ? '教材' : '考试'
|
||||
|
||||
getTemplateList()
|
||||
let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}`
|
||||
|
||||
params.dataset_id = dataSetJson[jsonKey]
|
||||
})
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<el-popover ref="popoverRef" placement="right" trigger="hover" popper-class="popoverStyle" :tabindex="999" >
|
||||
<template #reference>
|
||||
<div class="user-info">
|
||||
<el-image class="user-img" :src="userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api + userStore.user.avatar" />
|
||||
<el-image class="user-img" :src="userStore.user.avatar ==='/img/avatar-default.jpg' ? defaultUserImg : dev_api + userStore.user.avatar" />
|
||||
<span>{{ userStore.user.nickName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -65,6 +65,7 @@ import defaultUserImg from '@/assets/images/img-avatar.png'
|
|||
const { ipcRenderer } = window.electron || {}
|
||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
||||
const userStore = useUserStore()
|
||||
console.log(userStore)
|
||||
const router = useRouter()
|
||||
const currentRoute = ref('')
|
||||
const activeId = ref('/home')
|
||||
|
|
|
@ -396,12 +396,5 @@ export const dataSetJson = {
|
|||
"课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
|
||||
"课标-高中-地理": "270516829fd111efb13c0242ac140006",
|
||||
"课标-高中-政治": "a2f0b247b85d11ef84290242ac140005",
|
||||
"教材-高中-语文": "cee3062a9fcf11efa6910242ac140006",
|
||||
"教材-高中-生物": "fb5d01d59fd011ef9bb90242ac140006",
|
||||
"教材-高中-历史": "f2f6c1fb9fd011ef98740242ac140006",
|
||||
"教材-高中-英语": "e889fcac9fd011efb22a0242ac140006",
|
||||
"教材-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
|
||||
"教材-高中-地理": "270516829fd111efb13c0242ac140006",
|
||||
"教材-高中-政治": "a2f0b247b85d11ef84290242ac140005",
|
||||
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
|
||||
}
|
|
@ -422,19 +422,6 @@ export const toLinkWeb = (path) => {
|
|||
cookieData: { ...config }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 外部跳转-web网页
|
||||
* @param {*} url
|
||||
*/
|
||||
export const toLinkLeftWeb = (url) => {
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
key: `win-${Date.now()}`,
|
||||
fullPath: url
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 外部跳转-web网页
|
||||
* @param {*} path
|
||||
|
|
|
@ -90,7 +90,7 @@ import { dataSetJson } from '@/utils/comm' // 数据集id文生图
|
|||
import { sessionStore } from '@/utils/store'
|
||||
import {listEntpcourse} from "@/api/teaching/classwork";
|
||||
import {addEntpcoursefileReturnId, getEntpcoursefile} from "@/api/education/entpcoursefile";
|
||||
import {createWindow, toLinkLeftWeb} from "@/utils/tool";
|
||||
import {createWindow, ipcMsgSend} from "@/utils/tool";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {PPTXFileToJson} from "@/AixPPTist/src/hooks/useImport";
|
||||
import * as API_entpcoursefile from "@/api/education/entpcoursefile";
|
||||
|
@ -161,11 +161,6 @@ const tools = reactive([{
|
|||
name: '视频生成',
|
||||
path: '',
|
||||
img: 'aivideo'
|
||||
},{
|
||||
name: '音乐生成',
|
||||
path: 'https://ai.ysaix.com:7845/',
|
||||
type: 'link',
|
||||
img: 'aiyinyue'
|
||||
}])
|
||||
|
||||
const uploadData = ref({
|
||||
|
@ -178,11 +173,6 @@ const uploadData = ref({
|
|||
const currentFileList = ref([])
|
||||
|
||||
const gotoRoute = (item) => {
|
||||
if (item.type === 'link') {
|
||||
//link方式
|
||||
toLinkLeftWeb(item.path);
|
||||
return
|
||||
}
|
||||
if (item.path) {
|
||||
if (item.path === '/model/aiKolors') {
|
||||
gotoAiKolors(item.path)
|
||||
|
|
|
@ -33,7 +33,7 @@ const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
|||
|
||||
//图片裁剪数据
|
||||
const options = reactive({
|
||||
img: userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api.value + userStore.user.avatar, // 裁剪图片的地址
|
||||
img: userStore.user.avatar ==='/img/avatar-default.jpg' ? defaultUserImg : dev_api.value + userStore.user.avatar, // 裁剪图片的地址
|
||||
autoCrop: true, // 是否默认生成截图框
|
||||
autoCropWidth: 400, // 默认生成截图框宽度
|
||||
autoCropHeight: 400, // 默认生成截图框高度
|
||||
|
@ -69,7 +69,7 @@ function uploadImg(data) {
|
|||
|
||||
/** 关闭窗口 */
|
||||
function closeDialog() {
|
||||
options.img = userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api.value + userStore.user.avatar
|
||||
options.img = userStore.user.avatar ==='/img/avatar-default.jpg' ? defaultUserImg : dev_api.value + userStore.user.avatar
|
||||
options.visible = false
|
||||
}
|
||||
const cancle = () => {
|
||||
|
|
|
@ -85,7 +85,7 @@ const saveAdd = async () => {
|
|||
try {
|
||||
// 系统预设模板 copy一份
|
||||
const { msg } = await addKeyWords({ name: form.name, id })
|
||||
emitter.emit('onGetMain', props.item)
|
||||
emitter.emit('onGetMain')
|
||||
ElMessage.success(msg)
|
||||
mode.value = false
|
||||
} finally {
|
||||
|
|
|
@ -3,26 +3,26 @@
|
|||
<div class="left-header flex">教学模式</div>
|
||||
<div class="left-con" v-loading="loading">
|
||||
<el-empty v-if="!(tempList.length)" description="暂无数据" />
|
||||
<div class="con-item" v-for="item in tempList" :key="item.id" :class=" actId == item.id ? 'item-act' : ''">
|
||||
<div class="con-item" v-for="item in tempList" :key="item.id">
|
||||
<div class="item-header flex">
|
||||
<span>{{ item.name }}</span>
|
||||
<el-button type="primary" link @click="onSelect(item)">选择模式</el-button>
|
||||
</div>
|
||||
<div class="content-list">
|
||||
<div class="item-list flex" >
|
||||
<el-card class="item-card" shadow="never" v-for="el in item.child" :key="el.id">
|
||||
<p class="card-name">
|
||||
<el-text line-clamp="1" :title="el.name">
|
||||
{{ el.name }}
|
||||
</el-text>
|
||||
</p>
|
||||
<div class="card-text">
|
||||
<el-text line-clamp="4" :title="el.prompt">
|
||||
{{ el.prompt }}
|
||||
</el-text>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="item-list flex">
|
||||
<el-card class="item-card" shadow="never" v-for="el in item.child" :key="el.id">
|
||||
<p class="card-name">
|
||||
<el-text line-clamp="1" :title="el.name">
|
||||
{{ el.name }}
|
||||
</el-text>
|
||||
</p>
|
||||
<div class="card-text">
|
||||
<el-text line-clamp="4" :title="el.prompt">
|
||||
{{ el.prompt }}
|
||||
</el-text>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -49,7 +49,6 @@ const getTemplate = async (id) => {
|
|||
}
|
||||
|
||||
// 获取子模板
|
||||
const actId = ref('')
|
||||
const loading = ref(false)
|
||||
const tempList = ref([])
|
||||
const getChildTemp = async (parentId) => {
|
||||
|
@ -66,7 +65,6 @@ const getChildTemp = async (parentId) => {
|
|||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
actId.value = tempList.value[0].id
|
||||
}
|
||||
if(parentId){
|
||||
const item = tempList.value.find(item => item.id == parentId)
|
||||
|
@ -92,7 +90,6 @@ emitter.on('onGetMain', (item) => {
|
|||
// 选择模板
|
||||
const emit = defineEmits([''])
|
||||
const onSelect = (item) =>{
|
||||
actId.value = item.id
|
||||
emitter.emit('changeMode', item)
|
||||
}
|
||||
|
||||
|
@ -101,6 +98,8 @@ const curNode = reactive({})
|
|||
onMounted(() => {
|
||||
let data = sessionStore.get('subject.curNode')
|
||||
Object.assign(curNode, data);
|
||||
|
||||
|
||||
getTemplate()
|
||||
})
|
||||
|
||||
|
@ -144,16 +143,10 @@ onUnmounted(() => {
|
|||
.con-item {
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
flex-direction: column
|
||||
}
|
||||
.item-list{
|
||||
|
||||
padding: 10px;
|
||||
}
|
||||
.item-act{
|
||||
border: solid 1px #409eff;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.item-card {
|
||||
width: 130px;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<el-button type="danger" @click="pptDialog = true">生成PPT</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-con flex" ref="listRef">
|
||||
<div class="right-con flex">
|
||||
<el-empty v-if="!(resultList.length)" description="暂无数据" />
|
||||
<div class="con-item flex" v-for="(item, index) in resultList" :key="item.id" v-loading="item.loading">
|
||||
<div class="item-top flex">
|
||||
|
@ -30,12 +30,14 @@
|
|||
<el-button type="primary" link @click="removeItem(item, true)">移除</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
<!-- <el-button type="info" link>
|
||||
<i class="iconfont icon-xiazai9"></i>
|
||||
</el-button> -->
|
||||
</div>
|
||||
<div class="item-bom">
|
||||
<div class="item-prompt">{{ item.prompt }}</div>
|
||||
<div class="item-answer" v-if="item.answer">
|
||||
<div class="answer-text">
|
||||
<TypingEffect v-if="isStarted[index]" :text="item.answer" :delay="10" :aiShow="item.aiShow" @complete="handleCompleteText($event,index)" @updateScroll="scrollToBottom($event,index)" />
|
||||
<div class="answer-text" v-html="item.answer">
|
||||
</div>
|
||||
<div class="item-btn flex">
|
||||
<el-button type="primary" link @click="againResult(index, item)">
|
||||
|
@ -66,19 +68,18 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, reactive, nextTick } from 'vue'
|
||||
import { ref, onMounted, onUnmounted, reactive } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import emitter from '@/utils/mitt'
|
||||
import EditDialog from './edit-dialog.vue'
|
||||
import AdjustDialog from './adjust-dialog.vue'
|
||||
import progressDialog from './progress-dialog.vue'
|
||||
import { completion, tempResult, tempSave, removeChildTemp, editTempResult } from '@/api/mode/index.js'
|
||||
import { completion, tempResult, tempSave, removeChildTemp } from '@/api/mode/index.js'
|
||||
// import { dataSetJson } from '@/utils/comm.js'
|
||||
import * as commUtils from '@/utils/comm.js'
|
||||
import PptDialog from '@/views/prepare/container/pptist-dialog.vue'
|
||||
import keywordDialog from './keyword-dialog.vue'
|
||||
import TypingEffect from '@/components/typing-effect/index.vue'
|
||||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import {PPTXFileToJson} from '@/AixPPTist/src/hooks/useImport' // ppt转json
|
||||
|
@ -118,19 +119,11 @@ emitter.on('changeMode', (item) => {
|
|||
|
||||
// 一键研读
|
||||
const getCompletion = async () => {
|
||||
isStarted.value = new Array(resultList.length).fill(false)
|
||||
isStarted.value[0] = true
|
||||
|
||||
resultList.value.forEach(item =>{
|
||||
if(item.answer){
|
||||
item.answer = ''
|
||||
}
|
||||
})
|
||||
for (let item of resultList.value) {
|
||||
|
||||
console.log(item)
|
||||
try {
|
||||
item.loading = true
|
||||
item.aiShow = true
|
||||
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject} 对${curNode.itemtitle}进行教学分析`
|
||||
const { data } = await completion(params)
|
||||
item.answer = getResult(data.answer)
|
||||
|
@ -141,19 +134,6 @@ const getCompletion = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
const handleCompleteText = async (answer, index) =>{
|
||||
if (index < resultList.value.length - 1) {
|
||||
isStarted.value[index + 1] = true; // 开始显示下一个文本
|
||||
}
|
||||
if(isAgain.value){
|
||||
try{
|
||||
await editTempResult({ id: resultList.value[index].resultId, content: answer })
|
||||
}finally{
|
||||
isAgain.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 保存模板
|
||||
const onSaveTemp = (item) => {
|
||||
if (item.answer == '') return
|
||||
|
@ -213,49 +193,24 @@ const removeItem = async (item, isChild) => {
|
|||
// editKeyWord(item, !isChild)
|
||||
}
|
||||
}
|
||||
const listRef = ref()
|
||||
|
||||
// 查询模板结果
|
||||
const isStarted = ref([]);
|
||||
const getTempResult = (id) => {
|
||||
tempResult({ mainModelId: id }).then(res => {
|
||||
let rows = res.rows
|
||||
if (rows.length > 0) {
|
||||
isStarted.value = new Array(rows.length).fill(true)
|
||||
resultList.value.forEach(item => {
|
||||
rows.forEach(el => {
|
||||
if (item.id == el.modelId) {
|
||||
item.answer = getResult(el.content)
|
||||
item.resultId = el.id
|
||||
item.answer = el.content
|
||||
item.reultId = el.id
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
const scrollToBottom = (height,index) =>{
|
||||
|
||||
if (listRef.value) {
|
||||
let sum = 0
|
||||
let listDom = listRef.value.children
|
||||
|
||||
if(index == 0){
|
||||
// 220 去掉头部
|
||||
let screenHeight = window.innerHeight - 220
|
||||
if(height > screenHeight){
|
||||
listRef.value.scrollTop = (height - screenHeight + 50)
|
||||
}
|
||||
}
|
||||
else{
|
||||
for(let i = 0; i < index; i++){
|
||||
sum += listDom[i].clientHeight
|
||||
}
|
||||
listRef.value.scrollTop = sum + height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 去掉字符串中的 ### **
|
||||
let getResult = (str) => {
|
||||
let newStr = str.replace(/#+|(\*\*)/g, '');
|
||||
|
@ -327,32 +282,17 @@ const curIndex = ref(-1)
|
|||
const curItem = reactive({})
|
||||
|
||||
// 重新生成
|
||||
const isAgain = ref(false)
|
||||
const againResult = async (index, item) => {
|
||||
isAgain.value = true
|
||||
isStarted.value[index] = false
|
||||
resultList.value[index].answer = ''
|
||||
if(index == 0){
|
||||
listRef.value.scrollTop = 0
|
||||
|
||||
}else{
|
||||
scrollToBottom(50, index)
|
||||
}
|
||||
|
||||
try {
|
||||
await nextTick()
|
||||
resultList.value[index].loading = true
|
||||
item.aiShow = true
|
||||
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}课标对${curNode.itemtitle}进行教学分析`
|
||||
const { data } = await completion(params)
|
||||
resultList.value[index].answer = getResult(data.answer)
|
||||
isStarted.value[index] = true
|
||||
resultList.value[index].answer = data.answer
|
||||
} finally {
|
||||
resultList.value[index].loading = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 对话调整
|
||||
const isAdjust = ref(false)
|
||||
const onAdjust = (index, item) => {
|
||||
|
@ -567,12 +507,6 @@ onUnmounted(() => {
|
|||
left: -1px;
|
||||
top: 5px;
|
||||
}
|
||||
&:last-child{
|
||||
&::before{
|
||||
content: '';
|
||||
width: 0
|
||||
}
|
||||
}
|
||||
.item-top {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
|
Loading…
Reference in New Issue