소스 검색

Merge branch 'master' of http://59.110.91.129:3000/zhangmengying/AIClass

丸子 10 달 전
부모
커밋
bd20109d1d

BIN
src/assets/02video/01video.mp4


BIN
src/assets/images/ai-demo/ai-image-demo1.png


BIN
src/assets/images/ai-demo/ai-image-demo2.png


BIN
src/assets/images/ai-demo/ai-image-demo3.png


BIN
src/assets/images/ai-demo/ai-image-demo4.png


BIN
src/assets/images/color.png


+ 32 - 17
src/views/AIDevelop.vue

@@ -97,7 +97,8 @@
       </div>
     </div>
     <!-- 添加试题弹框 -->
-    <div
+    <transition name="fade-scale">
+      <div
         v-show="questionDialogVisible"
         class="child-dialog-wrapper"
         @click.self="handleCloseQuestionDialog"
@@ -120,11 +121,11 @@
           </div>
         </div>
         <div v-else class="no-options">
-          暂无选项
+<!--          暂无选项-->
         </div>
         <!-- 底部按钮 -->
         <div class="dialog-footer">
-          <el-button class="child-button cancel" @click="questionDialogVisible = false; showAIDialog = false">取消</el-button>
+<!--          <el-button class="child-button cancel" @click="questionDialogVisible = false; showAIDialog = false">取消</el-button>-->
           <el-button class="child-button confirm" @click="handleSubmitAnswer">确定</el-button>
         </div>
         <!-- 右侧小图标 -->
@@ -134,6 +135,7 @@
         </div>
       </div>
     </div>
+    </transition>
 
     <!-- AI对话弹框 -->
     <div
@@ -390,6 +392,17 @@ let messageHistory = ref([])
 
 // 定义每个视频对应的暂停时间和问题
 const videoPauseTimes = {
+  [video1]: {
+    pauseTimes: [1],
+    questions: [
+      {
+        title: '视频当中发生了什么事情呢?',
+        options: [],
+        aiQuestion: '视频当中发生了什么事情呢',
+        aiAnswer: '让我来告诉你吧:泡泡怪篡改了Ai历史数据,导致Ai系统发生崩溃,所以要修正Ai历史抓到泡泡怪!'
+      }
+    ]
+  },
   [video2]: {
     pauseTimes: [53],
     questions: [
@@ -462,7 +475,7 @@ const videoPauseTimes = {
         title: '在生活中,有哪些正在使用的专家系统呢?',
         options: [],
         aiQuestion: '在生活中,有哪些正在使用的专家系统呢?',
-        aiAnswer: '在医疗健康领域有复杂疾病协同决策Ai医生分身与诊断辅助;在水利交通领域的水利厅专家库系统用于项目验收和抢险督查'
+        aiAnswer: '在医疗健康领域有复杂疾病协同决策Ai医生分身与诊断辅助;在水利交通领域的水利厅专家库系统用于项目验收和抢险督查'
       }
     ]
   },
@@ -605,6 +618,7 @@ const handleCloseAIDialog = () => {
 
 <style scoped lang="scss">
 @use 'sass:math';
+@use 'sass:color'; // 引入 color 模块
 // 定义rpx转换函数
 @function rpx($px) {
   @return math.div($px, 750) * 100vw;
@@ -1054,7 +1068,7 @@ video.full-box-video::-webkit-media-controls-thumb {
 
 
     &:hover {
-      background: linear-gradient(to right, darken($primary-color, 5%), darken($secondary-color, 5%));
+      background: linear-gradient(to right, color.adjust($primary-color, $lightness: -5%), color.adjust($secondary-color, $lightness: -5%));
       box-shadow: 0 rpx(3) rpx(10) rgba($primary-color, 0.4);
       transform: translateY(-rpx(1));
       color: white;
@@ -1187,6 +1201,18 @@ video.full-box-video::-webkit-media-controls-thumb {
     text-indent: 1em;
   }
 }
+/* 定义淡入和缩放动画 */
+.fade-scale-enter-active,
+.fade-scale-leave-active {
+  transition: all 0.5s ease;
+}
+
+.fade-scale-enter-from,
+.fade-scale-leave-to {
+  opacity: 0.1;
+  transform: scale(0.9);
+}
+
 // 自定义试题弹框背景
 .child-dialog-wrapper {
   position: fixed;
@@ -1210,17 +1236,6 @@ video.full-box-video::-webkit-media-controls-thumb {
   padding: rpx(20);
   width: 60%;
   position: relative;
-
-  // 添加装饰元素
-  &::before {
-    content: "";
-    position: absolute;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: rpx(10);
-    background: linear-gradient(90deg, $primary-color, $secondary-color, $accent-color);
-  }
 }
 
 // AI对话弹框样式
@@ -1343,7 +1358,7 @@ video.full-box-video::-webkit-media-controls-thumb {
     transition: background-color 0.3s ease; // 颜色过渡效果
 
     &:hover {
-      background-color: darken($primary-color, 10%); // 悬停时滑块颜色加深
+      //background-color: darken($primary-color, 10%); // 悬停时滑块颜色加深
     }
   }
 

+ 79 - 2
src/views/AIPainting.vue

@@ -9,6 +9,17 @@
           智能绘画
         </div>
       </div>
+
+      <div class="img-box">
+        <p>
+          <img
+              style=" width: fit-content; height: 180px; margin: 10px;"
+              src="@/assets/images/color.png"
+              class="avatar user"
+          />
+        </p>
+        <p>期待你的画作喔~</p>
+      </div>
     </div>
     <!-- 右侧AI问答 -->
     <div class="number-people">
@@ -17,7 +28,7 @@
         <div class="chat-dialog">
           <!-- 对话消息列表 -->
           <div class="message-list">
-            <div v-for="(item, index) in imageAllList" :key="index">
+            <div v-if="imageAllList.length > 0" v-for="(item, index) in imageAllList" :key="index">
 
               <!-- 用户消息 -->
               <div class="user-message" v-if="item.type === 'user'">
@@ -62,7 +73,55 @@
                   </el-image>
                 </div>
               </div>
+            </div>
 
+            <div v-else class="content-demo">
+
+              <h3>请参考示例:</h3>
+
+              <!-- 用户消息 -->
+              <div class="user-message">
+                生成粉色的会飞的猪
+              </div>
+
+              <!-- AI生成图片对话框 -->
+              <div class="ai-message" >
+                为您生成图片:
+
+                <div class="image-list" v-if="demoImageList">
+                  <el-image
+                      v-for="(image, index) in demoImageList"
+                      :key="index"
+                      style=" width: fit-content; height: 180px; margin: 10px;"
+                      :src="image"
+                      :preview-src-list="demoImageList"
+                      fit="cover"
+                      show-progress
+                  >
+                    <template
+                        #toolbar="{ actions, prev, next, reset, activeIndex, setActiveItem }"
+                    >
+                      <el-icon @click="prev"><Back /></el-icon>
+                      <el-icon @click="next"><Right /></el-icon>
+                      <el-icon @click="setActiveItem(demoImageList.length - 1)">
+                        <DArrowRight />
+                      </el-icon>
+                      <el-icon @click="actions('zoomOut')"><ZoomOut /></el-icon>
+                      <el-icon
+                          @click="actions('zoomIn', { enableTransition: false, zoomRate: 2 })">
+                        <ZoomIn />
+                      </el-icon>
+                      <el-icon
+                          @click="actions('clockwise', { rotateDeg: 180, enableTransition: false })">
+                        <RefreshRight />
+                      </el-icon>
+                      <el-icon @click="actions('anticlockwise')"><RefreshLeft /></el-icon>
+                      <el-icon @click="reset"><Refresh /></el-icon>
+                      <el-icon @click="download(activeIndex)"><Download /></el-icon>
+                    </template>
+                  </el-image>
+                </div>
+              </div>
             </div>
           </div>
           <!-- 输入框和发送按钮 -->
@@ -85,6 +144,10 @@
 import { ref, onMounted,onUnmounted} from 'vue'
 import {AiImageStatusEnum, CreatePainting, PaintingGetMys} from '@/api/questions.js'
 import { useRouter, useRoute } from 'vue-router'
+import demo1 from '@/assets/images/ai-demo/ai-image-demo1.png'
+import demo2 from '@/assets/images/ai-demo/ai-image-demo2.png'
+import demo3 from '@/assets/images/ai-demo/ai-image-demo3.png'
+import demo4 from '@/assets/images/ai-demo/ai-image-demo4.png'
 import {
   Document,
   Menu as IconMenu,
@@ -100,6 +163,7 @@ const goBack = () => {
 const router = useRouter()
 const route = useRoute()
 
+const demoImageList = [demo1, demo2, demo3, demo4]
 
 // 消息列表和输入内容的响应式变量
 const messages = ref([])
@@ -265,6 +329,7 @@ const inProgressTimerFun = () => {
   display: flex;
   background-color: #ece9fd;
 }
+
 .content-box {
   flex: 1;
   margin-top: rpx(10);
@@ -274,6 +339,11 @@ const inProgressTimerFun = () => {
   background: rgba($color: #ffffff, $alpha: 0.5);
 }
 
+//左侧展览区图标
+.img-box {
+  margin-top: rpx(50);
+  color: #a39dce;
+}
 // 对话框
 .chat-dialog {
   display: flex;
@@ -340,4 +410,11 @@ const inProgressTimerFun = () => {
   display: flex;
   flex-wrap: wrap;
 }
-</style>
+
+
+.content-demo {
+  background-color: #f4f2fa;
+  border-radius: 15px;
+  padding: 30px 10px;
+}
+</style>

+ 8 - 7
src/views/AIQuestions.vue

@@ -295,15 +295,16 @@ const messageList = computed(() => {
   if (activeMessageList.value.length > 0) {
     return activeMessageList.value
   }
+
   // 没有消息时,如果有 systemMessage 则展示它
   if (activeConversation.value?.systemMessage) {
-    return [
-      {
-        id: 0,
-        type: 'system',
-        content: activeConversation.value.systemMessage
-      }
-    ]
+    let systemMessage = {
+      id: 0,
+      type: 'system',
+      content: activeConversation.value.systemMessage
+    }
+    activeMessageList.value.push(systemMessage)
+    return [systemMessage]
   }
   return []
 })