From 73f7bd888e5da6fda5e33a3544eb513a9750da83 Mon Sep 17 00:00:00 2001 From: WangLeo <690854599@qq.com> Date: Tue, 9 Jun 2026 12:42:57 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4=E6=97=A7=E6=9E=B6?= =?UTF-8?q?=E6=9E=84=E4=BB=A3=E7=A0=81=EF=BC=88config/models=E3=80=81runni?= =?UTF-8?q?nghub=E3=80=81dialogBox=20=E6=97=A7=E7=BB=84=E4=BB=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 dialogBox 下 8 个子组件目录(model/proportion/dimension/quantity/pattern/Time/imageUploader/videoImageUploader) - 删除 src/config/models/(模型配置已迁移至 src/platforms/painting/models/) - 删除 src/config/runninghub/ 及 config/index.js(Video 不再使用旧适配器) - 更新 Painting 平台的 getModelConfig 导入路径为 ./models/index.js - 移除 modelSelector.vue 中未使用的 getModelConfig 导入 - 保留 src/utils/modelConfig.js(Video 描述符仍需要 fetchModelConfig 加载远程配置) --- components.d.ts | 17 - src/components/dialogBox/Time/index.vue | 84 ---- src/components/dialogBox/dimension/index.vue | 247 ---------- .../dialogBox/imageUploader/index.vue | 312 ------------ src/components/dialogBox/model/painting.vue | 168 ------- src/components/dialogBox/model/video.vue | 149 ------ src/components/dialogBox/pattern/index.vue | 96 ---- .../dialogBox/proportion/painting.vue | 465 ------------------ src/components/dialogBox/proportion/video.vue | 242 --------- src/components/dialogBox/quantity/index.vue | 67 --- .../dialogBox/videoImageUploader/index.vue | 330 ------------- src/config/index.js | 4 - src/config/runninghub/index.js | 113 ----- src/platforms/painting/index.js | 2 +- src/platforms/painting/modelSelector.vue | 2 +- .../painting}/models/flux.js | 0 .../painting}/models/gpt-image-i2i.js | 0 .../painting}/models/gpt-image.js | 0 .../painting}/models/index.js | 0 .../painting}/models/jimeng.js | 0 .../painting}/models/nano-pro.js | 0 .../painting}/models/qwen-edit.js | 0 .../painting}/models/qwen.js | 0 .../painting}/models/z-image.js | 0 24 files changed, 2 insertions(+), 2296 deletions(-) delete mode 100644 src/components/dialogBox/Time/index.vue delete mode 100644 src/components/dialogBox/dimension/index.vue delete mode 100644 src/components/dialogBox/imageUploader/index.vue delete mode 100644 src/components/dialogBox/model/painting.vue delete mode 100644 src/components/dialogBox/model/video.vue delete mode 100644 src/components/dialogBox/pattern/index.vue delete mode 100644 src/components/dialogBox/proportion/painting.vue delete mode 100644 src/components/dialogBox/proportion/video.vue delete mode 100644 src/components/dialogBox/quantity/index.vue delete mode 100644 src/components/dialogBox/videoImageUploader/index.vue delete mode 100644 src/config/index.js delete mode 100644 src/config/runninghub/index.js rename src/{config => platforms/painting}/models/flux.js (100%) rename src/{config => platforms/painting}/models/gpt-image-i2i.js (100%) rename src/{config => platforms/painting}/models/gpt-image.js (100%) rename src/{config => platforms/painting}/models/index.js (100%) rename src/{config => platforms/painting}/models/jimeng.js (100%) rename src/{config => platforms/painting}/models/nano-pro.js (100%) rename src/{config => platforms/painting}/models/qwen-edit.js (100%) rename src/{config => platforms/painting}/models/qwen.js (100%) rename src/{config => platforms/painting}/models/z-image.js (100%) diff --git a/components.d.ts b/components.d.ts index cbf39d5..6178c47 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,19 +11,10 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { - 2: typeof import('./src/components/virtual-scroller/VirtualScroller copy 2.vue')['default'] - 3: typeof import('./src/components/virtual-scroller/VirtualScroller copy 3.vue')['default'] Canvas: typeof import('./src/components/canvas/index.vue')['default'] - copy: typeof import('./src/components/virtual-scroller/VirtualScroller copy.vue')['default'] DialogBox: typeof import('./src/components/dialogBox/index.vue')['default'] - Dimension: typeof import('./src/components/dialogBox/dimension/index.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] - ElInput: typeof import('element-plus/es')['ElInput'] - ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] - ElOption: typeof import('element-plus/es')['ElOption'] - ElSelect: typeof import('element-plus/es')['ElSelect'] - ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElUpload: typeof import('element-plus/es')['ElUpload'] IEpCalendar: typeof import('~icons/ep/calendar')['default'] @@ -32,19 +23,11 @@ declare module 'vue' { IEpLoading: typeof import('~icons/ep/loading')['default'] IEpPlus: typeof import('~icons/ep/plus')['default'] IEpStar: typeof import('~icons/ep/star')['default'] - ImageUploader: typeof import('./src/components/dialogBox/imageUploader/index.vue')['default'] Img: typeof import('./src/components/Img/index.vue')['default'] - Painting: typeof import('./src/components/dialogBox/model/painting.vue')['default'] - ParamControl: typeof import('./src/components/dialogBox/ParamControl.vue')['default'] - Pattern: typeof import('./src/components/dialogBox/pattern/index.vue')['default'] Popover: typeof import('./src/components/Popover/index.vue')['default'] - Quantity: typeof import('./src/components/dialogBox/quantity/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Select: typeof import('./src/components/Select/index.vue')['default'] - Time: typeof import('./src/components/dialogBox/Time/index.vue')['default'] - Video: typeof import('./src/components/dialogBox/model/video.vue')['default'] - VideoImageUploader: typeof import('./src/components/dialogBox/videoImageUploader/index.vue')['default'] VirtualScroller: typeof import('./src/components/virtual-scroller/VirtualScroller.vue')['default'] 'VirtualScroller copy': typeof import('./src/components/virtual-scroller/VirtualScroller copy.vue')['default'] } diff --git a/src/components/dialogBox/Time/index.vue b/src/components/dialogBox/Time/index.vue deleted file mode 100644 index 7acfe1a..0000000 --- a/src/components/dialogBox/Time/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - 选择视频生成时长 - - - - - - - diff --git a/src/components/dialogBox/dimension/index.vue b/src/components/dialogBox/dimension/index.vue deleted file mode 100644 index 1a70538..0000000 --- a/src/components/dialogBox/dimension/index.vue +++ /dev/null @@ -1,247 +0,0 @@ - - - - - 尺寸 (px) - - - W - - - - - {{ isLocked ? '解绑比例' : '约束比例' }} - - - H - - - - - - - - - {{ displayText }} - - - - - - - - diff --git a/src/components/dialogBox/imageUploader/index.vue b/src/components/dialogBox/imageUploader/index.vue deleted file mode 100644 index 3c793a9..0000000 --- a/src/components/dialogBox/imageUploader/index.vue +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - {{ index + 1 }} - - - - - - - 参考内容 - - - - - - - - - diff --git a/src/components/dialogBox/model/painting.vue b/src/components/dialogBox/model/painting.vue deleted file mode 100644 index ddb0b77..0000000 --- a/src/components/dialogBox/model/painting.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - diff --git a/src/components/dialogBox/model/video.vue b/src/components/dialogBox/model/video.vue deleted file mode 100644 index 7fa0dee..0000000 --- a/src/components/dialogBox/model/video.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - diff --git a/src/components/dialogBox/pattern/index.vue b/src/components/dialogBox/pattern/index.vue deleted file mode 100644 index 2ad910d..0000000 --- a/src/components/dialogBox/pattern/index.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - {{ option.labelText }} - - - - - - - - diff --git a/src/components/dialogBox/proportion/painting.vue b/src/components/dialogBox/proportion/painting.vue deleted file mode 100644 index a24369b..0000000 --- a/src/components/dialogBox/proportion/painting.vue +++ /dev/null @@ -1,465 +0,0 @@ - - - - - 选择比例 - - - {{ item.label }} - - - - - - 选择分辨率 - - - {{ item.label }} - - - - - - 尺寸(px) - - - W - - - - - {{ isLocked ? '解绑比例' : '约束比例' }} - - - H - - - - - - - - - {{ proportion }} - - - - - - - - diff --git a/src/components/dialogBox/proportion/video.vue b/src/components/dialogBox/proportion/video.vue deleted file mode 100644 index 0aeafae..0000000 --- a/src/components/dialogBox/proportion/video.vue +++ /dev/null @@ -1,242 +0,0 @@ - - - - - 选择比例 - - - {{ item.label }} - - - - - - 选择分辨率 - - - {{ item.label }} - - - - - - - - {{ proportion }} - - {{ resolution }} - - - - - - - - diff --git a/src/components/dialogBox/quantity/index.vue b/src/components/dialogBox/quantity/index.vue deleted file mode 100644 index 9ecb2af..0000000 --- a/src/components/dialogBox/quantity/index.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - diff --git a/src/components/dialogBox/videoImageUploader/index.vue b/src/components/dialogBox/videoImageUploader/index.vue deleted file mode 100644 index 4c7c708..0000000 --- a/src/components/dialogBox/videoImageUploader/index.vue +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - {{ getFrameLabel(index) }} - - - - - - - - {{ getUploadText(i) }} - - - - - - - - - - diff --git a/src/config/index.js b/src/config/index.js deleted file mode 100644 index 762d221..0000000 --- a/src/config/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import * as runninghub from './runninghub/index.js' -// import * as suno from './suno.js' - -export default { runninghub } \ No newline at end of file diff --git a/src/config/runninghub/index.js b/src/config/runninghub/index.js deleted file mode 100644 index 9d1c750..0000000 --- a/src/config/runninghub/index.js +++ /dev/null @@ -1,113 +0,0 @@ -import { fetchModelConfig } from '@/utils/modelConfig' - -function getWidthHeight({ proportion, resolution }) { - let baseSize - switch (resolution) { - case '1k': - baseSize = 1024 - break - case '2k': - baseSize = 2048 - break - case '4k': - baseSize = 4096 - break - default: - baseSize = 2048 - } - - if (proportion === '智能') { - return { width: baseSize, height: baseSize } - } - - const [w, h] = String(proportion).split(':').map(Number) - const aspectRatio = w / h - - if (aspectRatio > 1) { - return { - width: baseSize, - height: Math.round(baseSize / aspectRatio) - } - } else { - return { - height: baseSize, - width: Math.round(baseSize * aspectRatio) - } - } -} - -export async function Playload(data) { - try { - const json = await fetchModelConfig(data.type, data.modelName, data.modelType) - - const nodeInfoList = [] - const proportionParam = data.params.find(param => param.name === 'proportion') || {data: 0} - const resolutionParam = data.params.find(param => param.name === 'resolution') || {data: 0} - - if (Array.isArray(data.imgs) && data.imgs.length > 0 && (data.modelType === 'image' || data.modelType === 'edit')) { - for (const key of data.imgs) { - if (json.nodeInfoList[key.name]) { - console.log(key) - json.nodeInfoList[key.name].fieldValue = key.url - nodeInfoList.push(json.nodeInfoList[key.name]) - } - if (json.imageIndex && json.imageIndex[key.name]) { - json.imageIndex[key.name].fieldValue = key.index - nodeInfoList.push(json.imageIndex[key.name]) - } - } - if (json.nodeInfoList.index) { - json.nodeInfoList.index.fieldValue = data.imgs.length - 1 - } - } - - if (Array.isArray(data.params)) { - for (const key of data.params) { - if (json.nodeInfoList[key.name]) { - console.log(key) - json.nodeInfoList[key.name].fieldValue = key.data - nodeInfoList.push(json.nodeInfoList[key.name]) - } - } - } - - if ((json.nodeInfoList.width || json.nodeInfoList.height) && (proportionParam.data && resolutionParam.data)) { - const { width, height } = getWidthHeight({ - proportion: proportionParam.data, - resolution: resolutionParam.data - }) - json.nodeInfoList.width.fieldValue = width - json.nodeInfoList.height.fieldValue = height - nodeInfoList.push(json.nodeInfoList.width, json.nodeInfoList.height) - } - - if (Array.isArray(json.seed)) { - const min = Math.pow(10, 0) - const max = Math.pow(10, 9) - 1 - const randomNum = Math.floor(Math.random() * (max - min + 1)) + min - json.seed.map((seedItem) => { - seedItem.fieldValue = randomNum - nodeInfoList.push(seedItem) - }) - } - - if (Array.isArray(json.must)) { - nodeInfoList.push(...json.must) - } - - return { - workflowId: json.workflowId, - nodeInfoList - } - } catch (error) { - console.error('获取 JSON 文件失败:', error) - throw error - } -} - -export function result(result) { - if (result.code === 0 && result.msg === 'success') { - return { type: true, url: result.data[0].fileUrl } - } - return { type: false, message: result.data.exception_message } -} diff --git a/src/platforms/painting/index.js b/src/platforms/painting/index.js index c99e0c3..9bbc56d 100644 --- a/src/platforms/painting/index.js +++ b/src/platforms/painting/index.js @@ -1,6 +1,6 @@ import { ref, reactive, markRaw } from 'vue' import { fetchPlatformModels, getPlatformCode } from '@/utils/modelApi' -import { getModelConfig } from '@/config/models/index.js' +import { getModelConfig } from './models/index.js' import PaintingModelSelector from './modelSelector.vue' import PaintingProportion from './controls/proportion.vue' import DimensionInput from './controls/dimension.vue' diff --git a/src/platforms/painting/modelSelector.vue b/src/platforms/painting/modelSelector.vue index ddb0b77..99e1c2a 100644 --- a/src/platforms/painting/modelSelector.vue +++ b/src/platforms/painting/modelSelector.vue @@ -14,7 +14,7 @@