修复动画展示bug
This commit is contained in:
parent
19453bb218
commit
dff09315d4
@ -205,9 +205,10 @@ const shouldAutoScroll = ref(true);
|
|||||||
const panel = ref(null)
|
const panel = ref(null)
|
||||||
const modelCard = ref(null)
|
const modelCard = ref(null)
|
||||||
const examples = ref([
|
const examples = ref([
|
||||||
'写一个冒泡排序',
|
'写一个简单的冒泡排序',
|
||||||
'今天天气怎么样?',
|
'今天无锡天气怎么样?',
|
||||||
'贾宝玉今年多少岁?',
|
'介绍一下红楼梦',
|
||||||
|
'今天星期几?'
|
||||||
])
|
])
|
||||||
|
|
||||||
const opts = reactive({
|
const opts = reactive({
|
||||||
|
|||||||
@ -156,21 +156,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="model-provider-card" v-for="(item, key) in modelKeys" :key="key">
|
<div class="model-provider-card" v-for="(item, key) in modelKeys" :key="key">
|
||||||
<div class="card-header">
|
<div class="card-header" @click="toggleExpand(item)">
|
||||||
<!-- <div v-if="modelStatus[item]" class="success"></div> -->
|
<!-- <div v-if="modelStatus[item]" class="success"></div> -->
|
||||||
<div :class="{'model-icon': true, 'available': modelStatus[item]}">
|
<div :class="{'model-icon': true, 'available': modelStatus[item]}">
|
||||||
<img :src="modelIcons[item]" alt="模型图标">
|
<img :src="modelIcons[item]" alt="模型图标">
|
||||||
</div>
|
</div>
|
||||||
<div class="model-title-container">
|
<div class="model-title-container">
|
||||||
<h3>{{ modelNames[item].name }}</h3>
|
<h3>{{ modelNames[item].name }}</h3>
|
||||||
<a :href="modelNames[item].url" target="_blank" class="model-url">
|
<a :href="modelNames[item].url" target="_blank" class="model-url" @click.stop>
|
||||||
<InfoCircleOutlined />
|
<InfoCircleOutlined />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<a-button
|
<a-button
|
||||||
type="text"
|
type="text"
|
||||||
class="expand-button"
|
class="expand-button"
|
||||||
@click="expandedModels[item] = !expandedModels[item]"
|
@click.stop="toggleExpand(item)"
|
||||||
>
|
>
|
||||||
<span class="icon-wrapper" :class="{'rotated': expandedModels[item]}">
|
<span class="icon-wrapper" :class="{'rotated': expandedModels[item]}">
|
||||||
<DownOutlined />
|
<DownOutlined />
|
||||||
@ -270,11 +270,22 @@ const notModelKeys = computed(() => {
|
|||||||
return Object.keys(modelStatus.value || {}).filter(key => !modelStatus.value?.[key])
|
return Object.keys(modelStatus.value || {}).filter(key => !modelStatus.value?.[key])
|
||||||
})
|
})
|
||||||
|
|
||||||
// 模型展开状态管理,默认展开
|
// 模型展开状态管理
|
||||||
const expandedModels = reactive(modelKeys.value.reduce((acc, key) => {
|
const expandedModels = reactive({})
|
||||||
acc[key] = true
|
|
||||||
return acc
|
// 监听 modelKeys 变化,确保新添加的模型也是默认展开状态
|
||||||
}, {}))
|
watch(modelKeys, (newKeys) => {
|
||||||
|
newKeys.forEach(key => {
|
||||||
|
if (expandedModels[key] === undefined) {
|
||||||
|
expandedModels[key] = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
|
// 切换展开状态的方法
|
||||||
|
const toggleExpand = (item) => {
|
||||||
|
expandedModels[item] = !expandedModels[item]
|
||||||
|
}
|
||||||
|
|
||||||
const generateRandomHash = (length) => {
|
const generateRandomHash = (length) => {
|
||||||
let chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
let chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||||
@ -522,6 +533,7 @@ const sendRestart = () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.model-title-container {
|
.model-title-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user