Browse Source

style: 禁用样式格式化

1. 禁用样式格式化
2. 新增文档报告生成配置项
zhupei 1 year ago
parent
commit
f6bd8d1027
4 changed files with 61 additions and 39 deletions
  1. 1 0
      .prettierignore
  2. 2 2
      .vscode/settings.json
  3. 10 0
      src/utils/config.js
  4. 48 37
      src/views/Home.vue

+ 1 - 0
.prettierignore

@@ -0,0 +1 @@
+src

+ 2 - 2
.vscode/settings.json

@@ -1,7 +1,7 @@
 {
     "editor.defaultFormatter": "esbenp.prettier-vscode",
-    "eslint.format.enable": true,
-    "editor.formatOnSave": true,
+    "eslint.format.enable": false,
+    "editor.formatOnSave": false,
     "editor.formatOnPaste": true,
     "editor.formatOnType": true,
     "eslint.run": "onSave",

+ 10 - 0
src/utils/config.js

@@ -68,6 +68,16 @@ export default {
             desc: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载",
             dialog: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载。"
         },
+
+        {
+            id: 9,
+            title: "文档报告生成",
+            icon: "2",
+            img: "/src/assets/index/2.png",
+            desc: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载",
+            dialog: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载。"
+        },
+
         {
             id: 1,
             title: "报表合并",

+ 48 - 37
src/views/Home.vue

@@ -4,11 +4,11 @@
 
     <div class="main">
       <div :class="{ 'history-wrap': true, 'history-wrap-open': !closeOthers && navId > -1 }">
-        <History 
-          :list="historyList" 
-          :selectId="selectId" 
-          @handle-click="selectHistory" 
-          @set-new="handelSetNewChat" 
+        <History
+          :list="historyList"
+          :selectId="selectId"
+          @handle-click="selectHistory"
+          @set-new="handelSetNewChat"
         />
       </div>
 
@@ -38,23 +38,24 @@
               <!-- 文档出卷 -->
               <DocumentQuestion v-if="navId === 7 && !showDialog" :agentId="selectId" />
 
+              <!-- 出题组卷 -->
               <DocumentQuestion2 v-if="navId === 8 && !showDialog" :agentId="selectId" />
 
               <!-- 文库详情 -->
               <DocumentDetail v-if="navId === -2" @go-back="goBack" />
 
-              <dialog-wrap 
-                v-if="showDialog && initDialog" 
-                v-show="!hideDialog" 
+              <dialog-wrap
+                v-if="showDialog && initDialog"
+                v-show="!hideDialog"
                 :type="dialogType[navId]"
-                :isSetting="false" 
-                :readonly="readonly" 
-                :agentId="selectId" 
-                :dialogId="dialogId" 
-                :list="dialogList" 
-                @setReadonly="setReadonly" 
+                :isSetting="false"
+                :readonly="readonly"
+                :agentId="selectId"
+                :dialogId="dialogId"
+                :list="dialogList"
+                @setReadonly="setReadonly"
                 @changeParse="changeParse"
-                @goDocument="goDocument" 
+                @goDocument="goDocument"
               />
             </section>
 
@@ -85,16 +86,7 @@
 
               <a-textarea :max-length="maxLength" v-model="textValue"
                 :show-word-limit="textValue.length > maxLength / 2" :auto-size="{ maxRows: 6 }"
-                placeholder="输入您想了解的内容,Shift+Enter换行" :style="{
-                  flex: 1,
-                  borderRadius: '12px',
-                  marginTop: '20px',
-                  padding: '0px 30px 0 16px',
-                  background: 'transparent',
-                  border: '1px solid #e3e3e3',
-                  minHeight: '120px',
-                  paddingBottom: `${textValue.length > maxLength / 2 ? '20px' : ''}`
-                }">
+                placeholder="输入您想了解的内容,Shift+Enter换行" :style="text_area_style">
               </a-textarea>
 
               <a-button :style="{ width: '500px' }" type="primary" @click="beginCombine">开始</a-button>
@@ -207,14 +199,14 @@ export default defineComponent({
   setup() {
     // NOTE: 先把4文库问答的类型改成report类型,后续再改回来
     const dialogType = [
-      "report", 
-      "excel", 
-      "knowledgeQuiz", 
-      "report", 
-      "normal", 
-      "smartData", 
+      "report",
+      "excel",
+      "knowledgeQuiz",
+      "report",
+      "normal",
+      "smartData",
       "huitu",  // 小数绘图
-      "question", 
+      "question",
       "question"
     ];
 
@@ -272,7 +264,7 @@ export default defineComponent({
      * 当点击某个导航时触发的方法
      * 例如:点击 知识问答 文档智能 智能问答 智能数据 等
      * @params {object} node
-     * @params {number} node.id - 例如 3 4 5 
+     * @params {number} node.id - 例如 3 4 5
      * @params {string} node.title - 例如:文档智能 小数绘图
      */
     const selectNav = async (node) => {
@@ -315,7 +307,7 @@ export default defineComponent({
       }
 
       // 每次切换功能板块时,清空sendData数据
-      // helper.write('sendData', {}); 
+      // helper.write('sendData', {});
       clearLocalStorageSendData();
     };
 
@@ -391,7 +383,7 @@ export default defineComponent({
           dialogId.value = data.chat_id;
         }
       }
-      
+
       dialogList.value = [];
       showDialog.value = true;
       initDialog.value = true;
@@ -508,9 +500,26 @@ export default defineComponent({
     };
 
     function clearLocalStorageSendData(){
-      // helper.write('sendData', {}); 
+      // helper.write('sendData', {});
     }
 
+    const text_area_style = {
+        flex: 1,
+        borderRadius: '12px',
+        marginTop: '20px',
+        padding: '0px 30px 0 16px',
+        background: 'transparent',
+        border: '1px solid #e3e3e3',
+        minHeight: '120px',
+        paddingBottom: `${textValue.value.length > maxLength.value / 2 ? '20px' : ''}`
+    }
+
+    // const handleInputChange = (item) => {
+    //     const fn = (event) => {
+    //         customChange(event, item.node_id, item.variable_name);
+    //     }
+    // }
+
     return {
       SYSTEM_NAME,
       customChange,
@@ -544,7 +553,9 @@ export default defineComponent({
       parseStatus,
       maxLength,
 
-      handelSetNewChat
+        handelSetNewChat,
+
+        text_area_style
     };
   }
 });