index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <div class="reasoning">
  3. <el-steps :active="isActive" align-center class="step" finish-status="success">
  4. <el-step title="数据选择" description="请选择架次信息"></el-step>
  5. <el-step title="测试性模型选择" description="请选择测试性模型"></el-step>
  6. <el-step title="是否进行增强诊断" description="初步结果产生,是否还需要增强诊断"></el-step>
  7. <el-step title="故障方程选择" description="请选择故障方程"></el-step>
  8. <el-step title="最终结果展示"></el-step>
  9. </el-steps>
  10. <div class="content">
  11. <div class="box">
  12. <sortieTable v-if="isActive==0" :callback="handleCurrentChange" />
  13. <el-table v-if="isActive==1" :data="testModelOptions" highlight-current-row style="width: 100%;marginBottom:20px" @current-change="handleCurrentChange">
  14. <el-table-column prop="model" label="模型" align="center">
  15. </el-table-column>
  16. <el-table-column prop="modelID" label="模型编号" align="center">
  17. </el-table-column>
  18. <el-table-column prop="attribute1" label="属性1" align="center">
  19. </el-table-column>
  20. </el-table>
  21. <div v-if="isActive==2" class="">
  22. <div class="result">
  23. 初步结果
  24. </div>
  25. <el-select ref="selectTable" v-model="queryParams.diagnosis" placeholder="请选择增强诊断" @change="handleDiagnosis"
  26. style="marginRight:120px">
  27. <el-option v-for="item in diagnosisOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
  28. <span style="float: left;">{{item.dictLabel}}</span>
  29. <span style="float: right;color: #ccc;">{{item.dictValue}}</span>
  30. </el-option>
  31. </el-select>
  32. <el-select :disabled="queryParams.diagnosis==''" ref="selectTable" v-model="queryParams.diagnosisModel"
  33. placeholder="请选择诊断模型">
  34. <template #empty>
  35. <diagnosisTable :ModelOptions="ModelOptions" :modelFlag="modelFlag" :callback="handleCurrentChange" />
  36. </template>
  37. </el-select>
  38. </div>
  39. <el-select ref="selectTable" v-model="queryParams.faultModel" placeholder="请选择故障方程模型" v-if="isActive==3">
  40. <el-option v-for="item in FEQOptions" :key="item.value" :label="item.label" :value="item.value">
  41. </el-option>
  42. </el-select>
  43. <div v-if="isActive==4">
  44. 最终结果展示
  45. </div>
  46. </div>
  47. <div class="btn">
  48. <el-button type="primary" class="back" @click="back">上一步</el-button>
  49. <el-button v-if="isActive==2" type="primary" class="jump" @click="jump">跳过</el-button>
  50. <el-button type="primary" class="next" @click="next">{{nextBtn}}</el-button>
  51. </div>
  52. </div>
  53. <!-- 进度条对话框 -->
  54. <el-dialog title="数据测试中" :visible.sync="dialog" width="400px" :close-on-click-modal="false" :show-close="false">
  55. <div class="ProgressBar">
  56. <el-progress type="circle" :percentage="percentage" :color="colors"></el-progress>
  57. <p>{{tipText}}</p>
  58. </div>
  59. </el-dialog>
  60. </div>
  61. </template>
  62. <script>
  63. import sortieTable from '@/views/manage/reasoning/sortieTable'
  64. import { listFalseAlarmRestrainModel } from '@/api/manage/falseAlarmRestrainModel'
  65. import { listGroundDiagnosisModel } from '@/api/manage/groundDiagnosisModel'
  66. import { listDeepIsolationModel } from '@/api/manage/deepIsolationModel'
  67. import diagnosisTable from '@/views/manage/reasoning/diagnosisTable'
  68. import { listSortie } from '@/api/manage/sortie'
  69. import { getDicts } from "@/api/system/dict/data";
  70. export default {
  71. name: 'Reasoning',
  72. dicts: ['order_type'],
  73. components: { sortieTable, diagnosisTable },
  74. data() {
  75. return {
  76. // 遮罩层
  77. loading: true,
  78. // 显示分析条件
  79. showSearch: true,
  80. // 分析参数
  81. queryParams: {
  82. sortie: '',
  83. testModel: '',
  84. diagnosis: '',
  85. diagnosisModel: '',
  86. faultModel: '',
  87. computingEngine: '',
  88. },
  89. // 诊断模型信息
  90. diagnosisOptions: [],
  91. // 故障方程选择器信息
  92. FEQOptions: [
  93. { value: '选项1', label: '故障方程1' },
  94. { value: '选项2', label: '故障方程2' },
  95. { value: '选项3', label: '故障方程3' },
  96. ],
  97. // 选择性模型
  98. testModelOptions: [
  99. {
  100. model: '模型1',
  101. modelID: 'F111',
  102. attribute1: '属性1',
  103. },
  104. {
  105. model: '模型2',
  106. modelID: 'F222',
  107. attribute1: '属性2',
  108. },
  109. ],
  110. // 调用计算引擎的选择器
  111. ComputingEngine: [
  112. { value: '选项1', label: '计算引擎1' },
  113. { value: '选项2', label: '计算引擎2' },
  114. { value: '选项3', label: '计算引擎3' },
  115. ],
  116. // 架次列表
  117. sortieList: null,
  118. // 步骤条步骤
  119. isActive: 0,
  120. currentRow: null,
  121. // 下一步按钮
  122. nextBtn: '下一步',
  123. // 增强诊断模型
  124. ModelOptions: [],
  125. // 诊断的模型表格标记
  126. modelFlag: 0,
  127. // 进度条
  128. percentage: 0,
  129. colors: [
  130. { color: '#f56c6c', percentage: 20 },
  131. { color: '#e6a23c', percentage: 40 },
  132. { color: '#5cb87a', percentage: 60 },
  133. { color: '#1989fa', percentage: 80 },
  134. { color: '#6f7ad3', percentage: 100 },
  135. ],
  136. // 进度条弹出框
  137. dialog: false,
  138. // 进度条提示信息
  139. tipText: '正在测试...',
  140. // 定时器
  141. timer: null,
  142. // 是否跳过
  143. isJump: false,
  144. }
  145. },
  146. created() {
  147. this.getList()
  148. this.getOrderList()
  149. },
  150. watch: {
  151. queryParams: {
  152. handler() {
  153. if (this.$refs.selectTable) {
  154. this.$refs.selectTable.visible = false
  155. }
  156. },
  157. deep: true,
  158. },
  159. isActive(newValue, oldValue) {
  160. if (newValue === 1 || (oldValue === 2 && oldValue === 0)) {
  161. this.nextBtn = '开始测试'
  162. } else {
  163. this.nextBtn = '下一步'
  164. }
  165. },
  166. },
  167. methods: {
  168. // 架次信息列表
  169. getList() {
  170. this.loading = true
  171. listSortie(this.queryParams).then(response => {
  172. this.sortieList = response.rows
  173. this.total = response.total
  174. this.loading = false
  175. })
  176. },
  177. /** 查询系统指令信息列表 */
  178. getOrderList() {
  179. this.loading = true
  180. getDicts("order_type").then(response => {
  181. const selectedValues = ["FALSE_ALARM", "GROUND_DIAGNOSIS", "DEEP_ISOLATION"];
  182. this.diagnosisOptions = response.data.filter(item => selectedValues.includes(item.dictValue));
  183. });
  184. },
  185. /** 查询虚警抑制模型列表 */
  186. getFalseAlarmList() {
  187. this.loading = true
  188. listFalseAlarmRestrainModel(this.queryParams).then(response => {
  189. this.ModelOptions = response.rows
  190. this.modelFlag = 1
  191. this.total = response.total
  192. this.loading = false
  193. })
  194. },
  195. /** 查询深度隔离模型列表 */
  196. getDeepList() {
  197. this.loading = true
  198. listDeepIsolationModel(this.queryParams).then(response => {
  199. this.ModelOptions = response.rows
  200. this.modelFlag = 2
  201. this.total = response.total
  202. this.loading = false
  203. })
  204. },
  205. /** 查询地面诊断模型信息列表 */
  206. getGroundList() {
  207. this.loading = false
  208. listGroundDiagnosisModel(this.queryParams).then(response => {
  209. this.ModelOptions = response.rows
  210. this.modelFlag = 3
  211. this.total = response.total
  212. this.loading = true
  213. })
  214. },
  215. // 下一步
  216. next() {
  217. if (this.isActive >= 4) this.isActive = 4
  218. switch (this.isActive) {
  219. case 0:
  220. if (this.queryParams.sortie == '') {
  221. this.$message.error(`请选择架次信息`)
  222. break
  223. } else {
  224. this.isActive = 1
  225. break
  226. }
  227. case 1:
  228. if (this.queryParams.testModel == '') {
  229. this.$message.error(`请选择测试性模型`)
  230. break
  231. } else {
  232. // 调用接口、开始测试
  233. this.dialog = true
  234. if (!this.timer) {
  235. this.timer = setInterval(() => {
  236. if (this.percentage === 100) {
  237. this.tipText = '测试成功,正在生成结果'
  238. clearInterval(this.timer)
  239. this.timer = null
  240. setTimeout(() => {
  241. this.dialog = false
  242. this.percentage = 0
  243. this.tipText = '测试中...'
  244. this.isActive = 2
  245. }, 1500)
  246. } else {
  247. this.percentage += 1
  248. }
  249. }, 5)
  250. }
  251. break
  252. }
  253. case 2:
  254. if (this.queryParams.diagnosis == '') {
  255. this.$message.error(`请选择是否增强诊断`)
  256. break
  257. } else {
  258. this.isActive = 3
  259. break
  260. }
  261. case 3:
  262. if (this.queryParams.faultModel == '') {
  263. this.$message.error(`请选择故障方程`)
  264. break
  265. } else {
  266. this.$confirm('确定开始故障诊断吗?', '提示')
  267. .then(() => {
  268. this.$message.success('开始故障诊断')
  269. this.isActive = 4
  270. this.nextBtn = '完成'
  271. this.reset()
  272. })
  273. .catch(() => {})
  274. break
  275. }
  276. case 4:
  277. // 结果展示、步骤条初始化和内容重置
  278. this.isActive = 0
  279. this.reset()
  280. break
  281. default:
  282. break
  283. }
  284. },
  285. back() {
  286. if (this.isActive < 1) this.isActive = 1
  287. if (this.isJump) {
  288. this.isActive = 2
  289. this.isJump = false
  290. } else {
  291. this.isActive--
  292. }
  293. },
  294. //跳过
  295. jump() {
  296. this.queryParams.diagnosis = ''
  297. this.queryParams.diagnosisModel = ''
  298. this.isJump = true
  299. this.isActive = 4
  300. },
  301. // 内容重置
  302. reset() {
  303. this.queryParams = {
  304. sortie: '',
  305. testModel: '',
  306. diagnosis: '',
  307. diagnosisModel: '',
  308. faultModel: '',
  309. computingEngine: '',
  310. }
  311. },
  312. //单选
  313. handleCurrentChange(val) {
  314. this.currentRow = val
  315. switch (this.isActive) {
  316. case 0:
  317. this.queryParams.sortie = val.sortieNumber
  318. break
  319. case 1:
  320. this.queryParams.testModel = val.modelID
  321. break
  322. case 2:
  323. this.queryParams.diagnosisModel = val.code
  324. break
  325. default:
  326. break
  327. }
  328. },
  329. //增强诊断的选择框
  330. handleDiagnosis(val) {
  331. if (val === 'FALSE_ALARM') {
  332. this.getFalseAlarmList()
  333. } else if (val === 'GROUND_DIAGNOSIS') {
  334. this.getGroundList()
  335. } else {
  336. this.getDeepList()
  337. }
  338. },
  339. },
  340. }
  341. </script>
  342. <style lang="scss" scoped>
  343. .reasoning {
  344. height: 100%;
  345. }
  346. .step {
  347. margin: 30px;
  348. }
  349. .content {
  350. height: 100%;
  351. margin: 30px;
  352. position: relative;
  353. }
  354. .box {
  355. height: 100%;
  356. width: 100%;
  357. display: flex;
  358. justify-content: center;
  359. }
  360. .btn {
  361. width: 100%;
  362. height: 40px;
  363. position: absolute;
  364. margin-top: 10px;
  365. bottom: -40px;
  366. left: 0;
  367. display: flex;
  368. justify-content: space-around;
  369. }
  370. .result {
  371. width: 100%;
  372. height: 200px;
  373. border: 1px solid #ebebeb;
  374. margin-bottom: 20px;
  375. padding: 15px;
  376. }
  377. .ProgressBar {
  378. width: 350px;
  379. height: 200px;
  380. margin-top: 40px;
  381. display: flex;
  382. flex-direction: column;
  383. align-items: center;
  384. }
  385. </style>