Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front

This commit is contained in:
2026-02-26 13:48:14 +08:00
47 changed files with 96 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 KiB

View File

@@ -89,11 +89,17 @@
<div <div
v-for="item in styleOptions" v-for="item in styleOptions"
:key="item.value" :key="item.value"
class="fida-style-popover-item" class="fida-style-popover-item flex flex-center"
:class="{ 'is-selected': tempSelectedValue === item.value }" :class="{ 'is-selected': tempSelectedValue === item.value }"
@click="selectStyle(item.value)" @click="selectStyle(item.value)"
> >
<span class="fida-option-label">{{ $t(item.label) }}</span> <img
:src="getStyleImage(typeValue, item.value)"
class="style-bg"
/>
<span class="fida-option-label flex flex-center">{{
item.label
}}</span>
<img <img
v-show="tempSelectedValue === item.value" v-show="tempSelectedValue === item.value"
src="@/assets/images/checked.png" src="@/assets/images/checked.png"
@@ -179,6 +185,7 @@
import lightIcon from '@/assets/images/light-icon.png' import lightIcon from '@/assets/images/light-icon.png'
import closeIcon from '@/assets/images/close-icon.png' import closeIcon from '@/assets/images/close-icon.png'
import { createProject } from '@/api/agent' import { createProject } from '@/api/agent'
import { getStyleImage } from './style'
// import Tag from './Tag.vue' // import Tag from './Tag.vue'
const router = useRouter() const router = useRouter()
@@ -237,15 +244,21 @@
} }
const styleKeys: string[] = [ const styleKeys: string[] = [
'Venetian Modern',
'Coastal', 'Coastal',
'Maximalism',
'Memphis',
'Verdant', 'Verdant',
'Traditional', 'Century Chrome',
'CenturyChrome', 'Modern Revival',
'ModernRevival', 'Transitional',
'Tuscan2000s', "Tuscan 2000's",
'Kitsch-core',
'Bauhaus', 'Bauhaus',
'Constructivism', 'Constructivism',
'NordicNoir' 'Nordic Noir',
'Dopamine',
'Squiggle'
] ]
const editorRef = ref<HTMLDivElement | null>(null) const editorRef = ref<HTMLDivElement | null>(null)
@@ -506,7 +519,8 @@
const areaOptions = ref<any[]>(areaList) const areaOptions = ref<any[]>(areaList)
const styleOptions = ref<any[]>( const styleOptions = ref<any[]>(
styleKeys.map((key) => ({ styleKeys.map((key) => ({
label: `Input.styles.${key}`, label: key,
// label: `Input.styles.${key}`,
value: key value: key
})) }))
) )
@@ -810,14 +824,10 @@
.fida-style-popover-item { .fida-style-popover-item {
height: 9.1rem; height: 9.1rem;
width: 9.1rem; width: 9.1rem;
background-color: #a6a6a6; border-radius: 1.4rem;
border-radius: 0.8rem;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer; cursor: pointer;
transition: all 0.2s ease;
position: relative; position: relative;
border: none;
.checked-item-icon { .checked-item-icon {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@@ -826,16 +836,18 @@
width: 2.4rem; width: 2.4rem;
height: 2.4rem; height: 2.4rem;
} }
} .style-bg {
width: 100%;
.fida-style-popover-item:hover { height: 100%;
background-color: #e8e8e8; border-radius: 1.4rem;
}
} }
.fida-style-popover-item.is-selected { .fida-style-popover-item.is-selected {
background-color: #e3f2fd; // background-color: #e3f2fd;
border: 0.3rem solid #000;
.fida-option-label { .fida-option-label {
color: #000; background-color: none;
} }
// border-color: #2196f3; // border-color: #2196f3;
} }
@@ -847,6 +859,11 @@
color: #fff; color: #fff;
text-align: center; text-align: center;
padding: 0.5rem; padding: 0.5rem;
position: absolute;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.3);
border-radius: 1.4rem;
} }
.fida-style-popover-footer { .fida-style-popover-footer {

View File

@@ -0,0 +1,59 @@
const sofaImages = import.meta.glob('@/assets/images/sofa/*.png', { eager: true })
const deskImages = import.meta.glob('@/assets/images/desk/*.png', { eager: true })
const chairImages = import.meta.glob('@/assets/images/chair/*.png', { eager: true })
const imagesMaps = {
sofa: sofaImages,
desk: deskImages,
chair: chairImages
}
function slugify(str) {
return str
.toLowerCase()
.trim()
.replace(/['"]/g, '') // 去掉撇号
.replace(/[^a-z0-9\s-]+/g, '') // 只保留字母数字空格-
.replace(/\s+/g, '-') // 空格转 -
.replace(/-+/g, '-')
}
/**
* 动态获取风格对应的图片 URL
* @param { 'sofa' | 'desk' | 'chair' } type
* @param { string } style // 必须和 styleList 里的字符串完全一致
* @returns { string | null } 返回可直接用于 <img :src=""> 的 URL
*/
export function getStyleImage(types, style) {
if (!types) types = 'Sofa'
const type = types.toLowerCase()
const map = imagesMaps[type]
const fileName = `${slugify(style)}.png`
const key = `/src/assets/images/${type}/${fileName}`
console.log('types',types, 'style',style, 'fileName',fileName, 'key',key);
if (map[key]) {
return map[key].default
}
return ''
}
const styleList = [
'Venetian Modern',
'Coastal',
'Maximalism',
'Memphis',
'Verdant',
'Century Chrome',
'Modern Revival',
'Transitional',
"Tuscan 2000's",
'Kitsch-core',
'Bauhaus',
'Constructivism',
'Nordic Noir',
'Dopamine',
'Squiggle'
]