فهرست منبع

智能问答页面、文件管理

Rmengdi 7 ماه پیش
والد
کامیت
dcbb67a1a0

+ 5 - 0
src/api/als/aircraft.js

@@ -67,3 +67,8 @@ export const getAircaftCatalogAll = async (data) => {
 export const getflyTaskAll = async (data) => {
   return await post('/carryingtask/flyTask/queryFlyTaskTree', data)
 }
+
+// 根据飞机编号查询飞机实际飞行情况
+export const getSortieNo = async (data) => {
+  return await post('/carryingtask/taskExecondRegister/getAllTaskAndAircraftActualNum', data)
+}

+ 13 - 12
src/views/als/MDCData/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -39,10 +39,10 @@
             </el-select>
           </el-form-item>
           <el-form-item label="架次号" prop="sortieNo">
-            <el-input v-model="form.sortieNo" placeholder="请输入架次号" />
-            <!-- <el-select v-model="form.sortieNo" placeholder="请选择架次号">
-              <el-option v-for="item in flyTaskTree" :key="item.taskId" :label="item.taskName" :value="item.taskId"> </el-option>
-            </el-select> -->
+            <!-- <el-input v-model="form.sortieNo" placeholder="请输入架次号" /> -->
+            <el-select v-model="form.sortieNo" placeholder="请选择架次号">
+              <el-option v-for="item in sortieNoList" :key="item.taskId" :label="item.taskName" :value="item.taskId"> </el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="飞行日期" prop="flightDate">
             <el-date-picker v-model="form.flightDate" type="date" value-format="yyyy-MM-dd" placement="bottom-start" placeholder="请选择飞行日期"> </el-date-picker>
@@ -64,7 +64,7 @@
 <script>
 import { getDataImport, addDataImport, updateDataImport, removeDataImport } from '@/api/als/dataImport'
 import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
-import { getAircaftModelAll, getAircaftCatalogAll, getflyTaskAll } from '@/api/als/aircraft'
+import { getAircaftModelAll, getAircaftCatalogAll, getSortieNo } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 import { getItem } from '@/utils/index'
 import FileUpload from '@/views/als/components/FileUpload'
@@ -192,7 +192,7 @@ export default {
       debounceFn: debounce(this.fetch, 500),
       aircaftModelAll: [],
       aircaftCatalogAll: [],
-      flyTaskTree: [],
+      sortieNoList: [],
       upload: {
         open: false,
         title: '',
@@ -243,11 +243,6 @@ export default {
             .toString()
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
-        const res = await getflyTaskAll({
-          status: null, //状态
-          queryParam: '' //查询条件
-        })
-        this.flyTaskTree = res.data
       } catch (error) {}
     },
 
@@ -336,6 +331,12 @@ export default {
         .map((e) => e.id)
         .toString()
       this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
+      this.getSortieNoAPI(data.id)
+    },
+
+    async getSortieNoAPI(aircraftId) {
+      const res = await getSortieNo({ aircaftCatalogCode: aircraftId })
+      this.sortieNoList = res.data
     },
 
     openDialog() {

+ 6 - 2
src/views/als/fileManage/index.vue

@@ -73,8 +73,8 @@ export default {
           label: '文件名称'
         },
         {
-          prop: 'url',
-          label: 'Url'
+          prop: 'fileType',
+          label: '文件类型'
         },
         {
           prop: 'status',
@@ -87,6 +87,10 @@ export default {
             }
           }
         },
+        {
+          prop: 'fileType',
+          label: '上传时间'
+        },
         {
           prop: 'remark',
           label: '备注'

+ 39 - 0
src/views/als/intelligentQA/index.scss

@@ -36,6 +36,31 @@
   .main{
     flex: 1;
     // background-color: #f8f8fc4c;
+    display: flex;
+      flex-direction: column;
+    .chatLine {
+      flex: 1;
+      width: 100%;
+      max-width: 1200px;
+      margin: 0 auto;
+      overflow-y: auto;
+    }
+    .chatRow {
+      margin: 20px 10px;
+      display: flex;
+    }
+    .chatQ {
+      justify-content: flex-end;
+      .questionContent {
+        max-width: 800px;
+        display: inline-block;
+        border-radius: 8px;
+        padding: 6px 12px;
+        background: rgba(255, 255, 255, 0.4);
+        box-shadow: 0 16px 20px 0 rgba(174, 167, 223, 0.06);
+        color: #fff;
+      }
+    }
   }
 
   .footer{
@@ -61,6 +86,7 @@
         resize: none; /* 禁止用户手动调整大小 */
         overflow: hidden; /* 隐藏溢出内容 */
         transition: height 0.2s ease; /* 平滑过渡效果 */
+
       }
   
       .icon{
@@ -75,3 +101,16 @@
   }
 }
 
+::-webkit-scrollbar{ /*滚动条整体样式*/
+  width: 5px;
+  height: 1px;
+}
+::-webkit-scrollbar-thumb{
+  border-radius: 5px;
+  background: #cfcbcb;
+}
+::-webkit-scrollbar-track{ /*滚动条里面轨道*/
+  border-radius: 5px;
+  background: #ededed;
+}
+

+ 37 - 8
src/views/als/intelligentQA/index.vue

@@ -4,17 +4,19 @@
     <div class="chat">
       <!-- <div class="header">Header</div> -->
       <div class="main">
-        <div v-for="(item, index) in chatInfo" :key="index">
-          <div class="chatRow" v-if="item.type === 'HMC'"></div>
-          <div class="chatRow" v-if="item.type === 'QA'"></div>
-          <div class="chatRow chatQ" v-if="item.type === 'question'">
-            <div class="questionContent">{{ item.data }}</div>
+        <div class="chatLine">
+          <div v-for="(item, index) in chatInfo" :key="index">
+            <div class="chatRow" v-if="item.type === 'HMC'"></div>
+            <div class="chatRow" v-if="item.type === 'QA'"></div>
+            <div class="chatRow chatQ" v-if="item.type === 'question'">
+              <div class="questionContent">{{ item.data }}</div>
+            </div>
           </div>
         </div>
       </div>
       <div class="footer">
         <div class="footerContent">
-          <textarea v-model="questionInput" @input="adjustHeight" :style="{ height: `${currentHeight}px` }" placeholder="请输入您的问题..."> </textarea>
+          <textarea v-model="questionInput" :style="{ height: `${currentHeight}px`, overflowY: isScrollable ? 'auto' : 'hidden' }" placeholder="请输入您的问题..." @keydown="handleKeydown"> </textarea>
           <i class="el-icon-delete icon"></i>
         </div>
 
@@ -33,7 +35,8 @@ export default {
       chatInfo: [],
       questionInput: '',
       currentHeight: 'auto',
-      lastScrollHeight: null
+      lastScrollHeight: 0,
+      isScrollable: false
     }
   },
   mounted() {
@@ -45,14 +48,40 @@ export default {
     adjustHeight() {
       const textarea = this.$el.querySelector('textarea')
       this.currentHeight = 'auto'
-      if (textarea.scrollHeight <= this.lastScrollHeight) {
+      if (textarea.scrollHeight < this.lastScrollHeight) {
         this.lastScrollHeight = this.lastScrollHeight - 16
       }
       this.$nextTick(() => {
         this.currentHeight = Math.min(this.lastScrollHeight, 200)
         this.lastScrollHeight = textarea.scrollHeight
+        if (textarea.scrollHeight >= 200) {
+          this.isScrollable = true
+        } else {
+          this.isScrollable = false
+        }
       })
     },
+    handleKeydown(event) {
+      if (event.key === 'Enter') {
+        // 检查是否按下了 Ctrl 键
+        if (event.ctrlKey) {
+          // 按下了 Ctrl+Enter,则插入换行符
+          this.questionInput += '\n'
+          this.adjustHeight()
+        } else {
+          // 只是按下了 Enter,阻止默认行为并发送消息
+          event.preventDefault()
+          this.sendQuestion()
+        }
+      }
+      if (event.key === 'Backspace') {
+        if (this.questionInput) {
+          this.adjustHeight()
+        } else {
+          this.currentHeight = '50'
+        }
+      }
+    },
     sendQuestion() {
       console.log('222', this.questionInput.trim())
       if (this.questionInput.trim() === '') {