画布语言适配

This commit is contained in:
lzp
2026-04-14 14:26:41 +08:00
parent 1aa9119f43
commit 85a9e79329
22 changed files with 290 additions and 158 deletions

View File

@@ -14,7 +14,7 @@
<div>
<button class="export" @click="emit('export')">
<span class="icon"><svg-icon name="export" size="11" /></span>
<span class="text">Export</span>
<span class="text">{{ $t('FlowCanvas.export') }}</span>
</button>
<div v-loading="true" class="mask" v-if="downloadData.status == 'loading'"></div>
</div>

View File

@@ -1,12 +1,12 @@
<template>
<!-- 添加印花 -->
<div class="add-print">
<p class="label">Print</p>
<p class="label">{{ $t('FlowCanvas.print') }}</p>
<upload-file v-model="data.file" />
<p class="label">Settings</p>
<p class="label">{{ $t('FlowCanvas.settings') }}</p>
<div class="settings">
<div>
<p class="label">Angle</p>
<p class="label">{{ $t('FlowCanvas.angle') }}</p>
<my-input
v-model="data.setting.angle"
type="number"
@@ -18,7 +18,7 @@
/>
</div>
<div>
<span class="label">Scale</span>
<span class="label">{{ $t('FlowCanvas.scale') }}</span>
<slider
:min="1"
:max="1000"
@@ -27,7 +27,7 @@
/>
</div>
<div>
<span class="label">Gap X</span>
<span class="label">{{ $t('FlowCanvas.gapX') }}</span>
<slider
:min="0"
:max="1000"
@@ -36,7 +36,7 @@
/>
</div>
<div>
<span class="label">Gap Y</span>
<span class="label">{{ $t('FlowCanvas.gapY') }}</span>
<slider
:min="0"
:max="1000"
@@ -45,14 +45,14 @@
/>
</div>
<div>
<span class="label">Offset</span>
<span class="label">{{ $t('FlowCanvas.offset') }}</span>
<offset-tool v-model="data.setting.offset" :show-dish="false" />
</div>
<div class="offset">
<offset-tool v-model="data.setting.offset" :show-input="false" />
</div>
</div>
<p class="label">Prompt</p>
<p class="label">{{ $t('FlowCanvas.prompt') }}</p>
<my-textarea v-model="data.prompt" />
</div>
</template>

View File

@@ -22,6 +22,8 @@
<script setup lang="ts">
import { ref, inject, computed } from 'vue'
import { NODE_DATATYPE, NODE_DATATIER } from '../../../tools/index.d'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const nodeManager = inject('nodeManager') as any
const stateManager = inject('stateManager') as any
const props = defineProps({
@@ -35,29 +37,29 @@
{
tier: NODE_DATATIER.TO_REAL_STYLE,
type: NODE_DATATYPE.TO_REAL_STYLE,
title: 'To Real Style'
title: t('FlowCanvas.toRealStyleTitle')
},
{
tier: NODE_DATATIER.TO_REAL_VARIANTS,
type: NODE_DATATYPE.TO_REAL_VARIANTS,
title: 'To Real Variants'
title: t('FlowCanvas.toRealVariantsTitle')
},
{
tier: NODE_DATATIER.SURFACE_EDIT,
type: NODE_DATATYPE.SURFACE_EDIT,
title: 'Surface Edit',
title: t('FlowCanvas.surfaceEditTitle'),
secondaryMenu: {
title: 'Surface Edit',
title: t('FlowCanvas.surfaceEditTitle'),
icon: NODE_DATATYPE.SURFACE_EDIT,
selectList: [
{
tier: NODE_DATATIER.CANVAS_MODE,
type: NODE_DATATYPE.CANVAS_MODE,
title: 'Surface Edit (Canvas)',
title: t('FlowCanvas.surfaceEditCanvasTitle'),
},{
tier: NODE_DATATIER.Fast_MODE,
type: NODE_DATATYPE.Fast_MODE,
title: 'Surface Edit',
title: t('FlowCanvas.surfaceEditTitle'),
},
]
}
@@ -65,22 +67,22 @@
{
tier: NODE_DATATIER.SCENE_COMPOSITION,
type: NODE_DATATYPE.SCENE_COMPOSITION,
title: 'Scene Composition'
title: t('FlowCanvas.sceneCompositionTitle')
},
{
tier: NODE_DATATIER.COLOR_PALETTE,
type: NODE_DATATYPE.COLOR_PALETTE,
title: 'Color Palette'
title: t('FlowCanvas.colorPaletteTitle')
},
{
tier: NODE_DATATIER.TO_3D_MODEL,
type: NODE_DATATYPE.TO_3D_MODEL,
title: 'To 3D Model'
title: t('FlowCanvas.to3DModelTitle')
},
{
tier: NODE_DATATIER.TO_3VIEW,
type: NODE_DATATYPE.TO_3VIEW,
title: 'To 3-View'
title: t('FlowCanvas.to3ViewTitle')
}
])
const onClickItem = (v) => {

View File

@@ -1,9 +1,9 @@
<template>
<!-- 颜色调色板 -->
<div class="color-palette">
<p class="label">Mode</p>
<p class="label">{{ $t('FlowCanvas.mode') }}</p>
<my-select v-model="data.mode" :list="modeList" />
<p class="label">Choose Color</p>
<p class="label">{{ $t('FlowCanvas.chooseColor') }}</p>
<div class="color-list">
<div
class="color-item"
@@ -25,6 +25,8 @@
<script setup lang="ts">
import { reactive, onMounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const data = reactive({
colors: [],
mode: 'Advanced',
@@ -45,8 +47,8 @@
data.colors.push(target.value)
}
const modeList = ref([
{ value: 'Advanced', label: 'Advanced' },
{ value: 'Normal', label: 'Normal' }
{ value: 'Advanced', label: t('FlowCanvas.advancedMode') },
{ value: 'Normal', label: t('FlowCanvas.normalMode') }
])
const getApiData = ()=>{
return {

View File

@@ -1,7 +1,7 @@
<template>
<!-- 画布编辑印花 -->
<div class="fast-mode">
<p class="label">Output</p>
<p class="label">{{ $t('FlowCanvas.output') }}</p>
<div class="imgBox">
<img :src="data.url" alt="">
</div>

View File

@@ -19,13 +19,13 @@
<div class="footer" @mousedown.stop v-if="!currentComponent?.hideFooter">
<button @click="onGenerateClick">
<svg-icon name="xingxing" size="16" size-unit="px" />
<span>Generate</span>
<span>{{ $t('FlowCanvas.generate') }}</span>
</button>
</div>
<div class="footer canvasEdit" @mousedown.stop v-if="currentComponent?.showCanvasEdit">
<button @click="currentComponent?.on()">
<svg-icon name="xingxing" size="16" size-unit="px" />
<span>Edit</span>
<span>{{ $t('FlowCanvas.edit') }}</span>
</button>
</div>
</div>
@@ -58,7 +58,7 @@
{
tier: NODE_DATATIER.CARDS_SELECT,
type: NODE_DATATYPE.CARDS_SELECT,
title: 'Advanced Tools',
title: t('FlowCanvas.selectCardsTitle'),
component: CardsSelect,
hideFooter: true,
hideIcon: true,
@@ -66,28 +66,28 @@
{
tier: NODE_DATATIER.TO_REAL_STYLE,
type: NODE_DATATYPE.TO_REAL_STYLE,
title: 'To Real Style',
title: t('FlowCanvas.toRealStyleTitle'),
component: ToRealStyle,
api: toRealStyleApi
},
{
tier: NODE_DATATIER.TO_REAL_VARIANTS,
type: NODE_DATATYPE.TO_REAL_VARIANTS,
title: 'To Real Variants',
title: t('FlowCanvas.toRealVariantsTitle'),
component: ToRealVariants,
api: toRealStyleApi
},
{
tier: NODE_DATATIER.Fast_MODE,
type: NODE_DATATYPE.Fast_MODE,
title: 'Surface Edit',
title: t('FlowCanvas.surfaceEditTitle'),
component: SurfaceEdit,
api: sketchAddPrintApi
},
{
tier: NODE_DATATIER.CANVAS_MODE,
type: NODE_DATATYPE.CANVAS_MODE,
title: 'Surface Edit (Canvas)',
title: t('FlowCanvas.surfaceEditCanvasTitle'),
component: FastMode,
hideFooter: true,
showCanvasEdit: true,
@@ -98,28 +98,28 @@
{
tier: NODE_DATATIER.SCENE_COMPOSITION,
type: NODE_DATATYPE.SCENE_COMPOSITION,
title: 'Scene Composition',
title: t('FlowCanvas.sceneCompositionTitle'),
component: SceneComposition,
api: toSceneCompositionApi
},
{
tier: NODE_DATATIER.COLOR_PALETTE,
type: NODE_DATATYPE.COLOR_PALETTE,
title: 'Color Palette',
title: t('FlowCanvas.colorPaletteTitle'),
component: ColorPalette,
api: toColorPaletteApi
},
{
tier: NODE_DATATIER.TO_3D_MODEL,
type: NODE_DATATYPE.TO_3D_MODEL,
title: 'To 3D Model',
title: t('FlowCanvas.to3DModelTitle'),
component: To3DModel,
api:sketchToThreeApi
},
{
tier: NODE_DATATIER.TO_3VIEW,
type: NODE_DATATYPE.TO_3VIEW,
title: 'To 3-View',
title: t('FlowCanvas.to3DViewTitle'),
component: To3View,
api:threeToThreeViewsApi
}

View File

@@ -1,11 +1,11 @@
<template>
<!-- 场景构图 -->
<div class="scene-composition">
<p class="label">Prompt</p>
<p class="label">{{ $t('FlowCanvas.prompt') }}</p>
<my-textarea v-model="data.prompt" />
<p class="label">Mode</p>
<p class="label">{{ $t('FlowCanvas.mode') }}</p>
<my-select v-model="data.mode" :list="modeList" />
<p class="label">Choose Style</p>
<p class="label">{{ $t('FlowCanvas.chooseStyle') }}</p>
<div class="style-list">
<div
class="item"
@@ -26,26 +26,28 @@
<script setup lang="ts">
import { computed, ref, reactive, onMounted } from 'vue'
import myTextarea from '../../tools/my-textarea.vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const styleList = ref([
{ label: 'Colorful', value: 'Colorful' },
{ label: 'Minimalist', value: 'Minimalist' },
{ label: 'Modernist', value: 'Modernist' },
{ label: 'Bauhaus', value: 'Bauhaus' },
{ label: 'Mintage', value: 'Mintage' },
{ label: 'Industrial', value: 'Industrial' },
{ label: 'Futuristic', value: 'Futuristic' },
{ label: 'Elegant', value: 'Elegant' },
{ label: 'Organic', value: 'Organic' },
{ label: 'Calm', value: 'Calm' },
{ label: 'Abstract', value: 'Abstract' },
{ label: 'Kitsch-core', value: 'Kitsch-core' },
{ label: 'Sophisticated', value: 'Sophisticated' },
{ label: 'Maximalism', value: 'Maximalism' },
{ label: 'Clean', value: 'Clean' },
{ label: 'Bright Colors', value: 'Bright Colors' },
{ label: 'Luxurious', value: 'Luxurious' },
{ label: 'Bold Colors', value: 'Bold Colors' },
{ label: 'Brutalism', value: 'Brutalism' }
{ label: t('FlowCanvas.colorful'), value: 'Colorful' },
{ label: t('FlowCanvas.minimalist'), value: 'Minimalist' },
{ label: t('FlowCanvas.modernist'), value: 'Modernist' },
{ label: t('FlowCanvas.bauhaus'), value: 'Bauhaus' },
{ label: t('FlowCanvas.mintage'), value: 'Mintage' },
{ label: t('FlowCanvas.industrial'), value: 'Industrial' },
{ label: t('FlowCanvas.futuristic'), value: 'Futuristic' },
{ label: t('FlowCanvas.elegant'), value: 'Elegant' },
{ label: t('FlowCanvas.organic'), value: 'Organic' },
{ label: t('FlowCanvas.calm'), value: 'Calm' },
{ label: t('FlowCanvas.abstract'), value: 'Abstract' },
{ label: t('FlowCanvas.kitschCore'), value: 'Kitsch-core' },
{ label: t('FlowCanvas.sophisticated'), value: 'Sophisticated' },
{ label: t('FlowCanvas.maximalism'), value: 'Maximalism' },
{ label: t('FlowCanvas.clean'), value: 'Clean' },
{ label: t('FlowCanvas.brightColors'), value: 'Bright Colors' },
{ label: t('FlowCanvas.luxurious'), value: 'Luxurious' },
{ label: t('FlowCanvas.boldColors'), value: 'Bold Colors' },
{ label: t('FlowCanvas.brutalism'), value: 'Brutalism' }
])
const data = reactive({
prompt: '',
@@ -53,8 +55,8 @@
mode: 'Advanced',
})
const modeList = ref([
{ value: 'Advanced', label: 'Advanced' },
{ value: 'Normal', label: 'Normal' }
{ value: 'Advanced', label: t('FlowCanvas.advancedMode') },
{ value: 'Normal', label: t('FlowCanvas.normalMode') },
])
const onClickStyle = (value: string) => {
if (data.styles.includes(value)) {

View File

@@ -1,11 +1,11 @@
<template>
<!-- 编辑素材 -->
<div class="surface-edit">
<p class="label">Image</p>
<p class="label">{{ $t('FlowCanvas.image') }}</p>
<upload-file v-model="data.file" />
<p class="label">Mode</p>
<p class="label">{{ $t('FlowCanvas.mode') }}</p>
<my-select v-model="data.mode" :list="modeList" />
<p class="label">Prompt</p>
<p class="label">{{ $t('FlowCanvas.prompt') }}</p>
<my-textarea v-model="data.prompt" />
</div>
</template>
@@ -15,14 +15,16 @@
import myTextarea from '../../tools/my-textarea.vue'
import uploadFile from '../../tools/upload-file.vue'
import mySelect from '../../tools/my-select.vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const data = reactive({
prompt: '',
file: null,
mode: 'Advanced',
})
const modeList = ref([
{ value: 'Advanced', label: 'Advanced' },
{ value: 'Normal', label: 'Normal' }
{ value: 'Advanced', label: t('FlowCanvas.advancedMode') },
{ value: 'Normal', label: t('FlowCanvas.normalMode') }
])
const getApiData = ()=>{
return {

View File

@@ -1,11 +1,11 @@
<template>
<!-- 转3D模型 -->
<div class="to-3d-model">
<p class="label">Image</p>
<p class="label">{{ $t('FlowCanvas.image') }}</p>
<div class="image">
<img :src="data.url" alt="">
</div>
<p class="label">Mode</p>
<p class="label">{{ $t('FlowCanvas.mode') }}</p>
<my-select v-model="data.mode" :list="modeList" />
</div>
</template>
@@ -13,6 +13,9 @@
<script setup lang="ts">
import { reactive, inject, useAttrs, computed,ref } from 'vue'
import uploadFile from '../../tools/upload-file.vue'
import mySelect from '../../tools/my-select.vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const attrs = useAttrs()
const stateManager = inject('stateManager') as any
const data = reactive({
@@ -20,8 +23,8 @@
mode: 'Advanced',
})
const modeList = ref([
{ value: 'Advanced', label: 'Advanced' },
{ value: 'Normal', label: 'Normal' }
{ value: 'Advanced', label: t('FlowCanvas.advancedMode') },
{ value: 'Normal', label: t('FlowCanvas.normalMode') }
])
const getApiData = ()=>{
return {

View File

@@ -1,7 +1,7 @@
<template>
<!-- 转3-View -->
<div class="to-3view">
<p class="label">3D Model</p>
<p class="label">{{ $t('FlowCanvas._3DModel') }}</p>
<div class="image">
<img :src="data.url" alt="">
</div>

View File

@@ -1,9 +1,9 @@
<template>
<!-- 转CAD -->
<div class="to-cad">
<p class="label">3D Model</p>
<p class="label">{{ $t('FlowCanvas._3DModel') }}</p>
<upload-file v-model="data.file" />
<p class="label">Prompt</p>
<p class="label">{{ $t('FlowCanvas.prompt') }}</p>
<my-textarea v-model="data.prompt" />
</div>
</template>

View File

@@ -1,7 +1,7 @@
<template>
<!-- 转换为真实图 -->
<div class="to-real-style">
<p class="label">Prompt</p>
<p class="label">{{ $t('FlowCanvas.prompt') }}</p>
<my-textarea v-model="data.prompt" />
<div class="shortcut-list">
<div
@@ -13,9 +13,9 @@
{{ v.label }}
</div>
</div>
<p class="label">Mode</p>
<p class="label">{{ $t('FlowCanvas.mode') }}</p>
<my-select v-model="data.mode" :list="modeList" />
<p class="label">Size</p>
<p class="label">{{ $t('FlowCanvas.size') }}</p>
<pixel-ratio-selection v-model="data.pixelRatio" />
</div>
</template>
@@ -25,43 +25,30 @@
import myTextarea from '../../tools/my-textarea.vue'
import mySelect from '../../tools/my-select.vue'
import pixelRatioSelection from '../../tools/pixel-ratio-selection.vue'
const shortcutList = ref([
{
label: 'Change the...',
value: 'Change the style to a realistic design. '
},
{
label: 'Bright Colors...',
value: 'Bright colors with modern patterns, change the style to a realistic furniture design. '
},
{
label: 'Make the...',
value: 'Make the structure more refined and balanced, change the style to a realistic furniture style. '
},
{
label: 'Imagine...',
value: 'Imagine this furniture with detailed fabric textures, change the style to a realistic design. '
},
{
label: 'Wood Materials with...',
value: 'Wood materials with natural oak texture and soft fabric, change the style to a realistic furniture design.'
}
])
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const shortcutList = ref([])
for (let i = 0; i < 5; i++) {
shortcutList.value.push({
label: t(`FlowCanvas.toRealStyleShortcut${i + 1}Label`),
value: t(`FlowCanvas.toRealStyleShortcut${i + 1}Value`)
})
}
const modeList = ref([
{ value: 'Advanced', label: 'Advanced' },
{ value: 'Normal', label: 'Normal' }
{ value: 'Advanced', label: t('FlowCanvas.advancedMode') },
{ value: 'Normal', label: t('FlowCanvas.normalMode') }
])
const data = reactive({
prompt: '',
pixelRatio: '1:1',
mode: 'Advanced',
mode: 'Advanced'
})
const getApiData = ()=>{
const getApiData = () => {
return {
mode: data.mode,
size: data.pixelRatio,
userPrompt: data.prompt,
userPrompt: data.prompt
}
}

View File

@@ -1,8 +1,8 @@
<template>
<!-- 转换为真实图 -->
<div class="to-real-style">
<p class="label">Prompt</p>
<my-textarea v-model="data.prompt" :placeholder="$t('flowCanvas.toRealVariantsPlaceholder')" />
<p class="label">{{ t('FlowCanvas.prompt') }}</p>
<my-textarea v-model="data.prompt" :placeholder="$t('FlowCanvas.toRealVariantsPlaceholder')" />
<div class="shortcut-list">
<div
class="item"
@@ -13,9 +13,9 @@
{{ v.label }}
</div>
</div>
<p class="label">Mode</p>
<p class="label">{{ t('FlowCanvas.mode') }}</p>
<my-select v-model="data.mode" :list="modeList" />
<p class="label">Size</p>
<p class="label">{{ t('FlowCanvas.size') }}</p>
<pixel-ratio-selection v-model="data.pixelRatio" />
</div>
</template>
@@ -29,24 +29,24 @@
const { t } = useI18n()
const shortcutList = ref([
{
label: t('flowCanvas.toRealVariantsShortcut1Label'),
value: t('flowCanvas.toRealVariantsShortcut1Value')
label: t('FlowCanvas.toRealVariantsShortcut1Label'),
value: t('FlowCanvas.toRealVariantsShortcut1Value')
},
{
label: t('flowCanvas.toRealVariantsShortcut2Label'),
value: t('flowCanvas.toRealVariantsShortcut2Value')
label: t('FlowCanvas.toRealVariantsShortcut2Label'),
value: t('FlowCanvas.toRealVariantsShortcut2Value')
},
{
label: t('flowCanvas.toRealVariantsShortcut3Label'),
value: t('flowCanvas.toRealVariantsShortcut3Value')
label: t('FlowCanvas.toRealVariantsShortcut3Label'),
value: t('FlowCanvas.toRealVariantsShortcut3Value')
},
{
label: t('flowCanvas.toRealVariantsShortcut4Label'),
value: t('flowCanvas.toRealVariantsShortcut4Value')
label: t('FlowCanvas.toRealVariantsShortcut4Label'),
value: t('FlowCanvas.toRealVariantsShortcut4Value')
},
{
label: t('flowCanvas.toRealVariantsShortcut5Label'),
value: t('flowCanvas.toRealVariantsShortcut5Value')
label: t('FlowCanvas.toRealVariantsShortcut5Label'),
value: t('FlowCanvas.toRealVariantsShortcut5Value')
}
])
const stateManager = inject('stateManager') as any

View File

@@ -19,7 +19,7 @@
</span>
<button class="edit" @click="onEdit(item)" v-if="node.data.superiorNodeType !== NODE_DATATYPE.TO_3D_MODEL || node.data.tier == 0">
<span class="icon"><svg-icon name="edit" size="13" /></span>
<span class="text">Edit</span>
<span class="text">{{ $t('FlowCanvas.edit') }}</span>
</button>
</div>
<img
@@ -65,8 +65,10 @@
import { reactive, ref, onBeforeUnmount, useAttrs, inject, watch, computed, onMounted } from 'vue'
import HighlightAdmin from '@/components/highlightAdmin.vue'
import { NODE_DATATIER, NODE_DATATYPE } from '../../tools/index.d'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const openImagePreview = inject('openImagePreview') as (url: string) => void
const openThreeModelPreview = inject('openThreeModelPreview') as (url: string) => void
const openThreeModelPreview = inject('openThreeModelPreview') as (obj: any) => void
const props = defineProps({
node: {
type: Object,
@@ -125,9 +127,9 @@
{ immediate: true }
)
const menus = ref([
{ label: 'Copy', tip: 'Ctrl+C', on: () => emit('copy-node') },
{ label: t('FlowCanvas.copy'), tip: 'Ctrl+C', on: () => emit('copy-node') },
{
label: 'Delete',
label: t('FlowCanvas.delete'),
tip: 'Del',
on: () => {
emit('delete-node', props.node.id)
@@ -135,23 +137,8 @@
disabled: !!props.config?.disableDelete
},
{ isDivide: true },
// {
// label: 'Bring to font',
// tip: '',
// on: () => {
// emit('bring-to-font')
// }
// },
// {
// label: 'Send to back',
// tip: '',
// on: () => {
// emit('send-to-back')
// }
// },
// { isDivide: true },
{
label: 'Flip horizontal',
label: t('FlowCanvas.flipHorizontal'),
tip: '',
on: () => {
data.imageProcessTasks.forEach((item) => {
@@ -167,7 +154,7 @@
}
},
{
label: 'Flip vertical',
label: t('FlowCanvas.flipVertical'),
tip: '',
on: () => {
data.imageProcessTasks.forEach((item) => {

View File

@@ -24,6 +24,8 @@
<script setup lang="ts">
import { reactive, ref, onMounted, nextTick, watch } from 'vue'
import myTextTools from '@/components/Canvas/FlowCanvas/components/tools/my-textTools.vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const props = defineProps({
active: {
type: Boolean,
@@ -36,7 +38,7 @@
})
const emit = defineEmits(['update-data', 'delete-node'])
const data = reactive({
text: props.data?.text || '点击编辑文本',
text: props.data?.text || t('FlowCanvas.clickEditText'),
textStyle:{
'--font-size':props.data?.textStyle?.['--font-size'] || '16px',
'--font-color':props.data?.textStyle?.['--font-color'] || '#000',

View File

@@ -38,7 +38,7 @@
import { reactive, ref, markRaw, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
const emit = defineEmits(['update:textStyle'])
const { locale } = useI18n()
const { locale, t } = useI18n()
const fontFamilyList = ref({
ENGLISH: [
{ value:'Medium',label:'Medium' },

View File

@@ -1,7 +1,7 @@
<template>
<div class="my-textarea">
<textarea
:placeholder="placeholder"
:placeholder="placeholder || $t('FlowCanvas.promptDefaultPlaceholder')"
:value="modelValue"
@input="onInput"
@change="onChange"
@@ -16,12 +16,15 @@
<script setup lang="ts">
import { computed, ref, markRaw, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const placeholder = t('FlowCanvas.promptDefaultPlaceholder')
const emit = defineEmits(['update:modelValue', 'input', 'change'])
const props = defineProps({
modelValue: { type: String },
placeholder: {
type: String,
default: 'Enter the scene you want to describe...'
default: ''
}
})
const onInput = (e) => {

View File

@@ -8,8 +8,8 @@
</div>
<div class="control" v-else>
<div class="icon"><svg-icon name="upload" size="17" size-unit="px" /></div>
<div class="txt">{{ tip }}</div>
<div class="btn" @click="onSelectFile">Select File</div>
<div class="txt">{{ tip || $t('FlowCanvas.uploadFiles') }}</div>
<div class="btn" @click="onSelectFile">{{ $t('FlowCanvas.selectFile') }}</div>
</div>
</div>
</template>
@@ -20,7 +20,7 @@
const emit = defineEmits(['update:modelValue', 'change'])
const props = defineProps({
modelValue: { type: [File, Object, String, null] },
tip: { type: String, default: 'Upload your files' }
tip: { type: String, default: '' }
})
const data = reactive({
file: null

View File

@@ -10,31 +10,31 @@ const t = i18n.global.t
//推送到对话框的助手
const chatAssistant = {
[NODE_DATATYPE.TO_REAL_STYLE]:{
content: t('flowCanvas.toRealStyleDesignAssistant'),
content: t('FlowCanvas.toRealStyleDesignAssistant'),
nodeType:NODE_DATATYPE.TO_REAL_STYLE,
},
[NODE_DATATYPE.CANVAS_MODE]:{
content: t('flowCanvas.surfaceEditCanvasDesignAssistant'),
content: t('FlowCanvas.surfaceEditCanvasDesignAssistant'),
nodeType:NODE_DATATYPE.CANVAS_MODE,
},
[NODE_DATATYPE.Fast_MODE]:{
content: t('flowCanvas.surfaceEditAIDesignAssistant'),
content: t('FlowCanvas.surfaceEditAIDesignAssistant'),
nodeType:NODE_DATATYPE.Fast_MODE,
},
[NODE_DATATYPE.COLOR_PALETTE]:{
content: t('flowCanvas.colorPaletteDesignAssistant'),
content: t('FlowCanvas.colorPaletteDesignAssistant'),
nodeType:NODE_DATATYPE.COLOR_PALETTE,
},
[NODE_DATATYPE.SCENE_COMPOSITION]:{
content: t('flowCanvas.threeModelDesignAssistant'),
content: t('FlowCanvas.threeModelDesignAssistant'),
nodeType:NODE_DATATYPE.SCENE_COMPOSITION,
},
[NODE_DATATYPE.TO_3D_MODEL]:{
content: t('flowCanvas.threeModelDesignAssistant'),
content: t('FlowCanvas.threeModelDesignAssistant'),
nodeType:NODE_DATATYPE.TO_3D_MODEL,
},
[NODE_DATATYPE.TO_3VIEW]:{
content: t('flowCanvas.threeModelDesignAssistant'),
content: t('FlowCanvas.threeModelDesignAssistant'),
nodeType:NODE_DATATYPE.TO_3VIEW,
},
}
@@ -167,7 +167,7 @@ export class StateManager {
getSuperiorNodeImage(superiorID: string) {
const superiorNode = this.getNodeById(superiorID)
if(!superiorNode){
// ElMessage.error(t('flowCanvas.cannotFindSuperiorImage'))
// ElMessage.error(t('FlowCanvas.cannotFindSuperiorImage'))
return null
}
const superiorNodeUrl = superiorNode.data.data.imageProcessTasks.filter((item)=>{
@@ -179,7 +179,7 @@ export class StateManager {
async deleteSubordinateAllNodes(id: string,{ isElMessageBox } = { isElMessageBox: false }) {
const node = this.getNodeById(id)
if (!node) return console.warn(`没有找到指定id:${id}`)
if (node.data.disableDelete) return ElMessage.error(t('flowCanvas.initialNodeProhibited'))
if (node.data.disableDelete) return ElMessage.error(t('FlowCanvas.initialNodeProhibited'))
const result = [node]
@@ -197,11 +197,11 @@ export class StateManager {
if (isElMessageBox) {
deletePromise = await new Promise<void>((resolve, reject) => {
ElMessageBox.confirm(
result.length > 1 ? t('flowCanvas.deleteSubordinateCard') : t('flowCanvas.deleteCardConfirm'),
result.length > 1 ? t('FlowCanvas.deleteSubordinateCard') : t('FlowCanvas.deleteCardConfirm'),
'',
{
confirmButtonText: t('flowCanvas.confirm'),
cancelButtonText: t('flowCanvas.cancel'),
confirmButtonText: t('FlowCanvas.confirm'),
cancelButtonText: t('FlowCanvas.cancel'),
}
).then(() => {resolve(true)
}).catch(() => {