Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite
This commit is contained in:
@@ -575,6 +575,7 @@ export default defineComponent({
|
||||
// width: 34rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
&.isEditPattern{width: 0px;}
|
||||
&.model{
|
||||
|
||||
@@ -388,21 +388,22 @@ export default defineComponent({
|
||||
.flex-justify-around{
|
||||
justify-content: space-around;
|
||||
}
|
||||
.color{
|
||||
.color{
|
||||
// width: 34rem;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 1rem;
|
||||
overflow-y: auto;
|
||||
> .detailText{
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
> .pallet{
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
// > .detailText{
|
||||
// margin-bottom: .5rem;
|
||||
// }
|
||||
// > .pallet{
|
||||
// margin-bottom: 2rem;
|
||||
// }
|
||||
> .colorBox{
|
||||
margin-bottom: 1rem;
|
||||
// margin-bottom: 1rem;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
@@ -444,7 +445,7 @@ export default defineComponent({
|
||||
}
|
||||
> .uploadImage{
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 3rem;
|
||||
// margin-bottom: 3rem;
|
||||
border: 1px dashed transparent;
|
||||
background: linear-gradient(#fff, #fff) padding-box,repeating-linear-gradient(-45deg,#fff 0,#fff 0.3em, #000 0,#000 0.6em);
|
||||
height: 10rem;
|
||||
@@ -471,7 +472,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
> .colorCode{
|
||||
margin-bottom: 3rem;
|
||||
// margin-bottom: 3rem;
|
||||
> .generalModel_state{
|
||||
> .generalModel_state_item{
|
||||
width: 100%;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,watch,nextTick,onMounted,toRefs, reactive} from 'vue'
|
||||
import { defineComponent,computed,ref,watch,nextTick,onMounted,onUnmounted,toRefs, reactive} from 'vue'
|
||||
import { useStore } from "vuex";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { message,Upload} from 'ant-design-vue';
|
||||
@@ -273,7 +273,24 @@ export default defineComponent({
|
||||
}else{
|
||||
}
|
||||
}
|
||||
// 点击外部区域关闭颜色选择器
|
||||
const handleClickOutside = (event: Event) => {
|
||||
const target = event.target as HTMLElement;
|
||||
const colorSettingBlock = document.querySelector('.color_setting_block');
|
||||
const palletColo = document.querySelector('.palletColo');
|
||||
|
||||
// 如果点击的是 .palletColo 或 .color_setting_block 内部,则不关闭
|
||||
if (palletData.palletShow && colorSettingBlock &&
|
||||
!colorSettingBlock.contains(target) &&
|
||||
!palletColo?.contains(target)) {
|
||||
palletData.palletShow = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
// 添加点击外部区域监听器
|
||||
document.addEventListener('click', handleClickOutside);
|
||||
|
||||
nextTick().then(()=>{
|
||||
const backIcon = document.createElement('div');
|
||||
backIcon.classList.add('vc-sketch-color-wrap')
|
||||
@@ -297,6 +314,11 @@ export default defineComponent({
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
onUnmounted(()=>{
|
||||
// 清理事件监听器
|
||||
document.removeEventListener('click', handleClickOutside);
|
||||
})
|
||||
return{
|
||||
...toRefs(palletData),
|
||||
...toRefs(getpalletListDom),
|
||||
|
||||
@@ -72,7 +72,7 @@ export default defineComponent({
|
||||
.detailLeft{
|
||||
// width: 34rem;
|
||||
// width: 100%;
|
||||
height: 100%;
|
||||
// height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,9 @@
|
||||
ref="selectImages"
|
||||
@select="handleImageSelect"
|
||||
:api="Https.httpUrls.queryLibraryPage"
|
||||
isLibrary/>
|
||||
isLibrary
|
||||
:libraryType="type_.type2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
|
||||
@@ -106,7 +106,7 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
level1Type: {
|
||||
libraryType: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
@@ -119,12 +119,12 @@ const libraryTypeList = ref([
|
||||
...navTypeList(t).library.list.filter(item => item.value !== 'MyBrand')
|
||||
])
|
||||
|
||||
// 根据传入的level1Type参数确定默认选中的分类
|
||||
// 根据传入的libraryType参数确定默认选中的分类
|
||||
const getDefaultCategory = () => {
|
||||
if (props.level1Type) {
|
||||
// 如果传入了level1Type,查找匹配的category
|
||||
if (props.libraryType) {
|
||||
// 如果传入了libraryType,查找匹配的category
|
||||
const matchedCategory = libraryTypeList.value.find(
|
||||
item => item.value === props.level1Type
|
||||
item => item.value === props.libraryType
|
||||
)
|
||||
return matchedCategory ? matchedCategory.label : libraryTypeList.value[0]?.label || ''
|
||||
}
|
||||
@@ -154,7 +154,7 @@ const categories = computed(() => {
|
||||
|
||||
// 计算属性:是否显示分类选择器
|
||||
const showCategories = computed(() => {
|
||||
return !props.level1Type // 如果没有传入level1Type参数,则显示分类选择器
|
||||
return !props.libraryType // 如果没有传入libraryType参数,则显示分类选择器
|
||||
})
|
||||
|
||||
// 新增:API请求函数
|
||||
@@ -169,7 +169,7 @@ const fetchImages = async (
|
||||
const type = libraryTypeList.value.find(item => item.label === category)?.value
|
||||
const params = {
|
||||
classificationIdList: [],
|
||||
level1Type: props.level1Type || type,
|
||||
level1Type: props.libraryType || type,
|
||||
level2Type: '',
|
||||
page,
|
||||
ageGroup: '',
|
||||
@@ -242,6 +242,8 @@ const resetAndLoad = (category = selectedCategory.value) => {
|
||||
list.value = []
|
||||
hasMore.value = true
|
||||
currentPage.value = 0
|
||||
console.log('默认选择----',getDefaultCategory())
|
||||
selectedCategory.value = getDefaultCategory()
|
||||
fetchImages(1, category, true)
|
||||
|
||||
// 检查是否需要自动加载更多数据
|
||||
|
||||
Reference in New Issue
Block a user