Files
aida_front/src/component/Detail/habit.vue

1098 lines
30 KiB
Vue
Raw Normal View History

2023-07-26 15:54:34 +08:00
<template>
<div class="habit">
2023-09-12 10:11:27 +08:00
<div v-show="openType.habit" class="habit_mask"></div>
2023-11-28 16:21:00 +08:00
<div class="habit_button Guide_1_27" @click.stop="setOpenType('habit')" >
2023-10-30 17:26:36 +08:00
{{ $t('Habit.Workspace') }}
2023-07-26 15:54:34 +08:00
<i class="fi fi-bs-angle-down"></i>
</div>
2023-12-08 16:27:35 +08:00
<div class="habit_content Guide_1_28" :class="[driver__.driver?'showEvents':'']" v-fade="openType.habit">
2023-07-26 15:54:34 +08:00
<div class="habit_title">
2023-10-30 17:26:36 +08:00
<h3>{{ $t('Habit.WorkspaceSetting') }}</h3>
<div class="habit_intro">{{ $t('Habit.settingWorkspace') }}</div>
2023-07-26 15:54:34 +08:00
</div>
2023-09-12 10:11:27 +08:00
<div class="habit_type" trigger="['click']" >
<a-dropdown placement="bottomRight" @click.stop="setOpenType('workspace')">
2023-07-26 15:54:34 +08:00
<a-button>
<UserOutlined />
2023-09-12 10:11:27 +08:00
{{workspaceItem.workSpaceName}}
2023-07-26 15:54:34 +08:00
<DownOutlined />
</a-button>
</a-dropdown>
2023-09-12 10:11:27 +08:00
<div class="habit_model_show habit_workspace_show" v-fade="openType.workspace">
<ul class="habit_model_list">
<li v-for="item,index in workspace.workspaceList">
2023-09-25 10:09:00 +08:00
<div @click.stop="setWorkspace(item.id)" v-show="!item.putName">{{ item.workSpaceName }}</div>
2023-09-12 10:11:27 +08:00
<input v-show="item.putName" type="text" v-model="workspaceItemName">
<i @click.stop="putName(index,'put')" v-show="!item.putName" class="fi fi-rr-edit"></i>
<i @click.stop="putName(index,'affirm')" v-show="item.putName" class="fi fi-br-check"></i>
<i @click.stop="putName(index,'delete')" class="fi fi-rr-trash"></i>
</li>
<li @click="newWorkspace" class="newWorkspace">
<input v-show="openType.addWorkspace" type="text" v-model="workspaceItemName">
<i @click.stop="putName(-1,'affirm')" v-show="openType.addWorkspace" class="fi fi-br-check"></i>
<div v-show="!openType.addWorkspace">+</div>
</li>
2023-12-29 15:33:05 +08:00
<div v-show="total > workspace.workspaceList?.length && total != 0" class="material_content_list_loding" v-observe>
<img src="@/assets/images/homePage/loading.gif" alt="">
</div>
2023-09-12 10:11:27 +08:00
</ul>
</div>
2023-07-26 15:54:34 +08:00
</div>
2023-12-08 17:37:26 +08:00
<div class="habit_Overal_Single" :class="[driver__.index == 2?driver__.driver?'Guide_active':'':'']">
2023-09-25 10:09:00 +08:00
<a-dropdown @click.stop="setOpenType('sex')">
<a-button>
<UserOutlined />
2023-11-23 11:15:10 +08:00
{{ workspaceItem?.sexEnum?.value }}
2023-11-22 15:41:46 +08:00
<!-- {{ workspaceItem.sex.label }} -->
2023-09-25 10:09:00 +08:00
<DownOutlined />
</a-button>
</a-dropdown>
<div class="habit_model_show habit_sex_show" v-fade="openType.sex">
<ul class="habit_model_list">
<li v-for="item,index in sex">
2023-11-23 11:15:10 +08:00
<div @click.stop="setSex(item)">{{ item.value }}</div>
2023-09-25 10:09:00 +08:00
</li>
</ul>
</div>
2023-08-05 12:52:56 +08:00
</div>
2023-07-26 15:54:34 +08:00
<div class="habit_Overal_Single">
<div
class="habit_Overal_Single_text"
2023-09-12 10:11:27 +08:00
:class="{ active: !workspaceItem.overallSingle }"
2023-07-26 15:54:34 +08:00
>
2023-10-30 17:26:36 +08:00
{{ $t('Habit.Overall') }}
2023-07-26 15:54:34 +08:00
</div>
2023-09-25 10:09:00 +08:00
<a-switch @click="setOverallSingle" v-model:checked="workspaceItem.overallSingle" />
2023-07-26 15:54:34 +08:00
<div
class="habit_Overal_Single_text"
2023-09-12 10:11:27 +08:00
:class="{ active: workspaceItem.overallSingle }"
2023-07-26 15:54:34 +08:00
>
2023-10-30 17:26:36 +08:00
{{ $t('Habit.Single') }}
2023-07-26 15:54:34 +08:00
</div>
</div>
2023-09-25 10:09:00 +08:00
<div class="habit_habit_singleton" v-show="workspaceItem.overallSingle">
2023-09-12 10:11:27 +08:00
<a-dropdown @click.stop="setOpenType('singleton')">
2023-07-26 15:54:34 +08:00
<a-button>
<UserOutlined />
2023-11-23 11:15:10 +08:00
{{ workspaceItem?.positionEnum?.value }}
2023-07-26 15:54:34 +08:00
<DownOutlined />
</a-button>
</a-dropdown>
2023-09-12 10:11:27 +08:00
<div class="habit_model_show habit_singleton_show" v-fade="openType.singleton">
<ul class="habit_model_list">
<li v-for="item,index in singleTypeList">
2023-11-23 11:15:10 +08:00
<div @click.stop="setSingle(item)">{{ item.value }}</div>
2023-09-12 10:11:27 +08:00
</li>
</ul>
</div>
2023-07-26 15:54:34 +08:00
</div>
<div class="habit_System_Designer">
<a-slider id="system_silder"
2023-09-12 10:11:27 +08:00
v-model:value="workspaceItem.systemDesignerPercentage"
2023-07-26 15:54:34 +08:00
@afterChange="systemDesigner"
:tip-formatter="formatter"
>
</a-slider>
<div class="habit_System_Designer_text_max">
2023-10-30 17:26:36 +08:00
<div class="habit_System_Designer_text">{{ $t('Habit.System') }}</div>
<div class="habit_System_Designer_text">{{ $t('Habit.Designer') }}</div>
2023-07-26 15:54:34 +08:00
</div>
</div>
2023-12-08 17:37:26 +08:00
<div class="habit_model" :class="[driver__.index == 3?driver__.driver?'Guide_active':'':'']">
2023-07-26 15:54:34 +08:00
<a-dropdown placement="bottomRight"
trigger="['click']"
2023-09-12 10:11:27 +08:00
@click.stop="setOpenType('model')"
2023-07-26 15:54:34 +08:00
>
<a-button>
<UserOutlined />
2023-10-30 17:26:36 +08:00
{{ $t('Habit.Mannequin') }}
2023-07-26 15:54:34 +08:00
<DownOutlined />
</a-button>
</a-dropdown>
</div>
2023-11-28 16:21:00 +08:00
<div id="modelShow" class="habit_model_show Guide_1_29" :class="[driver__.driver?'showEvents':'']" v-fade="openType.model">
2023-07-26 15:54:34 +08:00
<div class="habit_btn">
<div class="model_current">
2023-10-30 17:26:36 +08:00
<div class="model_text">{{ $t('Habit.Current') }}</div>
2023-07-26 15:54:34 +08:00
<div class="model_img">
2023-09-25 10:09:00 +08:00
<img :src="workspaceItem.mannequinUrl" alt="">
2023-07-26 15:54:34 +08:00
</div>
</div>
<div class="model_Designer">
<div class="model_text">
<div
2023-08-05 12:52:56 +08:00
class="habit_System_Seleves_text"
2023-09-25 10:09:00 +08:00
:class="{ active: !systemSeleves }"
2023-07-26 15:54:34 +08:00
>
2023-10-30 17:26:36 +08:00
{{ $t('Habit.System') }}
2023-07-26 15:54:34 +08:00
</div>
2023-10-30 10:03:49 +08:00
<a-switch :disabled="mannequins?.[0]==null?true:false" v-model:checked="systemSeleves" />
2023-07-26 15:54:34 +08:00
<div
2023-08-05 12:52:56 +08:00
class="habit_System_Seleves_text"
2023-09-25 10:09:00 +08:00
:class="{ active: systemSeleves }"
2023-07-26 15:54:34 +08:00
>
2023-10-30 17:26:36 +08:00
{{ $t('Habit.User') }}
2023-07-26 15:54:34 +08:00
</div>
</div>
2023-10-13 17:06:44 +08:00
<div class="model_img" v-show="systemSeleves" v-mousewheel>
<div class="model_img_item">
2023-10-11 17:34:14 +08:00
<div v-for="(item,index) in mannequins?.[0]?.modelList" :key="item.id">
<img :src="item?.presignedUrl" alt="" @click="setMannequins(item,'Library')">
2023-09-25 10:09:00 +08:00
</div>
</div>
</div>
2023-10-13 17:06:44 +08:00
<div class="model_img" v-show="!systemSeleves" v-mousewheel>
<div class="model_img_item">
2023-10-11 17:34:14 +08:00
<div v-for="(item,index) in mannequins?.[1]?.modelList" :key="item.id">
<img :src="item?.presignedUrl" alt="" @click="setMannequins(item,'System')">
2023-09-25 10:09:00 +08:00
</div>
2023-07-26 15:54:34 +08:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
2023-09-12 10:11:27 +08:00
import { useStore } from "vuex";
2023-11-28 16:21:00 +08:00
import { defineComponent, createVNode,nextTick, computed,ref,Ref} from "vue";
2023-07-26 15:54:34 +08:00
import { UserOutlined, DownOutlined } from "@ant-design/icons-vue";
2023-08-05 12:52:56 +08:00
import { Https } from "@/tool/https";
2023-12-15 15:23:34 +08:00
// import type { MenuProps } from "ant-design-vue";
2023-10-12 17:09:05 +08:00
import { Modal,message,Upload} from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
2023-11-28 16:21:00 +08:00
import { openGuide,driverObj__ } from "@/tool/guide";
2023-10-30 17:26:36 +08:00
import { useI18n } from "vue-i18n";
2023-12-22 15:42:41 +08:00
import { position } from "html2canvas/dist/types/css/property-descriptors/position";
2023-07-26 15:54:34 +08:00
export default defineComponent({
components: {
DownOutlined,
UserOutlined,
},
setup(){
2023-11-28 16:21:00 +08:00
const store = useStore();
2023-10-11 17:34:14 +08:00
let workspaceItem:any = ref({
2023-11-28 16:21:00 +08:00
id:'',
2023-09-25 10:09:00 +08:00
id_:1,
workSpaceName:"工作台1",
2023-09-12 10:11:27 +08:00
putName:false,
2023-08-23 17:50:09 +08:00
systemDesignerPercentage:30,
2023-10-20 17:21:45 +08:00
position:'',
sex:'',
2023-09-12 10:11:27 +08:00
overallSingle:false,
2023-09-25 10:09:00 +08:00
mannequinUrl:'',
mannequinType:'',
mannequinId:'',
2023-08-23 17:50:09 +08:00
})
2023-09-25 10:09:00 +08:00
let mannequins:any = ref([{},{}])
let systemSeleves= ref(false);
2023-12-29 15:33:05 +08:00
let total= ref(0);
2023-12-08 16:27:35 +08:00
let openType:any = ref({
2023-09-12 10:11:27 +08:00
workspace:false,
singleton:false,
habit:false,
model:false,
addWorkspace:false,
2023-09-25 10:09:00 +08:00
sex:false
2023-09-12 10:11:27 +08:00
})
2023-11-28 16:21:00 +08:00
let driver__:any = computed(()=>{
return store.state.Guide.guide
})
2023-09-25 10:09:00 +08:00
let workspace:any = ref({
2023-07-26 15:54:34 +08:00
});
2023-09-12 10:11:27 +08:00
let workspaceItemName = ref('')//设置单独name公共使用
2023-10-11 17:34:14 +08:00
let singleTypeList:any = ref([
2023-09-25 10:09:00 +08:00
])
let sex = ref([
2023-07-26 15:54:34 +08:00
])
2023-12-22 15:42:41 +08:00
let position = ref([
{
name:'FemalePosition',
value:[],
},{
name:'MalePosition',
value:[],
},
])
2023-10-30 17:26:36 +08:00
const {t} = useI18n()
2023-07-26 15:54:34 +08:00
return{
2023-09-12 10:11:27 +08:00
systemSeleves,
2023-09-25 10:09:00 +08:00
mannequins,
2023-09-12 10:11:27 +08:00
openType,
2023-12-29 15:33:05 +08:00
total,
2023-11-28 16:21:00 +08:00
driver__,
2023-09-12 10:11:27 +08:00
workspace,
workspaceItem,
workspaceItemName,
2023-09-25 10:09:00 +08:00
singleTypeList,
2023-10-30 17:26:36 +08:00
sex,
2023-12-22 15:42:41 +08:00
position,
2023-10-30 17:26:36 +08:00
t
2023-07-26 15:54:34 +08:00
}
},
2023-09-12 10:11:27 +08:00
watch:{
'openType.habit':{
handler(newVal:any,oldVal:any){
// this.store.state.Workspace.workspace
if(!newVal){
2023-10-11 17:34:14 +08:00
if(!this.workspaceItem.overallSingle){
this.workspaceItem.position = 'Overall'
}
2023-09-25 10:09:00 +08:00
let data = this.workspaceItem
2023-10-12 17:09:05 +08:00
delete data.isLastIndex
this.putWorkspace(data,'')
2023-11-29 10:11:19 +08:00
this.openType.model = false
2023-11-28 16:21:00 +08:00
// this.getDetail(this.workspaceItem.id)
2023-09-25 10:09:00 +08:00
this.store.commit("setWorkspace", this.workspaceItem);
2023-09-12 10:11:27 +08:00
}
}
},
2023-12-08 16:27:35 +08:00
driver__:{
handler(newVal:any,oldVal:any){
2023-12-08 17:37:26 +08:00
if(newVal.index>=5){
2023-12-08 16:27:35 +08:00
this.openType.habit = false
}
}
},
2023-09-25 10:09:00 +08:00
'workspaceItem.id_':{
2023-09-12 10:11:27 +08:00
handler(newVal:any,oldVal:any){
2023-09-25 10:09:00 +08:00
this.workspace.workspaceList.forEach((v:any)=>{
if(v.id == this.workspaceItem.id_){
this.workspaceItem = v
this.workspaceItem.id_ = v.id
}
if(v.id == oldVal){
delete v.isLastIndex
2023-10-12 17:09:05 +08:00
this.putWorkspace(v,newVal)
2023-11-28 16:21:00 +08:00
this.getDetail(newVal)
2023-09-25 10:09:00 +08:00
}
})
2023-10-12 17:09:05 +08:00
this.getMannequins()
2023-09-12 10:11:27 +08:00
}
},
2023-11-16 09:44:53 +08:00
'openType.workspace':{
handler(newVal:any,oldVal:any){
this.openType.addWorkspace = false
this.workspace.workspaceList.forEach((item:any) => {
item.putName = false
});
// this.workspace.workspaceList.forEach((v:any)=>{
// if(v.id == this.workspaceItem.id_){
// this.workspaceItem = v
// this.workspaceItem.id_ = v.id
// }
// if(v.id == oldVal){
// delete v.isLastIndex
// this.putWorkspace(v,newVal)
// // this.getDetail(newVal)
// }
// })
}
},
2023-12-08 16:27:35 +08:00
'workspaceItem.overallSingle':{
2023-11-28 16:21:00 +08:00
handler(newVal:any,oldVal:any){
2023-12-08 16:27:35 +08:00
if(this.driver__.driver){
driverObj__.refresh();
}
2023-11-28 16:21:00 +08:00
}
},
2023-12-08 17:37:26 +08:00
'openType.sex':{
handler(newVal:any,oldVal:any){
if(this.driver__.driver && oldVal){
driverObj__.moveTo(3);
}
}
},
2023-12-08 16:27:35 +08:00
// 'openType.model':{
// handler(newVal:any,oldVal:any){
// if(this.driver__.driver){
// console.log(213);
// driverObj__.refresh();
// }
// }
// },
2023-09-12 10:11:27 +08:00
workspaceItem:{
handler(newVal:any,oldVal:any){
2023-10-11 17:34:14 +08:00
this.store.commit("setWorkspace", this.workspaceItem);
2023-09-12 10:11:27 +08:00
}
}
},
2023-07-26 15:54:34 +08:00
data() {
return {
2023-09-12 10:11:27 +08:00
store: useStore(),
2023-07-26 15:54:34 +08:00
};
},
2024-01-02 16:22:33 +08:00
async mounted() {
// new Promise((resolve) => {
// this.getPosition(resolve)
// })
2024-01-02 16:22:33 +08:00
await this.getPosition()
2023-09-12 10:11:27 +08:00
this.getworkspace()
2023-11-28 16:21:00 +08:00
this.getSex()
2023-08-05 12:52:56 +08:00
},
2023-07-26 15:54:34 +08:00
directives:{
fade:{
2023-09-25 10:09:00 +08:00
mounted (el,binding) {
2023-09-12 10:11:27 +08:00
el.addEventListener('click',()=>{
})
},
2023-07-26 15:54:34 +08:00
updated (el,model){
if(model.value){
el.style.display="block"
setTimeout(() => {
el.classList.add("active")
}, 100);
}else{
el.classList.remove("active")
setTimeout(() => {
el.style.display="none"
}, 100);
}
}
2023-09-25 10:09:00 +08:00
},
mousewheel:{
mounted (el) {
2023-10-13 17:06:44 +08:00
el.addEventListener('wheel',(e:WheelEvent)=>{
let num = 0
if(e.deltaY > 0){
num = 25
}else{
num = -25
2023-09-25 10:09:00 +08:00
}
2023-10-13 17:06:44 +08:00
el.scrollBy(num, 0);
2023-09-25 10:09:00 +08:00
})
}
2023-12-29 15:33:05 +08:00
},
observe:{
mounted (el,binding) {
// console.log(binding.instance);
const ob = new IntersectionObserver(callback,{
root:null,
threshold:[0.1]
})
ob.observe(el)
// this.currentPage = 1
// this.pageSize = 12
let this_:any = binding.instance
function callback(entries:any, observer:any) {
entries.forEach((entry:any) => {
if (entry.isIntersecting) {
this_.getworkspace('di')
} else {
}
});
}
},
},
2023-07-26 15:54:34 +08:00
},
methods: {
2023-11-09 10:16:18 +08:00
async getSex(){
await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'Sex'}}).then((rv: any) => {
2023-09-25 10:09:00 +08:00
if (rv) {
2023-12-11 14:30:16 +08:00
this.store.commit("setWorkspaceSex", rv);
2023-11-23 14:05:35 +08:00
this.sex = rv
2023-09-25 10:09:00 +08:00
}
})
2023-10-11 17:34:14 +08:00
},
2023-12-22 15:42:41 +08:00
setPosition(str:any){
let num
2023-11-23 14:05:35 +08:00
if(this.workspaceItem.sexEnum.name == 'Female'){
2023-12-22 15:42:41 +08:00
num = 0
2023-10-11 17:34:14 +08:00
}else{
2023-12-22 15:42:41 +08:00
num = 1
}
2023-12-22 15:42:41 +08:00
this.singleTypeList = this.position[num].value
this.store.commit("setWorkspacePosition", this.position[num].value);
if(str == 'sex'){
this.workspaceItem.position = this.singleTypeList[0].name
this.workspaceItem.positionEnum = this.singleTypeList[0]
2023-10-11 17:34:14 +08:00
}
2023-12-22 15:42:41 +08:00
},
2023-12-30 10:02:28 +08:00
async getPosition(){
await new Promise(async (resolve) => {
await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'FemalePosition'}}).then((rv: any) => {
if (rv) {
this.position[0].value = rv
}
})
await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'MalePosition'}}).then((rv: any) => {
if (rv) {
this.position[1].value = rv
}
})
resolve('')
2023-09-25 10:09:00 +08:00
})
// this.getworkspace()
2023-12-30 10:02:28 +08:00
// this.setPosition('')
2023-11-09 10:16:18 +08:00
},
2023-08-05 12:52:56 +08:00
getworkspace(){
2023-09-12 10:11:27 +08:00
// Https.axiosGet(Https.httpUrls.workspaceDetail,{params:{id:3}}).then((rv: any) => {
// if (rv) {
// console.log(rv,'workspace');
// }
// })
let data = {
page:1,
size:10,
}
2023-12-29 15:33:05 +08:00
// data.page = this.workspace.workspaceList?.[0]?.id != undefined?this.workspace.workspaceList?.length / data.size+1:1
data.size = this.workspace.workspaceList?.[0]?.id != undefined?this.workspace.workspaceList?.length + data.size+1:10
2023-09-12 10:11:27 +08:00
Https.axiosPost(Https.httpUrls.workspaceList,data).then((rv: any) => {
2023-08-05 12:52:56 +08:00
if (rv) {
2023-09-25 10:09:00 +08:00
rv.page.content.forEach((v:any) => {
v.id_ = v.id
if(v.position == "Overall"){
v.overallSingle = false
2023-09-12 10:11:27 +08:00
}else{
2023-09-25 10:09:00 +08:00
v.overallSingle = true
}
v.putName = false
2023-11-28 16:21:00 +08:00
if(v.id == (this.workspaceItem.id?this.workspaceItem.id:rv.id)){
2023-09-25 10:09:00 +08:00
this.workspaceItem = v
2023-10-11 17:34:14 +08:00
this.setMannequinsSex()
2023-12-22 15:42:41 +08:00
this.setPosition('')
2023-09-12 10:11:27 +08:00
}
2023-09-25 10:09:00 +08:00
});
2023-12-29 15:33:05 +08:00
this.total = rv.page.total
2023-09-25 10:09:00 +08:00
this.workspace.id = rv.id
2023-12-29 15:33:05 +08:00
// if(this.workspace.workspaceList){
// this.workspace.workspaceList.push(...rv.page.content)
// }else{
// this.workspace.workspaceList = rv.page.content
// }
2023-09-25 10:09:00 +08:00
this.workspace.workspaceList = rv.page.content
}
})
},
2023-10-11 17:34:14 +08:00
getDetail(id:any){//
2023-09-25 10:09:00 +08:00
Https.axiosGet(Https.httpUrls.workspaceDetail,{params:{id:id}}).then((rv: any) => {
if (rv) {
2023-11-28 16:21:00 +08:00
// this.getworkspace()
2023-09-25 10:09:00 +08:00
}
})
},
2023-10-11 17:34:14 +08:00
getMannequins(){//获取模特
Https.axiosGet(Https.httpUrls.getMannequins,{params:{sex:this.workspaceItem.sex}}).then((rv: any) => {
2023-09-25 10:09:00 +08:00
if (rv) {
2023-10-12 17:09:05 +08:00
// rv.forEach((item:any)=>{
// item.type ==
// })
if(rv[0].type == 'System'){
let a = rv[0]
rv[0] = rv[1]
rv[1] = a
}
2023-09-25 10:09:00 +08:00
this.mannequins = rv
2023-10-30 10:03:49 +08:00
if(this.mannequins?.[0]==null){
this.systemSeleves = false
}
2023-08-05 12:52:56 +08:00
}
})
2023-09-12 10:11:27 +08:00
2023-08-05 12:52:56 +08:00
},
2023-10-12 17:09:05 +08:00
putWorkspace(data:any,index:any){//修改workspace
2023-09-25 10:09:00 +08:00
Https.axiosPost(Https.httpUrls.workspacesaveOrUpdate,data).then((rv: any) => {
if (rv) {
2023-10-12 17:09:05 +08:00
if(index){
2023-11-28 16:21:00 +08:00
// this.getDetail(index)
2023-10-20 17:21:45 +08:00
}else{
this.getworkspace()
2023-10-12 17:09:05 +08:00
}
2023-11-24 17:32:57 +08:00
this.workspace.workspaceList[index].workSpaceName = this.workspaceItemName
this.workspace.workspaceList[index].putName = false
this.openType.addWorkspace = false
2023-09-25 10:09:00 +08:00
}
2023-11-16 17:23:17 +08:00
}).catch((res)=>{
2023-11-27 09:49:49 +08:00
this.getworkspace()
2023-11-16 17:23:17 +08:00
});
2023-09-12 10:11:27 +08:00
},
2023-09-25 10:09:00 +08:00
deleteWorkspace(data:any){
Https.axiosDelete(Https.httpUrls.workspaceRemove,data).then((rv: any) => {
if (rv) {
this.getworkspace()
}
})
},
//
setOverallSingle(){
2023-10-11 17:34:14 +08:00
if(this.workspaceItem.overallSingle){
2023-11-23 11:15:10 +08:00
this.workspaceItem.position = this.singleTypeList[0].name
this.workspaceItem.positionEnum = this.singleTypeList[0]
2023-10-11 17:34:14 +08:00
}else{
2023-10-12 17:09:05 +08:00
this.workspaceItem.position = 'Overall'
2023-09-12 10:11:27 +08:00
}
},
2023-10-12 17:09:05 +08:00
cancelDsign(index:any){
let _this = this
Modal.confirm({
2023-10-30 17:26:36 +08:00
title: _this.t('Habit.jsContent1'),
2023-10-12 17:09:05 +08:00
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
mask:false,
wrapClassName:'habit',
zIndex:999999999,
2023-11-27 16:25:32 +08:00
centered:true,
2023-10-12 17:09:05 +08:00
onOk() {
let data = [{
id:_this.workspace.workspaceList[index].id,
}]
let id = _this.workspace.workspaceList[index].id
_this.deleteWorkspace(data)
}
});
},
2023-09-12 10:11:27 +08:00
//修改名字
putName(index:number,v:string){
2023-09-25 10:09:00 +08:00
this.workspace.workspaceList.forEach((v:any )=> {
2023-09-12 10:11:27 +08:00
v.putName = false
});
2023-11-16 09:44:53 +08:00
this.openType.addWorkspace = false
2023-09-12 10:11:27 +08:00
if(v == 'put'){
2023-09-25 10:09:00 +08:00
this.workspaceItemName = this.workspace.workspaceList[index].workSpaceName
2023-09-12 10:11:27 +08:00
this.workspace.workspaceList[index].putName = true
}else if (v == 'delete'){
2023-10-12 17:09:05 +08:00
this.cancelDsign(index)
// let data = [{
// id:this.workspace.workspaceList[index].id,
// }]
// let id = this.workspace.workspaceList[index].id
// this.deleteWorkspace(data)
2023-09-12 10:11:27 +08:00
}else{
if(this.workspaceItemName == ''){
2023-11-16 17:23:17 +08:00
message.info(this.t('Habit.jsContent2'));
2023-09-12 10:11:27 +08:00
}else{
if(index == -1){
2023-09-25 10:09:00 +08:00
let data = {
workSpaceName:this.workspaceItemName,
}
2023-10-12 17:09:05 +08:00
this.putWorkspace(data,'')
2023-09-12 10:11:27 +08:00
}else{
2023-09-25 10:09:00 +08:00
let data:any
this.workspace.workspaceList.forEach((item:any)=>{
if(this.workspace.workspaceList[index].id == item.id){
2023-11-27 09:49:49 +08:00
// item.putName = true
2023-09-25 10:09:00 +08:00
data = item
}
})
2023-11-27 09:49:49 +08:00
data.workSpaceName = this.workspaceItemName
2023-10-12 17:09:05 +08:00
this.putWorkspace(data,'')
2023-11-24 17:32:57 +08:00
2023-09-12 10:11:27 +08:00
}
}
}
},
//设置系统设计占比
systemDesigner(num: number) {
this.workspaceItem.systemDesignerPercentage = num
2023-07-26 15:54:34 +08:00
},
formatter(value: number) {
return `${value}%`;
},
2023-09-12 10:11:27 +08:00
//根据id设置当前参数
setWorkspace(num:number){
this.openType.addWorkspace = false
2023-09-25 10:09:00 +08:00
this.workspace.workspaceList.forEach((v:any) => {
2023-09-12 10:11:27 +08:00
v.putName = false
});
2023-09-25 10:09:00 +08:00
this.workspaceItem.id_ = num
2023-09-12 10:11:27 +08:00
this.openType.workspace = false
},
//新建参数
newWorkspace(){
2023-09-25 10:09:00 +08:00
this.workspaceItemName = ''
2023-09-12 10:11:27 +08:00
this.openType.addWorkspace = true
2023-11-16 09:44:53 +08:00
this.workspace.workspaceList.forEach((item:any) => {
item.putName = false
});
2023-09-12 10:11:27 +08:00
},
2023-09-25 10:09:00 +08:00
setSex(v:any){
2023-11-23 11:15:10 +08:00
this.workspaceItem.sexEnum = v
2023-09-25 10:09:00 +08:00
this.openType.sex = false
2023-11-23 11:15:10 +08:00
this.workspaceItem.sex = v.name
2023-10-11 17:34:14 +08:00
this.getMannequins()
this.setMannequinsSex()
2023-12-22 15:42:41 +08:00
this.setPosition('sex')
2023-11-09 10:16:18 +08:00
2023-09-25 10:09:00 +08:00
},
2023-09-12 10:11:27 +08:00
//设置single & overall
2023-11-23 11:15:10 +08:00
setSingle(v:any){
2023-09-12 10:11:27 +08:00
this.openType.singleton = false
2023-11-23 11:15:10 +08:00
this.workspaceItem.position = v.name
this.workspaceItem.positionEnum = v
2023-09-12 10:11:27 +08:00
},
2023-09-25 10:09:00 +08:00
setMannequins(item:any,str:string){//设置模特
2023-10-11 17:34:14 +08:00
// this.workspaceItem.mannequinId = item.id
// this.workspaceItem.mannequinType = str
// this.workspaceItem.mannequinUrl = item.presignedUrl
2023-11-28 16:21:00 +08:00
let id
2023-11-23 11:15:10 +08:00
if(this.workspaceItem.sexEnum.name == 'Female'){
2023-11-28 16:21:00 +08:00
id = this.workspaceItem.mannequinFemaleId
2023-10-12 17:09:05 +08:00
this.workspaceItem.femalePresignedUrl = item.presignedUrl
this.workspaceItem.mannequinFemaleType = str
this.workspaceItem.mannequinFemaleId = item.id
2023-11-23 11:15:10 +08:00
}else if(this.workspaceItem.sexEnum.name == 'Male'){
2023-11-28 16:21:00 +08:00
id = this.workspaceItem.mannequinMaleId
2023-10-12 17:09:05 +08:00
this.workspaceItem.malePresignedUrl = item.presignedUrl
this.workspaceItem.mannequinMaleType = str
this.workspaceItem.mannequinMaleId = item.id
}
2023-12-08 16:27:35 +08:00
// if(id != item.id){
if(this.driver__.driver){
// this.openType.habit = false
nextTick().then(()=>{
2023-12-08 17:37:26 +08:00
// driverObj__.moveTo(2);
driverObj__.moveNext();
2023-12-08 16:27:35 +08:00
this.openType.model = false
// driverObj__.moveNext();
})
2023-11-28 16:21:00 +08:00
}
2023-12-08 16:27:35 +08:00
// }
2023-10-11 17:34:14 +08:00
this.workspaceItem.mannequinUrl = item.presignedUrl
2023-09-25 10:09:00 +08:00
this.workspaceItem.mannequinType = str
2023-10-11 17:34:14 +08:00
this.workspaceItem.mannequinId = item.id
},
2023-11-22 15:41:46 +08:00
// FEMALE MALE
2023-10-11 17:34:14 +08:00
setMannequinsSex(){
2023-11-23 11:15:10 +08:00
if(this.workspaceItem.sexEnum.name == 'Female'){
2023-10-11 17:34:14 +08:00
this.workspaceItem.mannequinUrl = this.workspaceItem.femalePresignedUrl
this.workspaceItem.mannequinType = this.workspaceItem.mannequinFemaleType
this.workspaceItem.mannequinId = this.workspaceItem.mannequinFemaleId
2023-11-23 11:15:10 +08:00
}else if(this.workspaceItem.sexEnum.name == 'Male'){
2023-10-11 17:34:14 +08:00
this.workspaceItem.mannequinUrl = this.workspaceItem.malePresignedUrl
this.workspaceItem.mannequinType = this.workspaceItem.mannequinMaleType
this.workspaceItem.mannequinId = this.workspaceItem.mannequinMaleId
}
2023-09-25 10:09:00 +08:00
},
2023-09-12 10:11:27 +08:00
setOpenType(v:string){
if(v == 'habit'){
this.openType.habit = !this.openType.habit
2023-11-28 16:21:00 +08:00
if(this.driver__.driver){
nextTick().then(()=>{
2023-12-08 16:27:35 +08:00
driverObj__.moveNext();
// driverObj__.moveTo(29);
2023-11-28 16:21:00 +08:00
})
}
2023-09-12 10:11:27 +08:00
}else if(v == 'workspace'){
this.openType.singleton = false
2023-09-25 10:09:00 +08:00
this.openType.sex = false
// this.workspace.workspaceList.forEach((v:any) => {
// v.putName = false
// });
2023-09-12 10:11:27 +08:00
this.openType.workspace = !this.openType.workspace
}else if(v == 'model'){
this.openType.singleton = false
this.openType.workspace = false
2023-09-25 10:09:00 +08:00
this.openType.sex = false
2023-09-12 10:11:27 +08:00
this.openType.model = !this.openType.model
2023-09-25 10:09:00 +08:00
this.getMannequins()
2023-12-08 16:27:35 +08:00
if(this.driver__.driver && this.openType.model){
2023-11-28 16:21:00 +08:00
nextTick().then(()=>{
2023-12-08 17:37:26 +08:00
driverObj__.moveTo(4);
2023-12-08 16:27:35 +08:00
// driverObj__.moveNext();
2023-11-28 16:21:00 +08:00
})
}
2023-09-12 10:11:27 +08:00
}else if(v == 'singleton'){
this.openType.singleton = !this.openType.singleton
this.openType.workspace = false
2023-09-25 10:09:00 +08:00
this.openType.sex = false
}else if(v == 'sex'){
this.openType.sex = !this.openType.sex
this.openType.workspace = false
this.openType.singleton = false
2023-11-28 16:21:00 +08:00
2023-07-26 15:54:34 +08:00
}
2023-09-12 10:11:27 +08:00
let mask = document.getElementsByClassName("habit_mask")[0]
mask.addEventListener("click", this.documentClick,true);
2023-07-26 15:54:34 +08:00
},
2023-09-12 10:11:27 +08:00
documentClick(){
let mask = document.getElementsByClassName("habit_mask")[0]
mask.removeEventListener("click", this.documentClick);
this.openType.habit = false
this.openType.workspace = false
this.openType.model = false
this.openType.singleton = false
2023-09-25 10:09:00 +08:00
this.openType.sex = false
2023-07-26 15:54:34 +08:00
},
2023-09-12 10:11:27 +08:00
// //选择模特
// selectModels() {
// let modelsModal: any = this.$refs.modelsModal;
// modelsModal.init();
// },
// //确定选择模特
// sureSelectModel(event: any) {
// this.store.commit("setTemplateData", event);
// },
2023-07-26 15:54:34 +08:00
},
});
</script>
<style lang="less" scoped>
.habit {
position: relative;
.habit_button {
background-color: #fff;
border: solid 2px #000;
padding: 0px calc(2rem*1.2);
2023-07-26 15:54:34 +08:00
box-sizing: initial;
font-weight: 600;
height: calc(3.2rem*1.2);
line-height: calc(3.2rem*1.2);
padding: calc(.4rem*1.2) calc(1.5rem*1.2);
font-size: calc(1.2rem*1.2);
2023-07-26 15:54:34 +08:00
cursor: pointer;
2023-09-12 10:11:27 +08:00
position: relative;
2023-07-26 15:54:34 +08:00
.fi-bs-angle-down {
margin-left: calc(1rem*1.2);
2023-07-26 15:54:34 +08:00
display: inline-block;
transform: translateY(2px);
}
}
2023-09-12 10:11:27 +08:00
.habit_mask{
position: absolute;
top: -20px;
left: auto;
right: -30px;
bottom: 0;
// background: #000;
opacity: 0;
width: 100vw;
height: 100vh;
}
2023-07-26 15:54:34 +08:00
.habit_content {
border: solid 2px #000;
border-radius: calc(1rem*1.2);
padding: calc(2rem*1.2);
2023-07-26 15:54:34 +08:00
// zoom: .75;
font-size: calc(1.6rem*1.2);
2023-07-26 15:54:34 +08:00
transform-origin: top right;
position: absolute;
right: calc(-.3rem*1.2);
2023-07-26 15:54:34 +08:00
top: 110%;
background: #fff;
// width: 25rem*1.2);
width: calc(30rem*1.2);
2023-07-26 15:54:34 +08:00
opacity: 0;
transition: all .3s;
transform: scale(0.75)translateY(10%);
display: none;
2023-11-28 16:21:00 +08:00
overflow: inherit !important;
2023-07-26 15:54:34 +08:00
&.active{
opacity: 1;
transform: scale(0.75)translateY(0%);
}
.habit_title {
h3 {
font-size: calc(1.6rem*1.2);
2023-07-26 15:54:34 +08:00
font-weight: 600;
color: #000;
margin: 0;
}
.habit_intro {
font-size: calc(1.2rem*1.2);
2023-07-26 15:54:34 +08:00
color: rgba(0, 0, 0, 0.5);
font-weight: 500;
}
}
.habit_type {
margin-top: calc(1.5rem*1.2);
2023-09-12 10:11:27 +08:00
cursor: pointer;
position: relative;
.habit_workspace_show{
width: 100%;
z-index: 1;
transform: translateY(10%);
top: calc(4rem*1.2);
height: calc(14rem*1.2);
2023-09-12 10:11:27 +08:00
overflow-x: hidden;
2023-08-05 12:52:56 +08:00
cursor: auto;
2023-09-12 10:11:27 +08:00
&.active{
transform: translateY(0%);
}
2023-08-05 12:52:56 +08:00
}
2023-07-26 15:54:34 +08:00
}
.habit_Overal_Single {
display: flex;
align-items: center;
justify-content: center;
margin: calc(3rem*1.2) 0;
2023-09-25 10:09:00 +08:00
position: relative;
2023-07-26 15:54:34 +08:00
.habit_Overal_Single_text {
font-weight: 600;
color: rgba(0, 0, 0, 0.5);
&.active {
color: rgba(0, 0, 0, 0.7);
font-weight: 900;
}
2023-08-05 12:52:56 +08:00
2023-07-26 15:54:34 +08:00
}
:deep(.ant-switch) {
margin: 0 calc(1rem*1.2);
2023-07-26 15:54:34 +08:00
}
2023-09-25 10:09:00 +08:00
.habit_sex_show{
width: 100%;
z-index: 1;
transform: translateY(10%);
top: calc(4rem*1.2);
height: calc(14rem*1.2);
2023-09-25 10:09:00 +08:00
overflow-x: hidden;
cursor: auto;
&.active{
transform: translateY(0%);
}
}
2023-07-26 15:54:34 +08:00
}
.habit_habit_singleton {
margin-bottom: calc(3rem*1.2);
2023-09-12 10:11:27 +08:00
position: relative;
.habit_singleton_show{
width: 100%;
z-index: 1;
transform: translateY(10%);
top: calc(4rem*1.2);
height: calc(14rem*1.2);
2023-09-12 10:11:27 +08:00
overflow-x: hidden;
cursor: auto;
&.active{
transform: translateY(0%);
}
}
2023-09-25 10:09:00 +08:00
2023-07-26 15:54:34 +08:00
}
.habit_System_Designer {
margin-top: calc(8rem*1.2);
2023-07-26 15:54:34 +08:00
:deep(.ant-slider-track),
:deep(.ant-slider-rail) {
height: calc(.6rem*1.2);
2023-07-26 15:54:34 +08:00
background-color: #e1e1e1;
border-radius: calc(0.5rem*1.2);
2023-07-26 15:54:34 +08:00
}
:deep(.ant-slider .ant-slider-handle:not(.ant-tooltip-open)),
:deep(.ant-slider-handle) {
background-color: #2d2e76 !important;
border: none !important;
}
:deep(.ant-slider-handle:hover) {
box-shadow: 0 0 0 5px rgba(45, 46, 118, 0.2);
}
.habit_System_Designer_text_max {
display: flex;
justify-content: space-between;
.habit_System_Designer_text {
}
}
}
.habit_model{
margin-top: calc(2rem*1.2);
2023-07-26 15:54:34 +08:00
}
.habit_model_show{
position: absolute;
2023-08-05 12:52:56 +08:00
background-color: #fff;
2023-07-26 15:54:34 +08:00
border: solid 2px #000;
border-radius: calc(1rem*1.2);
padding: calc(2rem*1.2);
bottom: calc(-.5rem*1.2);
2023-07-26 15:54:34 +08:00
transform: translateY(110%);
right: calc(-.2rem*1.2);
width: calc(40rem*1.2);
// width: 35rem*1.2);
2023-07-26 15:54:34 +08:00
opacity: 0;
transition: all .3s;
display: none;
&.active{
opacity: 1;
transform: translateY(100%);
}
.habit_btn{
min-height: calc(26rem*1.2);
2023-07-26 15:54:34 +08:00
display: flex;
justify-content: space-between;
2023-09-25 10:09:00 +08:00
.model_current{
margin-right: calc(3rem*1.2);
.model_text{
text-align: center;
}
2023-09-25 10:09:00 +08:00
}
2023-07-26 15:54:34 +08:00
}
2023-09-12 10:11:27 +08:00
.habit_model_list{
margin: 0;
li{
padding: calc(.5rem*1.2) 0;
2023-09-12 10:11:27 +08:00
display: flex;
input{
border: 0;
width: 80%;
background: rgba(0,0,0,0);
}
>div{
cursor: pointer;
width: 80%;
2023-09-25 10:09:00 +08:00
white-space: nowrap;
text-overflow:ellipsis;
overflow:hidden;
2023-09-12 10:11:27 +08:00
}
&.newWorkspace{
text-align: center;
justify-content: center;
div{
border-radius: 50%;
border: 1px solid #000;
display: inline-block;
width: calc(2rem*1.2);
height: calc(2rem*1.2);
line-height: calc(2rem*1.2);
2023-09-12 10:11:27 +08:00
text-align: center;
}
i{
flex: 1;
}
}
i{
cursor: pointer;
}
.fi-rr-trash{
margin-left: calc(1rem*1.2);
2023-09-12 10:11:27 +08:00
}
}
li:hover{
background: rgba(0, 0, 0, 0.1);
}
2023-12-29 15:33:05 +08:00
.material_content_list_loding{
width: 100%;
height: calc(4rem*1.2);
2023-12-29 15:33:05 +08:00
display: flex;
img{
width: auto;
margin: 0 auto;
height: 100%;
}
}
2023-09-12 10:11:27 +08:00
}
2023-07-26 15:54:34 +08:00
.model_Designer{
2023-09-25 10:09:00 +08:00
flex: 1;
overflow: hidden;
2023-10-11 17:34:14 +08:00
display: flex;
flex-direction: column;
2023-07-26 15:54:34 +08:00
.model_text{
display: flex;
justify-content: center;
2023-07-26 15:54:34 +08:00
:deep(.ant-switch) {
margin: 0 calc(1rem*1.2);
2023-08-05 12:52:56 +08:00
}
.habit_System_Seleves_text {
font-weight: 600;
color: rgba(0, 0, 0, 0.5);
&.active {
color: rgba(0, 0, 0, 0.7);
font-weight: 900;
}
:deep(.ant-switch-checked) {
background-color: #000;
}
2023-07-26 15:54:34 +08:00
}
}
}
.model_img{
2023-09-25 10:09:00 +08:00
display: flex;
2023-10-11 17:34:14 +08:00
flex: 1;
align-items: center;
2023-10-13 17:06:44 +08:00
overflow-x: auto;
&.model_img::-webkit-scrollbar {
/* 竖轴的宽度 */
width: calc(1rem*1.2);
2023-10-13 17:06:44 +08:00
/* 横轴的高度 */
height: calc(1rem*1.2);
2023-10-13 17:06:44 +08:00
transition: all .3s;
}
/* 进度 */
&.model_img::-webkit-scrollbar-thumb {
border-radius: calc(1rem*1.2);
2023-10-13 17:06:44 +08:00
background: rgba(238, 238, 244, 0);
}
/* 轨道 */
&.model_img::-webkit-scrollbar-track {
border-radius: calc(1rem*1.2);
2023-10-13 17:06:44 +08:00
background: rgba(238, 238, 244, 0);
}
&.model_img:hover {
// overflow-x: scroll;
&.model_img::-webkit-scrollbar-thumb {
background: #543087;
}
/* 轨道 */
&.model_img::-webkit-scrollbar-track {
background: rgba(84, 48, 135,.2);
}
}
2023-09-25 10:09:00 +08:00
>div{
2023-07-26 15:54:34 +08:00
display: flex;
2023-09-25 10:09:00 +08:00
}
div{
width: auto;
margin-right: calc(1rem*1.2);
2023-09-25 10:09:00 +08:00
}
img{
width: calc(10rem*1.2);
2023-09-25 10:09:00 +08:00
cursor: pointer;
}
2023-07-26 15:54:34 +08:00
}
}
}
}
.habit :deep(.ant-dropdown-button) {
margin-right: 8px;
margin-bottom: 8px;
}
.habit :deep(.ant-btn) {
box-shadow: none !important;
color: rgba(0, 0, 0, 0.5);
box-shadow: none;
border: none;
background: #f6f6f6;
width: 100%;
font-weight: 600;
display: flex;
align-items: center;
justify-content: space-between;
font-size: calc(1.4rem*1.2);
2023-07-26 15:54:34 +08:00
}
</style>
<style>
2023-08-05 12:52:56 +08:00
.ant-tooltip{
z-index: 1049 !important;
}
2023-07-26 15:54:34 +08:00
.habit :deep(.ant-tooltip .ant-tooltip-inner) ,:deep(.ant-tooltip-arrow-content){
background: #000 !important;
}
.habit_mod{
background-color: #000 !important;
/* top: 0 !important; */
/* left: 0 !important; */
}
.ant-tooltip .ant-tooltip-inner ,.ant-tooltip-arrow-content{
background: #000 !important;
}
</style>