Compare commits
No commits in common. "79839458f0fde146ee15c6d5b82c593bcd78fee8" and "f9efb76282eb405c7972a6fe6ee80cd5920b6b16" have entirely different histories.
79839458f0
...
f9efb76282
|
@ -33,7 +33,6 @@ export default defineConfig({
|
||||||
proxy: {
|
proxy: {
|
||||||
'/dev-api': {
|
'/dev-api': {
|
||||||
target: 'http://27.128.240.72:7865',
|
target: 'http://27.128.240.72:7865',
|
||||||
// target: 'https://prev.ysaix.com:7868/prod-api/',
|
|
||||||
// target: 'http://36.134.181.164:7863',
|
// target: 'http://36.134.181.164:7863',
|
||||||
// target: 'http://192.168.0.102:7865',
|
// target: 'http://192.168.0.102:7865',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
|
|
@ -28,8 +28,8 @@ import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||||
import { PPTApi } from './api'
|
import { PPTApi } from './api'
|
||||||
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||||
|
// import './api/watcher' // 监听
|
||||||
import watcher from './api/watcher' // 监听
|
import watcher from './api/watcher' // 监听
|
||||||
import emitter from '@/utils/mitt' //mitt 事件总线
|
|
||||||
watcher() // 监听启动
|
watcher() // 监听启动
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const _isPC = isPC()
|
const _isPC = isPC()
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||||
import * as useStore from '../store' // pptist-状态管理
|
import * as useStore from '../store' // pptist-状态管理
|
||||||
import ChatWs from '@/plugins/socket' // 聊天socket
|
import ChatWs from '@/plugins/socket' // 聊天socket
|
||||||
import msgUtils from '@/plugins/modal' // 消息工具
|
import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
|
import * as Fullscreen from '../utils/fullscreen' // 全屏
|
||||||
import useExecPlay from '../views/Screen/hooks/useExecPlay' // 播放控制
|
import useExecPlay from '../views/Screen/hooks/useExecPlay' // 播放控制
|
||||||
|
|
||||||
const slidesStore = useStore.useSlidesStore() // 幻灯片-状态管理
|
const slidesStore = useStore.useSlidesStore() // 幻灯片-状态管理
|
||||||
|
@ -30,9 +31,10 @@ export class Classcourse {
|
||||||
console.log('classcourse-load', classcourse)
|
console.log('classcourse-load', classcourse)
|
||||||
// 打开全屏
|
// 打开全屏
|
||||||
const isCourse = !!classcourse
|
const isCourse = !!classcourse
|
||||||
|
if (isCourse) Fullscreen.enterFullscreen()
|
||||||
screenStore.setScreening(isCourse)
|
screenStore.setScreening(isCourse)
|
||||||
// 如果课堂信息有值,则连接socket
|
// 如果课堂信息有值,则连接socket
|
||||||
if (isCourse) {
|
if (!!classcourse) {
|
||||||
// 连接socket
|
// 连接socket
|
||||||
if (!ChatWs.ws) ChatWs.init()
|
if (!ChatWs.ws) ChatWs.init()
|
||||||
ChatWs.id = classcourse.timgroupid // 群组id
|
ChatWs.id = classcourse.timgroupid // 群组id
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* @author zdg
|
* @author zdg
|
||||||
* @date 2024-11-26
|
* @date 2024-11-26
|
||||||
*/
|
*/
|
||||||
import { toRaw, nextTick } from 'vue'
|
import { toRaw } from 'vue'
|
||||||
import type { Result } from './types' // 接口类型
|
import type { Result } from './types' // 接口类型
|
||||||
import msgUtils from '@/plugins/modal' // 消息工具
|
import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||||
|
@ -12,8 +12,7 @@ import * as useStore from '../store' // pptist-状态管理
|
||||||
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||||
import useUserStore from '@/store/modules/user' // 外部-用户信息
|
import useUserStore from '@/store/modules/user' // 外部-用户信息
|
||||||
import * as Api_server from '@/api/apiService' // 相关api
|
import * as Api_server from '@/api/apiService' // 相关api
|
||||||
import * as commUtils from '@/utils/comm.js' // 工具
|
import * as commUtils from '@/utils/comm.js'
|
||||||
import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库
|
|
||||||
const slidesStore = useStore.useSlidesStore()
|
const slidesStore = useStore.useSlidesStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
@ -134,9 +133,6 @@ export class PPTApi {
|
||||||
|
|
||||||
const currentSlide = toRaw(slidesStore.currentSlide)
|
const currentSlide = toRaw(slidesStore.currentSlide)
|
||||||
const isAdd = !/^\d+$/.test(currentSlide.id) // 是否新增
|
const isAdd = !/^\d+$/.test(currentSlide.id) // 是否新增
|
||||||
const currInd = toRaw(slidesStore.slideIndex) // 当前页索引-new
|
|
||||||
const oldInd = oldData.findIndex(o => o.id == currentSlide.id) // 当前页索引-old
|
|
||||||
const isBatch = oldVal && oldVal.length && currInd != oldInd // 是否批量更新-排序
|
|
||||||
if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片)
|
if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片)
|
||||||
const bool = await this.addSlide(currentSlide)
|
const bool = await this.addSlide(currentSlide)
|
||||||
bool && await this.batchUpdateSlides(newData, true) // 批量更新-排序
|
bool && await this.batchUpdateSlides(newData, true) // 批量更新-排序
|
||||||
|
@ -144,9 +140,6 @@ export class PPTApi {
|
||||||
await PPTApi.getSlideList(resource.id)
|
await PPTApi.getSlideList(resource.id)
|
||||||
} else { // 防抖-更新
|
} else { // 防抖-更新
|
||||||
if (!this.isUpdate) return this.isUpdate = true // 下次更新数据
|
if (!this.isUpdate) return this.isUpdate = true // 下次更新数据
|
||||||
if (isBatch) { // 批量更新-排序
|
|
||||||
this.batchUpdateSlides(newData, true)
|
|
||||||
} else { // 更新当前页幻灯片
|
|
||||||
const params = {
|
const params = {
|
||||||
id: currentSlide.id,
|
id: currentSlide.id,
|
||||||
datacontent: JSON.stringify(currentSlide),
|
datacontent: JSON.stringify(currentSlide),
|
||||||
|
@ -154,12 +147,9 @@ export class PPTApi {
|
||||||
Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2)
|
Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// 更新幻灯片
|
// 更新幻灯片
|
||||||
static updateSlide(data: object): Promise<Boolean> {
|
static updateSlide(data: object): Promise<Boolean> {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
const thumUrl = await this.getSlideThumUrl()
|
|
||||||
data.base64Code = thumUrl // 更新缩略图
|
|
||||||
const res: Result = await API_entpcoursefile.updateEntpcoursefileNew(data)
|
const res: Result = await API_entpcoursefile.updateEntpcoursefileNew(data)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
resolve(true)
|
resolve(true)
|
||||||
|
@ -202,18 +192,7 @@ export class PPTApi {
|
||||||
else msgUtils.msgError(res.msg || '更新失败');return false
|
else msgUtils.msgError(res.msg || '更新失败');return false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// thumbnail-slide thumbnail 缩略图
|
|
||||||
static getSlideThumUrl(): Promise<Boolean> {
|
|
||||||
return nextTick().then(async() => {
|
|
||||||
const slideIndex = slidesStore.slideIndex
|
|
||||||
const elements = document.querySelectorAll('.thumbnail-slide')
|
|
||||||
if (elements.length && slideIndex >= 0) {
|
|
||||||
const element = elements[slideIndex]
|
|
||||||
return await toPng(element)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 图片|音频|视频 转换为在线地址
|
// 图片|音频|视频 转换为在线地址
|
||||||
static toRousrceUrl =async (o:any) => {
|
static toRousrceUrl =async (o:any) => {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
|
@ -224,6 +203,7 @@ export class PPTApi {
|
||||||
url &&(o.src = url)
|
url &&(o.src = url)
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,8 @@ export default () => {
|
||||||
case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页
|
case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页
|
||||||
const slideIndex = content?.current || 0
|
const slideIndex = content?.current || 0
|
||||||
const type = content?.animation
|
const type = content?.animation
|
||||||
if (type === 'Nextsteps') emitter.emit('useExecPlay', 'execNext') // 下一步
|
if (type === 'Nextsteps') execPlay.execNext() // 下一步
|
||||||
else if (type === 'Previoustep') emitter.emit('useExecPlay', 'turnPrevSlide') // 上一步清空-动画
|
else if (type === 'Previoustep') execPlay.execPrev() // 上一步
|
||||||
else slidesStore.updateSlideIndex(slideIndex) // 更新幻灯片下标
|
else slidesStore.updateSlideIndex(slideIndex) // 更新幻灯片下标
|
||||||
break
|
break
|
||||||
case MsgEnum.HEADS.MSG_homework: // 作业|活动-布置
|
case MsgEnum.HEADS.MSG_homework: // 作业|活动-布置
|
||||||
|
|
|
@ -151,9 +151,9 @@ export const useSlidesStore = defineStore('slides', {
|
||||||
for (const slide of slides) {
|
for (const slide of slides) {
|
||||||
if (slide.sectionTag) delete slide.sectionTag
|
if (slide.sectionTag) delete slide.sectionTag
|
||||||
}
|
}
|
||||||
const addIndex = this.slideIndex + 1
|
// const addIndex = this.slideIndex + 1
|
||||||
this.slides.splice(addIndex, 0, ...slides)
|
this.slides.splice(this.slideIndex, 0, ...slides)
|
||||||
this.slideIndex = addIndex
|
// this.slideIndex = addIndex
|
||||||
},
|
},
|
||||||
updateSlide(props: Partial<Slide>, slideId?: string) {
|
updateSlide(props: Partial<Slide>, slideId?: string) {
|
||||||
const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex
|
const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex
|
||||||
|
|
|
@ -45,9 +45,9 @@
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<!-- // 推送作业 -->
|
<!-- // 推送作业 -->
|
||||||
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="85%" height="500">
|
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="90%" height="500">
|
||||||
<el-scrollbar>
|
<el-scrollbar height="550">
|
||||||
<div style="height: 75vh;">
|
<div style="height: 550px;">
|
||||||
<NewClassTsakAssign :currentCourse='currentCourse' @getData="getData" />
|
<NewClassTsakAssign :currentCourse='currentCourse' @getData="getData" />
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
@ -335,9 +335,8 @@ onMounted(() => {
|
||||||
objItem.value = workItem.value[slideIndex.value]
|
objItem.value = workItem.value[slideIndex.value]
|
||||||
getCurrentPPtData()
|
getCurrentPPtData()
|
||||||
})
|
})
|
||||||
watch(() => [workItem.value.length,workItem.value[slideIndex.value]?.id], (newVal,oldVal) => {
|
watch(() => [workItem.value.length,slideIndex.value], (newVal,oldVal) => {
|
||||||
if(!objectsAreEqual(newVal,oldVal))
|
if(!objectsAreEqual(newVal,oldVal))
|
||||||
if(workItem.value[slideIndex.value])
|
|
||||||
getCurrentPPtData()
|
getCurrentPPtData()
|
||||||
})
|
})
|
||||||
// watch(() => workItem.value.length, () => {
|
// watch(() => workItem.value.length, () => {
|
||||||
|
|
|
@ -100,6 +100,7 @@ const {
|
||||||
execNext,
|
execNext,
|
||||||
animationIndex,
|
animationIndex,
|
||||||
} = useExecPlay()
|
} = useExecPlay()
|
||||||
|
|
||||||
const { slideWidth, slideHeight } = useSlideSize()
|
const { slideWidth, slideHeight } = useSlideSize()
|
||||||
const { exitScreening } = useScreening()
|
const { exitScreening } = useScreening()
|
||||||
const { fullscreenState, manualExitFullscreen } = useFullscreen()
|
const { fullscreenState, manualExitFullscreen } = useFullscreen()
|
||||||
|
@ -196,37 +197,6 @@ const contextmenus = (): ContextmenuItem[] => {
|
||||||
emitter.on('upvoteTrigger', (type) => {
|
emitter.on('upvoteTrigger', (type) => {
|
||||||
upvoteRef.value?.trigger(type)
|
upvoteRef.value?.trigger(type)
|
||||||
});
|
});
|
||||||
// zdg: 使用方法才生效
|
|
||||||
const execPlay = {
|
|
||||||
autoPlayTimer,
|
|
||||||
autoPlay,
|
|
||||||
closeAutoPlay,
|
|
||||||
autoPlayInterval,
|
|
||||||
setAutoPlayInterval,
|
|
||||||
loopPlay,
|
|
||||||
setLoopPlay,
|
|
||||||
mousewheelListener,
|
|
||||||
touchStartListener,
|
|
||||||
touchEndListener,
|
|
||||||
turnPrevSlide,
|
|
||||||
turnNextSlide,
|
|
||||||
turnSlideToIndex,
|
|
||||||
turnSlideToId,
|
|
||||||
execPrev,
|
|
||||||
execNext,
|
|
||||||
animationIndex,
|
|
||||||
}
|
|
||||||
emitter.on('useExecPlay', (data: string|any) => {
|
|
||||||
if (!data) throw new Error('参数错误')
|
|
||||||
if (typeof data === 'string') { // 字符串
|
|
||||||
if (execPlay[data]) execPlay[data]()
|
|
||||||
else throw new Error('方法不存在')
|
|
||||||
} else { // 对象
|
|
||||||
const { method, ...params } = data || {}
|
|
||||||
if (execPlay[method]) execPlay[method](...params)
|
|
||||||
else throw new Error('方法不存在')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -174,8 +174,9 @@ export default () => {
|
||||||
|
|
||||||
// 鼠标滚动翻页
|
// 鼠标滚动翻页
|
||||||
const mousewheelListener = throttle(function(e: WheelEvent) {
|
const mousewheelListener = throttle(function(e: WheelEvent) {
|
||||||
if (e.deltaY < 0) turning(e, 'prev')
|
e.preventDefault() // 阻止默认事件
|
||||||
else if (e.deltaY > 0) turning(e, 'next')
|
if (e.deltaY < 0) execPrev()
|
||||||
|
else if (e.deltaY > 0) execNext()
|
||||||
}, 500, { leading: true, trailing: false })
|
}, 500, { leading: true, trailing: false })
|
||||||
|
|
||||||
// 触摸屏上下滑动翻页
|
// 触摸屏上下滑动翻页
|
||||||
|
@ -196,28 +197,24 @@ export default () => {
|
||||||
const offsetY = e.changedTouches[0].clientY - touchInfo.value.y
|
const offsetY = e.changedTouches[0].clientY - touchInfo.value.y
|
||||||
if ( Math.abs(offsetY) > offsetX && Math.abs(offsetY) > 50 ) {
|
if ( Math.abs(offsetY) > offsetX && Math.abs(offsetY) > 50 ) {
|
||||||
touchInfo.value = null
|
touchInfo.value = null
|
||||||
if (offsetY > 0) turning(e, 'prev')
|
if (offsetY > 0) execPrev()
|
||||||
else turning(e, 'next')
|
else execNext()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 向上翻页/向下翻页
|
|
||||||
const turning = (e, type) => {
|
|
||||||
e.preventDefault() // 阻止默认事件
|
|
||||||
if (type === 'prev') execPrev()
|
|
||||||
else if (type === 'next') execNext()
|
|
||||||
}
|
|
||||||
// 快捷键翻页
|
// 快捷键翻页
|
||||||
const keydownListener = (e: KeyboardEvent) => {
|
const keydownListener = (e: KeyboardEvent) => {
|
||||||
|
e.preventDefault() // 阻止默认事件
|
||||||
const key = e.key.toUpperCase()
|
const key = e.key.toUpperCase()
|
||||||
|
|
||||||
if (key === KEYS.UP || key === KEYS.LEFT || key === KEYS.PAGEUP) turning(e, 'prev')
|
if (key === KEYS.UP || key === KEYS.LEFT || key === KEYS.PAGEUP) execPrev()
|
||||||
else if (
|
else if (
|
||||||
key === KEYS.DOWN ||
|
key === KEYS.DOWN ||
|
||||||
key === KEYS.RIGHT ||
|
key === KEYS.RIGHT ||
|
||||||
key === KEYS.SPACE ||
|
key === KEYS.SPACE ||
|
||||||
key === KEYS.ENTER ||
|
key === KEYS.ENTER ||
|
||||||
key === KEYS.PAGEDOWN
|
key === KEYS.PAGEDOWN
|
||||||
) turning(e, 'next')
|
) execNext()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => document.addEventListener('keydown', keydownListener))
|
onMounted(() => document.addEventListener('keydown', keydownListener))
|
||||||
|
|
|
@ -40,7 +40,7 @@ const props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1
|
default: 1
|
||||||
},
|
},
|
||||||
item: { // 当前操作的模板
|
item: { // 子模板
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return { ex3: '' }
|
return { ex3: '' }
|
||||||
|
@ -73,25 +73,23 @@ const loading = ref(false)
|
||||||
const saveAdd = async () => {
|
const saveAdd = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
if (props.item.ex3 == '1') {
|
if (props.item.ex3 == '1') {
|
||||||
let id; // id 为主模板id
|
|
||||||
if (props.item.isAdd) {
|
if (props.item.isAdd) {
|
||||||
id = props.item.id
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// 编辑状态下 item 为子模板 主模板则是item.parentId
|
|
||||||
id = props.item.parentId
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// 系统预设模板 copy一份
|
// 系统预设模板 copy一份
|
||||||
const { msg } = await addKeyWords({ name: form.name, id })
|
const { msg } = await addKeyWords({ name: form.name, id: props.item.id })
|
||||||
emitter.emit('onGetMain')
|
emitter.emit('onGetMain')
|
||||||
ElMessage.success(msg)
|
ElMessage.success(msg)
|
||||||
mode.value = false
|
mode.value = false
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
onAddChildTemp(props.item.parentId)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (props.item.isAdd) {
|
if (props.item.isAdd) {
|
||||||
onAddChildTemp(props.item.id)
|
onAddChildTemp(props.item.id)
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick, reactive } from 'vue'
|
import { ref, onMounted, nextTick } from 'vue'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import PDF from '@/components/PdfJs/index.vue'
|
import PDF from '@/components/PdfJs/index.vue'
|
||||||
import LeftDialog from './left-dialog.vue'
|
import LeftDialog from './left-dialog.vue'
|
||||||
|
|
||||||
const props = defineProps(['type'])
|
const props = defineProps(['curNode', 'type'])
|
||||||
|
|
||||||
const showDialog = ref(false)
|
const showDialog = ref(false)
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
|
@ -31,13 +31,8 @@ const onClick = () => {
|
||||||
|
|
||||||
// 加载PDF
|
// 加载PDF
|
||||||
const pdfUrl = ref('')
|
const pdfUrl = ref('')
|
||||||
const curNode = reactive({})
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await nextTick()
|
await nextTick()
|
||||||
// 当前节点
|
|
||||||
let nodeData = sessionStore.get('subject.curNode')
|
|
||||||
Object.assign(curNode, nodeData);
|
|
||||||
|
|
||||||
let data = sessionStore.get('subject.curBook')
|
let data = sessionStore.get('subject.curBook')
|
||||||
let fileurl = data.fileurl
|
let fileurl = data.fileurl
|
||||||
if(props.type == 1){
|
if(props.type == 1){
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, onUnmounted, nextTick } from 'vue'
|
import { ref, reactive, onMounted, watch, onUnmounted, nextTick } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { tempSave, completion, modelList, removeChildTemp, tempResult, editTempResult } from '@/api/mode/index'
|
import { tempSave, completion, modelList, removeChildTemp, tempResult, editTempResult } from '@/api/mode/index'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
|
@ -95,7 +95,7 @@ import useUserStore from '@/store/modules/user'
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
import { dataSetJson } from '@/utils/comm.js'
|
import { dataSetJson } from '@/utils/comm.js'
|
||||||
|
|
||||||
const props = defineProps(['type'])
|
const props = defineProps(['curNode', 'type'])
|
||||||
const { user } = useUserStore()
|
const { user } = useUserStore()
|
||||||
|
|
||||||
/*****************提示词相关****************/
|
/*****************提示词相关****************/
|
||||||
|
@ -270,6 +270,21 @@ const onEdit = (index, item) => {
|
||||||
isEdit.value = true
|
isEdit.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const modeType = ref('课标')
|
||||||
|
watch(() => props.type, (newVal) => {
|
||||||
|
if (newVal == 1) {
|
||||||
|
modeType.value = '课标'
|
||||||
|
}
|
||||||
|
if (newVal == 2) {
|
||||||
|
modeType.value = '教材'
|
||||||
|
}
|
||||||
|
if (newVal == 3) {
|
||||||
|
modeType.value = '考试'
|
||||||
|
}
|
||||||
|
|
||||||
|
}, { immediate: false })
|
||||||
|
|
||||||
// 重新研读
|
// 重新研读
|
||||||
const params = reactive(
|
const params = reactive(
|
||||||
{
|
{
|
||||||
|
@ -387,14 +402,11 @@ emitter.on('onGetMain', () => {
|
||||||
|
|
||||||
|
|
||||||
const curNode = reactive({})
|
const curNode = reactive({})
|
||||||
const modeType = ref('')
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let data = sessionStore.get('subject.curNode')
|
let data = sessionStore.get('subject.curNode')
|
||||||
Object.assign(curNode, data);
|
Object.assign(curNode, data);
|
||||||
modeType.value = props.type == 1 ? '课标' : props.type == 2 ? '教材' : '考试'
|
|
||||||
getTemplateList()
|
getTemplateList()
|
||||||
let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}`
|
let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}`
|
||||||
|
|
||||||
params.dataset_id = dataSetJson[jsonKey]
|
params.dataset_id = dataSetJson[jsonKey]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,18 @@
|
||||||
<div class="page-template flex">
|
<div class="page-template flex">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<Left :type="type" />
|
<Left :curNode="curNode" :type="type" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<Right :type="type" />
|
<Right :curNode="curNode" :type="type" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { reactive, onMounted } from 'vue'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
import Left from './container/left.vue'
|
import Left from './container/left.vue'
|
||||||
import Right from './container/right.vue'
|
import Right from './container/right.vue'
|
||||||
|
|
||||||
|
@ -21,6 +23,13 @@ const props = defineProps({
|
||||||
default: 1
|
default: 1
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const curNode = reactive({})
|
||||||
|
onMounted(() =>{
|
||||||
|
let data = sessionStore.get('subject.curNode')
|
||||||
|
Object.assign(curNode, data);
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div style="font-size: 18px; display: flex; flex-wrap: nowrap">
|
<div style="font-size: 18px; display: flex; flex-wrap: nowrap">
|
||||||
<div style="flex: 1">
|
<div style="flex: 1">
|
||||||
{{ classWorkAnalysis.title }}完成情况
|
{{ classWorkAnalysis.title }}完成情况
|
||||||
<el-tag :type="classWorkAnalysis.workclass||'info'" size="large" style="height: 25px">{{
|
<el-tag :type="classWorkAnalysis.workclass" size="large" style="height: 25px">{{
|
||||||
classWorkAnalysis.worktype
|
classWorkAnalysis.worktype
|
||||||
}}</el-tag>
|
}}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
|
@ -726,7 +726,6 @@ const msgHandle = (msg) => {
|
||||||
openDialog(data, false);
|
openDialog(data, false);
|
||||||
break
|
break
|
||||||
case MsgEnum.HEADS.MSG_slideFlapping: // 切换页面
|
case MsgEnum.HEADS.MSG_slideFlapping: // 切换页面
|
||||||
console.log('切换页面-关闭窗口')
|
|
||||||
window.close() // 关闭窗口
|
window.close() // 关闭窗口
|
||||||
break
|
break
|
||||||
// case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[]
|
// case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[]
|
||||||
|
@ -766,7 +765,6 @@ onMounted(() => {
|
||||||
|
|
||||||
// im监听消息
|
// im监听消息
|
||||||
if (ChatWs.ws) {
|
if (ChatWs.ws) {
|
||||||
console.log('socket监听消息')
|
|
||||||
ChatWs.watch((msg, e) => {
|
ChatWs.watch((msg, e) => {
|
||||||
try {
|
try {
|
||||||
msgHandle(JSON.parse(msg))
|
msgHandle(JSON.parse(msg))
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<el-input v-model="ruleForm.username" placeholder="请输入手机号" />
|
<el-input v-model="ruleForm.username" placeholder="请输入手机号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="验证码" prop="smsCode" style="display: flex">
|
<el-form-item label="验证码" prop="smsCode" style="display: flex">
|
||||||
<el-input style="width:185px" v-model="ruleForm.smsCode" placeholder="请输入验证码" /><el-button style="margin-left:10px;width:100px" :disabled="codeName=='发送验证码'?false:true" type="primary" @click="sendyzm">{{ codeName }}</el-button>
|
<el-input style="width:185px" v-model="ruleForm.smsCode" placeholder="请输入验证码" /><el-button style="margin-left:10px;width:100px" type="primary" @click="sendyzm">发送验证码</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="密码" prop="password" >
|
<el-form-item label="密码" prop="password" >
|
||||||
<el-input autocomplete="on" type="password" v-model="ruleForm.password" placeholder="请输入密码" />
|
<el-input autocomplete="on" type="password" v-model="ruleForm.password" placeholder="请输入密码" />
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
width="500"
|
width="500"
|
||||||
style=" -webkit-app-region: no-drag;"
|
style=" -webkit-app-region: no-drag;"
|
||||||
>
|
>
|
||||||
<span>根据图片回答相关问题1</span>
|
<span>根据图片回答相关问题</span>
|
||||||
<div style="display: flex;align-items: center;;margin-top:30px">
|
<div style="display: flex;align-items: center;;margin-top:30px">
|
||||||
<img :src="isPeopleImg" style="width:200px;height:60px;cursor: pointer;" alt="" srcset="" @click="refreshImg">
|
<img :src="isPeopleImg" style="width:200px;height:60px;cursor: pointer;" alt="" srcset="" @click="refreshImg">
|
||||||
<el-input v-model="ruleForm.imgCode" style="width: 250px;height:40px;margin-left:20px" placeholder="请根据图片填入答案" />
|
<el-input v-model="ruleForm.imgCode" style="width: 250px;height:40px;margin-left:20px" placeholder="请根据图片填入答案" />
|
||||||
|
@ -162,14 +162,6 @@ const sbmitImg=()=>{
|
||||||
ElMessage.success('短信发送成功')
|
ElMessage.success('短信发送成功')
|
||||||
ruleForm.Code=res.data
|
ruleForm.Code=res.data
|
||||||
isImg.value=false
|
isImg.value=false
|
||||||
codeName.value=60
|
|
||||||
timer.value=setInterval(()=>{
|
|
||||||
codeName.value--
|
|
||||||
if(codeName.value==0){
|
|
||||||
codeName.value='发送验证码'
|
|
||||||
clearInterval(timer.value);
|
|
||||||
}
|
|
||||||
},1000)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -190,14 +182,14 @@ const sendyzm=()=>{
|
||||||
isPeopleImg.value='data:image/jpg;base64,'+res.img
|
isPeopleImg.value='data:image/jpg;base64,'+res.img
|
||||||
isImg.value=true
|
isImg.value=true
|
||||||
resImg.imgData=res
|
resImg.imgData=res
|
||||||
// codeName.value=60
|
codeName.value=60
|
||||||
// timer.value=setInterval(()=>{
|
timer.value=setInterval(()=>{
|
||||||
// codeName.value--
|
codeName.value--
|
||||||
// if(codeName.value==0){
|
if(codeName.value==0){
|
||||||
// codeName.value='发送验证码'
|
codeName.value='发送验证码'
|
||||||
// clearInterval(timer.value);
|
clearInterval(timer.value);
|
||||||
// }
|
}
|
||||||
// },1000)
|
},1000)
|
||||||
}else{
|
}else{
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
@ -286,9 +278,6 @@ const setCookie = (name, value) => {
|
||||||
}
|
}
|
||||||
const gotoLogin = () => {
|
const gotoLogin = () => {
|
||||||
codeName.value='发送验证码'
|
codeName.value='发送验证码'
|
||||||
if (timer.value){
|
|
||||||
clearInterval(timer.value);
|
|
||||||
}
|
|
||||||
if (ruleFormRef.value) ruleFormRef.value.resetFields()
|
if (ruleFormRef.value) ruleFormRef.value.resetFields()
|
||||||
isRegister.value = true
|
isRegister.value = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,159 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-dialog v-model="mode" :show-close="false" width="600" append-to-body destroy-on-close>
|
|
||||||
<template #header>
|
|
||||||
<div class="custom-header flex">
|
|
||||||
<span>{{ item.ex3 == '1' ? '请输入新的模板名称' : item.isAdd ? '添加提示词' : '编辑提示词' }}</span>
|
|
||||||
<i class="iconfont icon-guanbi" @click="mode = false"></i>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="dialog-content" v-loading="loading">
|
|
||||||
<p class="small-tip" v-if="item && item.ex3 == '1'">*当前模板为系统预设,不支持直接操作。需要复制一份为自己的然后再操作</p>
|
|
||||||
<el-form :model="form" label-width="auto">
|
|
||||||
<el-form-item label="名称">
|
|
||||||
<el-input v-model="form.name" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="提示词" v-if="item.ex3 == '1' ? false : true">
|
|
||||||
<el-input v-model="form.prompt" type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button @click="mode = false">取消</el-button>
|
|
||||||
<el-button type="primary" @click="saveAdd">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, watch } from 'vue'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import emitter from '@/utils/mitt';
|
|
||||||
import { addKeyWords, addChildTemp, editChildTemp } from '@/api/mode/index'
|
|
||||||
|
|
||||||
const mode = defineModel()
|
|
||||||
const props = defineProps({
|
|
||||||
modeType: {
|
|
||||||
type: Number,
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
item: { // 当前操作的模板
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return { ex3: '' }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
const form = reactive({
|
|
||||||
name: '',
|
|
||||||
prompt: '',
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
watch(() => mode.value, (newVal) => {
|
|
||||||
if(newVal){
|
|
||||||
if (props.item.isAdd) {
|
|
||||||
form.name = ''
|
|
||||||
form.prompt = ''
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
form.name = props.item?.name
|
|
||||||
form.prompt = props.item?.prompt
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},{ deep: true})
|
|
||||||
|
|
||||||
const loading = ref(false)
|
|
||||||
const saveAdd = async () => {
|
|
||||||
loading.value = true
|
|
||||||
|
|
||||||
if (props.item.ex3 == '1') {
|
|
||||||
let id; // id 为主模板id
|
|
||||||
if (props.item.isAdd) {
|
|
||||||
id = props.item.id
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// 编辑状态下 item 为子模板 主模板则是item.parentId
|
|
||||||
id = props.item.parentId
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// 系统预设模板 copy一份
|
|
||||||
const { msg } = await addKeyWords({ name: form.name, id })
|
|
||||||
emitter.emit('onGetMain')
|
|
||||||
ElMessage.success(msg)
|
|
||||||
mode.value = false
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (props.item.isAdd) {
|
|
||||||
onAddChildTemp(props.item.id)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
try {
|
|
||||||
let data = JSON.parse(JSON.stringify(props.item))
|
|
||||||
data.name = form.name;
|
|
||||||
data.prompt = form.prompt
|
|
||||||
const { msg } = await editChildTemp(data)
|
|
||||||
emitter.emit('onGetChild', data )
|
|
||||||
ElMessage.success(msg)
|
|
||||||
mode.value = false
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加子模板
|
|
||||||
const onAddChildTemp = async (parentId) => {
|
|
||||||
// 添加子模板
|
|
||||||
let obj = {
|
|
||||||
name: form.name,
|
|
||||||
type: 2, // 子模板 固定值为2
|
|
||||||
sortNum: 1,
|
|
||||||
parentId,
|
|
||||||
lmType: 1,
|
|
||||||
model: props.modeType,
|
|
||||||
prompt: form.prompt,
|
|
||||||
ex1: props.item.ex1, //学段
|
|
||||||
ex2: props.item.ex2, // 学科
|
|
||||||
ex3: '', //是否系统预设 这里默认空
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
var { msg } = await addChildTemp(obj)
|
|
||||||
emitter.emit('onGetChild')
|
|
||||||
ElMessage.success(msg)
|
|
||||||
mode.value = false
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.custom-header {
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.icon-guanbi {
|
|
||||||
cursor: pointer;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-tip {
|
|
||||||
text-align: left;
|
|
||||||
font-size: 12px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
color: #F56C6C;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -2,7 +2,6 @@
|
||||||
<div class="container-left flex">
|
<div class="container-left flex">
|
||||||
<div class="left-header flex">教学模式</div>
|
<div class="left-header flex">教学模式</div>
|
||||||
<div class="left-con" v-loading="loading">
|
<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">
|
<div class="con-item" v-for="item in tempList" :key="item.id">
|
||||||
<div class="item-header flex">
|
<div class="item-header flex">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
|
@ -30,33 +29,27 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
import { modelList } from '@/api/mode/index'
|
import { modelList } from '@/api/mode/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
const { user } = useUserStore()
|
|
||||||
|
|
||||||
// 获取模板
|
// 获取模板
|
||||||
let list = ref([])
|
let list = []
|
||||||
const getTemplate = async (id) => {
|
const getTemplate = () => {
|
||||||
const { rows } = await modelList({ createUser: user.userId, model: 4, type: 1, pageNum: 1, pageSize: 10000})
|
modelList({ model: 1, type: 1, ex3: 1 }).then(res => {
|
||||||
list.value = rows
|
list = res.rows
|
||||||
if(list.value.length){
|
getChildTemp()
|
||||||
getChildTemp(id)
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取子模板
|
// 获取子模板
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const tempList = ref([])
|
const tempList = ref([])
|
||||||
const getChildTemp = async (parentId) => {
|
const getChildTemp = async () => {
|
||||||
tempList.value.length = 0
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
for (let item of list.value) {
|
for (let item of list) {
|
||||||
try {
|
try {
|
||||||
const { rows } = await modelList({ model: 4, type: 2, parentId: item.id })
|
const { rows } = await modelList({ model: 1, type: 2, parentId: item.id })
|
||||||
tempList.value.push({
|
tempList.value.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
@ -64,28 +57,10 @@ const getChildTemp = async (parentId) => {
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
|
||||||
}
|
|
||||||
if(parentId){
|
|
||||||
const item = tempList.value.find(item => item.id == parentId)
|
|
||||||
emitter.emit('changeMode', item)
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
emitter.emit('changeMode', tempList.value[0])
|
emitter.emit('changeMode', tempList.value[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 操作之后获取子模板
|
|
||||||
emitter.on('onGetChild', async (data) => {
|
|
||||||
|
|
||||||
await getTemplate(data.parentId)
|
|
||||||
|
|
||||||
})
|
|
||||||
// 操作之后获取主模板
|
|
||||||
emitter.on('onGetMain', (item) => {
|
|
||||||
getTemplate(item.parentId)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 选择模板
|
// 选择模板
|
||||||
const emit = defineEmits([''])
|
const emit = defineEmits([''])
|
||||||
|
@ -93,23 +68,9 @@ const onSelect = (item) =>{
|
||||||
emitter.emit('changeMode', item)
|
emitter.emit('changeMode', item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const curNode = reactive({})
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let data = sessionStore.get('subject.curNode')
|
|
||||||
Object.assign(curNode, data);
|
|
||||||
|
|
||||||
|
|
||||||
getTemplate()
|
getTemplate()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 解绑
|
|
||||||
onUnmounted(() => {
|
|
||||||
|
|
||||||
emitter.off('onGetMain');
|
|
||||||
emitter.off('onGetChild');
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -135,7 +96,7 @@ onUnmounted(() => {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
overflow: auto;
|
|
||||||
.item-header {
|
.item-header {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
|
@ -10,29 +10,17 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
<el-button type="primary" :disabled="!(resultList.length)" @click="getCompletion">一键研读</el-button>
|
|
||||||
<el-button type="primary">生成大纲</el-button>
|
<el-button type="primary">生成大纲</el-button>
|
||||||
<el-button type="danger" @click="pptDialog = true">生成PPT</el-button>
|
<el-button type="danger" @click="pptDialog = true">生成PPT</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-con flex">
|
<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="con-item flex" v-for="(item, index) in resultList" :key="item.id" v-loading="item.loading">
|
||||||
<div class="item-top flex">
|
<div class="item-top flex">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
<el-popover placement="bottom-end" trigger="hover" popper-class="template-custom-popover">
|
<el-button type="info" link>
|
||||||
<template #reference>
|
|
||||||
<el-button link type="primary">
|
|
||||||
<i class="iconfont icon-shenglvehao"></i></el-button>
|
|
||||||
</template>
|
|
||||||
<template #default>
|
|
||||||
<el-button type="primary" link @click="editKeyWord(item, false)">编辑</el-button>
|
|
||||||
<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>
|
<i class="iconfont icon-xiazai9"></i>
|
||||||
</el-button> -->
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-bom">
|
<div class="item-bom">
|
||||||
<div class="item-prompt">{{ item.prompt }}</div>
|
<div class="item-prompt">{{ item.prompt }}</div>
|
||||||
|
@ -63,23 +51,19 @@
|
||||||
<AdjustDialog v-model="isAdjust" :item="curItem" />
|
<AdjustDialog v-model="isAdjust" :item="curItem" />
|
||||||
<PptDialog @add-success="addAiPPT" :dataList="resultList" v-model="pptDialog"/>
|
<PptDialog @add-success="addAiPPT" :dataList="resultList" v-model="pptDialog"/>
|
||||||
<progress-dialog v-model:visible="pgDialog.visible" v-bind="pgDialog" />
|
<progress-dialog v-model:visible="pgDialog.visible" v-bind="pgDialog" />
|
||||||
<!--添加、编辑提示词-->
|
|
||||||
<keywordDialog v-model="isWordDialog" :item="curItem" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted, reactive } from 'vue'
|
import { ref, onMounted, onUnmounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import emitter from '@/utils/mitt'
|
import emitter from '@/utils/mitt'
|
||||||
import EditDialog from './edit-dialog.vue'
|
import EditDialog from './edit-dialog.vue'
|
||||||
import AdjustDialog from './adjust-dialog.vue'
|
import AdjustDialog from './adjust-dialog.vue'
|
||||||
import progressDialog from './progress-dialog.vue'
|
import progressDialog from './progress-dialog.vue'
|
||||||
import { completion, tempResult, tempSave, removeChildTemp } from '@/api/mode/index.js'
|
import { completion, tempResult } from '@/api/mode/index.js'
|
||||||
// import { dataSetJson } from '@/utils/comm.js'
|
// import { dataSetJson } from '@/utils/comm.js'
|
||||||
import * as commUtils from '@/utils/comm.js'
|
import * as commUtils from '@/utils/comm.js'
|
||||||
import PptDialog from '@/views/prepare/container/pptist-dialog.vue'
|
import PptDialog from '@/views/prepare/container/pptist-dialog.vue'
|
||||||
import keywordDialog from './keyword-dialog.vue'
|
|
||||||
|
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import {PPTXFileToJson} from '@/AixPPTist/src/hooks/useImport' // ppt转json
|
import {PPTXFileToJson} from '@/AixPPTist/src/hooks/useImport' // ppt转json
|
||||||
|
@ -113,87 +97,11 @@ const pgDialog = reactive({ // 弹窗-进度条
|
||||||
})
|
})
|
||||||
emitter.on('changeMode', (item) => {
|
emitter.on('changeMode', (item) => {
|
||||||
resultList.value = item.child
|
resultList.value = item.child
|
||||||
|
// conversation()
|
||||||
getTempResult(item.id)
|
getTempResult(item.id)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 一键研读
|
|
||||||
const getCompletion = async () => {
|
|
||||||
|
|
||||||
for (let item of resultList.value) {
|
|
||||||
console.log(item)
|
|
||||||
try {
|
|
||||||
item.loading = true
|
|
||||||
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject} 对${curNode.itemtitle}进行教学分析`
|
|
||||||
const { data } = await completion(params)
|
|
||||||
item.answer = getResult(data.answer)
|
|
||||||
onSaveTemp(item)
|
|
||||||
} finally {
|
|
||||||
item.loading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存模板
|
|
||||||
const onSaveTemp = (item) => {
|
|
||||||
if (item.answer == '') return
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
mainModelId: item.parentId,
|
|
||||||
modelId: item.id,
|
|
||||||
examDocld: '',
|
|
||||||
content: item.answer,
|
|
||||||
ex1: curNode.id
|
|
||||||
}
|
|
||||||
tempSave(data).then(res => { })
|
|
||||||
}
|
|
||||||
|
|
||||||
const isWordDialog = ref(false)
|
|
||||||
const editKeyWord = (item, val) => {
|
|
||||||
/**
|
|
||||||
* isAdd: 子模板中的移除 为编辑false 头部删除 添加提示词为新增 true
|
|
||||||
*/
|
|
||||||
Object.assign(curItem, item)
|
|
||||||
curItem.isAdd = val
|
|
||||||
isWordDialog.value = true
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 移除模板
|
|
||||||
const removeItem = async (item, isChild) => {
|
|
||||||
/**
|
|
||||||
* item: 当前操作的模板
|
|
||||||
* isChild: 子模板中的移除为 true
|
|
||||||
*/
|
|
||||||
if (item.ex3 != '1') {
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'确认是否移除?',
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
removeChildTemp(item.id).then(res => {
|
|
||||||
ElMessage.success('操作成功')
|
|
||||||
if (isChild) {
|
|
||||||
// 获取子模板
|
|
||||||
emitter.emit('onGetChild', item)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 获取主模板
|
|
||||||
// getTemplateList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// editKeyWord(item, !isChild)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询模板结果
|
// 查询模板结果
|
||||||
const getTempResult = (id) => {
|
const getTempResult = (id) => {
|
||||||
tempResult({ mainModelId: id }).then(res => {
|
tempResult({ mainModelId: id }).then(res => {
|
||||||
|
@ -211,11 +119,6 @@ const getTempResult = (id) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去掉字符串中的 ### **
|
|
||||||
let getResult = (str) => {
|
|
||||||
let newStr = str.replace(/#+|(\*\*)/g, '');
|
|
||||||
return newStr
|
|
||||||
}
|
|
||||||
|
|
||||||
const params = reactive(
|
const params = reactive(
|
||||||
{
|
{
|
||||||
|
@ -273,7 +176,18 @@ const addAiPPT = async(res) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const conversation = async () => {
|
||||||
|
for (let item of resultList.value) {
|
||||||
|
item.loading = true
|
||||||
|
try {
|
||||||
|
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}课标对${curNode.itemtitle}进行教学分析`
|
||||||
|
const { data } = await completion(params)
|
||||||
|
item.answer = data.answer
|
||||||
|
} finally {
|
||||||
|
item.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const isEdit = ref(false)
|
const isEdit = ref(false)
|
||||||
// 当前操作的索引
|
// 当前操作的索引
|
||||||
|
@ -454,10 +368,8 @@ onUnmounted(() => {
|
||||||
emitter.off('changeMode')
|
emitter.off('changeMode')
|
||||||
emitter.off('changeResult')
|
emitter.off('changeResult')
|
||||||
emitter.off('changeAdjust')
|
emitter.off('changeAdjust')
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -484,36 +396,12 @@ onUnmounted(() => {
|
||||||
.con-item {
|
.con-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
position: relative;
|
|
||||||
padding-left: 15px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
&::after{
|
|
||||||
content: '';
|
|
||||||
width: 15px;
|
|
||||||
height: 15px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #409eff;
|
|
||||||
position: absolute;
|
|
||||||
left: -8px;
|
|
||||||
top: 5px;
|
|
||||||
}
|
|
||||||
&::before{
|
|
||||||
content: '';
|
|
||||||
width: 2px;
|
|
||||||
height: 100%;
|
|
||||||
background: #409eff;
|
|
||||||
position: absolute;
|
|
||||||
left: -1px;
|
|
||||||
top: 5px;
|
|
||||||
}
|
|
||||||
.item-top {
|
.item-top {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
.icon-shenglvehao{
|
|
||||||
font-weight: bold
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-bom {
|
.item-bom {
|
||||||
|
@ -558,9 +446,3 @@ onUnmounted(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
|
||||||
.template-custom-popover {
|
|
||||||
width: 110px !important;
|
|
||||||
min-width: 110px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue