simulationHome.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <router-view v-if="$route.path.includes('simulationMap')"></router-view>
  3. <router-view v-else-if="$route.path.includes('simulationEdit')"></router-view>
  4. <router-view v-else-if="$route.path.includes('simulationEvaluate')"></router-view>
  5. <div v-else class="multimodeSimulation">
  6. <search-layout :needBox="true">
  7. <template slot="searchItem1">
  8. <span class="label">项目ID</span>
  9. <el-input
  10. v-model="searchParams.projectId"
  11. size="small"
  12. clearable
  13. placeholder="请输入"
  14. maxlength="60"
  15. >
  16. </el-input>
  17. </template>
  18. <template slot="searchItem1">
  19. <span class="label">项目名称</span>
  20. <el-input
  21. v-model="searchParams.projectName"
  22. size="small"
  23. clearable
  24. placeholder="请输入"
  25. maxlength="60"
  26. >
  27. </el-input>
  28. </template>
  29. <template slot="searchItem4">
  30. <span class="label">项目进度</span>
  31. <el-select
  32. v-model="searchParams.projectStatus"
  33. size="small"
  34. clearable
  35. placeholder="请输入"
  36. maxlength="60"
  37. >
  38. <el-option
  39. v-for="(item, idx) in [
  40. { label: '未开始', value: '0' },
  41. { label: '运行中', value: '1' },
  42. { label: '已终止', value: '2' },
  43. { label: '已完成', value: '3' },
  44. ]"
  45. :label="item.label"
  46. :value="item.value"
  47. :key="idx"
  48. ></el-option>
  49. </el-select>
  50. </template>
  51. <template slot="searchBtn1">
  52. <el-button type="primary" @click="doSearch">查询</el-button>
  53. <el-button type="primary" @click="doReset">重置</el-button>
  54. </template>
  55. </search-layout>
  56. <div></div>
  57. <div style="display: flex; justify-content: end; margin: 20px 50px">
  58. <el-button
  59. class="addBtn"
  60. icon="el-icon-circle-plus-outline"
  61. @click="mapConfig"
  62. type="primary"
  63. >地图管理</el-button>
  64. <el-button
  65. class="addBtn"
  66. icon="el-icon-circle-plus-outline"
  67. @click="addConfig"
  68. type="primary"
  69. >新增</el-button
  70. >
  71. </div>
  72. <tableList
  73. ref="table"
  74. style="margin: 0 30px 30px"
  75. :columns="simulationColumns"
  76. :getDataWay="getDataWay"
  77. :pagination="pagination"
  78. index
  79. >
  80. <el-table-column label="操作" slot="cgInfos" align="center" width="180">
  81. <template v-slot="scope">
  82. <!-- <span v-if="scope.row.projectStatus==1" @click="" class="elIcon"> 查看 </span> -->
  83. <i
  84. v-if="scope.row.projectStatus == '3'"
  85. @click="jumpEvaluate('preview',scope.row.id,scope)"
  86. class="el-icon-view elIcon"
  87. title="查看"
  88. >
  89. </i>
  90. <i
  91. v-if="scope.row.projectStatus == '0'"
  92. @click="jumpDetailPage('edit',scope.row.id)"
  93. class="el-icon-edit-outline elIcon"
  94. title="编辑"
  95. >
  96. </i>
  97. <i @click="downloadTask(scope.row)" v-if="scope.row.projectStatus == '3'" class="el-icon-download elIcon" title="下载">
  98. </i>
  99. <i @click="deleteById(scope.row)" class="elIcon el-icon-delete" title="删除"> </i>
  100. <i
  101. v-if="scope.row.projectStatus == '1'"
  102. @click="updateTask(scope.row,2)"
  103. class="elIcon myIconPause"
  104. title="终止"
  105. >
  106. </i>
  107. <i
  108. v-if="scope.row.projectStatus == '2' || scope.row.projectStatus == '3'"
  109. @click="updateTask(scope.row,1)"
  110. class="elIcon el-icon-refresh"
  111. title="重新运行"
  112. >
  113. </i>
  114. <i
  115. v-if="scope.row.projectStatus == '0'"
  116. @click="updateTask(scope.row,1)"
  117. class="elIcon el-icon-refresh-right"
  118. title="运行"
  119. >
  120. </i>
  121. </template>
  122. </el-table-column>
  123. </tableList>
  124. </div>
  125. </template>
  126. <script>
  127. import searchLayout from '@/components/grid/searchLayout'
  128. import tableList from '@/components/grid/TableList'
  129. import { mapState } from 'vuex'
  130. export default {
  131. name: 'multimodeSimulation', // 多模式仿真
  132. components: { searchLayout, tableList },
  133. data() {
  134. return {
  135. searchParams: {
  136. projectId: '', // 项目id
  137. projectName: '', // 项目名称
  138. projectStatus: '', // 项目进度
  139. },
  140. // 多模式仿真表头
  141. simulationColumns: [
  142. {
  143. label: '项目ID',
  144. prop: 'id',
  145. },
  146. {
  147. label: '项目名称',
  148. prop: 'projectName',
  149. },
  150. {
  151. label: '场景数量',
  152. prop: 'sceneNums',
  153. },
  154. {
  155. label: '创建时间',
  156. prop: 'createTime',
  157. },
  158. {
  159. label: '进度',
  160. prop: 'projectStatusValue',
  161. },
  162. {
  163. label: '操作',
  164. prop: 'cgInfos',
  165. template: true,
  166. },
  167. ],
  168. pagination: {
  169. //分页使用
  170. currentPage: 1,
  171. pageSize: 10,
  172. position: 'right',
  173. pageSizes: [10, 30, 50, 100, 200],
  174. layout: 'sizes, total, prev, pager, next, jumper',
  175. },
  176. getDataWay: {
  177. //加载表格数据
  178. dataType: 'url',
  179. type: 'post',
  180. data: this.$api.multimode.queryMulationList,
  181. param: {},
  182. },
  183. }
  184. },
  185. methods: {
  186. refreshList(param) {
  187. param
  188. ? this.$refs['table'].loadData(param)
  189. : this.$refs['table'].loadData()
  190. },
  191. doSearch() {
  192. this.refreshList({ ...this.searchParams })
  193. },
  194. doReset() {
  195. this.searchParams = {
  196. projectId: '', // 项目id
  197. projectName: '', // 项目名称
  198. projectStatus: '', // 项目进度
  199. }
  200. this.doSearch()
  201. // this.refreshList()
  202. },
  203. // 仿真任务状态更新
  204. updateTask(row,status) {
  205. const { id } = row
  206. this.$axios({
  207. method: 'post',
  208. url: this.$api.multimode.updateMulationStatus,
  209. data: {
  210. projectId: id,
  211. projectStatus: status,
  212. },
  213. }).then((res) => {
  214. if (res.code == 200) {
  215. this.$message.success('状态更新成功')
  216. this.doSearch()
  217. } else {
  218. this.$message.error(res.message || '更新失败')
  219. }
  220. })
  221. },
  222. // 删除仿真列表
  223. deleteById(row) {
  224. this.$axios({
  225. method: 'post',
  226. url: this.$api.multimode.deleteMulationById,
  227. data: { projectId: row.id },
  228. }).then((res) => {
  229. if (res.code == 200) {
  230. this.$message.success('删除成功')
  231. this.doSearch()
  232. } else {
  233. this.$message.error(res.message || '删除失败')
  234. }
  235. })
  236. },
  237. // 下载仿真任务
  238. downloadTask(row){
  239. this.$axios({
  240. method: 'get',
  241. url: `${this.$api.multimode.downloadMulation}?projectId=${row.id}`,
  242. responseType: "blob",
  243. }).then((res) => {
  244. this.$blobZipDown(res,row.projectName)
  245. })
  246. },
  247. addConfig() {
  248. this.$router.push({
  249. path: '/multimodeSimulation/simulationEdit',
  250. query: { mode: 'add' },
  251. })
  252. },
  253. // 跳转地图管理
  254. mapConfig(){
  255. this.$router.push({
  256. path: "/multimodeSimulation/simulationMap",
  257. })
  258. },
  259. // 跳转评价页面
  260. jumpEvaluate(mode,id,opt){
  261. this.$store.commit("getEvaluateTabname", opt.row.projectName);
  262. localStorage.setItem("evaluateTabname", opt.row.projectName);
  263. this.$router.push({
  264. path: '/multimodeSimulation/simulationEvaluate',
  265. query: { mode,id },
  266. })
  267. },
  268. jumpDetailPage(mode,id) {
  269. this.$router.push({
  270. path: '/multimodeSimulation/simulationEdit',
  271. query: { mode,id },
  272. })
  273. },
  274. },
  275. }
  276. </script>
  277. <style lang='less' scoped>
  278. // @import './common/util.less';
  279. .naturalDrivingScenarioListPanel {
  280. .inputBox {
  281. .label {
  282. min-width: 75px;
  283. }
  284. }
  285. .btnsPanel {
  286. text-align: right;
  287. }
  288. }
  289. </style>