zhangnuoyan пре 2 година
родитељ
комит
867c78409c
5 измењених фајлова са 106 додато и 9 уклоњено
  1. 15 0
      src/assets/document/icon.svg
  2. 8 3
      src/components/DialogWrap.vue
  3. 1 0
      src/router/index.js
  4. 49 0
      src/views/DocumentDetail.vue
  5. 33 6
      src/views/Home.vue

+ 15 - 0
src/assets/document/icon.svg

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="13px" height="16px" viewBox="0 0 13 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>编组备份 5</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="智能对话切图" transform="translate(-47, -481)">
+            <rect fill="#E6E6E6" x="0" y="0" width="428" height="564"></rect>
+            <g id="编组备份-5" transform="translate(47, 481)" fill-rule="nonzero">
+                <path d="M8.72857143,0 C8.8763349,0 9.01804637,0.0588038179 9.12253092,0.163475285 L12.8368166,3.88440552 C12.9413012,3.98907698 13,4.13104196 13,4.27906977 L13,14.6976744 C13,15.4169403 12.4179815,16 11.7,16 L1.3,16 C0.582027083,16 0,15.4169378 0,14.6976744 L0,1.30232558 C0,0.583070837 0.582029639,0 1.3,0 L8.72857143,0 Z" id="路径" fill="#FFC34C"></path>
+                <g id="w" transform="translate(2.05, 6.45)" fill="#FFFFFF">
+                    <polygon id="路径" points="1.81 5.64 0 0 1.38 0 2.48 4.03 2.53 4.03 3.63 0 4.96 0 6.07 4.03 6.12 4.03 7.21 0 8.59 0 6.79 5.64 5.45 5.64 4.32 1.63 4.27 1.63 3.14 5.64"></polygon>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 8 - 3
src/components/DialogWrap.vue

@@ -83,9 +83,12 @@
                             <!-- <b>{{ item.capacity.text }}</b> -->
                             <icon-caret-right
                                 size="18"
-                                v-if="item.capacity.status === 'loaded' && !menuList[key].open"
+                                v-if="item.capacity.status === 'loaded' && !menuList[key]?.open"
+                            />
+                            <icon-caret-down
+                                size="18"
+                                v-if="item.capacity.status === 'loaded' && menuList[key]?.open"
                             />
-                            <icon-caret-down size="18" v-if="item.capacity.status === 'loaded' && menuList[key].open" />
                         </div>
                         <div
                             v-else
@@ -496,7 +499,9 @@ export default defineComponent({
                 mockLink(text);
             }
         };
-        const goKnowledge = () => {};
+        const goKnowledge = () => {
+            emit("go-document");
+        };
         onBeforeUnmount(() => {
             helper.$bus.off("send-message");
             helper.$bus.off("clear-message");

+ 1 - 0
src/router/index.js

@@ -27,6 +27,7 @@ const router = createRouter({
     ]
 });
 const isUserAuthenticated = () => {
+    // return true;
     return (
         document.querySelector("#app").$helper.phone === 18811881188 &&
         document.querySelector("#app").$helper.code === 123123

Разлика између датотеке није приказан због своје велике величине
+ 49 - 0
src/views/DocumentDetail.vue


+ 33 - 6
src/views/Home.vue

@@ -16,7 +16,7 @@
             </div>
             <div class="wrap">
                 <Index :number="swiperNumber" v-if="navIndex === -1" @select-nav="selectNav" />
-                <div class="border-wrap" v-else>
+                <div :class="{ 'border-wrap': true, 'border-no-wrap': navIndex === -2 }" v-else>
                     <div>
                         <header v-if="!showDialog">
                             <div>
@@ -40,22 +40,26 @@
                             <Analysis v-if="navIndex === 4 && !showDialog" />
                             <!-- 智能问答 -->
                             <Answer v-if="navIndex === 5 && !showDialog" />
+                            <!-- 文库详情 -->
+                            <DocumentDetail v-if="navIndex === -2" @go-back="goBack" />
                             <dialog-wrap
                                 v-if="showDialog && initDialog"
+                                v-show="!hideDialog"
                                 :type="dialogType[navIndex]"
                                 :agentInfo="data"
                                 :userInfo="userInfo"
                                 :isSetting="false"
                                 :readonly="readonly"
                                 @setReadonly="setReadonly"
+                                @goDocument="goDocument"
                                 :list="dialogList"
                             />
                         </section>
-                        <footer>
+                        <footer v-if="navIndex !== -2">
                             <message-input :readonly="readonly" eventName="open-dialog" />
                         </footer>
                         <a-tooltip :content="closeOthers ? '收起' : '展开'">
-                            <div @click="openAll">
+                            <div @click="openAll" v-if="navIndex !== -2">
                                 <img src="@/assets/other/open.svg" width="20" v-if="closeOthers" />
                                 <img src="@/assets/other/close.svg" width="20" v-else />
                             </div>
@@ -73,6 +77,7 @@ import DialogWrap from "../components/DialogWrap.vue";
 import Slider from "../components/Slider.vue";
 import History from "../components/History.vue";
 import MessageInput from "../components/MessageInput.vue";
+import DocumentDetail from "./DocumentDetail.vue";
 import Index from "./Index.vue";
 import Answer from "./Answer.vue";
 import Document from "./Document.vue";
@@ -94,11 +99,12 @@ export default defineComponent({
         PicArticle,
         DocumentAnswer,
         DocumentQuestion,
-        Analysis
+        Analysis,
+        DocumentDetail
     },
     setup() {
         // nav对应的问答类型,4文库问答,对应的是knowledge类型
-        const dialogType = ["normal", "normal", "normal", "normal", "knowledge", "normal", "normal", "normal"];
+        const dialogType = ["knowledge", "normal", "normal", "normal", "normal", "normal", "normal", "normal"];
         const { config, helper } = inject("$global");
         const closeOthers = ref(false);
         const swiperNumber = ref(5);
@@ -108,6 +114,7 @@ export default defineComponent({
         const dialogList = ref([]);
         const selectId = ref("");
         const initDialog = ref(false);
+        const hideDialog = ref(false);
         const userInfo = {
             name: "奇橙",
             avatar: "https://s21.ax1x.com/2024/04/18/pFzyA0O.png"
@@ -138,6 +145,14 @@ export default defineComponent({
         const setReadonly = (status) => {
             readonly.value = status;
         };
+        const goDocument = () => {
+            navIndex.value = -2;
+            hideDialog.value = true;
+        };
+        const goBack = () => {
+            navIndex.value = 0;
+            hideDialog.value = false;
+        };
         const selectHistory = (id) => {
             showDialog.value = true;
             selectId.value = id;
@@ -182,7 +197,10 @@ export default defineComponent({
             openAll,
             dialogType,
             dialogList,
-            initDialog
+            initDialog,
+            goDocument,
+            goBack,
+            hideDialog
         };
     }
 });
@@ -211,6 +229,15 @@ export default defineComponent({
         padding: 30px 16px 30px 40px;
         flex: 1;
         height: 100%;
+        &.border-no-wrap {
+            padding: 0;
+            > div {
+                padding: 0;
+                > section.section-padding {
+                    padding: 0;
+                }
+            }
+        }
         > div {
             width: 100%;
             height: 100%;

Неке датотеке нису приказане због велике количине промена