|
@@ -53,13 +53,16 @@
|
|
|
</el-transfer>
|
|
|
</template>
|
|
|
</ProForm>
|
|
|
- <div class="card content-box-c" v-if="active === 4">结果......</div>
|
|
|
+ <div class="card content-box-c" v-if="active === 4">结果:{{ result }}</div>
|
|
|
</div>
|
|
|
<div class="step-footer">
|
|
|
<el-button @click="pre" v-show="active > 1">上一步</el-button>
|
|
|
<el-button type="primary" @click="next" v-show="active < 3">下一步</el-button>
|
|
|
<el-button type="primary" v-show="[2, 3].includes(active)" @click="onSubmit()">提交</el-button>
|
|
|
</div>
|
|
|
+ <el-dialog title="进度" v-model="dialogProgress" class="progress" width="800" :close-on-click-modal="false" append-to-body>
|
|
|
+ <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -70,11 +73,19 @@ import ProTable from '@/components/ProTable/index.vue'
|
|
|
import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
|
|
import type { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'
|
|
|
import { updateModelInfoApi } from '@/api/modules/manage/modelInfo'
|
|
|
-import { listSortieParameterAllApi, getWarningListApi, modelListAllApi, getSortieParamsApi } from '@/api/modules/manage/sortieParameter'
|
|
|
+import {
|
|
|
+ listSortieParameterAllApi,
|
|
|
+ getWarningListApi,
|
|
|
+ modelListAllApi,
|
|
|
+ getSortieParamsApi,
|
|
|
+ exeModelDiagnoseApi,
|
|
|
+ exeModelTestabilityApi
|
|
|
+} from '@/api/modules/manage/sortieParameter'
|
|
|
import { listSortieAllApi } from '@/api/modules/manage/sortie'
|
|
|
import { getDictsApi } from '@/api/modules/system/dictData'
|
|
|
// import { useRoute } from 'vue-router'
|
|
|
import { nextTick } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
// const route = useRoute()
|
|
|
onMounted(() => {
|
|
|
exeTypeChange()
|
|
@@ -83,10 +94,13 @@ const optionsModel = ref<any[]>([])
|
|
|
const formRef = ref<InstanceType<typeof ProForm> | null>(null)
|
|
|
let active = ref(1)
|
|
|
let model = ref({})
|
|
|
+let result = ref()
|
|
|
let activeModel = reactive({})
|
|
|
let parameterList = ref<any[]>([])
|
|
|
const proTable2 = ref<ProTableInstance>()
|
|
|
const proTable = ref<ProTableInstance>()
|
|
|
+const percentage = ref(20)
|
|
|
+const dialogProgress = ref(false)
|
|
|
const dataCallback = (data: any) => {
|
|
|
const page = proTable2.value!.pageable
|
|
|
return {
|
|
@@ -154,7 +168,7 @@ const modelChange = async () => {
|
|
|
formRef.value!.formModel.dataParams = JSON.parse(val.dataParams || '[]')
|
|
|
// 测试性模型
|
|
|
if (active.value === 2) {
|
|
|
- formRef.value!.formModel.testModelId = val.id
|
|
|
+ formRef.value!.formModel.testabilityId = val.id
|
|
|
}
|
|
|
// 增强诊断型模型
|
|
|
if (active.value === 3) {
|
|
@@ -201,9 +215,48 @@ const stepEnum = [
|
|
|
{ value: 5, label: '5帧/秒' },
|
|
|
{ value: 10, label: '10帧/秒' }
|
|
|
]
|
|
|
+const simulateProgress = async () => {
|
|
|
+ percentage.value = 0 // 重置进度
|
|
|
+ while (percentage.value < 96) {
|
|
|
+ percentage.value += 2 // 每次增加2%
|
|
|
+ await new Promise(resolve => setTimeout(resolve, 200)) // 延迟200毫秒
|
|
|
+ }
|
|
|
+}
|
|
|
const onSubmit = () => {
|
|
|
- active.value = 4
|
|
|
- console.log('formRef.value', formRef.value)
|
|
|
+ // active.value = 4
|
|
|
+ // console.log('formRef.value', formRef.value)
|
|
|
+ formRef.value!.proFormRef?.validate(async valid => {
|
|
|
+ if (valid) {
|
|
|
+ dialogProgress.value = true
|
|
|
+ exeModel()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+const exeModel = async () => {
|
|
|
+ simulateProgress()
|
|
|
+ let res
|
|
|
+ try {
|
|
|
+ if (active.value === 2) {
|
|
|
+ res = await exeModelTestabilityApi(formRef.value!.formModel)
|
|
|
+ }
|
|
|
+ if (active.value === 3) {
|
|
|
+ res = await exeModelDiagnoseApi(formRef.value!.formModel)
|
|
|
+ }
|
|
|
+ // 执行模型
|
|
|
+ if (res.code == 200) {
|
|
|
+ percentage.value = 100
|
|
|
+ dialogProgress.value = false
|
|
|
+ ElMessage.success('执行成功')
|
|
|
+ result.value = res.data
|
|
|
+ active.value = 4
|
|
|
+ } else {
|
|
|
+ dialogProgress.value = false
|
|
|
+ ElMessage.error(res.msg)
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ } finally {
|
|
|
+ dialogProgress.value = false
|
|
|
+ }
|
|
|
}
|
|
|
const change = (val: any) => {
|
|
|
const data = {
|
|
@@ -285,7 +338,7 @@ const setItemsOptions = () => {
|
|
|
span: 24,
|
|
|
rules: [{ required: true, message: '请选择数据', trigger: 'change' }],
|
|
|
show: () => {
|
|
|
- return formRef.value?.formModel.exeType === '3'
|
|
|
+ return formRef.value?.formModel.exeType === '3' && active.value === 3
|
|
|
},
|
|
|
compOptions: {
|
|
|
elTagName: 'slot'
|