zhangnuoyan 2 年之前
父節點
當前提交
05f0bfbc10

+ 1 - 0
src/App.vue

@@ -66,6 +66,7 @@ export default defineComponent({
 }
 body {
     --primary-6: 59, 202, 168;
+    --primary-5: 59 202 168 / 80%;
     --danger-6: 255, 110, 110;
 }
 </style>

+ 50 - 0
src/assets/question/word.svg

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
+	<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
+	<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
+	<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
+	<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
+	<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
+	<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
+	<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
+]>
+<svg version="1.1" id="Livello_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1881.25 1750"
+	 enable-background="new 0 0 1881.25 1750" xml:space="preserve">
+<metadata>
+	<sfw  xmlns="&ns_sfw;">
+		<slices></slices>
+		<sliceSourceBounds  bottomLeftOrigin="true" height="1750" width="1881.25" x="-938.5" y="-851"></sliceSourceBounds>
+	</sfw>
+</metadata>
+<path fill="#41A5EE" d="M1801.056,0H517.694C473.404,0,437.5,35.904,437.5,80.194c0,0,0,0,0,0V437.5l743.75,218.75l700-218.75
+	V80.194C1881.25,35.904,1845.346,0,1801.056,0L1801.056,0z"/>
+<path fill="#2B7CD3" d="M1881.25,437.5H437.5V875l743.75,131.25l700-131.25V437.5z"/>
+<path fill="#185ABD" d="M437.5,875v437.5l700,87.5l743.75-87.5V875H437.5z"/>
+<path fill="#103F91" d="M517.694,1750h1283.363c44.29,0,80.194-35.904,80.194-80.194l0,0V1312.5H437.5v357.306
+	C437.5,1714.096,473.404,1750,517.694,1750L517.694,1750z"/>
+<path opacity="0.1" enable-background="new    " d="M969.806,350H437.5v1093.75h532.306c44.23-0.144,80.05-35.964,80.194-80.194
+	V430.194C1049.856,385.964,1014.036,350.144,969.806,350z"/>
+<path opacity="0.2" enable-background="new    " d="M926.056,393.75H437.5V1487.5h488.556c44.23-0.144,80.05-35.964,80.194-80.194
+	V473.944C1006.106,429.714,970.286,393.894,926.056,393.75z"/>
+<path opacity="0.2" enable-background="new    " d="M926.056,393.75H437.5V1400h488.556c44.23-0.144,80.05-35.964,80.194-80.194
+	V473.944C1006.106,429.714,970.286,393.894,926.056,393.75z"/>
+<path opacity="0.2" enable-background="new    " d="M882.306,393.75H437.5V1400h444.806c44.23-0.144,80.05-35.964,80.194-80.194
+	V473.944C962.356,429.714,926.536,393.894,882.306,393.75z"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="167.2057" y1="1420.9117" x2="795.2943" y2="333.0883" gradientTransform="matrix(1 0 0 -1 0 1752)">
+	<stop  offset="0" style="stop-color:#2368C4"/>
+	<stop  offset="0.5" style="stop-color:#1A5DBE"/>
+	<stop  offset="1" style="stop-color:#1146AC"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M80.194,393.75h802.112c44.29,0,80.194,35.904,80.194,80.194v802.113
+	c0,44.29-35.904,80.194-80.194,80.194H80.194c-44.29,0-80.194-35.904-80.194-80.194V473.944C0,429.654,35.904,393.75,80.194,393.75z
+	"/>
+<path fill="#FFFFFF" d="M329.088,1008.788c1.575,12.381,2.625,23.144,3.106,32.375h1.837c0.7-8.75,2.158-19.294,4.375-31.631
+	c2.217-12.338,4.215-22.765,5.994-31.281l84.35-363.913h109.069l87.5,358.444c5.084,22.288,8.723,44.881,10.894,67.637h1.444
+	c1.631-22.047,4.671-43.966,9.1-65.625l69.781-360.631h99.269l-122.588,521.5H577.238L494.113,790.3
+	c-2.406-9.931-5.162-22.925-8.181-38.894c-3.019-15.969-4.9-27.65-5.644-35h-1.444c-0.962,8.487-2.844,21.088-5.644,37.8
+	c-2.8,16.713-5.046,29.079-6.738,37.1l-78.138,344.269h-117.95L147.131,614.337h101.062l75.994,364.656
+	C325.894,986.475,327.513,996.45,329.088,1008.788z"/>
+</svg>

+ 73 - 4
src/components/DialogWrap.vue

@@ -67,7 +67,11 @@
                             <span class="dialog-span">{{ agentInfo.title }}</span>
                         </a-typography-paragraph>
                     </div>
-                    <div class="dialog-footer" v-if="item.capacity">
+                    <div
+                        class="dialog-footer"
+                        v-if="item.capacity"
+                        :style="{ display: dialogConfig.type === 'paper' ? 'inline-block' : 'block' }"
+                    >
                         <div
                             v-if="type === 'knowledge'"
                             @click="openCapacity(key)"
@@ -89,7 +93,15 @@
                             :class="[readonly || item.capacity.status === 'loading' ? 'disabled' : '']"
                         >
                             <a-spin :size="18" />
-                            <span>小数正在为您生成答案...</span>
+                            <span
+                                >小数正在为您生成{{
+                                    dialogConfig.type === "paper"
+                                        ? "试卷"
+                                        : dialogConfig.type === "topic"
+                                        ? "试题"
+                                        : "答案"
+                                }}...</span
+                            >
                         </div>
                         <section
                             v-if="type === 'knowledge' && item.capacity.status === 'loaded'"
@@ -149,7 +161,14 @@
                             答案生成结果
                         </p>
                         <p v-if="item.answer" :style="{ 'margin-top': type === 'knowledge' ? '12px' : '0' }">
-                            {{ item.answer }}
+                            <span v-if="dialogConfig.type === 'paper'" class="paper-wrap">
+                                <img src="@/assets/question/word.svg" />
+                                <span>
+                                    <b>黄冈试卷考试题</b>
+                                    <em>DOCX,13.19KB</em>
+                                </span>
+                            </span>
+                            <span v-else>{{ item.answer }}</span>
                         </p>
                     </div>
                     <div class="dialog-footer" v-else>
@@ -157,6 +176,13 @@
                             {{ item.answer }}
                         </p>
                     </div>
+                    <div v-if="dialogConfig.type === 'paper' && item.other" class="paper-download">
+                        <a-tooltip content="下载">
+                            <span>
+                                <icon-download />
+                            </span>
+                        </a-tooltip>
+                    </div>
                     <div v-if="type === 'knowledge' && item.other" class="knowledge-wrap">
                         <header>
                             <p>来源</p>
@@ -347,6 +373,7 @@ export default defineComponent({
         const menuList = reactive([]);
         let dialogIndex = dialogList.length;
         const dialogScroll = ref("");
+        const dialogConfig = ref({});
         const scrollToEnd = async () => {
             await nextTick();
             if (dialogScroll.value) {
@@ -478,6 +505,7 @@ export default defineComponent({
         onMounted(() => {
             scrollToEnd();
             helper.$bus.on("send-message", (value) => {
+                dialogConfig.value = helper.dialogConfig;
                 mockLink(value);
             });
             helper.$bus.on("clear-message", () => {
@@ -504,7 +532,8 @@ export default defineComponent({
             handleOk,
             handleCancel,
             stopWriting,
-            knowledgeList
+            knowledgeList,
+            dialogConfig
         };
     }
 });
@@ -521,6 +550,46 @@ export default defineComponent({
 }
 </style>
 <style scoped>
+.paper-download {
+    padding-left: 50px;
+    > span {
+        width: 26px;
+        height: 26px;
+        border-radius: 3px;
+        cursor: pointer;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        &:hover {
+            background: rgba(150, 171, 185, 0.2);
+        }
+    }
+}
+.paper-wrap {
+    display: flex;
+    max-width: 200px;
+    align-items: center;
+    > img {
+        width: 50px;
+        margin-right: 10px;
+    }
+    > span {
+        flex: 1;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        > b {
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            display: block;
+            width: 100%;
+        }
+        > em {
+            font-style: normal;
+        }
+    }
+}
 .knowledge-detail {
     width: 320px;
     padding-top: 20px;

+ 19 - 4
src/components/DocumentCards.vue

@@ -149,7 +149,17 @@
                             <a-button type="outline" style="margin-right: 10px" @click="selectFiles(false)"
                                 >取消</a-button
                             >
-                            <a-button type="primary" @click="selectFiles(true)"
+                            <a-button
+                                type="primary"
+                                style="margin-right: 10px"
+                                @click="selectFiles(true, 'topic')"
+                                v-if="isQuestion"
+                                >去出题({{ selectedKeys.length }})</a-button
+                            >
+                            <a-button type="primary" @click="selectFiles(true, 'paper')" v-if="isQuestion"
+                                >去出卷({{ selectedKeys.length }})</a-button
+                            >
+                            <a-button type="primary" @click="selectFiles(true, 'question')" v-if="!isQuestion"
                                 >去提问({{ selectedKeys.length }})</a-button
                             >
                         </div>
@@ -166,19 +176,24 @@
 <script>
 import { defineComponent, ref, inject, reactive } from "vue";
 export default defineComponent({
-    props: ["data", "hasUpload", "hasSlider", "uploadImg"],
-    setup() {
+    props: ["data", "hasUpload", "hasSlider", "uploadImg", "isQuestion"],
+    setup(props) {
         const showUpload = ref(false);
         const { helper } = inject("$global");
         const maxSize = 30 * 1024 * 1024;
         const fileList = [];
         const showDeleteTooltip = ref(false);
         const deleteId = ref("");
-        const selectFiles = (isSelect) => {
+        const selectFiles = (isSelect, type) => {
             if (!isSelect) {
                 selectedKeys.value = [];
             }
             showUpload.value = false;
+            helper.dialogConfig = {
+                isQuestion: props.isQuestion,
+                selectedKeys: selectedKeys.value,
+                type
+            };
         };
         const handleDeleteButton = (id) => {
             showDeleteTooltip.value = true;

+ 5 - 5
src/components/MessageInput.vue

@@ -20,7 +20,7 @@
                     padding: '0px 30px 0 16px',
                     background: 'transparent',
                     border: '1px solid #e3e3e3',
-                    minHeight: '90px',
+                    minHeight: '120px',
                     paddingBottom: `${value.length > maxLength / 2 ? '20px' : ''}`
                 }"
             >
@@ -30,7 +30,7 @@
             :class="['message-button', 'message-button-send', value.length > 0 && !readonly ? '' : 'disabled']"
             @click="sendMessage"
         >
-            <icon-send />
+            <icon-send size="30" />
         </div>
     </div>
 </template>
@@ -114,12 +114,13 @@ export default defineComponent({
 .message-button {
     position: absolute;
     width: 30px;
-    height: 30px;
+    height: 40px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
-    bottom: 2px;
+    bottom: 5px;
+    right: 5px;
     z-index: 2;
     &.disabled {
         opacity: 0.5;
@@ -130,7 +131,6 @@ export default defineComponent({
     left: 38px;
 }
 .message-button-send {
-    right: 0;
     color: rgb(64, 95, 234, 0.8);
     &:hover {
         color: rgb(64, 95, 234);

+ 15 - 29
src/utils/config.js

@@ -3,11 +3,11 @@ export default {
     defaultDesc: "国网湖北电力AI能力平台,为你的下一个创意助力",
     slider: [
         {
-            title: "智能问答",
-            icon: "1",
-            img: "/src/assets/index/1.png",
-            desc: "能够理解和学习人类的语言,具备多轮对话的能力",
-            dialog: "我可以理解和学习人类的语言,具备多轮对话的能力,现在和我开始交流吧~"
+            title: "知识问答",
+            icon: "5",
+            img: "/src/assets/index/5.png",
+            desc: "遍历已创建的文档知识库,生成完整和准确的答案,同时显示来源文档供您参考",
+            dialog: "垂域知识的问答助手,针对你的提问,我们将遍历已创建的文档知识库,生成完整和准确的答案,同时显示来源文档供您参考。"
         },
         {
             title: "文档智能",
@@ -17,46 +17,32 @@ export default {
             dialog: "个人知识库的问答助手,基于您上传的文档进行问答,支持多文档,大小在30M以内。"
         },
         {
-            title: "以文生图",
-            icon: "3",
-            img: "/src/assets/index/3.png",
-            desc: "可以学习不同的绘画风格,并且通过文字描述智能绘制出图片",
-            dialog: "我可以学习不同的绘画风格,并且通过文字描述智能绘制出图片,现在让我开始创作吧~"
-        },
-        {
-            title: "文档创作",
-            icon: "4",
-            img: "/src/assets/index/4.png",
-            desc: "您的公文写作助手,根据你的创作要求,按需生成各类型公文",
-            dialog: "您的公文写作助手,输入你的创作要求,我们将按需生成各类型公文。"
-        },
-        {
-            title: "文库问答",
-            icon: "5",
-            img: "/src/assets/index/5.png",
-            desc: "遍历已创建的文档知识库,生成完整和准确的答案,同时显示来源文档供您参考",
-            dialog: "垂域知识的问答助手,针对你的提问,我们将遍历已创建的文档知识库,生成完整和准确的答案,同时显示来源文档供您参考。"
-        },
-        {
-            title: "文档出题",
+            title: "文档出卷",
             icon: "6",
             img: "/src/assets/index/6.png",
             desc: "针对单文档或多个文档内容自动出题,高效便捷的帮助你建立私人题库",
             dialog: "您可以上传文档,小数能针对单文档或多个文档内容自动出题,高效便捷的帮助你建立私人题库。"
         },
         {
-            title: "以图生文",
+            title: "小数绘图",
             icon: "7",
             img: "/src/assets/index/7.png",
             desc: "基于您上传的图片,生成对应的文字描述并基于图片内容实现问答",
             dialog: "基于您上传的图片,生成对应的文字描述并基于图片内容实现问答。"
         },
         {
-            title: "数据分析",
+            title: "智能数据",
             icon: "8",
             img: "/src/assets/index/8.png",
             desc: "您可以上传文档或添加数据库地址,小数可针对你文档的数据进行分析,并生成指定的图表",
             dialog: "您可以上传文档或添加数据库地址,小数可针对你文档的数据进行分析,并生成指定的图表。"
+        },
+        {
+            title: "智能问答",
+            icon: "1",
+            img: "/src/assets/index/1.png",
+            desc: "能够理解和学习人类的语言,具备多轮对话的能力",
+            dialog: "我可以理解和学习人类的语言,具备多轮对话的能力,现在和我开始交流吧~"
         }
     ]
 };

+ 5 - 0
src/utils/helper.js

@@ -23,6 +23,11 @@ const getToken = () => {
 };
 const helper = (router, ArcoVue) => {
     return {
+        dialogConfig: {
+            isQuestion: false,
+            selectedKeys: [],
+            type: "answer"
+        },
         $bus,
         getToken,
         goLink(path, query = {}) {

+ 1 - 1
src/views/DocumentQuestion.vue

@@ -1,5 +1,5 @@
 <template>
-    <document-cards :data="data" :hasUpload="true" :hasSlider="true" />
+    <document-cards :data="data" :hasUpload="true" :hasSlider="true" :isQuestion="true" />
 </template>
 <script>
 import DocumentCards from "@/components/DocumentCards.vue";

+ 0 - 47
src/views/GenDocument.vue

@@ -1,47 +0,0 @@
-<template>
-    <document-cards :data="data" :hasUpload="false" :hasSlider="false" />
-</template>
-<script>
-import DocumentCards from "@/components/DocumentCards.vue";
-import { defineComponent, ref, inject, reactive } from "vue";
-export default defineComponent({
-    components: {
-        DocumentCards
-    },
-    setup() {
-        const data = ref([
-            {
-                background: "rgba(72, 177, 244, 0.06)",
-                color: "rgb(72, 177, 244)",
-                img: "/src/assets/gen/1.png",
-                title: "多类型写作",
-                content: "讲话稿或者发言稿、工作总结、工作方案、述职报告等"
-            },
-            {
-                background: "rgba(158, 128, 255, 0.06)",
-                color: "rgb(158, 128, 255)",
-                img: "/src/assets/gen/2.png",
-                title: "字数控制",
-                content: "可控制字数范围,如800、1000、2000.3000字等,可在这个字数左右生成文档"
-            },
-            {
-                background: "rgba(24, 200, 138, 0.06)",
-                color: "rgb(24, 200, 138)",
-                img: "/src/assets/gen/3.png",
-                title: "续写扩写",
-                content: "对之前生成文章中的其中某一部分进行继续完善,支持1分钟内的3轮"
-            },
-            {
-                background: "rgba(255, 110, 110, 0.06)",
-                color: "rgb(255, 110, 110)",
-                img: "/src/assets/gen/4.png",
-                title: "多个 prompt 组合",
-                content: "支持标题、关键词、大纲等的随意组合"
-            }
-        ]);
-        return {
-            data
-        };
-    }
-});
-</script>

+ 0 - 51
src/views/GenPic.vue

@@ -1,51 +0,0 @@
-<template>
-    <normal-cards :data="data" />
-</template>
-<script>
-import NormalCards from "@/components/NormalCards.vue";
-import { defineComponent, ref } from "vue";
-export default defineComponent({
-    components: { NormalCards },
-    setup() {
-        const data = ref([
-            {
-                img: "https://szwl.harix.iamidata.com/static/img/图像生成10.e808b4aa.svg",
-                title: "游戏CG风格",
-                content: "生成游戏CG风格图片",
-                sug: "杰作,最高品质,游戏CG风格,细腻的皮肤,幻想,超详细,复杂的背景,HDR,_________(杰作,最高品质,游戏CG风格,细腻的皮肤,幻想,超详细,复杂的背景,HDR,身材高挑美丽的女性精灵在林中漫步)"
-            },
-            {
-                img: "https://szwl.harix.iamidata.com/static/img/%E5%9B%BE%E5%83%8F%E7%94%9F%E6%88%901.3e53041f.svg",
-                title: "水墨画风格",
-                content: "生成水墨画风格图片",
-                sug: "杰作,最高品质,水墨画,_________(杰作,最高品质,水墨画,一群文人墨客泛舟于江上)"
-            },
-            {
-                img: "https://szwl.harix.iamidata.com/static/img/%E5%9B%BE%E5%83%8F%E7%94%9F%E6%88%908.fbd859d1.svg",
-                title: "皮克斯风格",
-                content: "生成皮克斯风格图片",
-                sug: "杰作,最高品质,皮克斯风格,_______(杰作,最高品质,皮克斯风格,一对在游乐园玩耍的母女)"
-            },
-            {
-                img: "https://szwl.harix.iamidata.com/static/img/%E5%9B%BE%E5%83%8F%E7%94%9F%E6%88%905.d0507cb6.svg",
-                title: "照片/摄影风格",
-                content: "生成照片/摄影风格图片",
-                sug: "照片,高品质,最佳画质,HDR,UHD,8k,_______(照片,高品质,最佳画质,HDR,UHD,8k,在练芭蕾的少女)"
-            },
-            {
-                img: "https://szwl.harix.iamidata.com/static/img/%E5%9B%BE%E5%83%8F%E7%94%9F%E6%88%904.a54bb126.svg",
-                title: "水彩画风格",
-                content: "生成水彩画风格图片",
-                sug: "杰作,最高品质,水彩画,________(杰作,最高品质,水彩画,牡丹花)"
-            },
-            {
-                img: "https://szwl.harix.iamidata.com/static/img/%E5%9B%BE%E5%83%8F%E7%94%9F%E6%88%906.0f9117f2.svg",
-                title: "动漫风格",
-                content: "生成动漫风格图片",
-                sug: "杰作,最高品质,动漫,彩色,细腻,_______(杰作,最高品质,动漫,彩色,细腻,一个看书的少女)"
-            }
-        ]);
-        return { data };
-    }
-});
-</script>

+ 11 - 11
src/views/Home.vue

@@ -28,14 +28,18 @@
                             </div>
                         </header>
                         <section :class="{ 'section-padding': showDialog }">
-                            <Answer v-if="navIndex === 0 && !showDialog" />
+                            <!-- 知识问答 -->
+                            <DocumentAnswer v-if="navIndex === 0 && !showDialog" />
+                            <!-- 文档智能 -->
                             <Document v-if="navIndex === 1 && !showDialog" />
-                            <GenPic v-if="navIndex === 2 && !showDialog" />
-                            <GenDocument v-if="navIndex === 3 && !showDialog" />
-                            <DocumentAnswer v-if="navIndex === 4 && !showDialog" />
-                            <DocumentQuestion v-if="navIndex === 5 && !showDialog" />
-                            <PicArticle v-if="navIndex === 6 && !showDialog" />
-                            <Analysis v-if="navIndex === 7 && !showDialog" />
+                            <!-- 文档出题 -->
+                            <DocumentQuestion v-if="navIndex === 2 && !showDialog" />
+                            <!-- 小数绘图 -->
+                            <PicArticle v-if="navIndex === 3 && !showDialog" />
+                            <!-- 智能数据 -->
+                            <Analysis v-if="navIndex === 4 && !showDialog" />
+                            <!-- 智能问答 -->
+                            <Answer v-if="navIndex === 5 && !showDialog" />
                             <dialog-wrap
                                 v-if="showDialog && initDialog"
                                 :type="dialogType[navIndex]"
@@ -72,8 +76,6 @@ import MessageInput from "../components/MessageInput.vue";
 import Index from "./Index.vue";
 import Answer from "./Answer.vue";
 import Document from "./Document.vue";
-import GenPic from "./GenPic.vue";
-import GenDocument from "./GenDocument.vue";
 import PicArticle from "./PicArticle.vue";
 import DocumentAnswer from "./DocumentAnswer.vue";
 import DocumentQuestion from "./DocumentQuestion.vue";
@@ -89,8 +91,6 @@ export default defineComponent({
         MessageInput,
         DialogWrap,
         Document,
-        GenPic,
-        GenDocument,
         PicArticle,
         DocumentAnswer,
         DocumentQuestion,