fix: workflow name cannot repeat and optimize chat quick question
This commit is contained in:
parent
c92c8f9a1a
commit
de97de64b2
@ -180,16 +180,19 @@ import Recorder from 'recorder-core'
|
|||||||
import applicationApi from '@/api/application'
|
import applicationApi from '@/api/application'
|
||||||
import { MsgAlert } from '@/utils/message'
|
import { MsgAlert } from '@/utils/message'
|
||||||
import { type chatType } from '@/api/type/application'
|
import { type chatType } from '@/api/type/application'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { getImgUrl } from '@/utils/utils'
|
import { getImgUrl } from '@/utils/utils'
|
||||||
import 'recorder-core/src/engine/mp3'
|
import 'recorder-core/src/engine/mp3'
|
||||||
|
|
||||||
import 'recorder-core/src/engine/mp3-engine'
|
import 'recorder-core/src/engine/mp3-engine'
|
||||||
import { MsgWarning } from '@/utils/message'
|
import { MsgWarning } from '@/utils/message'
|
||||||
|
import useStore from '@/stores'
|
||||||
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const { application } = useStore()
|
||||||
const {
|
const {
|
||||||
query: { mode, question }
|
query: { mode, question },
|
||||||
|
params: { accessToken }
|
||||||
} = route as any
|
} = route as any
|
||||||
const quickInputRef = ref()
|
const quickInputRef = ref()
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
@ -533,6 +536,24 @@ onMounted(() => {
|
|||||||
if (question) {
|
if (question) {
|
||||||
inputValue.value = decodeURIComponent(question.trim())
|
inputValue.value = decodeURIComponent(question.trim())
|
||||||
sendChatHandle()
|
sendChatHandle()
|
||||||
|
setTimeout(() => {
|
||||||
|
// 获取当前路由信息
|
||||||
|
const route = router.currentRoute.value
|
||||||
|
// 复制query对象
|
||||||
|
const query = { ...route.query }
|
||||||
|
// 删除特定的参数
|
||||||
|
delete query.question
|
||||||
|
const newRoute =
|
||||||
|
Object.entries(query)?.length > 0
|
||||||
|
? route.path +
|
||||||
|
'?' +
|
||||||
|
Object.entries(query)
|
||||||
|
.map(([key, value]) => `${key}=${value}`)
|
||||||
|
.join('&')
|
||||||
|
: route.path
|
||||||
|
|
||||||
|
history.pushState(null, '', '/ui' + newRoute)
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (quickInputRef.value && mode === 'embed') {
|
if (quickInputRef.value && mode === 'embed') {
|
||||||
|
|||||||
@ -41,7 +41,17 @@ class AppNode extends HtmlResize.view {
|
|||||||
} else {
|
} else {
|
||||||
const filterNodes = props.graphModel.nodes.filter((v: any) => v.type === props.model.type)
|
const filterNodes = props.graphModel.nodes.filter((v: any) => v.type === props.model.type)
|
||||||
if (filterNodes.length - 1 > 0) {
|
if (filterNodes.length - 1 > 0) {
|
||||||
props.model.properties.stepName = props.model.properties.stepName + (filterNodes.length - 1)
|
getNodesName(filterNodes.length - 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getNodesName(num: number) {
|
||||||
|
let number = num
|
||||||
|
const name = props.model.properties.stepName + number
|
||||||
|
if (!props.graphModel.nodes?.some((node: any) => node.properties.stepName === name.trim())) {
|
||||||
|
props.model.properties.stepName = name
|
||||||
|
} else {
|
||||||
|
number += 1
|
||||||
|
getNodesName(number)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
props.model.properties.config = nodeDict[props.model.type].properties.config
|
props.model.properties.config = nodeDict[props.model.type].properties.config
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user