Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite

This commit is contained in:
李志鹏
2025-09-24 16:26:45 +08:00
8 changed files with 75 additions and 51 deletions

2
components.d.ts vendored
View File

@@ -18,6 +18,7 @@ declare module 'vue' {
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal']
APagination: typeof import('ant-design-vue/es')['Pagination']
APopover: typeof import('ant-design-vue/es')['Popover']
ARangePicker: typeof import('ant-design-vue/es')['RangePicker']
ASelect: typeof import('ant-design-vue/es')['Select']
@@ -29,6 +30,7 @@ declare module 'vue' {
ATabPane: typeof import('ant-design-vue/es')['TabPane']
ATabs: typeof import('ant-design-vue/es')['Tabs']
AUpload: typeof import('ant-design-vue/es')['Upload']
ElCascader: typeof import('element-plus/es')['ElCascader']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}

View File

@@ -575,6 +575,7 @@ export default defineComponent({
// width: 34rem;
display: flex;
flex-direction: column;
justify-content: space-between;
}
&.isEditPattern{width: 0px;}
&.model{

View File

@@ -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%;

View File

@@ -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),

View File

@@ -72,7 +72,7 @@ export default defineComponent({
.detailLeft{
// width: 34rem;
// width: 100%;
height: 100%;
// height: 100%;
display: flex;
flex-direction: column;
}

View File

@@ -228,7 +228,9 @@
ref="selectImages"
@select="handleImageSelect"
:api="Https.httpUrls.queryLibraryPage"
isLibrary/>
isLibrary
:libraryType="type_.type2"
/>
</div>
</template>
<script lang="ts">

View File

@@ -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)
// 检查是否需要自动加载更多数据

View File

@@ -18,8 +18,15 @@
<p>{{$t('Header.NewProject')}}</p>
</div>
<div class="navList ">
<div class="tools list" v-for="item in navTypeList" :class="{active:openType == item.value,history:item.value == 'history','show-history' : showHistory && item.value === 'history','isHistory' : item.value === 'history'}">
<div class="titleBox" @click="setOpenType(item.value,item.list)">
<div class="tools list"
v-for="item in navTypeList"
:class="{
active:openType == item.value,
history:item.value == 'history',
'show-history' : showHistory && item.value === 'history',
'isHistory' : item.value === 'history'
}">
<div class="titleBox" @click="setOpenType(item)">
<div class="left">
<i :class="['fi',item.icon]"></i>
<span>{{item.label}}</span>
@@ -37,7 +44,7 @@
</div>
</div>
</div>
<div class="detail" v-else-if="item.value == 'history'" style="height: auto;">
<!-- <div class="detail" v-else-if="item.value == 'history'" style="height: auto;">
<div v-for="historyTypeItem in historyData.updateTimeType" :key="historyTypeItem">
<div class="timeType" v-if="historyTypeItem == 'Todaylist' && item.Todaylist.length>0">{{$t('Header.Today')}}</div>
<div class="timeType" v-if="historyTypeItem == 'Yesterdaylist' && item.Yesterdaylist.length>0">{{$t('Header.Yesterday')}}</div>
@@ -48,8 +55,6 @@
<span :title="childItem.name" v-show="!childItem.editName">{{ childItem.name }}</span>
<textarea v-model="historyData.historyTextarea" v-show="childItem.editName" @click.stop></textarea>
</div>
<!-- <div class="type" v-if="childItem.process == 'THREE_D_PLATE_MAKING'">3D Pattern Making</div>
<div class="type" v-else>{{ childItem.process.replace(/_/g, ' ').toLowerCase().replace(/\b\w/g, char => char.toUpperCase()) }}</div> -->
<div class="type">{{ $t(`Header.${childItem.process}`) }}</div>
<div class="time">{{ childItem?.updateTime?.replace('T', ' ') }}</div>
<div class="btn">
@@ -64,10 +69,6 @@
<i class="fi fi-rr-settings-sliders"></i>
<span>{{$t('Header.Setting')}}</span>
</div>
<!-- <div class="item" v-if="bathGenerationList.indexOf(childItem.process)>-1" @click.stop="bathGeneration(childItem)">
<i class="fi fi-rr-cloud-upload-alt"></i>
<span>{{$t('Header.BatchGeneration')}}</span>
</div> -->
<div class="item" @click.stop="deleteItem(childItem)">
<i class="icon iconfont icon-shanchu operate_icon"></i>
<span>{{$t('Header.Delete')}}</span>
@@ -84,7 +85,7 @@
</span>
</div>
<img v-show="historyData.isNoData && historyData.isNull" src="@/assets/images/homePage/null_img.png">
</div>
</div> -->
</div>
</div>
</div>
@@ -402,10 +403,12 @@ export default defineComponent({
homeMainData.openType = Object.keys(query)[0]
homeMainData.openTypeChild = query[Object.keys(query)[0]]
}
// if((query?.id || query?.history) && !await getIdExistToHistory()){
// router.push('/home')
// return
// }
console.log('homeMainData.openType',homeMainData.openType,'route.path',route.path)
if (homeMainData.openType == 'history' && route.path !== '/home/history') {
homeMainData.openType = ''
homeMainData.openTypeChild = ''
}
}else{
homeMainData.openType = ''
homeMainData.openTypeChild = ''
@@ -432,14 +435,8 @@ export default defineComponent({
homeMainData.showHistory = false
}
},
{ immediate: true }
{ immediate: true}
)
// watch(()=>homeMainData.openTypeList,()=>{
// homeMainData.historyData.page = 1
// })
let isMurmur = ref()
let credits = computed(()=>{
@@ -564,16 +561,13 @@ export default defineComponent({
let imgParent = document.querySelector('.homeMain_max .detail .material_content_list_loding .historyPage_loading')
if(Observer?.unobserve)Observer.unobserve(imgParent);
})
const setOpenType = (type, list) => {
if(homeMainData.openType == type){
homeMainData.openType = ''
}else {
homeMainData.openType = type
if (type === 'history') {
router.push('/home/history')
}
const setOpenType = (item) => {
const { value, list } = item
if (!list?.length) {
router.push(item.router)
return
}
homeMainData.openType = homeMainData.openType === value ? '' : value
}
let Observer = null
let setPorfolioDom = ()=>{