画布
This commit is contained in:
@@ -91,3 +91,20 @@ export const GetUserInfo = () => {
|
|||||||
loading: true,
|
loading: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户拓展信息
|
||||||
|
* @param data 更新用户拓展信息的参数
|
||||||
|
* @param data.base 基础信息
|
||||||
|
* @param data.vibe 风格特点
|
||||||
|
* @param data.role 角色类型
|
||||||
|
* @returns 更新用户拓展信息成功的响应
|
||||||
|
*/
|
||||||
|
export const UpdateUserProfile = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/user/profile',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="header-tools">
|
<div class="header-tools">
|
||||||
<span class="icon"><svg-icon name="c-mouse" size="16" /></span>
|
<span class="icon" @click="emit('mouse')"><svg-icon name="c-mouse" size="16" /></span>
|
||||||
<span class="icon"><svg-icon name="c-hand" size="18" /></span>
|
<span class="icon" @click="emit('hand')"><svg-icon name="c-hand" size="18" /></span>
|
||||||
<span class="icon"><svg-icon name="c-t" size="18" /></span>
|
<span class="icon" @click="emit('t')"><svg-icon name="c-t" size="18" /></span>
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
<span class="icon"><svg-icon name="c-undo" size="18" /></span>
|
<span class="icon" @click="emit('undo')"><svg-icon name="c-undo" size="18" /></span>
|
||||||
<span class="icon"><svg-icon name="c-redo" size="18" /></span>
|
<span class="icon" @click="emit('redo')"><svg-icon name="c-redo" size="18" /></span>
|
||||||
<button class="export">
|
<button class="export" @click="emit('export')">
|
||||||
<span class="icon"><svg-icon name="export" size="11" /></span>
|
<span class="icon"><svg-icon name="export" size="11" /></span>
|
||||||
<span class="text">Export</span>
|
<span class="text">Export</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
zoom: { default: 1, type: Number },
|
zoom: { default: 1, type: Number },
|
||||||
step: { default: 0.1, type: Number }
|
step: { default: 0.1, type: Number }
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['add', 'sub'])
|
const emit = defineEmits(['mouse', 'hand', 't', 'undo', 'redo', 'export'])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</div>
|
</div>
|
||||||
<header-tools />
|
<header-tools @export="exportFlow" />
|
||||||
<zoom
|
<zoom
|
||||||
:zoom="stateManager.zoom.value"
|
:zoom="stateManager.zoom.value"
|
||||||
:step="0.1"
|
:step="0.1"
|
||||||
@@ -90,6 +90,11 @@
|
|||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const exportFlow = () => {
|
||||||
|
// flowManager.exportFlow()
|
||||||
|
console.log(flowManager.exportFlow())
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// window['vueFlow'] = vueFlow
|
// window['vueFlow'] = vueFlow
|
||||||
// window['nodes'] = nodes
|
// window['nodes'] = nodes
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { defineStore } from 'pinia'
|
|||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { removeLocal, setLocal } from '@/utils/local'
|
import { removeLocal, setLocal } from '@/utils/local'
|
||||||
import MyEvent from '@/utils/myEvent'
|
import MyEvent from '@/utils/myEvent'
|
||||||
import { Logout, GetUserInfo } from '@/api/login'
|
import { Logout, GetUserInfo } from '@/api/user'
|
||||||
export const useUserInfoStore = defineStore('userInfo', () => {
|
export const useUserInfoStore = defineStore('userInfo', () => {
|
||||||
const state = ref({
|
const state = ref({
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
> .right-main {
|
> .right-main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -61,8 +62,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-1 {
|
.bg-1 {
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
background: #f8f7f5;
|
||||||
animation: opacity-in 0.5s ease-in-out 1 both;
|
animation: opacity-in 0.5s ease-in-out 1 both;
|
||||||
}
|
}
|
||||||
.bg-2 {
|
.bg-2 {
|
||||||
@@ -73,7 +76,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
// background-color: rgba(248, 247, 245, 1);
|
|
||||||
> * {
|
> * {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="label">Region</div>
|
<div class="label">Region</div>
|
||||||
<dropdown-menu v-model="region" :list="regions" @change="changeRegion" />
|
<dropdown-menu v-model="base" :list="baseList" @change="changeBase" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="label">Role</div>
|
<div class="label">Role</div>
|
||||||
@@ -25,9 +25,10 @@
|
|||||||
import dropdownMenu from '@/components/dropdown-menu.vue'
|
import dropdownMenu from '@/components/dropdown-menu.vue'
|
||||||
import { useUserInfoStore } from '@/stores'
|
import { useUserInfoStore } from '@/stores'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
const userInfoStore = useUserInfoStore()
|
||||||
const { locale } = useI18n()
|
const { locale } = useI18n()
|
||||||
const region = ref('China')
|
const base = ref(userInfoStore.state.userInfo.base)
|
||||||
const regions = ref([
|
const baseList = ref([
|
||||||
{ label: 'United States', value: 'United States' },
|
{ label: 'United States', value: 'United States' },
|
||||||
{ label: 'Singapore', value: 'Singapore' },
|
{ label: 'Singapore', value: 'Singapore' },
|
||||||
{ label: 'Australia', value: 'Australia' },
|
{ label: 'Australia', value: 'Australia' },
|
||||||
@@ -39,16 +40,17 @@
|
|||||||
{ label: 'Canada', value: 'Canada' },
|
{ label: 'Canada', value: 'Canada' },
|
||||||
{ label: 'Germany', value: 'Germany' }
|
{ label: 'Germany', value: 'Germany' }
|
||||||
])
|
])
|
||||||
const changeRegion = (value: string) => {
|
const changeBase = (value: string) => {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const role = ref('Designer')
|
const role = ref(userInfoStore.state.userInfo.role)
|
||||||
const roles = ref([
|
const roles = ref([
|
||||||
{ label: 'Designer', value: 'Designer' },
|
{ label: 'Designer', value: 'Designer' },
|
||||||
{ label: 'Student', value: 'Student' },
|
{ label: 'Student', value: 'Student' },
|
||||||
{ label: 'Teacher', value: 'Teacher' },
|
{ label: 'Teacher', value: 'Teacher' },
|
||||||
{ label: 'Parent', value: 'Parent' }
|
{ label: 'Parent', value: 'Parent' },
|
||||||
|
{ value: 'Other', label: 'Other' }
|
||||||
])
|
])
|
||||||
const changeRole = (value: string) => {
|
const changeRole = (value: string) => {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import md5 from 'md5'
|
import md5 from 'md5'
|
||||||
import { Login } from '@/api/login'
|
import { Login } from '@/api/user'
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { validateEmail, validatePass, validatePrivacy } from './tools'
|
import { validateEmail, validatePass, validatePrivacy } from './tools'
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import md5 from 'md5'
|
import md5 from 'md5'
|
||||||
import { Register } from '@/api/login'
|
import { Register } from '@/api/user'
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { validateName, validateEmail, validatePass, validatePrivacy } from './tools'
|
import { validateName, validateEmail, validatePass, validatePrivacy } from './tools'
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import md5 from 'md5'
|
import md5 from 'md5'
|
||||||
import { ForgotPassword } from '@/api/login'
|
import { ForgotPassword } from '@/api/user'
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { validateEmail, validatePass } from './tools'
|
import { validateEmail, validatePass } from './tools'
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import md5 from 'md5'
|
import md5 from 'md5'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { SendVerificationCode } from '@/api/login'
|
import { SendVerificationCode } from '@/api/user'
|
||||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||||
import { CountDown } from '@/utils/tools'
|
import { CountDown } from '@/utils/tools'
|
||||||
import InputCode from '@/components/input-code.vue'
|
import InputCode from '@/components/input-code.vue'
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, markRaw } from 'vue'
|
import { computed, ref, markRaw } from 'vue'
|
||||||
|
import { UpdateUserProfile } from '@/api/user'
|
||||||
import nuic1 from './nuic-1.vue'
|
import nuic1 from './nuic-1.vue'
|
||||||
import nuic2 from './nuic-2.vue'
|
import nuic2 from './nuic-2.vue'
|
||||||
import nuic3 from './nuic-3.vue'
|
import nuic3 from './nuic-3.vue'
|
||||||
@@ -44,16 +45,38 @@
|
|||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
router.push({ name: 'mainInput' })
|
router.push({ name: 'mainInput' })
|
||||||
}
|
}
|
||||||
const onNext = () => {
|
const onNext = (value) => {
|
||||||
const index = active.value + 1
|
const index = active.value + 1
|
||||||
if (index < list.length) {
|
const data = {
|
||||||
router.push({ query: { index } })
|
...route.query,
|
||||||
} else {
|
...(value ? value : {})
|
||||||
loading.value = true
|
|
||||||
setTimeout(() => {
|
|
||||||
router.push({ name: 'mainInput' })
|
|
||||||
}, 5000)
|
|
||||||
}
|
}
|
||||||
|
delete data.index
|
||||||
|
if (index < list.length) {
|
||||||
|
router.push({
|
||||||
|
query: {
|
||||||
|
...data,
|
||||||
|
index
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
onSubmit(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const onSubmit = (data) => {
|
||||||
|
loading.value = true
|
||||||
|
const stime = Date.now()
|
||||||
|
UpdateUserProfile(data)
|
||||||
|
.then((res) => {
|
||||||
|
if (!res) return (loading.value = false)
|
||||||
|
const time = stime - Date.now() + 3000
|
||||||
|
setTimeout(() => {
|
||||||
|
router.push({ name: 'mainInput' })
|
||||||
|
}, time)
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<button class="next" @click="emit('next')">{{ $t('Nuic.next') }}</button>
|
<button class="next" @click="onNext">{{ $t('Nuic.next') }}</button>
|
||||||
<button class="more" @click="onLoadMore">
|
<button class="more" @click="onLoadMore">
|
||||||
<span>{{ $t('Nuic.loadMore') }}</span>
|
<span>{{ $t('Nuic.loadMore') }}</span>
|
||||||
<div><svg-icon name="refresh-single" size="24" /></div>
|
<div><svg-icon name="refresh-single" size="24" /></div>
|
||||||
@@ -34,6 +34,15 @@
|
|||||||
{ id: 7, url: '/image/nuic/style-7.png', title: '沙发', active: false },
|
{ id: 7, url: '/image/nuic/style-7.png', title: '沙发', active: false },
|
||||||
{ id: 8, url: '/image/nuic/style-8.png', title: '桌子', active: false }
|
{ id: 8, url: '/image/nuic/style-8.png', title: '桌子', active: false }
|
||||||
])
|
])
|
||||||
|
const onNext = () => {
|
||||||
|
const data = {
|
||||||
|
vibe: list.value
|
||||||
|
.filter((v) => v.active)
|
||||||
|
.map((v) => v.id)
|
||||||
|
.join(',')
|
||||||
|
}
|
||||||
|
emit('next', data)
|
||||||
|
}
|
||||||
const onLoadMore = () => {}
|
const onLoadMore = () => {}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
<div class="select-item">
|
<div class="select-item">
|
||||||
<div class="title">{{ $t('Nuic.basedIn') }}</div>
|
<div class="title">{{ $t('Nuic.basedIn') }}</div>
|
||||||
<el-select v-model="data.based">
|
<el-select v-model="data.base">
|
||||||
<el-option
|
<el-option
|
||||||
class="el-select__option"
|
class="el-select__option"
|
||||||
v-for="v in data.basedList"
|
v-for="v in data.baseList"
|
||||||
:key="v.value"
|
:key="v.value"
|
||||||
:label="v.label"
|
:label="v.label"
|
||||||
:value="v.value"
|
:value="v.value"
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<button class="next" @click="emit('next')">{{ $t('Nuic.allSet') }}</button>
|
<button class="next" @click="onNext">{{ $t('Nuic.allSet') }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -38,21 +38,35 @@
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const emit = defineEmits(['next'])
|
const emit = defineEmits(['next'])
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
basedList: [
|
baseList: [
|
||||||
{ value: '1', label: 'Student' },
|
{ label: 'United States', value: 'United States' },
|
||||||
{ value: '2', label: 'Teacher' },
|
{ label: 'Singapore', value: 'Singapore' },
|
||||||
{ value: '3', label: 'Parent' },
|
{ label: 'Australia', value: 'Australia' },
|
||||||
{ value: '4', label: 'Other' }
|
{ label: 'South Korea', value: 'South Korea' },
|
||||||
|
{ label: 'China', value: 'China' },
|
||||||
|
{ label: 'Italy', value: 'Italy' },
|
||||||
|
{ label: 'France', value: 'France' },
|
||||||
|
{ label: 'Japan', value: 'Japan' },
|
||||||
|
{ label: 'Canada', value: 'Canada' },
|
||||||
|
{ label: 'Germany', value: 'Germany' }
|
||||||
],
|
],
|
||||||
roleList: [
|
roleList: [
|
||||||
{ value: '1', label: 'Student' },
|
{ label: 'Designer', value: 'Designer' },
|
||||||
{ value: '2', label: 'Teacher' },
|
{ value: 'Student', label: 'Student' },
|
||||||
{ value: '3', label: 'Parent' },
|
{ value: 'Teacher', label: 'Teacher' },
|
||||||
{ value: '4', label: 'Other' }
|
{ value: 'Parent', label: 'Parent' },
|
||||||
|
{ value: 'Other', label: 'Other' }
|
||||||
],
|
],
|
||||||
based: '',
|
base: 'China',
|
||||||
role: ''
|
role: 'Student'
|
||||||
})
|
})
|
||||||
|
const onNext = () => {
|
||||||
|
const data_ = {
|
||||||
|
base: data.base,
|
||||||
|
role: data.role
|
||||||
|
}
|
||||||
|
emit('next', data_)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user