simulationHome.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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 == '2'"
  102. @click="updateTask(scope.row)"
  103. class="elIcon myIconPause"
  104. title="终止"
  105. >
  106. </i>
  107. <i
  108. v-if="scope.row.projectStatus == '0'"
  109. @click="updateTask(scope.row)"
  110. class="elIcon el-icon-refresh-right"
  111. title="运行"
  112. >
  113. </i>
  114. </template>
  115. </el-table-column>
  116. </tableList>
  117. </div>
  118. </template>
  119. <script>
  120. import searchLayout from '@/components/grid/searchLayout'
  121. import tableList from '@/components/grid/TableList'
  122. import { mapState } from 'vuex'
  123. export default {
  124. name: 'multimodeSimulation', // 多模式仿真
  125. components: { searchLayout, tableList },
  126. data() {
  127. return {
  128. searchParams: {
  129. projectId: '', // 项目id
  130. projectName: '', // 项目名称
  131. projectStatus: '', // 项目进度
  132. },
  133. // 多模式仿真表头
  134. simulationColumns: [
  135. {
  136. label: '项目ID',
  137. prop: 'id',
  138. },
  139. {
  140. label: '项目名称',
  141. prop: 'projectName',
  142. },
  143. {
  144. label: '场景数量',
  145. prop: 'sceneNums',
  146. },
  147. {
  148. label: '创建时间',
  149. prop: 'createTime',
  150. },
  151. {
  152. label: '进度',
  153. prop: 'projectStatusValue',
  154. },
  155. {
  156. label: '操作',
  157. prop: 'cgInfos',
  158. template: true,
  159. },
  160. ],
  161. pagination: {
  162. //分页使用
  163. currentPage: 1,
  164. pageSize: 10,
  165. position: 'right',
  166. pageSizes: [10, 30, 50, 100, 200],
  167. layout: 'sizes, total, prev, pager, next, jumper',
  168. },
  169. getDataWay: {
  170. //加载表格数据
  171. dataType: 'url',
  172. type: 'post',
  173. data: this.$api.multimode.queryMulationList,
  174. param: {},
  175. },
  176. }
  177. },
  178. methods: {
  179. refreshList(param) {
  180. param
  181. ? this.$refs['table'].loadData(param)
  182. : this.$refs['table'].loadData()
  183. },
  184. doSearch() {
  185. this.refreshList({ ...this.searchParams })
  186. },
  187. doReset() {
  188. this.searchParams = {
  189. projectId: '', // 项目id
  190. projectName: '', // 项目名称
  191. projectStatus: '', // 项目进度
  192. }
  193. this.doSearch()
  194. // this.refreshList()
  195. },
  196. // 仿真任务状态更新
  197. updateTask(row) {
  198. const { id, projectStatus } = row
  199. this.$axios({
  200. method: 'post',
  201. url: this.$api.multimode.updateMulationStatus,
  202. data: {
  203. projectId: id,
  204. projectStatus: projectStatus == 0 || 2 ? 1 : 2,
  205. },
  206. }).then((res) => {
  207. if (res.code == 200) {
  208. this.$message.success('状态更新成功')
  209. this.doSearch()
  210. } else {
  211. this.$message.error(res.message || '更新失败')
  212. }
  213. })
  214. },
  215. // 删除仿真列表
  216. deleteById(row) {
  217. this.$axios({
  218. method: 'post',
  219. url: this.$api.multimode.deleteMulationById,
  220. data: { projectId: row.id },
  221. }).then((res) => {
  222. if (res.code == 200) {
  223. this.$message.success('删除成功')
  224. this.doSearch()
  225. } else {
  226. this.$message.error(res.message || '删除失败')
  227. }
  228. })
  229. },
  230. // 下载仿真任务
  231. downloadTask(row){
  232. this.$axios({
  233. method: 'get',
  234. url: `${this.$api.multimode.downloadMulation}?projectId=${row.id}`,
  235. responseType: "blob",
  236. }).then((res) => {
  237. this.$blobZipDown(res,row.projectName)
  238. })
  239. },
  240. addConfig() {
  241. this.$router.push({
  242. path: '/multimodeSimulation/simulationEdit',
  243. query: { mode: 'add' },
  244. })
  245. },
  246. // 跳转地图管理
  247. mapConfig(){
  248. this.$router.push({
  249. path: "/multimodeSimulation/simulationMap",
  250. })
  251. },
  252. // 跳转评价页面
  253. jumpEvaluate(mode,id,opt){
  254. this.$store.commit("getEvaluateTabname", opt.row.projectName);
  255. localStorage.setItem("evaluateTabname", opt.row.projectName);
  256. this.$router.push({
  257. path: '/multimodeSimulation/simulationEvaluate',
  258. query: { mode,id },
  259. })
  260. },
  261. jumpDetailPage(mode,id) {
  262. this.$router.push({
  263. path: '/multimodeSimulation/simulationEdit',
  264. query: { mode,id },
  265. })
  266. },
  267. },
  268. }
  269. </script>
  270. <style lang='less' scoped>
  271. // @import './common/util.less';
  272. .naturalDrivingScenarioListPanel {
  273. .inputBox {
  274. .label {
  275. min-width: 75px;
  276. }
  277. }
  278. .btnsPanel {
  279. text-align: right;
  280. }
  281. }
  282. </style>