diff --git a/build/optimize.ts b/build/optimize.ts index d06f0d8fe..fbf706efb 100644 --- a/build/optimize.ts +++ b/build/optimize.ts @@ -17,6 +17,7 @@ const include = [ "qrcode", "intro.js", "vue-i18n", + "deep-chat", "vxe-table", "vue-types", "js-cookie", @@ -28,6 +29,7 @@ const include = [ "sortablejs", "swiper/vue", "mint-filter", + "highlight.js", "@vueuse/core", "vue3-danmaku", "v-contextmenu", diff --git a/build/plugins.ts b/build/plugins.ts index b2e45022b..ea8bbc3d3 100644 --- a/build/plugins.ts +++ b/build/plugins.ts @@ -19,7 +19,13 @@ export function getPluginsList( ): PluginOption[] { const lifecycle = process.env.npm_lifecycle_event; return [ - vue(), + vue({ + template: { + compilerOptions: { + isCustomElement: tag => tag === "deep-chat" + } + } + }), // jsx、tsx语法支持 vueJsx(), VueI18nPlugin({ diff --git a/package.json b/package.json index 310fcfdcc..43f1a7db5 100644 --- a/package.json +++ b/package.json @@ -69,9 +69,11 @@ "codemirror-editor-vue3": "^2.8.0", "cropperjs": "^1.6.2", "dayjs": "^1.11.13", + "deep-chat": "^2.1.1", "echarts": "^5.6.0", "el-table-infinite-scroll": "^3.0.6", "element-plus": "^2.9.4", + "highlight.js": "^11.11.1", "intro.js": "^7.2.0", "js-cookie": "^3.0.5", "jsbarcode": "^3.11.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39fb7d81f..9312023a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,6 +74,9 @@ importers: dayjs: specifier: ^1.11.13 version: 1.11.13 + deep-chat: + specifier: ^2.1.1 + version: 2.1.1 echarts: specifier: ^5.6.0 version: 5.6.0 @@ -83,6 +86,9 @@ importers: element-plus: specifier: ^2.9.4 version: 2.9.4(vue@3.5.13(typescript@5.7.3)) + highlight.js: + specifier: ^11.11.1 + version: 11.11.1 intro.js: specifier: ^7.2.0 version: 7.2.0 @@ -980,6 +986,10 @@ packages: resolution: {integrity: sha512-2kGiWoXaeV8HZlhU/Nml12oTbhv7j2ufsJ5vQaa0VTjzUmZVdd/nmKFRAOJ/FtjO90Qba5AnZDwsrY7ZND5udA==} engines: {node: '>= 16'} + '@intlify/shared@11.1.2': + resolution: {integrity: sha512-dF2iMMy8P9uKVHV/20LA1ulFLL+MKSbfMiixSmn6fpwqzvix38OIc7ebgnFbBqElvghZCW9ACtzKTGKsTGTWGA==} + engines: {node: '>= 16'} + '@intlify/unplugin-vue-i18n@6.0.3': resolution: {integrity: sha512-9ZDjBlhUHtgjRl23TVcgfJttgu8cNepwVhWvOv3mUMRDAhjW0pur1mWKEUKr1I8PNwE4Gvv2IQ1xcl4RL0nG0g==} engines: {node: '>= 18'} @@ -1104,6 +1114,9 @@ packages: '@logicflow/extension@1.2.28': resolution: {integrity: sha512-OHaO57SxjNwDDYVAqrJp/fq9g0NDc4elHmZnWGIqLbkbOMJhiU9IUT2WWK6DctUoYzxhGzTR4Ai5S/TFZ9JjGA==} + '@microsoft/fetch-event-source@2.0.1': + resolution: {integrity: sha512-W6CLUJ2eBMw3Rec70qrsEW0jOm/3twwJv21mrmj2yORiaVmVYGS4sSS5yUwvQc1ZlDLYGPnClVWmUUMagKNsfA==} + '@napi-rs/canvas-android-arm64@0.1.67': resolution: {integrity: sha512-W+3DFG5h0WU8Vqqb3W5fNmm5/TPH5ECZRinQDK4CAKFSUkc4iZcDwrmyFG9sB4KdHazf1mFVHCpEeVMO6Mk6Zg==} engines: {node: '>= 10'} @@ -1957,6 +1970,9 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + autolinker@3.16.2: + resolution: {integrity: sha512-JiYl7j2Z19F9NdTmirENSUUIIL/9MytEWtmzhfmsKPCp9E+G35Y0UNCMoM9tFigxT59qSc8Ml2dlZXOCVTYwuA==} + autoprefixer@10.4.20: resolution: {integrity: sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==} engines: {node: ^10 || ^12 || >=14} @@ -2455,6 +2471,9 @@ packages: dedent@0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} + deep-chat@2.1.1: + resolution: {integrity: sha512-zJV34RvuTHoyXlmSKeHOJS4dcEuTkh1Ndcm7ByKVKOLz2H2UAhAx2RPMeSlW5Yx0yYEh9n29uJk7fWbgHGYdlA==} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -3038,6 +3057,10 @@ packages: hey-listen@1.0.8: resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} + highlight.js@11.11.1: + resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==} + engines: {node: '>=12.0.0'} + hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -4378,6 +4401,11 @@ packages: reinterval@1.1.0: resolution: {integrity: sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==} + remarkable@2.0.1: + resolution: {integrity: sha512-YJyMcOH5lrR+kZdmB0aJJ4+93bEojRZ1HGDn9Eagu6ibg7aVZhc3OWbbShRid+Q5eAfsEqWxpe+g5W5nYNfNiA==} + engines: {node: '>= 6.0.0'} + hasBin: true + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -4594,6 +4622,9 @@ packages: resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==} engines: {node: '>=0.10.0'} + speech-to-element@0.1.66: + resolution: {integrity: sha512-tHDZ8ttFCsXtQLgWHDDVVTGuiCGWqkxRoIGLygBbU0DUsod2Ho89fws7OeCHpGOeDL9s5rBVpEqj45BsEIKy+Q==} + split2@3.2.2: resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} @@ -5989,12 +6020,14 @@ snapshots: '@intlify/shared@11.1.1': {} + '@intlify/shared@11.1.2': {} + '@intlify/unplugin-vue-i18n@6.0.3(@vue/compiler-dom@3.5.13)(eslint@9.20.1(jiti@2.4.2))(rollup@4.34.6)(typescript@5.7.3)(vue-i18n@11.1.1(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.20.1(jiti@2.4.2)) '@intlify/bundle-utils': 10.0.0(vue-i18n@11.1.1(vue@3.5.13(typescript@5.7.3))) - '@intlify/shared': 11.1.1 - '@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.1.1)(@vue/compiler-dom@3.5.13)(vue-i18n@11.1.1(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3)) + '@intlify/shared': 11.1.2 + '@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.1.2)(@vue/compiler-dom@3.5.13)(vue-i18n@11.1.1(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3)) '@rollup/pluginutils': 5.1.4(rollup@4.34.6) '@typescript-eslint/scope-manager': 8.24.0 '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) @@ -6016,11 +6049,11 @@ snapshots: - supports-color - typescript - '@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.1.1)(@vue/compiler-dom@3.5.13)(vue-i18n@11.1.1(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))': + '@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.1.2)(@vue/compiler-dom@3.5.13)(vue-i18n@11.1.1(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))': dependencies: '@babel/parser': 7.26.8 optionalDependencies: - '@intlify/shared': 11.1.1 + '@intlify/shared': 11.1.2 '@vue/compiler-dom': 3.5.13 vue: 3.5.13(typescript@5.7.3) vue-i18n: 11.1.1(vue@3.5.13(typescript@5.7.3)) @@ -6233,6 +6266,8 @@ snapshots: - ts-node - utf-8-validate + '@microsoft/fetch-event-source@2.0.1': {} + '@napi-rs/canvas-android-arm64@0.1.67': optional: true @@ -7147,6 +7182,10 @@ snapshots: asynckit@0.4.0: {} + autolinker@3.16.2: + dependencies: + tslib: 2.8.1 + autoprefixer@10.4.20(postcss@8.5.2): dependencies: browserslist: 4.24.4 @@ -7720,6 +7759,12 @@ snapshots: dedent@0.7.0: {} + deep-chat@2.1.1: + dependencies: + '@microsoft/fetch-event-source': 2.0.1 + remarkable: 2.0.1 + speech-to-element: 0.1.66 + deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -8395,6 +8440,8 @@ snapshots: hey-listen@1.0.8: {} + highlight.js@11.11.1: {} + hookable@5.5.3: {} hookified@1.7.0: {} @@ -9880,6 +9927,11 @@ snapshots: reinterval@1.1.0: {} + remarkable@2.0.1: + dependencies: + argparse: 1.0.10 + autolinker: 3.16.2 + require-directory@2.1.1: {} require-from-string@2.0.2: {} @@ -10094,6 +10146,8 @@ snapshots: speakingurl@14.0.1: {} + speech-to-element@0.1.66: {} + split2@3.2.2: dependencies: readable-stream: 3.6.2 diff --git a/src/router/enums.ts b/src/router/enums.ts index 2dc6a794a..d9c1d6699 100644 --- a/src/router/enums.ts +++ b/src/router/enums.ts @@ -1,35 +1,37 @@ // 完整版菜单比较多,将 rank 抽离出来,在此方便维护 const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以后端在返回 rank 的时候需要从非 0 开始 - vueflow = 1, - ganttastic = 2, - components = 3, - able = 4, - table = 5, - form = 6, - list = 7, - result = 8, - error = 9, - frame = 10, - nested = 11, - permission = 12, - system = 13, - monitor = 14, - tabs = 15, - about = 16, - codemirror = 17, - markdown = 18, - editor = 19, - flowchart = 20, - formdesign = 21, - board = 22, - ppt = 23, - mind = 24, - guide = 25, - menuoverflow = 26; + chatai = 1, + vueflow = 2, + ganttastic = 3, + components = 4, + able = 5, + table = 6, + form = 7, + list = 8, + result = 9, + error = 10, + frame = 11, + nested = 12, + permission = 13, + system = 14, + monitor = 15, + tabs = 16, + about = 17, + codemirror = 18, + markdown = 19, + editor = 20, + flowchart = 21, + formdesign = 22, + board = 23, + ppt = 24, + mind = 25, + guide = 26, + menuoverflow = 27; export { home, + chatai, vueflow, ganttastic, components, diff --git a/src/router/modules/chatai.ts b/src/router/modules/chatai.ts new file mode 100644 index 000000000..10180f73c --- /dev/null +++ b/src/router/modules/chatai.ts @@ -0,0 +1,22 @@ +import { chatai } from "@/router/enums"; + +export default { + path: "/chatai", + redirect: "/chatai/index", + meta: { + icon: "ri:chat-search-line", + title: "chat-ai", + rank: chatai + }, + children: [ + { + path: "/chatai/index", + name: "ChatAi", + component: () => import("@/views/chatai/index.vue"), + meta: { + title: "chat-ai", + extraIcon: "IF-pure-iconfont-new svg" + } + } + ] +} satisfies RouteConfigsTable; diff --git a/src/views/chatai/components/Bard.vue b/src/views/chatai/components/Bard.vue new file mode 100644 index 000000000..63443111b --- /dev/null +++ b/src/views/chatai/components/Bard.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/views/chatai/components/Bing.vue b/src/views/chatai/components/Bing.vue new file mode 100644 index 000000000..06d308e15 --- /dev/null +++ b/src/views/chatai/components/Bing.vue @@ -0,0 +1,147 @@ + + + diff --git a/src/views/chatai/components/Blue.vue b/src/views/chatai/components/Blue.vue new file mode 100644 index 000000000..a1e861deb --- /dev/null +++ b/src/views/chatai/components/Blue.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/views/chatai/components/ChatGPT.vue b/src/views/chatai/components/ChatGPT.vue new file mode 100644 index 000000000..b5f12d24d --- /dev/null +++ b/src/views/chatai/components/ChatGPT.vue @@ -0,0 +1,114 @@ + + + diff --git a/src/views/chatai/components/Dark.vue b/src/views/chatai/components/Dark.vue new file mode 100644 index 000000000..02e7c1f0d --- /dev/null +++ b/src/views/chatai/components/Dark.vue @@ -0,0 +1,85 @@ + + + diff --git a/src/views/chatai/components/FullInput.vue b/src/views/chatai/components/FullInput.vue new file mode 100644 index 000000000..182eb5bd5 --- /dev/null +++ b/src/views/chatai/components/FullInput.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/views/chatai/components/Group.vue b/src/views/chatai/components/Group.vue new file mode 100644 index 000000000..932b402b1 --- /dev/null +++ b/src/views/chatai/components/Group.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/views/chatai/components/IntroPanel.vue b/src/views/chatai/components/IntroPanel.vue new file mode 100644 index 000000000..9cc291129 --- /dev/null +++ b/src/views/chatai/components/IntroPanel.vue @@ -0,0 +1,48 @@ + + + diff --git a/src/views/chatai/components/LoFi.vue b/src/views/chatai/components/LoFi.vue new file mode 100644 index 000000000..7791fa608 --- /dev/null +++ b/src/views/chatai/components/LoFi.vue @@ -0,0 +1,100 @@ + + + diff --git a/src/views/chatai/components/MessageCode.vue b/src/views/chatai/components/MessageCode.vue new file mode 100644 index 000000000..868851913 --- /dev/null +++ b/src/views/chatai/components/MessageCode.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/views/chatai/components/Red.vue b/src/views/chatai/components/Red.vue new file mode 100644 index 000000000..4c5813e50 --- /dev/null +++ b/src/views/chatai/components/Red.vue @@ -0,0 +1,65 @@ + + + diff --git a/src/views/chatai/components/Speech.vue b/src/views/chatai/components/Speech.vue new file mode 100644 index 000000000..15e880419 --- /dev/null +++ b/src/views/chatai/components/Speech.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/views/chatai/components/iMessage.vue b/src/views/chatai/components/iMessage.vue new file mode 100644 index 000000000..ab5472a59 --- /dev/null +++ b/src/views/chatai/components/iMessage.vue @@ -0,0 +1,135 @@ + + + diff --git a/src/views/chatai/components/index.ts b/src/views/chatai/components/index.ts new file mode 100644 index 000000000..0f98414e3 --- /dev/null +++ b/src/views/chatai/components/index.ts @@ -0,0 +1,13 @@ +export { default as ChatGPT } from "./ChatGPT.vue"; +export { default as Bard } from "./Bard.vue"; +export { default as Bing } from "./Bing.vue"; +export { default as iMessage } from "./iMessage.vue"; +export { default as Blue } from "./Blue.vue"; +export { default as LoFi } from "./LoFi.vue"; +export { default as Red } from "./Red.vue"; +export { default as Dark } from "./Dark.vue"; +export { default as FullInput } from "./FullInput.vue"; +export { default as Group } from "./Group.vue"; +export { default as MessageCode } from "./MessageCode.vue"; +export { default as Speech } from "./Speech.vue"; +export { default as IntroPanel } from "./IntroPanel.vue"; diff --git a/src/views/chatai/index.vue b/src/views/chatai/index.vue new file mode 100644 index 000000000..595977da6 --- /dev/null +++ b/src/views/chatai/index.vue @@ -0,0 +1,150 @@ + + + + +