Files
FiDA_Front/src/views/home/components/Input.vue

145 lines
3.3 KiB
Vue
Raw Normal View History

2026-02-03 13:15:39 +08:00
<template>
<div class="assist-input-wrapper flex flex-col">
2026-02-03 14:51:43 +08:00
<textarea
class="input"
type="text"
v-model="inputValue"
:placeholder="$t('Input.placeholder')"
/>
2026-02-03 13:15:39 +08:00
<div class="operate flex align-center">
<div class="attach flex flex-center">
<img src="@/assets/icons/attach.svg" alt="" />
</div>
2026-02-03 14:51:43 +08:00
<el-select v-model="typeValue" :placeholder="$t('Input.selectPlaceholder')">
2026-02-03 13:15:39 +08:00
<el-option
v-for="item in typeOptions"
2026-02-03 14:51:43 +08:00
class="input-option"
2026-02-03 13:15:39 +08:00
:key="item.value"
2026-02-03 14:51:43 +08:00
:label="$t(item.label)"
:value="item.value"
/>
</el-select>
<el-select v-model="areaValue" :placeholder="$t('Input.selectPlaceholder')">
<el-option
v-for="item in areaOptions"
class="input-option"
:key="item.value"
:label="$t(item.label)"
:value="item.value"
/>
</el-select>
<el-select v-model="styleValue" :placeholder="$t('Input.selectPlaceholder')">
<el-option
v-for="item in styleOptions"
class="input-option"
:key="item.value"
:label="$t(item.label)"
2026-02-03 13:15:39 +08:00
:value="item.value"
/>
</el-select>
</div>
</div>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
2026-02-03 14:51:43 +08:00
import { areaList } from '@/utils/area'
2026-02-03 13:15:39 +08:00
const inputValue = ref<string>('')
const typeValue = ref<string>('')
2026-02-03 14:51:43 +08:00
const areaValue = ref<string>('')
const styleValue = ref<string>('')
2026-02-03 13:15:39 +08:00
const typeOptions = ref<any[]>([
{
2026-02-03 14:51:43 +08:00
label: 'Input.types.sofa',
2026-02-03 13:15:39 +08:00
value: 'Sofa'
},
{
2026-02-03 14:51:43 +08:00
label: 'Input.types.desk',
2026-02-03 13:15:39 +08:00
value: 'Desk'
},
{
2026-02-03 14:51:43 +08:00
label: 'Input.types.chair',
2026-02-03 13:15:39 +08:00
value: 'Chair'
}
])
2026-02-03 14:51:43 +08:00
const areaOptions = ref<any[]>(areaList)
const styleOptions = ref<any[]>([
{
label: 'Input.styles.modern',
value: 'Modern'
},
{
label: 'Input.styles.classic',
value: 'Classic'
}
])
2026-02-03 13:15:39 +08:00
</script>
<style lang="less" scoped>
.assist-input-wrapper {
height: 23.5rem;
width: 106.3rem;
border-radius: 2.8rem;
background-color: #fff;
border: 0.1rem solid #00000005;
box-shadow: 0px 5px 14px 0px #0000001a;
margin: 0 auto;
padding: 3.4rem 1.7rem 1.7rem 2rem;
.input {
flex: 1;
border: none;
outline: none;
padding: 0 1.4rem;
font-size: 2rem;
font-family: 'InterRegular';
font-weight: 400;
color: #000000;
resize: none;
}
.operate {
column-gap: 2rem;
.attach {
width: 4rem;
height: 4rem;
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
}
.el-select {
width: 13.9rem;
height: 4rem;
:deep(.el-select__wrapper) {
border-radius: 0.8rem;
height: 100%;
box-shadow: none;
border: 0.1rem solid rgba(0, 0, 0, 0.1);
2026-02-03 14:51:43 +08:00
font-family: 'GeneralMedium';
font-weight: 500;
font-size: 1.4rem;
.el-select__placeholder {
color: #000;
}
.el-select__icon {
color: #000;
2026-02-03 13:15:39 +08:00
}
}
}
}
}
2026-02-03 14:51:43 +08:00
.input-option {
// padding: 0 1rem;
margin: 0 0.6rem;
padding: 0 0.8rem 0 1rem;
color: #0d0d0d;
font-weight: 510;
font-size: 1.3rem;
height: 3rem;
line-height: 3rem;
&.el-select-dropdown__item.is-hovering {
background-color: rgba(13, 13, 13, 0.02);
// border-radius: 0.6rem;
}
}
2026-02-03 13:15:39 +08:00
</style>