<template>
    <div class="library_page">
        <div class="page_content">
            <!-- <img
                class="page_content_bg"
                src="@/assets/images/homePage/bg.png"
            /> -->
            <div class="page_content_body">
                <HeaderComponent></HeaderComponent>
                <div class="library_page_body">
                    <div class="library_body_left">
						<div>
							<div class="library_menu_list" v-for="(menu,index) in menuList" :key="menu.title">
								<div :class="['menu_item', selectCode==menu.code ? 'select_menu_item' :'']"  @click="selectMenuItem(menu,index)">
									<div class="menu_item_left">
										<i :class="[menu.icon]"></i>
										<div>{{menu.title}}</div>
									</div>
									<div v-show="menu.children.length" :class="['icon','iconfont', 'icon-xiala', menu.showChildren?'icon_rotate':'']"></div>
								</div>
								<div v-show="menu.showChildren && menu.children.length">
									<div :class="['menu_item','child_menu_item', selectCode==child.code ? 'select_menu_item' :'']" v-for="child in menu.children" :key="child.title" @click="selectMenuItem(child,index)">
										{{child.title}}
									</div>
								</div>
							</div>
						</div>
                      
                    </div>
                    <div class="library_body_right">
                        <div class="library_right_header">
                            <div class="library_header_left">
                                <div class="header_operate_item pointer" :class="{operate_select:uploadGenerate == 'Upload'}" @click="uploadGenerateOpen('Upload')">
									<div>{{ $t('LibraryPage.Organize') }}</div>
                                </div>
							   <div v-show="selectCode != 'Models'" class='header_operate_item pointer'  :class="{operate_select:uploadGenerate == 'Generate'}" @click="uploadGenerateOpen('Generate')">{{ $t('LibraryPage.Generate') }}</div>
                            </div>

                            <div class="librart_headr_right">
                                <div class="select_block" v-show="selectCode == 'Sketchboard' || selectCode == 'Models'">
									<a-select
                                        ref="select"
                                        v-model:value="sex.value"
                                        :options="sexList"
                                        @change="sexChange"
                                    >
                                        <template #suffixIcon
                                            ><span
                                                class="icon iconfont icon-xiala"
                                                style="color: #343579"
                                            ></span
                                        ></template>
                                    </a-select>
                                    <a-select
                                        ref="select"
										v-show="selectCode == 'Sketchboard'"
                                        v-model:value="designType.value"
                                        :options="disignTypeList"
                                        @change="handleChange"
                                    >
                                        <template #suffixIcon
                                            ><span
                                                class="icon iconfont icon-xiala"
                                                style="color: #343579"
                                            ></span
                                        ></template>
                                    </a-select>
                                </div>
                            </div>
                        </div>

                        <div class="libray_right_content">
                            <div class="right_content_body" v-show="uploadGenerate =='Upload'">
                                <div class="content_body_header">
									<div class="content_body_header_left">
										<div class="content_body_header_right">
											<div :class="['header_operate_item' , 'fontSize','active']">
												<a-upload
													:capture="null"
													v-show="uploadGenerate == 'Upload'"
													:before-upload="beforeUpload"
													:customRequest="customRequest "
													:multiple="selectCode != 'Models'"
													:maxCount="15"
													accept=".jpg,.png,.jpeg,.bmp"
													@change="fileUploadChange"
													>
													<div>{{ $t('LibraryPage.Upload') }}</div>
												</a-upload>
											</div>
											<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="deleteBatchPic()">{{ $t('LibraryPage.Delete') }}</div>
											<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="showRenameModal(selectImgList,'batch')">{{ $t('LibraryPage.Rename') }}</div>
										</div>
										<div class="content_search_block">
											<input class="search_input" :placeholder="$t('LibraryPage.inputContent1')" v-model="searchPictureName"  @keydown.enter="getLibraryList('')">
											<div class="search_cascader">
												<!-- <a-cascader
													@click.stop="dropdownVisibleChange"
													ref="cascader"
													v-model:value="value.labelValue"
													style="width: 100%"
													:field-names="{ label: 'label', value: 'value', children: 'childList'}"
													multiple
													@change="setLabel1"
													:changeOnSelect="false"
													max-tag-count="responsive"
													:options="options"
													placeholder="Please select"
													:show-search="{ filter }"
													:open="false"
													dropdownClassName="libraryPageCascader"
												>
												</a-cascader> -->
												<el-cascader 
													:options="options" 
													filterable
													v-model="value.labelValue"
													:collapse-tags="true" 
													:show-all-levels="false" 
													:clearable="true"
													:placeholder="$t('LibraryPage.Select')"
													:max-collapse-tags=3
													:props="props" 
													:collapse-tags-tooltip="true"
													ref="cascader"
													popper-class="libraryPageCascader"
													@visible-change="dropdownVisibleChange"
												>
													<template #empty>
														<div>
															{{$t('LibraryPage.Select')}}
														</div>
													</template>
												</el-cascader>
											</div>
											<div class="intersection">
												<div :title="$t('LibraryPage.unionSet')" @click="()=>intersection = 1" v-show="intersection == 0" :class="['icon', 'iconfont','icon-bingji',]"></div>
												<div :title="$t('LibraryPage.intersection')" @click="()=>intersection = 0" v-show="intersection == 1" :class="['icon', 'iconfont','icon-bingji1',]"></div>
											</div>
											<!-- <div class="search_icon_block" @click="getLibraryList('')"><span class="icon iconfont icon-sousuo"></span></div> -->
											<div class="generage_btn search_icon_block" @click="getLibraryList('')"><span class="icon iconfont icon-sousuo"></span></div>
										</div>
									</div>
                                    <div v-show="imgList.length" :class="['check_all_block',selectImgList.length == imgList.length ? 'check_all' : '']" @click="selectAllImg()">
                                        <div class="check_block"><div class="check_block_body" v-show="selectImgList.length == imgList.length && imgList.length"></div></div>
                                        <div>{{ $t('LibraryPage.all') }}</div>
                                    </div>
                                </div>

                                <div class="content_body_table scroll_style">
                                    <div class="content_img_item" v-for="(img,index) in imgList" :key="img.id" @click="selectImgItem(img)" :draggable="true">
                                        <div :class="['content_img_item_block', selectImgList.indexOf(img.id) > -1 ? 'select_item_img' :'']">
                                            <img v-lazy="img.url" :key="img.url" :class="['content_img', ['Moodboard','Printboard'].indexOf(selectCode) > -1 ? 'board_content_img' :'']"/>
                                            <div class="img_item_hover">
                                                <div class="img_operate_content">
                                                    <div class="img_operate_block" :title="t('LibraryPage.Point')" @click.stop="editPlacementClick(img)" v-show="selectCode === 'Models'">
                                                        <span class="icon iconfont icon-dianwei operate_icon"></span>
                                                    </div>
                                                    <div class="img_operate_block" :title="t('LibraryPage.Rename')" @click.stop="showRenameModal(img,'single')">
                                                        <span class="icon iconfont icon-tianxie operate_icon"></span>
                                                    </div>
                                                    <div class="img_operate_block" :title="t('LibraryPage.Delete')" @click.stop="deleteSinglePic(img,index)">
                                                        <span class="icon iconfont icon-shanchu operate_icon"></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="content_img_name">{{img.name}}</div>
                                    </div>
                                    <div class="no_data_block" v-show="!imgList.length && !isShowMark">
                                        <img src="@/assets/images/homePage/null_img.png">
                                    </div>
                                </div>

                                <div class="table_pagination" v-show="imgList.length">
                                    <a-pagination
                                        
                                        v-model:current="currentPage"
                                        v-model:pageSize="pageSize"
                                        :total="total"
                                        :showQuickJumper="true"
                                        :showSizeChanger="false"
                                        @change="changePage"
                                    />
                                </div>
                            </div>
							<div class="right_content_body" v-show="uploadGenerate !='Upload'">
								<div class="content_body_header content_body_header_generate">
									<div class="content_body_header_right" >
										<div class="content_body_header_right" v-show="selectCode != 'Moodboard'">
											<div class="checkboxItem" v-show="selectCode != 'Sketchboard'">
												<label>
													<input
														type="checkbox"
														v-model="checkbox[0].type"
														@click="setKeyword(0)"
													/>
													<span>{{ $t('LibraryPage.ImageOnly') }}</span>
												</label>
											</div>
											<div class="checkboxItem">
												<label>
													<input
														type="checkbox"
														v-model="checkbox[1].type"
														@click="setKeyword(1)"
													/>
													<span>{{ $t('LibraryPage.TextOnly') }}</span>
												</label>
											</div>
											<div class="checkboxItem">
												<label>
													<input
														type="checkbox"
														v-model="checkbox[2].type"
														@click="setKeyword(2)"
													/>
													<span>{{ $t('LibraryPage.TextImage') }}</span>
												</label>
											</div>
										</div>
									</div>
									
									<div class="input_box" :class="{active:inputShow}">
										<input 
											class="search_input" 
											@input="ifMaximumLength" 
											:maxlength='inputShow?0:9999' 
											:class="{active:checkbox[0].type && selectCode != 'Moodboard'}" 
											@keydown.enter="getgenerate" :readonly="checkbox[0].type  && selectCode != 'Moodboard'" 
											:placeholder="$t('LibraryPage.inputContent2')" 
											v-model="captionGeneration">
										<div class="generage_btn started_btn" @click.stop="getgenerate">{{ $t('LibraryPage.Generate') }}</div>
										<span>{{ $t('LibraryPage.maximumLength') }}</span>
									</div>
									<div v-show="selectCode == 'Printboard'" class="printModel">
										<div @click.stop="PrintModel">{{ printModel.name }}</div>
										<ul v-show="printModel.optype">
											<li class="printModel_item" @click="setprintModel(1)">{{ $t('LibraryPage.Model1') }}</li>
											<li class="printModel_item" @click="setprintModel(2)">{{ $t('LibraryPage.Model2') }}</li>
											<li class="printModel_item" @click="setprintModel(3)">{{ $t('LibraryPage.Model3') }}</li>
										</ul>
									</div>
									<div  v-show="selectCode != 'Moodboard'" class="upload_item">
										<div
											class="upload_file_item"
											v-for="(file, index) in selectGenerateList"
											:key="file"
											:class="[file?.checked?'active':'']"
										>
											<div
												class="upload_file_item_content"
												v-show="file?.status === 'uploading'"
											>
												<a-spin :indicator="indicator" tip="Uploading..." />
											</div>
											<div class="upload_file_item_content" @click.stop="setSketchboardItem(file)" v-show="file?.status === 'done'">
												<img :src="file?.imgUrl" class="upload_img" />
												<div class="delete_file_block rightTop" @click.stop="deleteFile(index)" >
													<span class="icon iconfont icon-shanchu"></span>
												</div>
											</div>
										</div>
										
										<div
											class="upload_component upload_file_item"
											v-show="selectGenerateList.length <= 2"
										>
											<a-upload
												:capture="null"
												:action="uploadUrl + '/api/element/upload'"
												list-type="picture-card"
												:before-upload="beforeUpload"
												:disabled="checkbox[1].type"
												:data="{
													...upload
												}"
												:headers="{Authorization:token}"
												v-model:file-list="selectGenerateList"
												multiple
												:maxCount="3"
												accept=".jpg,.png,.jpeg,.bmp"
												@change="generateFileUploadChange"
												>
												<div class="upload_tip_block">
													<i class="fi fi-br-upload"></i>
													<!-- <img class="upload_img_icon" src="@/assets/images/homePage/add_file.png"> -->
												</div>
											</a-upload>
										</div>
									</div>
									
                                </div>

                                <div class="content_body_table scroll_style">
                                    <div class="content_img_item" v-for="(img,index) in generateList" :key="img.id">
                                        <div :class="['content_img_item_block', selectImgList.indexOf(img.id) > -1 ? 'select_item_img' :'']">
                                            <img v-lazy="img.imgUrl" :key="img.imgUrl" :class="['content_img', ['Moodboard','Printboard'].indexOf(selectCode) > -1 ? 'board_content_img' :'']"/>
											<div class="img_item_hover">
                                                <div class="img_operate_content">
                                                    <div class="img_operate_block">
														<i v-if="!img.like" class="fi fi-rr-heart operate_icon" @click.stop="likeFile(img,'like')"></i>
														<i v-else class="fi fi-sr-heart operate_icon" @click.stop="likeFile(img,'noLike')"></i>
                                                    </div>
                                                </div>
												<div class="img_operate_content left"  :class="[driver__.driver?'hideEvents':'']">
													<div class="img_operate_block">
														<i class="fi fi-bs-expand-arrows-alt" @click.stop="scaleImage(index)"></i>
                                                    </div>
												</div>
                                            </div>
                                        </div>
                                        <div class="content_img_name"></div>
                                    </div>
                                    <div class="no_data_block" v-show="!generateList.length && !isShowMark">
                                        <img src="@/assets/images/homePage/null_img.png">
                                    </div>
                                </div>

                                <div class="table_pagination" v-show="generateList.length">
                                  
                                </div>
							</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <a-modal class="library_rename_modal_component" 
            v-model:visible="renameVisivle" 
            :footer="null" 
            :title="$t('LibraryPage.Rename')"
            width="78%"
			:keyboard="false"
            :maskClosable="false"
            :centered="true"
            @onCancel="closeRenameModal"
        >
            <div class="collection_rename_content">
				<div class="collection_rename_title">{{$t('LibraryPage.Name')}}</div>
                <div class="rename_form_content">
                    <input class="rename_form_input" :placeholder="$t('LibraryPage.inputContent3')" v-model="newPicName" @keydown.enter="confrimRename()">
                </div>
				<div class="collection_rename_title">{{$t('LibraryPage.Tag')}}</div>
				<el-cascader 
					:options="options" 
					:filterable="true" 
					v-model="value.editLabelValue"
					:collapse-tags="true" 
					:show-all-levels="false" 
					:placeholder="$t('LibraryPage.Select')"
					:clearable="true"
					:max-collapse-tags=6
					:props="props" 
					ref="cascader1"
					:collapse-tags-tooltip="true"
					@visible-change="dropdownVisibleChange1"
				>
				<template #empty>
						<div>
							{{$t('LibraryPage.Select')}}
						</div>
					</template>
				</el-cascader>
				<div v-show="selectCode == 'Sketchboard'" class="collection_rename_title">{{$t('LibraryPage.Category')}}</div>
				<!-- <div v-show="selectCode == 'Sketchboard'" class="collection_rename_title">{{$t('LibraryPage.Category')}}</div> -->
                <div v-show="selectCode == 'Sketchboard'" class="rename_form_content">
					<div class="select_block">
						<a-select
							ref="select"
							v-model:value="editSex.value"
							:options="sexList"
							@change="getPosition"
						>
							<template #suffixIcon>
								<!-- <span
									class="icon iconfont icon-xiala"
									style="color: #343579"
								></span> -->
								<i class="el-icon el-input__icon icon-arrow-down"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path></svg></i>
							</template>
						</a-select>
						<a-select
							ref="select"
							v-model:value="editDesignType.value"
							:options="disignTypeList"
						>
							<template #suffixIcon>
								<!-- <span
									class="icon iconfont icon-xiala"
									style="color: #343579"
								></span> -->
								<i class="el-icon el-input__icon icon-arrow-down"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path></svg></i>
							</template>
						</a-select>
					</div>
                </div>
				<div class="rename_button_list">
                    <div class="rename_button_item rename_cancel_button"  @click="closeRenameModal()">{{ $t('LibraryPage.Cancel') }}</div>
                    <div class="rename_button_item rename_submit_button"  @click="confrimRename()">{{ $t('LibraryPage.Sure') }}</div>
                </div>
            </div>
        </a-modal>
		<scaleImage ref="scaleImage"></scaleImage>
        <ModelPlacement ref="ModelPlacement" @submitModelPlacement="getLibraryList"></ModelPlacement>
        <ModelPlacementMobile ref="ModelPlacementMobile" @submitModelPlacement="getLibraryList"></ModelPlacementMobile>
		<setLabel ref="setLabel"></setLabel>
        <!-- 蒙层 start-->
        <div class="mark_loading" v-show="isShowMark">
            <a-spin size="large" />
			<!-- <div class="mark_loading_text" v-show="generateLineUp >= 0">
				<div>{{$t('Generate.Sequence')}}: {{ generateLineUp }}</div>
			</div> -->
			<div v-show="remGenerate" class="mark_loading_btn" @click="removeGenerate">{{$t('Generate.Close')}}</div>

        </div>
        <!-- 蒙层 end-->
		<RobotAssist></RobotAssist>

    </div>
</template>
<script lang="ts">
import { LoadingOutlined } from "@ant-design/icons-vue";
import { defineComponent,h ,ref,createVNode,nextTick,provide,computed} from 'vue'
import HeaderComponent from "@/component/HomePage/Header.vue";
import ModelPlacement from '@/component/LibraryPage/ModelPlacement.vue';
import setLabel from '@/component/LibraryPage/setLabel.vue';
import ModelPlacementMobile from '@/component/LibraryPage/ModelPlacementMobile.vue';
import RobotAssist from "@/component/HomePage/RobotAssist.vue";
import { Modal,message,Upload,CascaderProps } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import {getUploadUrl,isMoible} from '@/tool/util'
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import { getCookie } from "@/tool/cookie";
import scaleImage from "@/component/HomePage/scaleImage.vue";
import { useI18n } from "vue-i18n";
import { ElCascader } from 'element-plus'
import { remove } from "jszip";
export default defineComponent({
    components: {
        HeaderComponent,
        ModelPlacement,
		setLabel,
        ModelPlacementMobile,
		RobotAssist,
		ElCascader,
		scaleImage,
    },
    setup() {
		
        let menuList = computed(()=>{
			return [
				{title:useI18n().t('LibraryPage.Moodboard'),code:'Moodboard',icon:'fi fi-rr-grid',showChildren:false,children:[]},
				{title:useI18n().t('LibraryPage.Prints'),code:'Printboard',icon:'fi fi-rs-objects-column',showChildren:false,children:[]},
				// {title:'Sketches',code:'SketchboardFirst',icon:'fi icon iconfont icon-a-waitao_changkuanwaitao11x',showChildren:false,children:[{title:'Apparel',code:'Sketchboard'}]},
				{title:useI18n().t('LibraryPage.Sketches'),code:'Sketchboard',icon:'fi icon iconfont icon-a-waitao_changkuanwaitao11x',showChildren:false,children:[]},
				// {title:'Market Sketch',code:'MarketingSketch',icon:'icon-fuwushichang',showChildren:false,children:[]},
				{title:useI18n().t('LibraryPage.Mannequins'),code:'Models',icon:'fi fi-rs-people',showChildren:false,children:[]},

			]
		})
        let selectImgList:any = ref([])
        let selectCode:any = ref('Moodboard')
        let searchPictureName = ref('')
        let newSearchPictureName = ref('')
        let designType:any = ref('Outwear')
        let sex:any = ref('Meal')
		let sexList:any = [
               
            ]
        let disignTypeList:any = [
              
            ]
        let editSex:any = ref({
			value:''
		})
        let editDesignType:any = ref({
			value:''
		})
        let imgList = ref([])
        let currentPage:any = ref(1)
        let pageSize:any = ref(18)
        let total:any = ref(20)
        let renameVisivle:any = ref(false)
        let renameType:any = ref('single')//修改名字的方式single-单个 batch-批量
        let newPicName:any = ref('')
        let uploadUrl:any = ref('')
        let currentUploadFileNum:any = ref(0) //当次上传文件数量
        let isShowMark:any = ref(false) //蒙层
        let selectSingleImg:any = ref({}) //保存单个图片数据
        let store = useStore();
		let uploadGenerate:any = ref('Upload')
		let checkbox = ref([
            {
                name: "image",
                type: true,
            },
            {
                name: "text",
                type: false,
            },
            {
                name: "text-image",
                type: false,
            },
        ]);
		let inputShow = ref(false)
		let generateCheckbox:any = ref()
		let captionGeneration:any = ref()
		let inputTime = ref()
		let generateList:any = ref([
		])
		let selectGenerateList:any = ref([])
		let printModel = ref({
			num:1,
			optype:false,
			name:useI18n().t('LibraryPage.Model1')
		})
		let {t} = useI18n()
		const options:any = ref([
		]);
		let type:any = {
			selectCode:selectCode,
			designType:designType
		}
		provide('type',type)
		let value = ref({
			labelValue:[],
			editLabelValue:[],
		})
		

		let props = {
			multiple: true,
			checkStrictly: true,
			emitPath:true,
			children:'childList',
			value:'id',
			label:'classificationName',
		}
		let intersection = ref(1)
		let isTest = ref()
		let driver__:any = computed(()=>{
			return store.state.Guide.guide
		})
		let generateId:any = ref()
		let generateTime:any = ref()
		let generateLineUp:any = ref(-1)
		let isGenerate:any = ref(false)
		let remGenerate:any = ref(false)
		let remGenerateTime:any = ref()
		let getLibraryListInputTime:any = ref()
        return {
            menuList,
            selectImgList,
            selectCode,
            searchPictureName,
			newSearchPictureName,
			sexList,
			sex,
            disignTypeList,
			editSex,
			editDesignType,
            designType,
            imgList,
            currentPage,
            pageSize,
            total,
            renameVisivle,
            renameType,
            newPicName,
            uploadUrl,
            currentUploadFileNum,
            isShowMark,
            selectSingleImg,
			store,
			uploadGenerate,
			checkbox,
			inputShow,
			generateCheckbox,
			captionGeneration,
			inputTime,
			generateList,
			selectGenerateList,
			printModel,
			value,
			options,
			t,
			props,
			intersection,
			isTest,
			driver__,
			generateId,
			generateTime,
			generateLineUp,
			isGenerate,
			remGenerate,
			remGenerateTime,
			getLibraryListInputTime,
        }
    },
	data(this_) {
        return {
            userInfo: {},
			indicator: h(LoadingOutlined, {
                style: {
                    fontSize: "2.4rem",
                },
                spin: true,
            }),
            upload: {
                isPin: 0,
				gender:'',
                level1Type: this_.selectCode,
                timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
            },
            token: "",
        };
    },
	watch:{
		sex(newVal,oldVal){
			this.upload.gender = newVal.value
		},
		searchPictureName(newVal,oldVal){
			// clearTimeout(this.getLibraryListInputTime)
			// this.getLibraryListInputTime = setTimeout(() => {
			// 	if(newVal != oldVal){
			// 		this.currentPage = 1
			// 	}
			// }, 500);
		},
	},
    async mounted(){
		let userInfo:any = getCookie("userInfo")
		let isTest:any = getCookie('isTest')
        this.isTest =JSON.parse(isTest)
        this.userInfo = JSON.parse(userInfo);
        this.uploadUrl = getUploadUrl()
        this.getLibraryList('')
		this.getClass()
		this.getSex()
        this.token = getCookie("token") || "";
    },
    methods:{

		getSex(){
			Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'Sex'}}).then((rv: any) => {
				if (rv) {
					let arr:any = []
					rv.forEach((item:any) => {
						arr.push({
							value:item.name,
							label:item.value,
						})
					});
					
					this.sex = arr[0]
					this.sexList = arr
					this.getPosition()
				}
			})
		},
		async getPosition(){
			let params
			if(this.sex.value == 'Female'){
				params = 'FemalePosition'
			}else{
				params = 'MalePosition'
			}
			await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:params}}).then((rv: any) => {
				if (rv) {
					let arr:any = []
					rv.forEach((item:any) => {
						arr.push({
							value:item.name,
							label:item.value,
						})
					});
					this.designType = arr[0]
					this.editDesignType = arr[0]
					this.disignTypeList = arr
					// this.workspaceItem.position = this.singleTypeList[0].label
				}
			})
		},
		likeFile(item:any,str:string){
            let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : ''

			if(str == 'like'){
				let data = {
					generateDetailId:item.id,
					level1Type:this.selectCode,
					level2Type: designType,
					gender:this.sex.value,
					timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
				}
				Https.axiosPost(Https.httpUrls.generateLike, data).then(
					(rv) => {
						item.like = true
					}
				).catch(res=>{
				});
			}else{
				let data = {
					generateDetailId:item.id,
					timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
				}
				Https.axiosGet(Https.httpUrls.generateDislike, {params:data}).then(
					(rv) => {
						item.like = false
					}
				).catch(res=>{
				});
			}
		},
        selectMenuItem(menu:any,index:any){
            if(menu.children?.length){ //证明是有子菜单
                menu.showChildren = !menu.showChildren
            }else{
				if(menu.code != this.upload.level1Type){
					this.selectCode = menu.code
					this.currentPage = 1,
					this.total = 0,
					this.searchPictureName = ''
					this.imgList = [],
					// this.sex = 'Female',
					// this.designType = 'Outwear',
					this.selectImgList = []
					this.selectSingleImg = {}
					this.value.labelValue = []
					this.getLibraryList('')
					this.getClass()
					this.uploadGenerate = 'Upload'
					this.captionGeneration = ''
					this.selectGenerateList = []
					this.generateList = []
				}
				this.upload.level1Type = menu.code
            }
			if(this.selectCode == 'Sketchboard'){
				this.checkbox=[
					{
						name: "image",
						type: false,
					},
					{
						name: "text",
						type: true,
					},
					{
						name: "text-image",
						type: false,
					},
				]
			}
        },

		async sexChange(){
			await this.getPosition()
            this.currentPage = 1
            this.getLibraryList('')
		},
        handleChange(){
            this.currentPage = 1
            this.getLibraryList('')
        },

         fileUploadChange(data:any){
            let file = data.file
            // let Cropper:any = this.$refs.Cropper
			
            if(this.selectCode == 'Models'){
                let reader = new FileReader();
				//试用用户上传限制
				// if(this.imgList.length+this.currentUploadFileNum > 10 && this.isTest){
				// 	message.info(this.t('isTest.image'));
				// 	return
				// }
                reader.onload = (e:any) => {
                    let data_new;
                    if (typeof e.target.result === 'object') {
                    // 把Array Buffer转化为blob 如果是base64不需要
                    data_new = window.URL.createObjectURL(new Blob([e.target.result]));
                    } else {
                    data_new = e.target.result;
                    }
                    this.placementClick({url:data_new,file:file.originFileObj})
                    
                };
                // 转化为base64
                // reader.readAsDataURL(file)
                // 转化为blob
                reader.readAsArrayBuffer(file.originFileObj);
            }
            
        },

        //改变页码
        changePage(current: number, pageSize: number){
            this.currentPage = current
            this.pageSize = pageSize
            this.getLibraryList('page')
        },

        //选择图片
        selectImgItem(imgData:any){
            if(this.selectImgList.indexOf(imgData.id) === -1){
                this.selectImgList.push(imgData.id)
            }else{
                let index = this.selectImgList.indexOf(imgData.id)
                this.selectImgList.splice(index,1)
            }
        },

        //选择所有的图片
        selectAllImg(){
            if(this.selectImgList.length == this.imgList.length){
                this.selectImgList = []
            }else{
                this.selectImgList = this.imgList.map((v:any) => v.id)
            }
        },

        closeRenameModal(){
            this.renameVisivle= false;
            this.newPicName = ''
			this.value.editLabelValue = []
			this.value.labelValue = []
        },

        //确定修改名称
        async confrimRename(){
            let data = {
                libraryIds:this.renameType === 'single' ? [this.selectSingleImg.id] : this.selectImgList,
                libraryName:this.newPicName,
                timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,  
            }
			let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : ''
			let labelArr:any = []
			this.value.editLabelValue.forEach((item:any)=>{
				// if(item.length > 1){
				// }else{
				// labelArr.push(item[0])
				// }
				labelArr.push(item[item.length-1]?item[item.length-1]:item)
			})
			let data2 = {
				"classificationIdList": labelArr,
				"classificationName": "",
				"createTime": "",
				"id": 0,
				"libraryIdList": this.renameType === 'single' ? [this.selectSingleImg.id] : this.selectImgList,
				"type": this.selectCode,
				"updateTime": "",
				"userId": 0
			}
			let bor = false
			if(this.newPicName){//多选修改名字
				await Https.axiosPost(Https.httpUrls.batchUpdateLibraryName, data).then(
					(rv: any) => {
						// if(this.renameType ==='batch'){
						// 	this.selectImgList = []
						// }
						bor = true 
					}
				).catch((res)=>{
				});
			}
			if(this.renameType == 'single'){//多选修改标签
				await Https.axiosPost(Https.httpUrls.relationLibrary, data2).then(
					(rv: any) => {
						bor = true 
					}
				).catch((res)=>{
				});
			}else{
				await Https.axiosPost(Https.httpUrls.editRelPublicClassificationIdList, data2).then(
					(rv: any) => {
						bor = true 
					}
				).catch((res)=>{
				});
			}
			let data3 = {
				libraryId:this.renameType === 'single' ? [this.selectSingleImg.id] : this.selectImgList,
				level2Type:this.editDesignType.value,
			}
			if(this.selectCode == 'Sketchboard'){
				await Https.axiosPost(Https.httpUrls.setSketchLibrary,data3).then(
					(rv) => {
					}
				).catch((res)=>{
				});
			}
			// if(bor){
				
			// }
			this.value.labelValue = []
			this.getLibraryList('')
			this.closeRenameModal() 
        },

        //打开修改名称弹窗
        showRenameModal(data:any,type:any){
			this.newPicName = ''
			this.editSex = this.sex
			this.editDesignType = this.designType
            if(type =='batch' && !this.selectImgList.length){ //批量但未选中
				this.newPicName = ''
                return
            }
			let classData = {
				"classificationIdList": [],
				"classificationName": "",
				"createTime": "",
				"deleteConfirm": 0,
				"id": 0,
				"isDeleted": 0,
				"libraryIdList": [data.id],
				"parentId": 0,
				"type": "",
				"updateTime": "",
				"userId": 0
			}
			this.value.editLabelValue = []
			this.selectSingleImg = data
			this.newPicName = data.name
            if(type === 'single'){
				Https.axiosPost(Https.httpUrls.getRelClassificationIdList, classData).then(
					(rv: any) => {
						this.value.editLabelValue = rv
					}
				).catch((res)=>{
				});
            }else{
				classData.libraryIdList = data
				Https.axiosPost(Https.httpUrls.getRelPublicClassificationIdList, classData).then(
					(rv: any) => {
						this.value.editLabelValue = rv
					}
				).catch((res)=>{
				});
			}
            this.renameType = type
            this.renameVisivle = true
        },
		upLoad(){

		},
		uploadGenerateOpen(str:any){
			if(this.uploadGenerate == 'Generate'){
				if(str != 'Generate'){
                    this.getLibraryList('')
				}
			}
			this.uploadGenerate = str
		},
        //删除单个图片
        deleteSinglePic(data:any,index:any){
            let _this = this
            Modal.confirm({
                title: this.t('LibraryPage.jsContent1'),
                icon: createVNode(ExclamationCircleOutlined),
                okText: 'Yes',
                cancelText: 'No',
				mask:false,
                centered:true,
                onOk() {
                    _this.confirmDeletePic(data,index)
                }
            });
        },

        //批量删除图片
        deleteBatchPic(){
            if(!this.selectImgList.length){
                return
            }
            let _this = this
            Modal.confirm({
                title: this.t('LibraryPage.jsContent2'),
                icon: createVNode(ExclamationCircleOutlined),
                okText: 'Yes',
                cancelText: 'No',
                centered:true,
                onOk() {
                    _this.confirmDeletePic('',0)
                }
            });
        },

        //确定删除图片 有data则是单个
        confirmDeletePic(data:any,index:any){
            let libraryIds = data ? [data.id] : this.selectImgList
            let newData = {
                libraryIds:libraryIds,
				deleteModelConfirm:data.level1Type == 'Models' ? data.deleteModelConfirm?data.deleteModelConfirm : 0:'',
				timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,  
            }
             Https.axiosPost(Https.httpUrls.batchDeleteLibrary, newData).then(
                (rv: any) => {
                    if(data && data.id){
                        this.imgList.splice(index, 1)
                    }else{
                        this.selectImgList = []
                        this.getLibraryList('')
                    }
                }
            ).catch((res)=>{
				if(data.level1Type == "Models" && res.errCode === 2){
					let _this = this
					Modal.confirm({
						title: res.errMsg,
						icon: createVNode(ExclamationCircleOutlined),
						okText: 'Yes',
						cancelText: 'No',
						mask:false,
						zIndex:99999,
						centered:true,
						onOk() {
							data.deleteModelConfirm = 1
							
							_this.confirmDeletePic(data,index)
						},
						onCancel(){
							
						}
					});
				}
            });
        },

        beforeUpload(file:any,fileList:any){
            const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/bmp';
            if (!isJpgOrPng) {
                message.info(this.t('LibraryPage.jsContent3'));
            }
            const isLt2M = file.size / 1024 / 1024 < 2;
            if (!isLt2M) {
                message.info(this.t('LibraryPage.jsContent4'));
            }
			if(isJpgOrPng && isLt2M){
				this.currentUploadFileNum = fileList.length
            }else{
                return (isJpgOrPng && isLt2M) || Upload.LIST_IGNORE;
            }
        },



        customRequest(event:any){
			if(this.selectCode == "Models"){
				return
			}
			//试用用户上传限制
			// if(this.imgList.length+this.currentUploadFileNum > 10 && this.isTest){
			// 	message.info(this.t('isTest.image'));
			// 	return
			// }
            let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : ''
            let new_data = {
                file:event.file,
                level1Type:this.selectCode,
                level2Type:designType,
				sex:this.selectCode == 'Sketchboard' ? this.sex.value:'',
				modelType:'',
				checkMd5:1,
                timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
            }
            this.isShowMark = true
            Https.axiosPost(Https.httpUrls.libraryUpload, new_data,{headers:{'Content-Type': 'multipart/form-data'}}).then(
                (rv: any) => {
					if(!rv.checkMd5){
						this.affirmCstomRequest(new_data)
					}else{
						this.currentUploadFileNum -- 
						if(!this.currentUploadFileNum){
							this.getLibraryList('')
						}
					}
                }
            ).catch((res)=>{
                this.currentUploadFileNum -- 
                if(!this.currentUploadFileNum){
                    this.getLibraryList('')
                }
            });
        },
		affirmCstomRequest(data:any){
			let _this = this
            Modal.confirm({
                title: this.t('LibraryPage.jsContent5'),
                icon: createVNode(ExclamationCircleOutlined),
                okText: 'Yes',
                cancelText: 'No',
				mask:false,
				zIndex:99999,
                centered:true,
                onOk() {
					data.checkMd5 = 0
					Https.axiosPost(Https.httpUrls.libraryUpload, data,{headers:{'Content-Type': 'multipart/form-data'}}).then(
						(rv: any) => {
							_this.currentUploadFileNum -- 
							if(!_this.currentUploadFileNum){
								_this.getLibraryList('')
							}
						}
					).catch((res)=>{
						_this.currentUploadFileNum -- 
						if(!_this.currentUploadFileNum){
							_this.getLibraryList('')
						}
					});
                },
				onCancel(){
					_this.currentUploadFileNum -- 
					if(!_this.currentUploadFileNum){
						_this.getLibraryList('')
					}
				}
            });
		},
        getLibraryList(str:any){
			let labelArr:any = []
			this.value.labelValue.forEach((item:any)=>{
				labelArr.push(item[item.length-1])
			})
            let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : ''
            let data = {
				classificationIdList:labelArr,
                level1Type:this.selectCode,
                level2Type:designType,
                page:1,
				modelSex:this.sex.value?this.sex.value:'',
                pictureName:this.searchPictureName,
                size:this.pageSize,
				intersection:this.intersection,
            }
			if(str == 'page'){
				data.page = this.currentPage
			}else{
				this.currentPage = 1
			}
            this.isShowMark = true
            Https.axiosPost(Https.httpUrls.queryLibraryPage,data).then(
                (rv: any) => {
					if(rv.content.length == 0 && this.currentPage != 1){
						this.currentPage = 1
						this.getLibraryList('')
					}else{
						this.imgList = rv.content
						this.total = rv.total
						this.newSearchPictureName = this.searchPictureName
						this.isShowMark = false
					}
                }
            ).catch((res)=>{
                this.isShowMark = false
            });
        },

        //编辑模特打点
        editPlacementClick(data:any){
			let name = data.name + '.'+data.url.split("?")[0].split(".").pop()
            let newData = {
                ...data.libraryModelPoint,
                url:data.url,
				name:name,
            }
            this.placementClick(newData)
        },

        //给模特打点编辑
        placementClick(data:any){
            let placementModal:any = isMoible() ? this.$refs.ModelPlacementMobile : this.$refs.ModelPlacement
            placementModal.showPlacementModal(data,this.sex)
        },
		//generate
		setKeyword(num: any) {
            this.checkbox.forEach((v: any) => {
                v.type = false;
            });
			nextTick().then(()=>{
				this.checkbox[num].type = true
				if(this.checkbox[1].type){
					this.selectGenerateList.forEach((v:any)=>{
						v.checked = false
					})
				}
			})
        },
		ifMaximumLength(){
			clearTimeout(this.inputTime)
			this.inputTime = setTimeout(()=>{
				if(this.captionGeneration?.split(/\s+/).length > 75){
					this.inputShow = true
				}else{
					this.inputShow = false
				}
			},500)
		},
		generateFileUploadChange(data:any){
			let file = data.file;
			let bor = true
            if (file.status === "done") {
                let res:any = JSON.parse(file.xhr.response);
				if(res.errCode == 0){
					file.id = res.data.id;
					file.imgUrl = res.data.url;
					file.resData = res.data;
					file.type_ = "upload";
				}else{
					bor = false
				}
            } else if (file.status === "error") {
				bor = false
            }
			if(!bor){
                let res:any = JSON.parse(file.xhr.response);
                let index = -1;
                this.selectGenerateList.forEach((ele: any, index1: any) => {
                    if (file.uid === ele.uid) {
                        index = index1;
                    }
                });
                if (index > -1) {
                    this.selectGenerateList.splice(index, 1);
                }
                // message.warning(file.name + this.t('LibraryPage.jsContent8'));
                message.warning(res.errMsg);
			}
		},
		deleteFile(index: any) {
		   this.selectGenerateList.splice(index, 1);

        },
		setSketchboardItem(item:any){
			if(this.checkbox[1].type){
				return
			}
			if(item.checked){
				item.checked = false
			}else{
				this.selectGenerateList.forEach((v:any)=>{
					if(v.checked){
						v.checked = false
					}
				})
				item.checked = true
			}
		},
		PrintModel(){
			if(!this.printModel.optype){
				document.addEventListener('click',this.removePrintModel)
			}
			this.printModel.optype = !this.printModel.optype
		},
		removePrintModel(){
			this.printModel.optype = false
			document.removeEventListener('click',this.removePrintModel)
		},
		setprintModel(num:any){
			this.printModel = {
				num : num,
				optype:false,
				name:this.t('LibraryPage.Model'+num)
			}
		},
		getgenerate(){
			clearInterval(this.remGenerateTime)
			this.remGenerate = false
			// if(this.isTest){//试用用户禁止使用
			// 	message.info(
			// 		this.t('isTest.available')
			// 		);
			// 	return
			// }
			if(this.isShowMark){
				return
			}
			let arr = ["Painting Style","Illustration Style","Real Style"]
			let generateType = this.checkbox.filter((v:any)=>v.type)[0].name
			if(this.selectCode == 'Moodboard'){
				generateType = this.checkbox[1].name
			}
			let generageImg = this.selectGenerateList.filter((v:any)=>v.checked)[0]
			let data = {
				generateType:generateType,
				designType:'',
				collectionElementId:generageImg?.id,
				level1Type:this.selectCode,
				level2Type:this.selectCode == 'Sketchboard'?this.designType.value:'',
				userId:(this?.userInfo as any).userId,
				isTestUser:this.driver__.driver?false:this.isTest,
				text:this.selectCode == 'Printboard'?`${arr[this.printModel.num-1]},${this.captionGeneration}`:this.captionGeneration,
				timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
				version:1,//为1就是Print
				gender:this.selectCode == 'Sketchboard'?this.sex.value:'',
			}
			if(generateType == 'image'){
				if(generageImg?.id){
					data.text = ''
				}else{
					message.info(
						this.t('LibraryPage.jsContent9')
					);
					return
				}
			}else if(generateType == 'text'){
				data.collectionElementId = ''
				data.level2Type = ''
				// this.beforeUpload(false)
				if(this.captionGeneration){
					let arr = this.captionGeneration.split(/\s+/).length
					if(arr > 75){
						message.info(
							this.t('LibraryPage.jsContent6')
						);
					return

					}
				}else{
					message.info(
						this.t('LibraryPage.jsContent7')
					);
					return
				}
				
			}else if(generateType == 'text-image'){
				if(generageImg?.id){
					if(this.captionGeneration){
						let arr = this.captionGeneration.split(/\s+/).length
						if(arr > 75){
							message.info(
								this.t('LibraryPage.jsContent6')
							);
						return

						}
					}else{
						message.info(
							this.t('LibraryPage.jsContent7')
						);
						return
					}
				}else{
					message.info(
						this.t('LibraryPage.jsContent9')
					);
					return
				}
			}
			this.isShowMark = true
			this.isGenerate = true
			Https.axiosPost(Https.httpUrls.generatePrepare, data).then(
                (rv) => {
					if(data.isTestUser){
						let str:any
						if(this.selectCode == 'Moodboard'){
							str = this.t('collectionModal.Moodboard')
						}else if(this.selectCode == 'Printboard'){
							str = this.t('collectionModal.Printboard')
						}else if(this.selectCode == 'Sketchboard'){
							str = this.t('collectionModal.Sketchboard')
						}
						if(rv.leftUsageCount >= 1){
							message.warning(this.t('Generate.jsContent8',{num:rv.leftUsageCount,str:str}));
						}else if(rv.leftUsageCount == 0){
							message.warning(this.t('Generate.jsContent9',{str:str}));
							this.isGenerate = false
							this.isShowMark = false
							return
						}
					}
					this.generateId = rv.uniqueId
					this.setGenerate()
					this.remGenerateTime = setTimeout(()=>{
						this.remGenerate = true
					},10000)
                }
            ).catch(res=>{
				this.isShowMark = false
				this.isGenerate = false
            });
		},
		setGenerate(){
			this.generateTime = setInterval(()=>{
				let data = {uniqueId:this.generateId}
				Https.axiosGet(Https.httpUrls.generateResult, {params:data}).then(
					(rv) => {
						if(rv.generateId){
							this.generateLineUp = -1
							clearInterval(this.generateTime)
							let arr
							rv.generatedCollectionItems.forEach((v:any,index:number)=>{
								arr = {
									id:v.generateItemId,
									imgUrl:v.generateItemUrl,
									like:v.isLiked
								}
							// this.generateList.push(arr)
							this.generateList.unshift(arr)
							
							})
						// this.isShowMark = false
						this.isGenerate = false
						this.isShowMark = false
						clearInterval(this.remGenerateTime)
						this.remGenerate = false
						}else{
							this.generateLineUp = rv.rankPosition
						}
					}
				).catch(res=>{
					clearInterval(this.generateTime)
					clearInterval(this.remGenerateTime)
					this.isShowMark = false
					this.isGenerate = false
				});
			},5000)
		},
		removeGenerate(){
			if(this.generateId){
				let data = {uniqueId:this.generateId,userId:(this?.userInfo as any).userId,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}
				Https.axiosGet(Https.httpUrls.generateStopWaiting, {params:data}).then(
					(rv) => {
						this.generateId = ''
						this.isShowMark = false
						this.isGenerate = false
						this.generateLineUp = -1
						clearInterval(this.generateTime)
					}
				).catch(res=>{
				});
			}
		},
		dropdownVisibleChange1(){
			let element:any = this.$refs.cascader1
			let el = element.contentRef?.getElementsByClassName('el-cascader-menu__empty-text')?.[0]
			if(el){
				el.innerHTML = this.t('LibraryPage.NoLabel')
			}
		},
		dropdownVisibleChange(){
			let element:any = this.$refs.cascader
			// element.contentRef._value.textContent = 123123
			// element.contentRef._value.outerText = 123123
			nextTick().then(()=>{
				let cascader = document.getElementsByClassName('libraryPageCascader')[0]
				let cascaderChild = cascader
				let element:any = this.$refs.cascader
				if(cascader.children.length > 3 ){
				}else{
					let button1:any = document.createElement("span")
					button1.classList.add('started_btn','cascader_btn1')
					let button2:any = document.createElement("span")
					button2.classList.add('started_btn','cascader_btn2')
					let divMax:any = document.createElement("div")
					divMax.classList.add('cascader_btn_max')
					button1.textContent = 'Edit'
					// button2.textContent = '删除'
					button1.addEventListener('click',this.removeLabel,false)
					divMax.appendChild(button1)
					// divMax.appendChild(button2)
					cascaderChild?.insertAdjacentElement("afterbegin", divMax);
					
					// cascader.addEventListener('click',this.cascaderClick)
				}
			})
			let el = element.contentRef?.getElementsByClassName('el-cascader-menu__empty-text')?.[0]
			if(el){
				el.innerHTML = this.t('LibraryPage.NoLabel')
			}
		},
		// cascaderClick(e:Event){
		// 	console.log(e.target)
		// },
		
		removeLabel(){
			let setLabel:any = this.$refs.setLabel
			let cascader:any = this.$refs.cascader
			cascader.togglePopperVisible()
			let event = new Event('click', {"bubbles":true, "cancelable":true});
			document.dispatchEvent(event);
			setLabel.init('add',this.options)
		},
		labelSearch(){
			nextTick().then(()=>{
				let cascader = document.getElementsByClassName('editLabel')[0]
				cascader.addEventListener('click',(event)=>{
					event.stopPropagation()
				})
			})
			

		},
		getClass(){
			let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : ''
			let data = {
				"classificationIdList": [],
				"classificationName": "",
				"createTime": "",
				"deleteConfirm": '',
				"id": '',
				"libraryId": '',
				"parentId": '',
				"type": this.selectCode,
				"updateTime": "",
				"userId": ''
			}
			Https.axiosPost(Https.httpUrls.queryClassification, data).then(
                (rv: any) => {
					this.options = rv
					rv.forEach((rvItem:any,rvIndex:number) => {
						this.options[rvIndex].value = rvItem.id
						this.options[rvIndex].label = rvItem.classificationName
						rvItem.childList.forEach((childItem:any,index:number) => {
							this.options[rvIndex].childList[index].value = childItem.id
							this.options[rvIndex].childList[index].label = childItem.classificationName
						});
					});
                }
            ).catch((res)=>{
            });
		},
		scaleImage(index:any){
			let scaleImage:any = this.$refs.scaleImage
			scaleImage.scaleImageMask = true
			scaleImage.init(this.generateList,index)
		},
    }
})
</script>
<style lang="less">
.el-icon{
	font-size: 14px;
}
.library_page {
    width: 100%;
	overflow: hidden;
    height: 100%;
	padding: 0 9rem;
	// min-width: 1440px;
	position: relative;
    .page_content {
        position: relative;

        .page_content_bg {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .page_content_body {
            position: absolute;
            width: 100%;
            height: 100%;
            box-sizing: border-box;
			display: flex;
			flex-direction: column;
            
            .library_page_body{
				overflow: hidden;
                width: 100%;
                // height: calc(100% - 7rem);
				flex: 1;
                box-sizing: border-box;
                display: flex;
				padding-top: 2rem;
                .library_body_left{
                    width: 27.5rem;
                    height: 100%;
                    background: rgba(255,255,255,0.4);
					margin-right: 5rem;
					>div{
						background: #f7f8fa;
						border-radius: 2rem;
						overflow: hidden;
						padding: 2rem 0;
					}
                    .library_menu_list{
						padding-left: 2rem;
                        .menu_item{
                            width: 100%;
                            height: 6.8rem;
                            display: flex;
							font-weight: 900;
                            align-items: center;
                            justify-content: space-between;
                            padding: 0 1rem 0 2.5rem;
                            border-left: 0.5rem solid transparent;
                            // font-size: 1.6rem;
							font-size: var(--aida-fsize2);
                            color: #030303;
                            cursor: pointer;
							transition: all .3s;
                            
                            &.child_menu_item{
                                padding-left: 6.5rem;
                            }

                            &.select_menu_item{
                                background: #fff;
								border-radius: 2rem;
								transform: translateX(2rem);
                                // background: #E6E6F6;
                                // border-color: #343579;;
                            }

                            .menu_item_left{
                                display: flex;
                                align-items: center;
                                user-select: none;

                                .fi{
                                    font-size: 2.2rem;
									display: flex;
                                    color: #030303;
                                    margin-right: 1.8rem;
                                }
                            }

                            .icon_rotate{
                                -moz-transform:rotate(180deg);
                                -webkit-transform:rotate(180deg);
                                transform: rotate(180deg);
                                animation-direction: 0.5s;
                            }
                        }

                    }
                }
                .library_body_right{
                    width: calc(100% - 23.5rem);
                    height: 100%;

					.header_operate_item{
						margin-right: 5rem;
						color: #C2C2C2;
						font-size: var(--aida-fsize1-8);
						.ant-upload{
							// font-size: 1.6rem;
							// font-weight: 900;
						}
						.ant-upload-list-text{
							display: none;
						}

						&.operate_select{
							color:#333333;
							cursor: pointer;
							font-weight: 900;
						}
						&.fontSize{
							font-size: 1.4rem;
						}
						&.active{
							color:#333333;
							cursor: pointer;
						}
						&.pointer{
							cursor: pointer;
						}
						&:last-child{
							margin-right: 11rem;
						}
					}

					.content_search_block{
						display: flex;
						align-items: center;
						width: 75rem; 
						.search_input{
							// width: 20.8rem;
							// padding-left: 1.5rem;
							// height: 2.8rem;
							// line-height: 3.6rem;
							// background: #FFFFFF;
							// border: 0.1rem solid #F1F1F1;
							// font-size: 1.6rem;
							// font-weight: 400;
							height: 3rem;
							border-radius: 0.5rem;
							width: 20rem;
							border: 1px solid rgba(0, 0, 0, 0.15);
							padding-left: 1.5rem;
							border: 0.1rem solid #F1F1F1;
							font-size: 1.2rem;
							font-weight: 400;
							margin-right: 2rem;
							&::placeholder {
								color: #C2C2C2;
							}
						}
						.search_cascader{
							// width: 53%;
							width: 38rem;
							display: flex;
							position: relative;
							
							
						}
						.search_icon_block{
							width: 5.2rem;
							height: 2.8rem;
							line-height: 2.8rem;
							text-align: center;
							background: #343579;
							background-color: #39215b;
							cursor: pointer;
							border-radius: 2rem;
							margin-left: 3rem;
							.icon-sousuo{
								font-size: 1.6rem;
								color: #FFFFFF;
							}
						}
						.intersection{
							margin-left: 3rem;
							cursor: pointer;
						}
						
					}

                    .library_right_header{
                        display: flex;
                        padding: 0 3.5rem 0 2.8rem;
                        align-items: center;
                        justify-content: space-between;
                        background: rgba(255,255,255,0.4);
                        box-shadow: 0 0.2rem 0.8rem 0 rgba(238,238,244,0.25);

                        .library_header_left{
                            height: 4rem;
                            display: flex;
                            align-items: center;

                           
                        }

						 

                        .librart_headr_right{
                            display: flex;
                            align-items: center;
                            .select_block{
                                // background: #FFFFFF;
                                color: #1A1A1A !important;
								.ant-select-selector{
									border: 2px solid !important;
								}
								.ant-select{
									.ant-select-arrow{
										.icon-xiala{
											margin-left: -2rem;
											zoom: .7;
										}
									}
								}
                                .icon-xiala{
                                    color: #1A1A1A !important;
                                }
                            }
                        }
                    }

                    .libray_right_content{
                        width:100%;
                        height:calc(100% - 8rem);
                        padding: 0.1rem 0 0 0.3rem;
                        box-sizing: border-box;

                        .right_content_body{
                            width: 100%;
                            height: 100%;
                            background: #f6f5fa;
                            padding: 0 2rem 5rem 1rem;
							border-radius: 2rem;
							overflow: hidden;
							display: flex;
							flex-direction: column;
                            .content_body_header{
                                height: 10rem;
                                display: flex;
                                justify-content: flex-end;
                                align-items: center;
								// padding: 2rem 0 2rem 3rem;
								padding-left: 3rem;
								box-sizing: content-box;
								justify-content: space-between;
								.content_body_header_left{
									display: flex;
									align-items: center;
								}
								.content_body_header_right{
									display: flex;
									width: 43rem;
								}
                                .check_all_block{
                                    display: flex;
                                    align-items: center;
                                    font-size: 1.6rem;
                                    color: #64686D;
                                    cursor: pointer;

                                    &.check_all{
                                        color: #1A1A1A;
                                    }

                                    .check_block{
                                        width: 2.4rem;
                                        height: 2.4rem;
                                        background: #EBECF4;
                                        border: 0.1rem solid #64686D;
                                        padding: 0.3rem;
                                        margin-right: 0.7rem;

                                        .check_block_body{
                                            width: 100%;
                                            height: 100%;
                                            background: #343579;
                                        }
                                    }
                                }
								&.content_body_header_generate{
									justify-content: flex-start;
									.checkboxItem {
										margin-right: 4rem;
										label {
											display: flex;
											cursor: pointer;
											input {
												margin-right: 0.5rem;
												padding-left: 1.5rem;
											}
											span {
												font-size: 1.4rem;
												font-weight: 500;
											}
										}
									}
									.input_box{
										background:initial;
										padding: 1.5rem 0;
										input{
											width: 30rem;
											height: 3rem;
											&.active{
												cursor: no-drop;
											}
										}
										
										.generage_btn{
											margin: 0 3rem;
										}
									}
									.printModel{
											font-size: 1.4rem;
											font-weight: 500;
											>div{
												width: 13rem;
												// display: flex;
												display: block;
												border-radius: 1rem;
												margin: 0;
												border: 2px solid;
												cursor: pointer;
												white-space: nowrap; 
												overflow: hidden;
												text-overflow: ellipsis;
												padding: 0 1rem;
												text-align: center;
											}
											ul{
												position: absolute;
												width: 13rem;
												text-align: center;
												margin-top: .3rem;
												border-radius: 1rem;
												overflow: hidden;
												z-index: 3;
												li{
													background: #c5c4c8;
													line-height: 2;
													cursor: pointer;
													white-space: nowrap; 
													overflow: hidden;
													text-overflow: ellipsis;
													padding: 0 1rem;
													&.printModel_item:hover{
														background: #949396;
													}
												}
											}
										}
									.upload_item{
										margin-left: 4rem;
										.upload_file_item{
											width: 8rem;
											height: 8rem;
											margin: 0;
											margin-right: 2rem;
										}
										.upload_component{
											margin: 0;
										}
										
									}
									
								}
								
                            }

                            .content_body_table{
                                width: 100%;
                                height: calc(100% - 12rem);
                                overflow-y:auto;
								display: flex;
								flex-wrap: wrap;
								justify-content: flex-start;
								align-content: flex-start;
								&.content_body_table::-webkit-scrollbar {
									display: none;
								}
                                .content_img_item{
                                    display: inline-block;
                                    vertical-align: top;
                                    padding: 0 1.4rem;
                                    margin-bottom: 2.8rem;
									width: 16.6%;
									display: flex;
									flex-direction: column;
									align-items: center;
									position: relative;
                                    .content_img_item_block{
                                        border: 0.1rem solid transparent;
                                        // width: 16.5rem;
                                        // height: 16.5rem;
										width: 17rem;
										height: 17rem;
                                        display: flex;
                                        align-items: center;
                                        justify-content: center;
                                        position: relative;
                                        cursor: pointer;
										background: #fff;
                                        &.select_item_img{
                                            // border-color: #343579;
											opacity: 0.5;
											border-radius: 1rem;
											transform: scale(0.9);
                                        }

                                        .content_img{
                                            max-width: 100%;
                                            max-height: 100%;
                                        }

                                        .board_content_img{
                                            // width: 100%;
                                            // height: 100%;
                                        }

                                        &:hover .img_item_hover{
                                            display: block;
                                        }

                                        .img_item_hover{
                                            position: absolute;
                                            width: 100%;
                                            height: 100%;
                                            left: 0;
                                            top:0;
                                            background: rgba(0,0,0,0.2);
                                            display: none;

                                            .img_operate_content{
                                                position: absolute;
                                                right: 0.6rem;
                                                top: 0.6rem;
												&.left{
													left: 0.6rem;
													right: auto;
													
												}
                                            }
                                            .img_operate_block{
                                                width: 3.6rem;
                                                height: 3.6rem;
                                                background: rgba(0,0,0,0.6);
                                                border-radius: 50%;
                                                text-align: center;
                                                line-height: 3.6rem;
                                                cursor: pointer;
                                                margin-bottom: 0.4rem;
                                                .operate_icon{
                                                    font-size: 1.8rem;
                                                    color: #fff;
													&.fi-sr-heart{
														color: red;
													}
                                                }
												i{
													font-size: 1.8rem;
													color: #fff;
												}
                                            }
											
                                        }
                                    }
                                    .content_img_name{
                                        width: 16.5rem;
                                        height: 3.5rem;
                                        line-height: 3.5rem;
                                        white-space: nowrap;
                                        text-align: center;
                                        overflow: hidden;
                                        text-overflow: ellipsis;
                                        font-size: 1.4rem;
                                        color: #030303;
                                    }
                                }

                                .no_data_block{
                                    width: 100%;
                                    height: 100%;
                                    display: flex;
                                    justify-content: center;
                                    align-items: center;
                                }
                            }

                            .table_pagination{
                                text-align: center;
								// height: 5.2rem;
								flex: 1;
                                margin-top: 2rem;
                            }
                        }
                    }
                }

            }
        }
        
    }
}

.library_rename_modal_component{

    .collection_rename_content{
        padding:0 6.8rem 1.8rem;

		.collection_rename_title{
			margin: 2rem 0rem 1rem 0;
			font-size: var(--aida-fsize1-8);
		}
        .rename_form_content{

            .rename_form_input{
                width: 100%;
                height: 4.6rem;
                border: 0.1rem solid #d9d9d9;
                padding-left: 2.1rem;
                line-height: 4.6rem;
                font-size: 1.8rem;
                box-sizing: border-box;
				border-radius: 4px;

                &::placeholder {
                    color:#adabb9
                }
            }
			.select_block{
				display: flex;
				justify-content: space-between;
                font-size: 1.8rem;
				color:#adabb9;
				font-weight: 300;
				.ant-select{
					border-radius: 4px;
					width: 48%;
					border: 0.1rem solid #d9d9d9 !important;
					.ant-select-arrow{
						.icon-xiala{
							margin-left: -0rem;
						}
					}
				}
				.ant-select-selection-item{
					color:#262626;
					font-weight: 300;
				}
				.ant-select-selector{
					margin-left: 0rem;
					color:#adabb9;
					width: 100%;
					padding-left: 2.1rem;
				}
				.icon-xiala{
					color: #adabb9 !important;
					font-weight: 400;
				}
			}
        }

        .rename_button_list{
            display: flex;
            align-items: center;
            justify-content: flex-end;
            margin-top: 3rem;

            .rename_button_item{
                width: 8.6rem;
                height: 3.2rem;
                line-height: 3.2rem;
                text-align: center;
                font-size: 1.4rem;
                cursor: pointer;
            }

            .rename_cancel_button{
                background: #E4E5EB;
                color: #030303;
                margin-right: 1.8rem;
            }

            .rename_submit_button{
                background: #343579;
                color: #FFFFFF;
            }
        }
		.el-cascader{
			.el-input--suffix{
			--el-input-hover-border-color: #d9d9d9;
				// border: .1rem solid #d9d9d9;
			}
			height: 4.6rem;
			.el-tag__content{
				line-height: 2.5;
				.el-cascader__tags{
					
				}
			}
			.el-input__wrapper{
				padding-left: 0;
			}
			.el-cascader__search-input,.el-input__inner{
				margin: 0;
				width: 100%;
				height: 4.6rem;
				padding-left: 2.1rem;
				line-height: 4.6rem;
				font-size: 1.8rem;
				box-sizing: border-box;
			}
		}

        
    }
}
</style>