Przeglądaj źródła

智能问答输入框、架次数据获取

Rmengdi 7 miesięcy temu
rodzic
commit
d911f05d7f

+ 49 - 21
src/views/als/MDCData/index.vue

@@ -40,13 +40,10 @@
           </el-form-item>
           <el-form-item label="架次号" prop="sortieNo">
             <!-- <el-input v-model="form.sortieNo" placeholder="请输入架次号" /> -->
-            <el-select v-model="form.sortieNo" placeholder="请选择架次号">
+            <el-select v-model="form.sortieNo" placeholder="请选择架次号" @click="selectSortieNo">
               <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>
-          </el-form-item>
           <el-form-item label="数据导入" prop="ossId">
             <FileUpload v-model="form.ossId" :limit="1" :fileSize="500" :fileType="['xls', 'xlsx']" />
           </el-form-item>
@@ -65,8 +62,10 @@
 import { getDataImport, addDataImport, updateDataImport, removeDataImport } from '@/api/als/dataImport'
 import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 import { getAircaftModelAll, getAircaftCatalogAll, getSortieNo } from '@/api/als/aircraft'
+import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
 import { deepClone, debounce } from '@/utils/index'
 import { getItem } from '@/utils/index'
+
 import FileUpload from '@/views/als/components/FileUpload'
 export default {
   name: 'MDCData',
@@ -97,14 +96,6 @@ export default {
       searchValue: '',
       columns: [
         // { prop: 'id', label: '唯一编号' },
-        {
-          prop: 'ossId',
-          label: '文件编号'
-        },
-        {
-          prop: 'source',
-          label: '数据源'
-        },
         {
           prop: 'aircraftId',
           label: '编目',
@@ -120,14 +111,34 @@ export default {
         {
           prop: 'sortieNo',
           label: '架次号'
+          // render: (h, params) => {
+          // const Item = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+          // this.getSortieNoAPI(Item.aircaftCatalogCode)
+          // if (code === 200) {
+          //   console.log('data', data)
+          //   const matchedItem = data.find((item) => params.row.sortieNo === item.taskId)
+          //   if (matchedItem) {
+          //     return h('span', matchedItem.taskName)
+          //   } else {
+          //     return h('span', {}, '')
+          //   }
+          // }
+          // }
         },
         {
-          prop: 'flightDate',
-          label: '飞行日期'
+          prop: 'source',
+          label: '数据源',
+          render: (h, params) => {
+            if (params.row.source == 1) {
+              return h('span', { class: 'success-state' }, '飞参数据')
+            } else {
+              return h('span', { class: 'success-state' }, 'MDC数据')
+            }
+          }
         },
         {
-          prop: 'status',
-          label: '状态'
+          prop: 'ossId',
+          label: '文件编号'
         },
         {
           button: true,
@@ -241,6 +252,7 @@ export default {
           this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
             .map((e) => e.id)
             .toString()
+
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -260,12 +272,20 @@ export default {
         }
       } catch (error) {}
     },
+    async selectSortieNo() {
+      try {
+        const { code, data } = await getTaskExecondRegister(this.form.sortieNo)
+        if (code == 200) {
+          this.form.flightDate = data.taskTime
+        }
+      } catch (error) {}
+    },
 
     getTreeLeafData(list) {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {
@@ -286,6 +306,7 @@ export default {
       } = await getDataImport({ pageSize, pageNum: pageIndex, ...params, source: 2 })
       this.tableData = list
       this.tableRequset.total = total
+      // list.
     },
 
     fetch() {
@@ -327,16 +348,22 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
+      console.log('deta', data)
       this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
         .map((e) => e.id)
         .toString()
+      if (!this.aircaftModelIdList) {
+        this.aircaftModelIdList = '#'
+      }
       this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
-      this.getSortieNoAPI(data.id)
+      this.getSortieNoAPI(data.label)
     },
 
-    async getSortieNoAPI(aircraftId) {
-      const res = await getSortieNo({ aircaftCatalogCode: aircraftId })
-      this.sortieNoList = res.data
+    async getSortieNoAPI(aircaftCatalogCode) {
+      const res = await getSortieNo({ aircaftCatalogCode })
+      this.sortieNoList = res.data.filter((item) => {
+        return item.taskName
+      })
     },
 
     openDialog() {
@@ -369,6 +396,7 @@ export default {
 
     handUpdate(row) {
       this.dialogTitle = '编辑'
+      console.log('row', row)
       this.form = deepClone(row)
       this.dialogVisible = true
     },

+ 1 - 1
src/views/als/intelligentQA/index.vue

@@ -17,7 +17,7 @@
       <div class="footer">
         <div class="footerContent">
           <textarea v-model="questionInput" :style="{ height: `${currentHeight}px`, overflowY: isScrollable ? 'auto' : 'hidden' }" placeholder="请输入您的问题..." @keydown="handleKeydown"> </textarea>
-          <i class="el-icon-delete icon"></i>
+          <i class="el-icon-s-promotion icon" @click="sendQuestion"></i>
         </div>
 
         <!-- :rows="3" type="textarea" -->