|
@@ -1,115 +1,68 @@
|
|
<template>
|
|
<template>
|
|
<router-view v-if="$route.path.includes('evaluationResults')"></router-view>
|
|
<router-view v-if="$route.path.includes('evaluationResults')"></router-view>
|
|
- <div
|
|
|
|
- v-else
|
|
|
|
- style="
|
|
|
|
|
|
+ <div v-else style="
|
|
width: 100%;
|
|
width: 100%;
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
padding: 20px 50px;
|
|
padding: 20px 50px;
|
|
- "
|
|
|
|
- >
|
|
|
|
- <p
|
|
|
|
- style="
|
|
|
|
|
|
+ ">
|
|
|
|
+ <p style="
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
border-bottom: 1px solid #ccc;
|
|
border-bottom: 1px solid #ccc;
|
|
padding-bottom: 15px;
|
|
padding-bottom: 15px;
|
|
- "
|
|
|
|
- >
|
|
|
|
|
|
+ ">
|
|
基础信息
|
|
基础信息
|
|
</p>
|
|
</p>
|
|
<search-layout :needBox="true">
|
|
<search-layout :needBox="true">
|
|
<template slot="searchItem1">
|
|
<template slot="searchItem1">
|
|
<span class="label">项目名称</span>
|
|
<span class="label">项目名称</span>
|
|
- <el-input
|
|
|
|
- v-model="baseInfo.projectName"
|
|
|
|
- size="small"
|
|
|
|
- clearable
|
|
|
|
- placeholder="请输入"
|
|
|
|
- maxlength="60"
|
|
|
|
- :disabled="!isEdit"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-input v-model="baseInfo.projectName" size="small" clearable placeholder="请输入" maxlength="60"
|
|
|
|
+ :disabled="!isEdit">
|
|
</el-input>
|
|
</el-input>
|
|
</template>
|
|
</template>
|
|
<template slot="searchItem3">
|
|
<template slot="searchItem3">
|
|
<span class="label">最大仿真时间(s)</span>
|
|
<span class="label">最大仿真时间(s)</span>
|
|
- <el-input
|
|
|
|
- v-model="baseInfo.projectMaxSeconds"
|
|
|
|
- size="small"
|
|
|
|
- clearable
|
|
|
|
- placeholder="请输入"
|
|
|
|
- maxlength="60"
|
|
|
|
- :disabled="!isEdit"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-input v-model="baseInfo.projectMaxSeconds" size="small" clearable placeholder="请输入" maxlength="60"
|
|
|
|
+ :disabled="!isEdit">
|
|
</el-input>
|
|
</el-input>
|
|
<span style="color: red" class="label">(最小是5,最大4500)</span>
|
|
<span style="color: red" class="label">(最小是5,最大4500)</span>
|
|
</template>
|
|
</template>
|
|
<template slot="searchItem8">
|
|
<template slot="searchItem8">
|
|
<span class="label">项目描述</span>
|
|
<span class="label">项目描述</span>
|
|
- <el-input
|
|
|
|
- v-model="baseInfo.projectDescription"
|
|
|
|
- size="small"
|
|
|
|
- clearable
|
|
|
|
- placeholder="请输入"
|
|
|
|
- maxlength="60"
|
|
|
|
- :disabled="!isEdit"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-input v-model="baseInfo.projectDescription" size="small" clearable placeholder="请输入" maxlength="60"
|
|
|
|
+ :disabled="!isEdit">
|
|
</el-input>
|
|
</el-input>
|
|
</template>
|
|
</template>
|
|
</search-layout>
|
|
</search-layout>
|
|
- <p
|
|
|
|
- style="
|
|
|
|
|
|
+ <p style="
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
border-bottom: 1px solid #ccc;
|
|
border-bottom: 1px solid #ccc;
|
|
padding-bottom: 15px;
|
|
padding-bottom: 15px;
|
|
margin-top: 30px;
|
|
margin-top: 30px;
|
|
- "
|
|
|
|
- >
|
|
|
|
|
|
+ ">
|
|
场景详情
|
|
场景详情
|
|
</p>
|
|
</p>
|
|
<div style="display: flex; justify-content: end; margin: 20px 50px">
|
|
<div style="display: flex; justify-content: end; margin: 20px 50px">
|
|
- <el-button
|
|
|
|
- v-if="configBtnShow"
|
|
|
|
- class="addBtn"
|
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
|
- @click="addConfig"
|
|
|
|
- type="primary"
|
|
|
|
- >添加</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- v-if="configBtnShow"
|
|
|
|
- class="addBtn"
|
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
|
- @click="copyConfig"
|
|
|
|
- type="primary"
|
|
|
|
- >复制配置</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <el-button v-if="configBtnShow" class="addBtn" icon="el-icon-circle-plus-outline" @click="addConfig"
|
|
|
|
+ type="primary">添加</el-button>
|
|
|
|
+ <el-button v-if="configBtnShow" class="addBtn" icon="el-icon-circle-plus-outline" @click="copyConfig"
|
|
|
|
+ type="primary">复制配置</el-button>
|
|
</div>
|
|
</div>
|
|
- <tableList
|
|
|
|
- v-if="tableShow"
|
|
|
|
- ref="table"
|
|
|
|
- style="margin: 0 30px 30px"
|
|
|
|
- :columns="columns"
|
|
|
|
- :getDataWay="getDataWay"
|
|
|
|
- :pagination="pagination"
|
|
|
|
- selection
|
|
|
|
- index
|
|
|
|
- :needSelectedCallBack="true"
|
|
|
|
- :selectedCallBack="selectedCallBackB"
|
|
|
|
- :selectedAllCallBack="selectedAllCallBackB"
|
|
|
|
- >
|
|
|
|
|
|
+ <tableList v-if="tableShow" ref="table" style="margin: 0 30px 30px" :columns="columns" :getDataWay="getDataWay"
|
|
|
|
+ :pagination="pagination" selection index :needSelectedCallBack="true" :selectedCallBack="selectedCallBackB"
|
|
|
|
+ :selectedAllCallBack="selectedAllCallBackB">
|
|
<el-table-column label="操作" slot="cgInfos" align="center" width="180">
|
|
<el-table-column label="操作" slot="cgInfos" align="center" width="180">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
- <span
|
|
|
|
- v-if="!isEdit && ![2, 4, 6, null].includes(scope.row.taskStatus)"
|
|
|
|
- @click="toEvaluate(scope.row)"
|
|
|
|
- class="elIcon"
|
|
|
|
- >
|
|
|
|
|
|
+ <span v-if="!isEdit && scope.row.taskStatus == 4" @click="updateStatus(scope.row)" class="elIcon">
|
|
|
|
+ 重新运行
|
|
|
|
+ </span>
|
|
|
|
+ <span v-if="!isEdit && ![2, 6, null].includes(scope.row.taskStatus) && scope.row.taskStatus != 4"
|
|
|
|
+ @click="toEvaluate(scope.row)" class="elIcon">
|
|
评价结果
|
|
评价结果
|
|
</span>
|
|
</span>
|
|
- <span v-else>-</span>
|
|
|
|
|
|
+ <!-- <span v-else>-</span> -->
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</tableList>
|
|
</tableList>
|
|
@@ -128,7 +81,7 @@ export default {
|
|
name: 'simulationEvaluate',
|
|
name: 'simulationEvaluate',
|
|
components: { searchLayout, tableList },
|
|
components: { searchLayout, tableList },
|
|
|
|
|
|
- data() {
|
|
|
|
|
|
+ data () {
|
|
return {
|
|
return {
|
|
isEdit: true, // 模式, 默认编辑模式 false 预览
|
|
isEdit: true, // 模式, 默认编辑模式 false 预览
|
|
isUpdate: false, // 更新模式
|
|
isUpdate: false, // 更新模式
|
|
@@ -161,8 +114,12 @@ export default {
|
|
{
|
|
{
|
|
label: '运行状态',
|
|
label: '运行状态',
|
|
prop: 'taskStatus',
|
|
prop: 'taskStatus',
|
|
- formatter(row) {
|
|
|
|
|
|
+ formatter (row) {
|
|
switch (Number(row.taskStatus)) {
|
|
switch (Number(row.taskStatus)) {
|
|
|
|
+ case 0:
|
|
|
|
+ return '初始状态'
|
|
|
|
+ case 1:
|
|
|
|
+ return '初始状态'
|
|
case 2:
|
|
case 2:
|
|
return '手动终止'
|
|
return '手动终止'
|
|
case 3:
|
|
case 3:
|
|
@@ -181,7 +138,7 @@ export default {
|
|
{
|
|
{
|
|
label: '运行结果',
|
|
label: '运行结果',
|
|
prop: 'taskStatus',
|
|
prop: 'taskStatus',
|
|
- formatter(row) {
|
|
|
|
|
|
+ formatter (row) {
|
|
if ([3, 5, '3', '5'].includes(row.taskStatus)) {
|
|
if ([3, 5, '3', '5'].includes(row.taskStatus)) {
|
|
return '成功'
|
|
return '成功'
|
|
} else {
|
|
} else {
|
|
@@ -214,7 +171,7 @@ export default {
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
|
|
+ mounted () {
|
|
this.isEdit = ['edit', 'add'].includes(this.$route.query.mode)
|
|
this.isEdit = ['edit', 'add'].includes(this.$route.query.mode)
|
|
? true
|
|
? true
|
|
: false
|
|
: false
|
|
@@ -232,7 +189,7 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 获取任务详情信息
|
|
// 获取任务详情信息
|
|
- getTaskDetailById(id) {
|
|
|
|
|
|
+ getTaskDetailById (id) {
|
|
this.$axios({
|
|
this.$axios({
|
|
method: 'post',
|
|
method: 'post',
|
|
url: this.$api.multimode.queryMulationDetailById,
|
|
url: this.$api.multimode.queryMulationDetailById,
|
|
@@ -251,7 +208,7 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- deleteScene(id) {
|
|
|
|
|
|
+ deleteScene (id) {
|
|
this.$axios({
|
|
this.$axios({
|
|
method: 'post',
|
|
method: 'post',
|
|
url: this.$api.multimode.deleteMulationScene,
|
|
url: this.$api.multimode.deleteMulationScene,
|
|
@@ -268,7 +225,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 提交
|
|
// 提交
|
|
- saveTask() {
|
|
|
|
|
|
+ saveTask () {
|
|
this.$axios({
|
|
this.$axios({
|
|
method: 'post',
|
|
method: 'post',
|
|
url: this.$api.multimode.saveMulationTask,
|
|
url: this.$api.multimode.saveMulationTask,
|
|
@@ -290,13 +247,13 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 刷新场景列表
|
|
// 刷新场景列表
|
|
- refreshList(param) {
|
|
|
|
|
|
+ refreshList (param) {
|
|
param
|
|
param
|
|
? this.$refs['table'].loadData(param)
|
|
? this.$refs['table'].loadData(param)
|
|
: this.$refs['table'].loadData()
|
|
: this.$refs['table'].loadData()
|
|
},
|
|
},
|
|
// 复制场景列表
|
|
// 复制场景列表
|
|
- copyConfig() {
|
|
|
|
|
|
+ copyConfig () {
|
|
if (this.selectSceneIds.length <= 0) {
|
|
if (this.selectSceneIds.length <= 0) {
|
|
this.$message.warning('请选择要复制的列表')
|
|
this.$message.warning('请选择要复制的列表')
|
|
return
|
|
return
|
|
@@ -318,7 +275,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 新增场景列表
|
|
// 新增场景列表
|
|
- addConfig() {
|
|
|
|
|
|
+ addConfig () {
|
|
this.$axios({
|
|
this.$axios({
|
|
method: 'post',
|
|
method: 'post',
|
|
url: this.$api.multimode.addMulationSceneList,
|
|
url: this.$api.multimode.addMulationSceneList,
|
|
@@ -337,7 +294,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 单列表选中
|
|
// 单列表选中
|
|
- selectedCallBackB(row, type) {
|
|
|
|
|
|
+ selectedCallBackB (row, type) {
|
|
// 选中
|
|
// 选中
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
const arr = this.selectSceneIds
|
|
const arr = this.selectSceneIds
|
|
@@ -351,7 +308,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 全选
|
|
// 全选
|
|
- selectedAllCallBackB(row) {
|
|
|
|
|
|
+ selectedAllCallBackB (row) {
|
|
const arr = []
|
|
const arr = []
|
|
row.forEach((item) => {
|
|
row.forEach((item) => {
|
|
arr.push(item.id)
|
|
arr.push(item.id)
|
|
@@ -359,7 +316,7 @@ export default {
|
|
this.selectSceneIds = arr
|
|
this.selectSceneIds = arr
|
|
},
|
|
},
|
|
// 创建仿真任务
|
|
// 创建仿真任务
|
|
- createTask() {
|
|
|
|
|
|
+ createTask () {
|
|
// 编辑,更新
|
|
// 编辑,更新
|
|
if (this.isUpdate) {
|
|
if (this.isUpdate) {
|
|
this.$axios({
|
|
this.$axios({
|
|
@@ -411,17 +368,38 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- cancelHandle() {
|
|
|
|
|
|
+ cancelHandle () {
|
|
this.$router.back()
|
|
this.$router.back()
|
|
},
|
|
},
|
|
// 跳转场景评价
|
|
// 跳转场景评价
|
|
- toEvaluate(row) {
|
|
|
|
|
|
+ toEvaluate (row) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: '/multimodeSimulation/simulationEvaluate/evaluationResults',
|
|
path: '/multimodeSimulation/simulationEvaluate/evaluationResults',
|
|
query: { id: row.id },
|
|
query: { id: row.id },
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- navigatorEdit(id) {
|
|
|
|
|
|
+ // 重新运行状态
|
|
|
|
+ updateStatus (row) {
|
|
|
|
+ console.log('row', row.id)
|
|
|
|
+ this.$axios({
|
|
|
|
+ method: 'post',
|
|
|
|
+ url: this.$api.workManagement.getMultiSimulationSceneStatus,
|
|
|
|
+ data: {
|
|
|
|
+ projectId: this.$route.query.id,
|
|
|
|
+ sceneIdList: [row.id]
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ let timer = setTimeout(() => {
|
|
|
|
+ this.$refs['table'].loadData({
|
|
|
|
+ projectId: this.$route.query.id
|
|
|
|
+ })
|
|
|
|
+ clearTimeout(timer)
|
|
|
|
+ }, 3000);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ navigatorEdit (id) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: 'multimodeSimulationEdit',
|
|
name: 'multimodeSimulationEdit',
|
|
query: {
|
|
query: {
|