Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front
BIN
src/assets/images/chair/bauhaus.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
src/assets/images/chair/century-chrome.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
src/assets/images/chair/coastal.png
Normal file
|
After Width: | Height: | Size: 276 KiB |
BIN
src/assets/images/chair/constructivism.png
Normal file
|
After Width: | Height: | Size: 298 KiB |
BIN
src/assets/images/chair/dopamine.png
Normal file
|
After Width: | Height: | Size: 223 KiB |
BIN
src/assets/images/chair/kitsch-core.png
Normal file
|
After Width: | Height: | Size: 576 KiB |
BIN
src/assets/images/chair/maximalism.png
Normal file
|
After Width: | Height: | Size: 457 KiB |
BIN
src/assets/images/chair/memphis.png
Normal file
|
After Width: | Height: | Size: 353 KiB |
BIN
src/assets/images/chair/modern-revival.png
Normal file
|
After Width: | Height: | Size: 290 KiB |
BIN
src/assets/images/chair/nordic-noir.png
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
src/assets/images/chair/squiggle.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
src/assets/images/chair/transitional.png
Normal file
|
After Width: | Height: | Size: 240 KiB |
BIN
src/assets/images/chair/tuscan-2000s.png
Normal file
|
After Width: | Height: | Size: 364 KiB |
BIN
src/assets/images/chair/venetian-modern.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
src/assets/images/chair/verdant.png
Normal file
|
After Width: | Height: | Size: 464 KiB |
BIN
src/assets/images/desk/bauhaus.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
src/assets/images/desk/century-chrome.png
Normal file
|
After Width: | Height: | Size: 164 KiB |
BIN
src/assets/images/desk/coastal.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
src/assets/images/desk/constructivism.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
src/assets/images/desk/dopamine.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
src/assets/images/desk/kitsch-core.png
Normal file
|
After Width: | Height: | Size: 303 KiB |
BIN
src/assets/images/desk/maximalism.png
Normal file
|
After Width: | Height: | Size: 313 KiB |
BIN
src/assets/images/desk/memphis.png
Normal file
|
After Width: | Height: | Size: 333 KiB |
BIN
src/assets/images/desk/modern-revival.png
Normal file
|
After Width: | Height: | Size: 222 KiB |
BIN
src/assets/images/desk/nordic-noir.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
src/assets/images/desk/squiggle.png
Normal file
|
After Width: | Height: | Size: 404 KiB |
BIN
src/assets/images/desk/transitional.png
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
src/assets/images/desk/tuscan-2000s.png
Normal file
|
After Width: | Height: | Size: 296 KiB |
BIN
src/assets/images/desk/venetian-modern.png
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
src/assets/images/desk/verdant.png
Normal file
|
After Width: | Height: | Size: 204 KiB |
BIN
src/assets/images/sofa/bauhaus.png
Normal file
|
After Width: | Height: | Size: 281 KiB |
BIN
src/assets/images/sofa/century-chrome.png
Normal file
|
After Width: | Height: | Size: 312 KiB |
BIN
src/assets/images/sofa/coastal.png
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
src/assets/images/sofa/constructivism.png
Normal file
|
After Width: | Height: | Size: 406 KiB |
BIN
src/assets/images/sofa/dopamine.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
src/assets/images/sofa/kitsch-core.png
Normal file
|
After Width: | Height: | Size: 529 KiB |
BIN
src/assets/images/sofa/maximalism.png
Normal file
|
After Width: | Height: | Size: 673 KiB |
BIN
src/assets/images/sofa/memphis.png
Normal file
|
After Width: | Height: | Size: 385 KiB |
BIN
src/assets/images/sofa/modern-revival.png
Normal file
|
After Width: | Height: | Size: 278 KiB |
BIN
src/assets/images/sofa/nordic-noir.png
Normal file
|
After Width: | Height: | Size: 271 KiB |
BIN
src/assets/images/sofa/squiggle.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
src/assets/images/sofa/transitional.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
src/assets/images/sofa/tuscan-2000s.png
Normal file
|
After Width: | Height: | Size: 756 KiB |
BIN
src/assets/images/sofa/venetian-modern.png
Normal file
|
After Width: | Height: | Size: 481 KiB |
BIN
src/assets/images/sofa/verdant.png
Normal file
|
After Width: | Height: | Size: 485 KiB |
@@ -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 {
|
||||||
|
|||||||
59
src/views/home/components/style.ts
Normal 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'
|
||||||
|
]
|
||||||