This commit is contained in:
zhangxuelin 2025-02-18 17:04:22 +08:00
commit 7a64625567
7 changed files with 56 additions and 18 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win-ws", "name": "aix-win-ws",
"version": "2.5.17", "version": "2.5.18",
"description": "", "description": "",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "上海交大重庆人工智能研究院", "author": "上海交大重庆人工智能研究院",

View File

@ -80,6 +80,7 @@ provide(injectKeySlideScale, scale)
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden;
} }
.slide-item { .slide-item {
position: absolute; position: absolute;

View File

@ -198,7 +198,7 @@ export default (isLoader?: boolean = true) => {
const touchInfo = ref<{ x: number; y: number; } | null>(null) const touchInfo = ref<{ x: number; y: number; } | null>(null)
const touchStartListener = (e: TouchEvent) => { const touchStartListener = (e: TouchEvent) => {
e.preventDefault() // 阻止默认事件 // e.preventDefault() // 阻止默认事件
touchInfo.value = { touchInfo.value = {
// x: e.changedTouches[0].pageX, // x: e.changedTouches[0].pageX,
// y: e.changedTouches[0].pageY, // y: e.changedTouches[0].pageY,
@ -208,6 +208,7 @@ export default (isLoader?: boolean = true) => {
} }
const touchEndListener = (e: TouchEvent) => { const touchEndListener = (e: TouchEvent) => {
if (!touchInfo.value) return if (!touchInfo.value) return
// window.scrollTo(0, 0) // 滚动到顶部
const offsetX = Math.abs(touchInfo.value.x - e.changedTouches[0].clientX) const offsetX = Math.abs(touchInfo.value.x - e.changedTouches[0].clientX)
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 ) {

View File

@ -23,7 +23,7 @@
</el-button> </el-button>
<el-button type="primary" link :disabled="!(templateList.length)" @click="onAdd"> <el-button type="primary" link :disabled="!(templateList.length)" @click="onAdd">
<i class="iconfont icon-jiahao"></i> <i class="iconfont icon-jiahao"></i>
添加提示词 {{curTemplate.ex3 === '1' ? '复制并创建个人模板' : '添加提示词'}}
</el-button> </el-button>
<el-button type="primary" :disabled="!(childTempList.length)" @click="getCompletion">一键研读</el-button> <el-button type="primary" :disabled="!(childTempList.length)" @click="getCompletion">一键研读</el-button>
</div> </div>
@ -120,6 +120,10 @@ const modeOptions = ref([
label: '知识库模型', label: '知识库模型',
value: 2, value: 2,
disabled: false disabled: false
},
{
label: 'deepseek模型',
value: 3
} }
]) ])
@ -134,7 +138,7 @@ const modeOptions = ref([
const isWordDialog = ref(false) const isWordDialog = ref(false)
const editItem = reactive({}) const editItem = reactive({})
const onAdd = () => { const onAdd = () => {
console.log(curTemplate)
Object.assign(editItem, curTemplate) Object.assign(editItem, curTemplate)
editItem.isAdd = true editItem.isAdd = true
isWordDialog.value = true isWordDialog.value = true
@ -333,6 +337,9 @@ const againResult = async (index, item) => {
}) })
data = res.data data = res.data
} else { } else {
if (curMode.value == 3) {
params.llm = 'deepseek-r1:8b'
}
// //
const res = await completion(params) const res = await completion(params)
data = res.data data = res.data
@ -381,6 +388,9 @@ const getCompletion = async () => {
} }
// //
else { else {
if (curMode.value == 3) {
params.llm = 'deepseek-r1:8b'
}
const res = await completion(params) const res = await completion(params)
data = res.data data = res.data
} }
@ -439,6 +449,7 @@ const onSaveTemp = async (item) => {
// ### ** // ### **
let getResult = (str) => { let getResult = (str) => {
let newStr = str.replace(/#+|(\*\*)/g, ''); let newStr = str.replace(/#+|(\*\*)/g, '');
newStr = newStr.replace(/<think>[\s\S]*?<\/think>/g, '');
return newStr return newStr
} }

View File

@ -40,9 +40,22 @@ const type = async () => {
displayedText.value = props.text displayedText.value = props.text
return return
} }
if (index.value <= props.text.length) { //ms
let allLength = props.text.length
let allTime = 3000
let addIndex = allLength/(allTime/props.delay);
//5
for (let i = 0; i < addIndex; i++) {
if (index.value <= allLength) {
displayedText.value += props.text.charAt(index.value); displayedText.value += props.text.charAt(index.value);
index.value++; index.value++;
} else {
break;
}
}
if (index.value <= props.text.length) {
// displayedText.value += props.text.charAt(index.value);
// index.value++;
setTimeout(() => { setTimeout(() => {
type(); type();
emit('updateScroll', typingEffectRef.value.clientHeight); // emit('updateScroll', typingEffectRef.value.clientHeight); //

View File

@ -438,17 +438,23 @@ const toRousrceUrl = async (o) => {
if (!!o.src) { // src if (!!o.src) { // src
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src) const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
const isBlobUrl = /^blob:/.test(o.src) const isBlobUrl = /^blob:/.test(o.src)
let onLineUrl = '' // 线 let onLineUrl = '', typeExt = '' // 线|
if (!!o.zipPath) onLineUrl = pptMedia[o.zipPath] || '' // if (!!o.zipPath) {
onLineUrl = pptMedia[o.zipPath] || '' //
typeExt = o.zipPath.split('.').pop()
}
if (onLineUrl) o.src = onLineUrl // 线 if (onLineUrl) o.src = onLineUrl // 线
else { // else { //
if (isBase64) { // if (isBase64) { //
const url = await getOnlineFileUrl(o.src) if(!typeExt) typeExt = 'png'
const url = await getOnlineFileUrl(o.src, typeExt)
url &&(o.src = url)
url && o.zipPath && (pptMedia[o.zipPath] = url) // url && o.zipPath && (pptMedia[o.zipPath] = url) //
} else if (isBlobUrl) { // } else if (isBlobUrl) { //
if(!typeExt) typeExt = o.type=='video'?'mp4':'mp3'
const res = await fetch(o.src) const res = await fetch(o.src)
const blob = await res.blob() const blob = await res.blob()
const url = await getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3') const url = await getOnlineFileUrl(blob, typeExt)
URL.revokeObjectURL(o.src) // URL.revokeObjectURL(o.src) //
url &&(o.src = url) url &&(o.src = url)
url && o.zipPath && (pptMedia[o.zipPath] = url) // url && o.zipPath && (pptMedia[o.zipPath] = url) //

View File

@ -653,17 +653,23 @@ export default {
if (!!o.src) { // src if (!!o.src) { // src
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src) const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
const isBlobUrl = /^blob:/.test(o.src) const isBlobUrl = /^blob:/.test(o.src)
let onLineUrl = '' // 线 let onLineUrl = '', typeExt = '' // 线|
if (!!o.zipPath) onLineUrl = this.pptMedia[o.zipPath] || '' // if (!!o.zipPath) {
onLineUrl = this.pptMedia[o.zipPath] || '' //
typeExt = o.zipPath.split('.').pop()
}
if (onLineUrl) o.src = onLineUrl // 线 if (onLineUrl) o.src = onLineUrl // 线
else { // else { //
if (isBase64) { // if (isBase64) { //
const url = await this.getOnlineFileUrl(o.src) if(!typeExt) typeExt = 'png'
const url = await this.getOnlineFileUrl(o.src, typeExt)
url &&(o.src = url)
url && o.zipPath && (this.pptMedia[o.zipPath] = url) // url && o.zipPath && (this.pptMedia[o.zipPath] = url) //
} else if (isBlobUrl) { // } else if (isBlobUrl) { //
if(!typeExt) typeExt = o.type=='video'?'mp4':'mp3'
const res = await fetch(o.src) const res = await fetch(o.src)
const blob = await res.blob() const blob = await res.blob()
const url = await this.getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3') const url = await this.getOnlineFileUrl(blob, typeExt)
URL.revokeObjectURL(o.src) // URL.revokeObjectURL(o.src) //
url &&(o.src = url) url &&(o.src = url)
url && o.zipPath && (this.pptMedia[o.zipPath] = url) // url && o.zipPath && (this.pptMedia[o.zipPath] = url) //