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

View File

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

View File

@@ -391,18 +391,19 @@ export default defineComponent({
.color{ .color{
// width: 34rem; // width: 34rem;
width: 100%; width: 100%;
height: 100%; // height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
row-gap: 1rem;
overflow-y: auto; overflow-y: auto;
> .detailText{ // > .detailText{
margin-bottom: .5rem; // margin-bottom: .5rem;
} // }
> .pallet{ // > .pallet{
margin-bottom: 2rem; // margin-bottom: 2rem;
} // }
> .colorBox{ > .colorBox{
margin-bottom: 1rem; // margin-bottom: 1rem;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
@@ -444,7 +445,7 @@ export default defineComponent({
} }
> .uploadImage{ > .uploadImage{
flex-shrink: 0; flex-shrink: 0;
margin-bottom: 3rem; // margin-bottom: 3rem;
border: 1px dashed transparent; 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); background: linear-gradient(#fff, #fff) padding-box,repeating-linear-gradient(-45deg,#fff 0,#fff 0.3em, #000 0,#000 0.6em);
height: 10rem; height: 10rem;
@@ -471,7 +472,7 @@ export default defineComponent({
} }
} }
> .colorCode{ > .colorCode{
margin-bottom: 3rem; // margin-bottom: 3rem;
> .generalModel_state{ > .generalModel_state{
> .generalModel_state_item{ > .generalModel_state_item{
width: 100%; width: 100%;

View File

@@ -42,7 +42,7 @@
</template> </template>
<script lang="ts"> <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 { useStore } from "vuex";
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { message,Upload} from 'ant-design-vue'; import { message,Upload} from 'ant-design-vue';
@@ -273,7 +273,24 @@ export default defineComponent({
}else{ }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(()=>{ onMounted(()=>{
// 添加点击外部区域监听器
document.addEventListener('click', handleClickOutside);
nextTick().then(()=>{ nextTick().then(()=>{
const backIcon = document.createElement('div'); const backIcon = document.createElement('div');
backIcon.classList.add('vc-sketch-color-wrap') backIcon.classList.add('vc-sketch-color-wrap')
@@ -297,6 +314,11 @@ export default defineComponent({
}) })
}) })
}) })
onUnmounted(()=>{
// 清理事件监听器
document.removeEventListener('click', handleClickOutside);
})
return{ return{
...toRefs(palletData), ...toRefs(palletData),
...toRefs(getpalletListDom), ...toRefs(getpalletListDom),

View File

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

View File

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

View File

@@ -106,7 +106,7 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false default: false
}, },
level1Type: { libraryType: {
type: String, type: String,
default: '' default: ''
} }
@@ -119,12 +119,12 @@ const libraryTypeList = ref([
...navTypeList(t).library.list.filter(item => item.value !== 'MyBrand') ...navTypeList(t).library.list.filter(item => item.value !== 'MyBrand')
]) ])
// 根据传入的level1Type参数确定默认选中的分类 // 根据传入的libraryType参数确定默认选中的分类
const getDefaultCategory = () => { const getDefaultCategory = () => {
if (props.level1Type) { if (props.libraryType) {
// 如果传入了level1Type查找匹配的category // 如果传入了libraryType查找匹配的category
const matchedCategory = libraryTypeList.value.find( const matchedCategory = libraryTypeList.value.find(
item => item.value === props.level1Type item => item.value === props.libraryType
) )
return matchedCategory ? matchedCategory.label : libraryTypeList.value[0]?.label || '' return matchedCategory ? matchedCategory.label : libraryTypeList.value[0]?.label || ''
} }
@@ -154,7 +154,7 @@ const categories = computed(() => {
// 计算属性:是否显示分类选择器 // 计算属性:是否显示分类选择器
const showCategories = computed(() => { const showCategories = computed(() => {
return !props.level1Type // 如果没有传入level1Type参数则显示分类选择器 return !props.libraryType // 如果没有传入libraryType参数则显示分类选择器
}) })
// 新增API请求函数 // 新增API请求函数
@@ -169,7 +169,7 @@ const fetchImages = async (
const type = libraryTypeList.value.find(item => item.label === category)?.value const type = libraryTypeList.value.find(item => item.label === category)?.value
const params = { const params = {
classificationIdList: [], classificationIdList: [],
level1Type: props.level1Type || type, level1Type: props.libraryType || type,
level2Type: '', level2Type: '',
page, page,
ageGroup: '', ageGroup: '',
@@ -242,6 +242,8 @@ const resetAndLoad = (category = selectedCategory.value) => {
list.value = [] list.value = []
hasMore.value = true hasMore.value = true
currentPage.value = 0 currentPage.value = 0
console.log('默认选择----',getDefaultCategory())
selectedCategory.value = getDefaultCategory()
fetchImages(1, category, true) fetchImages(1, category, true)
// 检查是否需要自动加载更多数据 // 检查是否需要自动加载更多数据

View File

@@ -18,8 +18,15 @@
<p>{{$t('Header.NewProject')}}</p> <p>{{$t('Header.NewProject')}}</p>
</div> </div>
<div class="navList "> <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="tools list"
<div class="titleBox" @click="setOpenType(item.value,item.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"> <div class="left">
<i :class="['fi',item.icon]"></i> <i :class="['fi',item.icon]"></i>
<span>{{item.label}}</span> <span>{{item.label}}</span>
@@ -37,7 +44,7 @@
</div> </div>
</div> </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 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 == 'Todaylist' && item.Todaylist.length>0">{{$t('Header.Today')}}</div>
<div class="timeType" v-if="historyTypeItem == 'Yesterdaylist' && item.Yesterdaylist.length>0">{{$t('Header.Yesterday')}}</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> <span :title="childItem.name" v-show="!childItem.editName">{{ childItem.name }}</span>
<textarea v-model="historyData.historyTextarea" v-show="childItem.editName" @click.stop></textarea> <textarea v-model="historyData.historyTextarea" v-show="childItem.editName" @click.stop></textarea>
</div> </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="type">{{ $t(`Header.${childItem.process}`) }}</div>
<div class="time">{{ childItem?.updateTime?.replace('T', ' ') }}</div> <div class="time">{{ childItem?.updateTime?.replace('T', ' ') }}</div>
<div class="btn"> <div class="btn">
@@ -64,10 +69,6 @@
<i class="fi fi-rr-settings-sliders"></i> <i class="fi fi-rr-settings-sliders"></i>
<span>{{$t('Header.Setting')}}</span> <span>{{$t('Header.Setting')}}</span>
</div> </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)"> <div class="item" @click.stop="deleteItem(childItem)">
<i class="icon iconfont icon-shanchu operate_icon"></i> <i class="icon iconfont icon-shanchu operate_icon"></i>
<span>{{$t('Header.Delete')}}</span> <span>{{$t('Header.Delete')}}</span>
@@ -84,7 +85,7 @@
</span> </span>
</div> </div>
<img v-show="historyData.isNoData && historyData.isNull" src="@/assets/images/homePage/null_img.png"> <img v-show="historyData.isNoData && historyData.isNull" src="@/assets/images/homePage/null_img.png">
</div> </div> -->
</div> </div>
</div> </div>
</div> </div>
@@ -402,10 +403,12 @@ export default defineComponent({
homeMainData.openType = Object.keys(query)[0] homeMainData.openType = Object.keys(query)[0]
homeMainData.openTypeChild = query[Object.keys(query)[0]] homeMainData.openTypeChild = query[Object.keys(query)[0]]
} }
// if((query?.id || query?.history) && !await getIdExistToHistory()){ console.log('homeMainData.openType',homeMainData.openType,'route.path',route.path)
// router.push('/home') if (homeMainData.openType == 'history' && route.path !== '/home/history') {
// return homeMainData.openType = ''
// } homeMainData.openTypeChild = ''
}
}else{ }else{
homeMainData.openType = '' homeMainData.openType = ''
homeMainData.openTypeChild = '' homeMainData.openTypeChild = ''
@@ -432,15 +435,9 @@ export default defineComponent({
homeMainData.showHistory = false homeMainData.showHistory = false
} }
}, },
{ immediate: true } { immediate: true}
) )
// watch(()=>homeMainData.openTypeList,()=>{
// homeMainData.historyData.page = 1
// })
let isMurmur = ref() let isMurmur = ref()
let credits = computed(()=>{ let credits = computed(()=>{
return store.state.UserHabit.credits.value return store.state.UserHabit.credits.value
@@ -564,16 +561,13 @@ export default defineComponent({
let imgParent = document.querySelector('.homeMain_max .detail .material_content_list_loding .historyPage_loading') let imgParent = document.querySelector('.homeMain_max .detail .material_content_list_loding .historyPage_loading')
if(Observer?.unobserve)Observer.unobserve(imgParent); if(Observer?.unobserve)Observer.unobserve(imgParent);
}) })
const setOpenType = (type, list) => { const setOpenType = (item) => {
const { value, list } = item
if(homeMainData.openType == type){ if (!list?.length) {
homeMainData.openType = '' router.push(item.router)
}else { return
homeMainData.openType = type
if (type === 'history') {
router.push('/home/history')
}
} }
homeMainData.openType = homeMainData.openType === value ? '' : value
} }
let Observer = null let Observer = null
let setPorfolioDom = ()=>{ let setPorfolioDom = ()=>{