diff --git a/web/package-lock.json b/web/package-lock.json index 19caefee..90514b12 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -38,7 +38,8 @@ "v3-waterfall": "^1.3.3", "vant": "^4.5.0", "vue": "^3.2.13", - "vue-router": "^4.0.15" + "vue-router": "^4.0.15", + "vue-waterfall-plugin-next": "^2.6.5" }, "devDependencies": { "@babel/core": "7.18.6", @@ -12951,6 +12952,11 @@ "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", "dev": true }, + "node_modules/vue-waterfall-plugin-next": { + "version": "2.6.5", + "resolved": "https://registry.npmmirror.com/vue-waterfall-plugin-next/-/vue-waterfall-plugin-next-2.6.5.tgz", + "integrity": "sha512-8ACGbdjoyKLiJfnKXB8h8f9eE14lhyzfI1N1nrfVAIRczSpNY1KRwGOnVXN5OHqheLl3V1C0uVVRPtjTJkHkhw==" + }, "node_modules/watchpack": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", diff --git a/web/package.json b/web/package.json index 2a099a60..98515624 100644 --- a/web/package.json +++ b/web/package.json @@ -9,7 +9,6 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", - "@openai/realtime-api-beta": "github:openai/openai-realtime-api-beta", "animate.css": "^4.1.1", "axios": "^0.27.2", "clipboard": "^2.0.11", @@ -33,12 +32,18 @@ "pinia": "^2.1.4", "qrcode": "^1.5.3", "qs": "^6.11.1", + "@better-scroll/core": "^2.5.1", + "@better-scroll/mouse-wheel": "^2.5.1", + "@better-scroll/observe-dom": "^2.5.1", + "@better-scroll/pull-up": "^2.5.1", + "@better-scroll/scroll-bar": "^2.5.1", "sortablejs": "^1.15.0", "three": "^0.128.0", "v3-waterfall": "^1.3.3", "vant": "^4.5.0", "vue": "^3.2.13", - "vue-router": "^4.0.15" + "vue-router": "^4.0.15", + "vue-waterfall-plugin-next": "^2.6.5" }, "devDependencies": { "@babel/core": "7.18.6", diff --git a/web/src/router.js b/web/src/router.js index 2513ab0b..1c3a7f4e 100644 --- a/web/src/router.js +++ b/web/src/router.js @@ -330,12 +330,7 @@ const routes = [ meta: { title: "测试页面" }, component: () => import("@/views/Test.vue"), }, - { - name: "test2", - path: "/test2", - meta: { title: "测试页面" }, - component: () => import("@/views/RealtimeTest.vue"), - }, + { name: "NotFound", path: "/:all(.*)", diff --git a/web/src/views/Dalle.vue b/web/src/views/Dalle.vue index d6fcd11e..2387d172 100644 --- a/web/src/views/Dalle.vue +++ b/web/src/views/Dalle.vue @@ -97,7 +97,7 @@
-
+

任务列表

@@ -105,7 +105,7 @@

创作记录

-
- + --> + + +
+ +
+ +
@@ -236,6 +285,11 @@ import { useSharedStore } from "@/store/sharedata"; import TaskList from "@/components/TaskList.vue"; import BackTop from "@/components/BackTop.vue"; import { showMessageError, showMessageOK } from "@/utils/dialog"; +import BScrollBox from "@/components/ui/BScrollBox.vue"; +import { LazyImg, Waterfall } from 'vue-waterfall-plugin-next' +import 'vue-waterfall-plugin-next/dist/style.css' + +import error from '@/assets/img/failed.png' const listBoxHeight = ref(0); // const paramBoxHeight = ref(0) @@ -251,6 +305,89 @@ const resizeElement = function () { listBoxHeight.value = window.innerHeight - 58; // paramBoxHeight.value = window.innerHeight - 110 }; + +const options = ref({ + // 唯一key值 + rowKey: 'id', + // 卡片之间的间隙 + gutter: 10, + // 是否有周围的gutter + hasAroundGutter: true, + // 卡片在PC上的宽度 + width: 200, + // 自定义行显示个数,主要用于对移动端的适配 + breakpoints: { + 3840: { + // 4K下 + rowPerView: 8, + }, + 2560: { + // 2K下 + rowPerView: 7, + }, + 1920: { + // 2K下 + rowPerView: 6, + }, + 1600: { + // 2K下 + rowPerView: 5, + }, + 1366: { + // 2K下 + rowPerView: 4, + }, + 800: { + // 当屏幕宽度小于等于800 + rowPerView: 3, + }, + 500: { + // 当屏幕宽度小于等于500 + rowPerView: 2, + }, + }, + // 动画效果 + animationEffect: 'animate__fadeInUp', + // 动画时间 + animationDuration: 1000, + // 动画延迟 + animationDelay: 300, + animationCancel: false, + // 背景色 + backgroundColor: '#2C2E3A', + // imgSelector + imgSelector: 'img_thumb', + // 加载配置 + loadProps: { + loading, + error, + ratioCalculator: (width, height) => { + console.log("width, height", width, height) + return height / width + }, + }, + // 是否懒加载 + lazyload: true, + align: 'center', +}) + +function imageLoad(url) { + console.log(`${url}: 加载完成`) +} + +function imageError(url) { + console.error(`${url}: 加载失败`) +} + +function imageSuccess(url) { + console.log(`${url}: 加载成功`) +} + +function afterRender() { + loading.value = false + console.log('计算完成') +} + resizeElement(); window.onresize = () => { resizeElement(); diff --git a/web/src/views/RealtimeTest.vue b/web/src/views/RealtimeTest.vue deleted file mode 100644 index 00a26242..00000000 --- a/web/src/views/RealtimeTest.vue +++ /dev/null @@ -1,471 +0,0 @@ - - - - - \ No newline at end of file diff --git a/web/vue.config.js b/web/vue.config.js index 3c59b9be..3b829948 100644 --- a/web/vue.config.js +++ b/web/vue.config.js @@ -24,6 +24,9 @@ module.exports = defineConfig({ outputDir: "dist", crossorigin: "anonymous", devServer: { + client: { + overlay: false // 关闭错误覆盖层 + }, allowedHosts: "all", port: 8888, proxy: {