@@ -13,7 +13,7 @@ import List from './list/index.vue'
defineOptions({ name: 'Index' })
-const listRef = ref<{generateMusic: (...args) => void} | null>(null)
+const listRef = ref
void}>>(null)
function generateMusic (args: {formData: Recordable}) {
unref(listRef)?.generateMusic(args.formData)
diff --git a/src/views/ai/music/components/list/audioBar/index.vue b/src/views/ai/music/components/list/audioBar/index.vue
index 2b25e40f..412d7fef 100644
--- a/src/views/ai/music/components/list/audioBar/index.vue
+++ b/src/views/ai/music/components/list/audioBar/index.vue
@@ -1,9 +1,68 @@
- 播放器
+
+
+
+
+
+
+
+
+
+
+ {{audioProps.currentTime}}
+
+ {{ audioProps.duration }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ai/music/components/list/index.vue b/src/views/ai/music/components/list/index.vue
index 6dce9b8c..1b8a46e5 100644
--- a/src/views/ai/music/components/list/index.vue
+++ b/src/views/ai/music/components/list/index.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/views/ai/music/components/mode/index.vue b/src/views/ai/music/components/mode/index.vue
index bb6cf116..61cf238e 100644
--- a/src/views/ai/music/components/mode/index.vue
+++ b/src/views/ai/music/components/mode/index.vue
@@ -1,5 +1,5 @@
-
+
描述模式
@@ -28,10 +28,7 @@ const emits = defineEmits(['generate-music'])
const generateMode = ref('lyric')
-interface ModeRef {
- formData: Recordable
-}
-const modeRef = ref(null)
+const modeRef = ref>(null)
/*
*@Description: 根据信息生成音乐
diff --git a/src/views/ai/utils/constants.ts b/src/views/ai/utils/constants.ts
index 0a88775b..4fee2dc6 100644
--- a/src/views/ai/utils/constants.ts
+++ b/src/views/ai/utils/constants.ts
@@ -20,17 +20,21 @@ export const AiPlatformEnum = {
Ollama: 'Ollama',
STABLE_DIFFUSION: 'StableDiffusion', // Stability AI
MIDJOURNEY: 'Midjourney', // Midjourney
- SUNO: 'Suno', // Suno AI
+ SUNO: 'Suno' // Suno AI
}
-export const OtherPlatformEnum:ImageModelVO [] = [
+export const OtherPlatformEnum: ImageModelVO[] = [
{
key: AiPlatformEnum.TONG_YI,
name: '通义万相'
},
{
key: AiPlatformEnum.YI_YAN,
- name: '百度图片'
+ name: '百度千帆'
+ },
+ {
+ key: AiPlatformEnum.ZHI_PU,
+ name: '智谱 AI'
}
]
@@ -60,6 +64,12 @@ export enum AiWriteTypeEnum {
REPLY // 回复
}
+// 表格展示对照map
+export const AiWriteTypeTableRender = {
+ [AiWriteTypeEnum.WRITING]: '撰写',
+ [AiWriteTypeEnum.REPLY]: '回复',
+}
+
// ========== 【图片 UI】相关的枚举 ==========
export const ImageHotWords = [
'中国旗袍',
@@ -200,54 +210,6 @@ export const StableDiffusionStylePresets: ImageModelVO[] = [
}
]
-// todo @芋艿 这些是通义的风格,看要不要删除
-export const TongYiWanXiangStylePresets: ImageModelVO[] = [
- {
- key: '-1',
- name: '上传图像风格'
- },
- {
- key: '0',
- name: '复古漫画'
- },
- {
- key: '1',
- name: '3D童话'
- },
- {
- key: '2',
- name: '二次元'
- },
- {
- key: '3',
- name: '小清新'
- },
- {
- key: '4',
- name: '未来科技'
- },
- {
- key: '5',
- name: '国画古风'
- },
- {
- key: '6',
- name: '将军百战'
- },
- {
- key: '7',
- name: '炫彩卡通'
- },
- {
- key: '8',
- name: '清雅国风'
- },
- {
- key: '9',
- name: '喜迎新年'
- }
-]
-
export const TongYiWanXiangModels: ImageModelVO[] = [
{
key: 'wanx-v1',
@@ -259,6 +221,20 @@ export const TongYiWanXiangModels: ImageModelVO[] = [
}
]
+export const QianFanModels: ImageModelVO[] = [
+ {
+ key: 'sd_xl',
+ name: 'sd_xl'
+ }
+]
+
+export const ChatGlmModels: ImageModelVO[] = [
+ {
+ key: 'cogview-3',
+ name: 'cogview-3'
+ }
+]
+
export const StableDiffusionClipGuidancePresets: ImageModelVO[] = [
{
key: 'NONE',
@@ -318,7 +294,7 @@ export const Dall3StyleList: ImageModelVO[] = [
export interface ImageSizeVO {
key: string
- name: string
+ name?: string
style: string
width: string
height: string
diff --git a/src/views/ai/writer/index/components/Left.vue b/src/views/ai/write/index/components/Left.vue
similarity index 81%
rename from src/views/ai/writer/index/components/Left.vue
rename to src/views/ai/write/index/components/Left.vue
index 7e7744c7..05cc04a5 100644
--- a/src/views/ai/writer/index/components/Left.vue
+++ b/src/views/ai/write/index/components/Left.vue
@@ -24,26 +24,28 @@
-
+
-
-
-
+
@@ -102,7 +104,7 @@
import { createReusableTemplate } from '@vueuse/core'
import { ref } from 'vue'
import Tag from './Tag.vue'
-import { WriteVO } from '@/api/ai/writer'
+import { WriteVO } from 'src/api/ai/write'
import { omit } from 'lodash-es'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { AiWriteTypeEnum, WriteExample } from '@/views/ai/utils/constants'
@@ -177,10 +179,18 @@ const initData: WriteVO = {
}
const formData = ref({ ...initData })
+/** 用来记录切换之前所填写的数据,切换的时候给赋值回来 **/
+const recordFormData = {} as Record
+
/** 切换tab **/
const switchTab = (value: TabType) => {
- selectedTab.value = value
- formData.value = { ...initData }
+ if (value !== selectedTab.value) {
+ // 保存之前的久数据
+ recordFormData[selectedTab.value] = formData.value
+ selectedTab.value = value
+ // 将之前的旧数据赋值回来
+ formData.value = { ...initData, ...recordFormData[value] }
+ }
}
/** 提交写作 */
diff --git a/src/views/ai/writer/index/components/Right.vue b/src/views/ai/write/index/components/Right.vue
similarity index 74%
rename from src/views/ai/writer/index/components/Right.vue
rename to src/views/ai/write/index/components/Right.vue
index 00380a7e..d0aada5d 100644
--- a/src/views/ai/writer/index/components/Right.vue
+++ b/src/views/ai/write/index/components/Right.vue
@@ -1,17 +1,19 @@
-
-
- 预览
-
-
-
-
-
- 复制
-
-
+
+
+
+ 预览
+
+
+
+
+
+ 复制
+
+
+
-
+