|
|
@@ -5,7 +5,10 @@
|
|
|
</div>
|
|
|
<div class="view-dataSpecies-right">
|
|
|
<div class="view-dataType-title">
|
|
|
- <div class="view-dataType-title-btn"></div>
|
|
|
+ <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="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
|
|
|
+ </div>
|
|
|
<div class="view-dataType-title-search">
|
|
|
<el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
|
|
|
<el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
|
|
|
@@ -16,73 +19,64 @@
|
|
|
<LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
|
|
|
</div>
|
|
|
<!-- 添加或修改故障诊断对话框 -->
|
|
|
- <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
|
|
|
+ <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="800px" :before-close="handleClose">
|
|
|
<el-form ref="form" :model="form" label-width="80px">
|
|
|
+ <el-form-item label="编目" prop="aircraftId">
|
|
|
+ <el-select v-model="form.aircraftId" placeholder="请选择编目" @change="changeAircraftId(form.aircraftId)">
|
|
|
+ <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
|
|
|
+ </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 sortieNoList" :key="item.id" :label="item.sortieNo" :value="item.id"> </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="机号" prop="aircraftId">
|
|
|
- <el-input v-model="form.aircraftId" placeholder="请输入机号" />
|
|
|
+ <el-form-item label="模型类型">
|
|
|
+ <el-select v-model="form.modelType" placeholder="请选择模型类型" @change="changeModelType(form.modelType)">
|
|
|
+ <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="模型名称">
|
|
|
+ <el-select v-model="form.modelName" placeholder="模型名称">
|
|
|
+ <el-option v-for="item in algoNameList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="参数" prop="param">
|
|
|
<el-input v-model="form.param" placeholder="请输入参数" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数据列" prop="columnData">
|
|
|
- <el-input v-model="form.columnData" placeholder="请输入数据列" />
|
|
|
+ <!-- <el-input v-model="form.columnData" placeholder="请输入数据列" /> -->
|
|
|
+ <el-transfer v-model="form.columnData" :data="transferData"></el-transfer>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文件Id" prop="ossId">
|
|
|
<el-input v-model="form.ossId" placeholder="请输入文件Id" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="结果">
|
|
|
- <editor v-model="form.resultContent" :min-height="192" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="模型类型" prop="modelType1">
|
|
|
- <el-input v-model="form.modelType1" placeholder="请输入模型类型" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="参数" prop="param1">
|
|
|
- <el-input v-model="form.param1" placeholder="请输入参数" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数据列" prop="columnData1">
|
|
|
- <el-input v-model="form.columnData1" placeholder="请输入数据列" />
|
|
|
+ <!-- <editor v-model="form.resultContent" :min-height="192" /> -->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
-
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="handleClose">取 消</el-button>
|
|
|
<el-button type="primary" @click="submit">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="选择算法" :visible.sync="executeVisible" width="800px" :before-close="handleClose">
|
|
|
- <el-form :inline="true" :model="agloForm" class="demo-form-inline">
|
|
|
- <el-form-item label="算法类型">
|
|
|
- <el-select v-model="agloForm.agloType" placeholder="请选择算法类型" @change="changeAgloType(agloForm.agloType)">
|
|
|
- <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="算法名称">
|
|
|
- <el-select v-model="agloForm.agloName" placeholder="算法名称">
|
|
|
- <el-option v-for="item in algoNameList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="选择参数">
|
|
|
- <el-transfer v-model="agloForm.paramsList" :data="transferData"></el-transfer>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="handleClose">取 消</el-button>
|
|
|
- <el-button type="primary" @click="beginExecute">开始执行</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
<el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
|
|
|
<el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="结果展示" :visible.sync="resultVisible" width="800px">
|
|
|
+ 展示结果
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="resultVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="resultVisible = false">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { getFaultDiagnosis, addFaultDiagnosis, updateFaultDiagnosis, removeFaultDiagnosis } from '@/api/als/faultDiagnosis'
|
|
|
-import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
|
|
|
+import { getAircaftCatalogTree } from '@/api/als/sideTree'
|
|
|
import { deepClone, debounce } from '@/utils/index'
|
|
|
import { getAircaftCatalogAll } from '@/api/als/aircraft'
|
|
|
import { getDataImport } from '@/api/als/dataImport'
|
|
|
@@ -95,7 +89,7 @@ export default {
|
|
|
return {
|
|
|
dialogTitle: '新增',
|
|
|
dialogVisible: false,
|
|
|
- executeVisible: false,
|
|
|
+ resultVisible: false,
|
|
|
progressVisible: false,
|
|
|
keyWordData: '',
|
|
|
aircaftModelIdList: [],
|
|
|
@@ -228,7 +222,7 @@ export default {
|
|
|
aircraftId: '',
|
|
|
modelType: '',
|
|
|
param: '',
|
|
|
- columnData: '',
|
|
|
+ columnData: [],
|
|
|
ossId: '',
|
|
|
resultContent: '',
|
|
|
status: '',
|
|
|
@@ -238,10 +232,7 @@ export default {
|
|
|
createBy: '',
|
|
|
createTime: '',
|
|
|
updateBy: '',
|
|
|
- updateTime: '',
|
|
|
- modelType1: '',
|
|
|
- param1: '',
|
|
|
- columnData1: ''
|
|
|
+ updateTime: ''
|
|
|
},
|
|
|
debounceFn: debounce(this.fetch, 500),
|
|
|
agloForm: {
|
|
|
@@ -255,7 +246,8 @@ export default {
|
|
|
transferData: [],
|
|
|
algoTypeList: [{ id: 5, name: '故障诊断' }],
|
|
|
algoNameList: [],
|
|
|
- percentage: 0
|
|
|
+ percentage: 0,
|
|
|
+ sortieNoList: []
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -278,10 +270,13 @@ export default {
|
|
|
const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
|
|
|
this.aircaftCatalogAll = data2
|
|
|
if (data.length) {
|
|
|
- this.currentNodeKey = data[0].value
|
|
|
+ this.currentNodeKey = data[0].id
|
|
|
this.currentNode = data[0]
|
|
|
- // this.getFaultDiagnosisAPI()
|
|
|
- this.getDataImportAPI()
|
|
|
+ this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
|
|
|
+ .map((e) => e.id)
|
|
|
+ .toString()
|
|
|
+ this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
|
|
|
+ // this.getDataImportAPI()
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -293,7 +288,7 @@ export default {
|
|
|
type: 'success',
|
|
|
message: '操作成功!'
|
|
|
})
|
|
|
- await this.getFaultDiagnosisAPI(this.currentNodeKey)
|
|
|
+ await this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
|
|
|
this.handleClose()
|
|
|
}
|
|
|
} catch (error) {}
|
|
|
@@ -321,16 +316,7 @@ export default {
|
|
|
const { pageSize, pageIndex } = this.tableRequset
|
|
|
const {
|
|
|
data: { list, totalCount }
|
|
|
- } = await getFaultDiagnosis({ pageSize, pageIndex, aircraftId: params })
|
|
|
- this.tableData = list
|
|
|
- this.tableRequset.total = totalCount
|
|
|
- },
|
|
|
- async getDataImportAPI(params) {
|
|
|
- if (this.$refs.table) this.$refs.table.clearSelection()
|
|
|
- const { pageSize, pageIndex } = this.tableRequset
|
|
|
- const {
|
|
|
- data: { list, totalCount }
|
|
|
- } = await getDataImport({ pageSize, pageIndex, aircraftId: params })
|
|
|
+ } = await getFaultDiagnosis({ pageSize, pageIndex, ...params })
|
|
|
this.tableData = list
|
|
|
this.tableRequset.total = totalCount
|
|
|
},
|
|
|
@@ -339,17 +325,8 @@ export default {
|
|
|
this.getFaultDiagnosisAPI(this.currentNodeKey)
|
|
|
},
|
|
|
|
|
|
- async searchClick() {
|
|
|
- // this.getFaultDiagnosisAPI(this.currentNodeKey)
|
|
|
- if (this.keyWordData && this.currentNodeKey !== 'quanbu') {
|
|
|
- const {
|
|
|
- data: { list, totalCount }
|
|
|
- } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData })
|
|
|
- this.tableData = list
|
|
|
- this.tableRequset.total = totalCount
|
|
|
- } else {
|
|
|
- this.getDataImportAPI(this.currentNodeKey)
|
|
|
- }
|
|
|
+ searchClick() {
|
|
|
+ this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList, sortieNo: this.keyWordData })
|
|
|
},
|
|
|
|
|
|
async addFaultDiagnosisAPI() {
|
|
|
@@ -361,7 +338,22 @@ export default {
|
|
|
type: 'success',
|
|
|
message: '操作成功!'
|
|
|
})
|
|
|
- this.getFaultDiagnosisAPI(this.currentNodeKey)
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.progressVisible = true
|
|
|
+ const myTimer = setInterval(() => {
|
|
|
+ if (this.percentage < 100) {
|
|
|
+ this.percentage += 1
|
|
|
+ } else {
|
|
|
+ this.progressVisible = false
|
|
|
+ this.percentage = 0
|
|
|
+ clearInterval(myTimer)
|
|
|
+ this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
|
|
|
+ this.handleClose()
|
|
|
+ // 调用完数据再展示
|
|
|
+ this.resultVisible = true
|
|
|
+ }
|
|
|
+ }, 30)
|
|
|
+ this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
|
|
|
}
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
@@ -374,31 +366,49 @@ export default {
|
|
|
type: 'success',
|
|
|
message: '操作成功!'
|
|
|
})
|
|
|
- this.getFaultDiagnosisAPI(this.currentNodeKey)
|
|
|
+ this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
|
|
|
}
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
|
|
|
treeNodeClick(data) {
|
|
|
this.$refs.table.clearSelection()
|
|
|
- this.currentNodeKey = data.id
|
|
|
+ this.currentNodeKey = this.form.aircraftId = data.id
|
|
|
this.currentNode = data
|
|
|
- this.getDataImportAPI(this.currentNodeKey)
|
|
|
+ this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
|
|
|
+ .map((e) => e.id)
|
|
|
+ .toString()
|
|
|
+ this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
|
|
|
+ // this.getDataImportAPI(this.currentNodeKey)
|
|
|
},
|
|
|
|
|
|
openDialog() {
|
|
|
this.dialogTitle = '新增'
|
|
|
this.dialogVisible = true
|
|
|
- this.form.aircaftModelName = this.currentNode.label
|
|
|
- this.form.aircaftModelId = this.currentNode.id
|
|
|
+ if (this.form.aircraftId !== '') {
|
|
|
+ this.changeAircraftId(this.form.aircraftId)
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
handleClose() {
|
|
|
- this.executeVisible = false
|
|
|
- this.agloForm = {
|
|
|
- agloType: '',
|
|
|
- agloName: '',
|
|
|
- paramsList: []
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.form = {
|
|
|
+ id: '',
|
|
|
+ sortieNo: '',
|
|
|
+ aircraftId: '',
|
|
|
+ modelType: '',
|
|
|
+ param: '',
|
|
|
+ columnData: [],
|
|
|
+ ossId: '',
|
|
|
+ resultContent: '',
|
|
|
+ status: '',
|
|
|
+ tenantId: '',
|
|
|
+ version: '',
|
|
|
+ delFlag: '',
|
|
|
+ createBy: '',
|
|
|
+ createTime: '',
|
|
|
+ updateBy: '',
|
|
|
+ updateTime: ''
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -409,19 +419,18 @@ export default {
|
|
|
},
|
|
|
|
|
|
checkResultList(row) {
|
|
|
- this.agloForm.sortieNo = row.sortieNo
|
|
|
- this.agloForm.aircraftId = row.aircraftId
|
|
|
- this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
|
|
|
+ this.form = deepClone(row)
|
|
|
+ this.resultVisible = true
|
|
|
},
|
|
|
executeAglo(row) {
|
|
|
- this.executeVisible = true
|
|
|
- this.agloForm.sortieNo = row.sortieNo
|
|
|
- this.agloForm.aircraftId = row.aircraftId
|
|
|
+ // this.executeVisible = true
|
|
|
+ // this.agloForm.sortieNo = row.sortieNo
|
|
|
+ // this.agloForm.aircraftId = row.aircraftId
|
|
|
},
|
|
|
beginExecute() {
|
|
|
- // 调用算法接口
|
|
|
+ // 调用模型接口
|
|
|
|
|
|
- this.executeVisible = false
|
|
|
+ // this.executeVisible = false
|
|
|
this.progressVisible = true
|
|
|
const myTimer = setInterval(() => {
|
|
|
if (this.percentage < 100) {
|
|
|
@@ -430,18 +439,25 @@ export default {
|
|
|
this.progressVisible = false
|
|
|
this.percentage = 0
|
|
|
clearInterval(myTimer)
|
|
|
- this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
|
|
|
+ // this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
|
|
|
this.handleClose()
|
|
|
}
|
|
|
}, 30)
|
|
|
},
|
|
|
- async changeAgloType(type) {
|
|
|
+ async changeModelType(type) {
|
|
|
const {
|
|
|
data: { list }
|
|
|
} = await getModel({ type })
|
|
|
this.algoNameList = list
|
|
|
},
|
|
|
|
|
|
+ async changeAircraftId(aircraftId) {
|
|
|
+ const {
|
|
|
+ data: { list }
|
|
|
+ } = await getDataImport({ aircraftId })
|
|
|
+ this.sortieNoList = list
|
|
|
+ },
|
|
|
+
|
|
|
submit() {
|
|
|
switch (this.dialogTitle) {
|
|
|
case '编辑':
|
|
|
@@ -460,7 +476,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
remove(row) {
|
|
|
- this.$confirm('是否删除该机种', '提示', {
|
|
|
+ this.$confirm('是否删除该数据', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|