benchmarkScenario.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <template>
  2. <div class="generalizationScenarioListPanel">
  3. <search-layout :needBox="true">
  4. <template slot="searchItem1">
  5. <span class="label">场景名称</span>
  6. <el-input
  7. v-model="searchParams.sceneName"
  8. size="small"
  9. clearable
  10. placeholder="请输入"
  11. maxlength="60"
  12. @keyup.enter.native="doSearch"
  13. >
  14. </el-input>
  15. </template>
  16. <template slot="searchItem1">
  17. <span class="label">主车动作</span>
  18. <el-select
  19. v-model="searchParams.mainBehavior[0][1]"
  20. size="small"
  21. clearable
  22. >
  23. <el-option
  24. v-for="item in dictionaryList['egoAction']"
  25. :label="item.dictName"
  26. :value="item.dictName"
  27. :key="item.id"
  28. ></el-option>
  29. </el-select>
  30. </template>
  31. <template slot="searchItem2">
  32. <span class="label">他车动作</span>
  33. <el-select
  34. v-model="searchParams.otherBehavior[0][1]"
  35. size="small"
  36. clearable
  37. >
  38. <el-option
  39. v-for="item in dictionaryList['targetAction']"
  40. :label="item.dictName"
  41. :value="item.dictName"
  42. :key="item.id"
  43. ></el-option>
  44. </el-select>
  45. </template>
  46. <template slot="searchItem2">
  47. <span class="label">天气</span>
  48. <el-select v-model="searchParams.weather[0][1]" size="small" clearable>
  49. <el-option
  50. v-for="item in dictionaryList['sceneLibWeather']"
  51. :label="item.dictName"
  52. :value="item.dictName"
  53. :key="item.id"
  54. ></el-option>
  55. </el-select>
  56. </template>
  57. <template slot="searchItem3">
  58. <span class="label">道路类型</span>
  59. <el-select v-model="searchParams.roadType[0][1]" size="small" clearable>
  60. <el-option
  61. v-for="item in dictionaryList['sceneLibrodeType']"
  62. :label="item.dictName"
  63. :value="item.dictName"
  64. :key="item.id"
  65. ></el-option>
  66. </el-select>
  67. </template>
  68. <template slot="searchItem3">
  69. <span class="label">道路几何-平面</span>
  70. <el-select
  71. v-model="searchParams.roadGeometryPlane[0][1]"
  72. size="small"
  73. clearable
  74. >
  75. <el-option
  76. v-for="item in dictionaryList['roadPlaneGeometry']"
  77. :label="item.dictName"
  78. :value="item.dictName"
  79. :key="item.id"
  80. ></el-option>
  81. </el-select>
  82. </template>
  83. <template slot="searchItem4">
  84. <span class="label">道路几何-纵断面</span>
  85. <el-select
  86. v-model="searchParams.roadGeometryVertical[0][1]"
  87. size="small"
  88. clearable
  89. >
  90. <el-option
  91. v-for="item in dictionaryList['roadProfileGeometry']"
  92. :label="item.dictName"
  93. :value="item.dictName"
  94. :key="item.id"
  95. ></el-option>
  96. </el-select>
  97. </template>
  98. <template slot="searchItem4">
  99. <span class="label">智能驾驶</span>
  100. <el-select
  101. v-model="searchParams.autoDriveFunction[0][1]"
  102. size="small"
  103. clearable
  104. >
  105. <el-option
  106. v-for="item in dictionaryList['supportedAdas']"
  107. :label="item.dictName"
  108. :value="item.dictName"
  109. :key="item.id"
  110. ></el-option>
  111. </el-select>
  112. </template>
  113. <template slot="searchItem5">
  114. <span class="label">运行区域</span>
  115. <el-select
  116. v-model="searchParams.operationArea[0][1]"
  117. size="small"
  118. clearable
  119. >
  120. <el-option
  121. v-for="item in dictionaryList['rodeSection']"
  122. :label="item.dictName"
  123. :value="item.dictName"
  124. :key="item.id"
  125. ></el-option>
  126. </el-select>
  127. </template>
  128. <!-- 复杂度 -->
  129. <template slot="searchItem5">
  130. <span class="label">复杂度</span>
  131. <el-input
  132. v-model="searchParams.minComplexity"
  133. size="small"
  134. clearable
  135. placeholder="请输入"
  136. maxlength="60"
  137. style="width: 100px"
  138. >
  139. </el-input>
  140. <span class="dateSeparator">至</span>
  141. <el-input
  142. v-model="searchParams.maxComplexity"
  143. size="small"
  144. clearable
  145. placeholder="请输入"
  146. maxlength="60"
  147. style="width: 100px"
  148. >
  149. </el-input>
  150. </template>
  151. <!-- 危险度 -->
  152. <template slot="searchItem6">
  153. <span class="label">危险度</span>
  154. <el-input
  155. v-model="searchParams.minRisk"
  156. size="small"
  157. clearable
  158. placeholder="请输入"
  159. maxlength="60"
  160. style="width: 100px"
  161. >
  162. </el-input>
  163. <span class="dateSeparator">至</span>
  164. <el-input
  165. v-model="searchParams.maxRisk"
  166. size="small"
  167. clearable
  168. placeholder="请输入"
  169. maxlength="60"
  170. style="width: 100px"
  171. >
  172. </el-input>
  173. </template>
  174. <template slot="searchItem6">
  175. <span class="label">复杂度等级</span>
  176. <el-select
  177. v-model="searchParams.complexityLevel"
  178. size="small"
  179. clearable
  180. >
  181. <el-option
  182. v-for="item in dictionaryList['complexityLevel']"
  183. :label="item.dictName"
  184. :value="item.dictName"
  185. :key="item.id"
  186. ></el-option>
  187. </el-select>
  188. </template>
  189. <template slot="searchItem7">
  190. <span class="label">危险度等级</span>
  191. <el-select v-model="searchParams.riskLevel" size="small" clearable>
  192. <el-option
  193. v-for="item in dictionaryList['riskLevel']"
  194. :label="item.dictName"
  195. :value="item.dictName"
  196. :key="item.id"
  197. ></el-option>
  198. </el-select>
  199. </template>
  200. <template slot="searchItem7">
  201. <span class="label">标签</span>
  202. <el-input
  203. v-model="searchParams.label"
  204. size="small"
  205. clearable
  206. placeholder="请输入"
  207. maxlength="60"
  208. >
  209. </el-input>
  210. </template>
  211. <template slot="searchItem8">
  212. <span class="label">场景描述</span>
  213. <el-input
  214. v-model="searchParams.sceneDescription"
  215. size="small"
  216. clearable
  217. placeholder="请输入"
  218. maxlength="60"
  219. >
  220. </el-input>
  221. </template>
  222. <template slot="searchBtn1">
  223. <el-button type="primary" @click="doSearch">查询</el-button>
  224. </template>
  225. <template slot="searchBtn2">
  226. <el-button type="primary" @click="doReset">重置</el-button>
  227. </template>
  228. </search-layout>
  229. <div class="btnsPanel">
  230. <el-button type="primary" plain icon="el-icon-delete" @click="delRows"
  231. >批量删除</el-button
  232. >
  233. </div>
  234. <tableList
  235. ref="table"
  236. style="margin: 0 30px"
  237. :columns="columns"
  238. :getDataWay="getDataWay"
  239. :pagination="pagination"
  240. :checkedData="checkedArr"
  241. index
  242. indexFixed
  243. selection
  244. >
  245. <el-table-column
  246. label="操作"
  247. slot="cgInfos"
  248. align="center"
  249. width="180"
  250. fixed="right"
  251. >
  252. <template v-slot="scope">
  253. <i
  254. class="el-icon-view elIcon cursor"
  255. @click="viewRow(scope.row)"
  256. title="查看"
  257. >
  258. </i>
  259. <el-popconfirm title="确定删除吗?" @confirm="delRow(scope.row)">
  260. <i slot="reference" class="el-icon-delete elIcon" title="删除"> </i>
  261. </el-popconfirm>
  262. </template>
  263. </el-table-column>
  264. </tableList>
  265. <el-dialog
  266. v-if="generalizationVisible"
  267. :visible.sync="generalizationVisible"
  268. :title="generalizationDiaTitle"
  269. width="90%"
  270. class="generalizationDia"
  271. :close-on-click-modal="false"
  272. :close-on-press-escape="false"
  273. :before-close="generalizationCancel"
  274. >
  275. <div>
  276. <generalization-detail
  277. ref="generalizationDetail"
  278. :disabled="true"
  279. :id="generalizationId"
  280. :genUrlType="1"
  281. ></generalization-detail>
  282. </div>
  283. </el-dialog>
  284. <!-- 查看视频弹窗 -->
  285. <el-dialog
  286. :title="videoDiaTitle"
  287. :visible.sync="dialogVisible"
  288. width="690px"
  289. :close-on-click-modal="false"
  290. :close-on-press-escape="false"
  291. >
  292. <div class="videoBox">
  293. <video autoplay :src="videoSrc" controls></video>
  294. </div>
  295. </el-dialog>
  296. <!-- 编辑表格 -->
  297. <el-dialog
  298. title="编辑"
  299. :visible.sync="editVisible"
  300. width="780px"
  301. :close-on-click-modal="false"
  302. :close-on-press-escape="false"
  303. >
  304. <el-form
  305. ref="editInfo"
  306. :model="editInfo"
  307. label-width="150px"
  308. style="display: flex; flex-wrap: wrap; justify-content: space-between"
  309. >
  310. <el-form-item label="场景名称">
  311. <el-input v-model="editInfo.sceneName" :disabled="true"></el-input>
  312. </el-form-item>
  313. <el-form-item label="场景描述">
  314. <el-input v-model="editInfo.sceneDescription"></el-input>
  315. </el-form-item>
  316. <el-form-item label="主车动作">
  317. <el-select v-model="editInfo.mainBehavior"></el-select>
  318. </el-form-item>
  319. <el-form-item label="他车动作">
  320. <el-select v-model="editInfo.otherBehavior"></el-select>
  321. </el-form-item>
  322. <el-form-item label="天气">
  323. <el-select v-model="editInfo.weather"></el-select>
  324. </el-form-item>
  325. <el-form-item label="道路类型">
  326. <el-select v-model="editInfo.roadType"></el-select>
  327. </el-form-item>
  328. <el-form-item label="道路几何-平面">
  329. <el-select v-model="editInfo.roadGeometryPlane"></el-select>
  330. </el-form-item>
  331. <el-form-item label="道路几何-纵断面">
  332. <el-select v-model="editInfo.roadGeometryVertical"></el-select>
  333. </el-form-item>
  334. <el-form-item label="自动驾驶功能">
  335. <el-select v-model="editInfo.autoDriveFunction"></el-select>
  336. </el-form-item>
  337. <el-form-item label="运行区域">
  338. <el-select v-model="editInfo.operationArea"></el-select>
  339. </el-form-item>
  340. <el-form-item label="标签">
  341. <el-select v-model="editInfo.label"></el-select>
  342. </el-form-item>
  343. </el-form>
  344. <div style="width: 100%; display: flex; justify-content: center">
  345. <el-button @click="editVisible = false">取消</el-button>
  346. <el-button type="primary" @click="onSubmit">立即创建</el-button>
  347. </div>
  348. </el-dialog>
  349. </div>
  350. </template>
  351. <script>
  352. import searchLayout from '@/components/grid/searchLayout'
  353. import tableList from '@/components/grid/TableList'
  354. import { mapState } from 'vuex'
  355. export default {
  356. name: 'benchmarkScenarioList', // 基准场景库
  357. components: { searchLayout, tableList },
  358. data() {
  359. return {
  360. activeName: '2',
  361. searchParams: {
  362. sceneName: '', // 场景名称
  363. share: '0',
  364. mainBehavior: [['mainBehavior', '']], // 主车动作
  365. otherBehavior: [['otherBehavior', '']],
  366. weather: [['weather', '']],
  367. roadType: [['roadType', '']],
  368. roadGeometryPlane: [['roadGeometryPlane', '']],
  369. roadGeometryVertical: [['roadGeometryVertical', '']],
  370. autoDriveFunction: [['autoDriveFunction', '']],
  371. operationArea: [['operationArea', '']],
  372. minComplexity: '',
  373. maxComplexity: '',
  374. minRisk: '',
  375. maxRisk: '',
  376. complexityLevel: '',
  377. riskLevel: '',
  378. sceneDescription: '',
  379. label: '',
  380. },
  381. // 编辑信息
  382. editVisible: false,
  383. // 编辑内容数据回填
  384. editInfo: {
  385. sceneName: '', //场景名称
  386. sceneDescription: '', // 场景描述
  387. mainBehavior: '', //主车动作
  388. weather: '', // 天气
  389. roadGeometryPlane: '', // 道路几何-平面
  390. autoDriveFunction: '', // 自动驾驶功能
  391. label: '', // 标签
  392. otherBehavior: '', // 他车动作
  393. roadType: '', // 道路类型
  394. roadGeometryVertical: '', // 道路几何-纵断面
  395. operationArea: '', // 运行区域
  396. },
  397. fileNameList: [],
  398. scenarioRoadTypeList: [],
  399. // scenarioWeatherList: [],
  400. props: {
  401. multiple: true,
  402. label: 'dictName',
  403. value: 'dictCode',
  404. },
  405. columns: [
  406. //表格列
  407. {
  408. label: '场景名称',
  409. prop: 'sceneName',
  410. fixed: 'left',
  411. },
  412. {
  413. label: '主车动作',
  414. prop: 'mainBehavior',
  415. },
  416. {
  417. label: '他车动作',
  418. prop: 'otherBehavior',
  419. },
  420. {
  421. label: '天气',
  422. prop: 'weather',
  423. },
  424. {
  425. label: '道路类型',
  426. prop: 'roadType',
  427. },
  428. {
  429. label: '道路几何-平面',
  430. prop: 'roadGeometryPlane',
  431. },
  432. {
  433. label: '道路几何-纵断面',
  434. prop: 'roadGeometryVertical',
  435. },
  436. {
  437. label: '支持智驾功能',
  438. prop: 'autoDriveFunction',
  439. },
  440. {
  441. label: '运行区域',
  442. prop: 'operationArea',
  443. },
  444. {
  445. label: '复杂度',
  446. prop: 'complexity',
  447. },
  448. {
  449. label: '复杂度等级',
  450. prop: 'complexityLevel',
  451. },
  452. {
  453. label: '危险度',
  454. prop: 'risk',
  455. },
  456. {
  457. label: '危险度等级',
  458. prop: 'riskLevel',
  459. },
  460. {
  461. label: '便签',
  462. prop: 'label',
  463. },
  464. {
  465. label: '场景描述',
  466. prop: 'sceneDescription',
  467. },
  468. {
  469. label: '操作',
  470. prop: 'cgInfos',
  471. template: true,
  472. },
  473. ],
  474. pagination: {
  475. //分页使用
  476. currentPage: 1,
  477. pageSize: 10,
  478. position: 'right',
  479. pageSizes: [10, 30, 50, 100, 200],
  480. layout: 'sizes, total, prev, pager, next, jumper',
  481. },
  482. getDataWay: {
  483. dataType: 'url',
  484. type: 'post',
  485. data: this.$api.sceneLibrary.querybenchmarkList,
  486. param: {
  487. share: '0',
  488. },
  489. },
  490. generalizationVisible: false, // 泛化dialog
  491. generalizationId: '', // 泛化详情id
  492. generalizationDiaTitle: '',
  493. // 视频弹窗信息
  494. dialogVisible: false,
  495. autoplay: false,
  496. videoSrc: '',
  497. objectPath: '',
  498. videoDiaTitle: '',
  499. checkedArr: [], //  表格多选
  500. dictionaryList:{},
  501. }
  502. },
  503. computed: {
  504. ...mapState(['fileHost', 'fileUrl']),
  505. },
  506. methods: {
  507. doSearch() {
  508. this.searchParams.share = '0'
  509. const specialParams = [
  510. 'mainBehavior',
  511. 'otherBehavior',
  512. 'weather',
  513. 'roadType',
  514. 'roadGeometryPlane',
  515. 'roadGeometryVertical',
  516. 'autoDriveFunction',
  517. 'operationArea',
  518. ]
  519. const obj = JSON.parse(JSON.stringify(this.searchParams))
  520. Object.keys(obj).forEach((item) => {
  521. if (specialParams.includes(item)) {
  522. if (!obj[item][0][1]) {
  523. obj[item] = []
  524. }
  525. }
  526. })
  527. this.refreshList(obj)
  528. },
  529. //刷新table
  530. refreshList(param) {
  531. param
  532. ? this.$refs['table'].loadData(param)
  533. : this.$refs['table'].loadData()
  534. },
  535. doReset() {
  536. this.searchParams = {
  537. sceneId: '',
  538. fileName: [],
  539. scenarioRoadType: [],
  540. scenarioResume: '',
  541. share: this.activeName === '1' ? '1' : '0',
  542. // scenarioWeather: [],
  543. // scenarioTime: "",
  544. }
  545. this.doSearch()
  546. },
  547. pageControl(data) {
  548. this.activeName = data.name
  549. this.doSearch()
  550. },
  551. // 观看视频
  552. viewRow(row) {
  553. this.dialogVisible = true
  554. this.videoSrc = 'https://media.w3.org/2010/05/sintel/trailer.mp4'
  555. },
  556. // 删除列表
  557. delRow(e) {
  558. this.$axios({
  559. method: 'post',
  560. url: this.$api.sceneLibrary.batchDeleteSceneReference,
  561. data: { sceneNames: [e.sceneName] },
  562. }).then((res) => {
  563. if (res.code == 200) {
  564. this.doSearch()
  565. this.$message.success('删除成功')
  566. } else {
  567. this.$message.error(res.message || '删除失败')
  568. }
  569. })
  570. },
  571. // 编辑
  572. editHandle() {
  573. this.editVisible = true
  574. },
  575. // 跳转场景评价
  576. jumpScene() {
  577. this.$router.push({
  578. path: '/sceneEvaluation',
  579. // query: this.activeName == '3' ? { isScore: true } : {}, // 评分规则新增路由跳转标识
  580. })
  581. },
  582. delRows() {
  583. let checkedArr = this.checkedArr
  584. if (checkedArr.length <= 0) {
  585. this.$message.info('请先选择数据')
  586. return
  587. } else {
  588. const obj = []
  589. checkedArr.forEach(item=>{
  590. obj.push(item.sceneName)
  591. })
  592. this.$axios({
  593. method: 'post',
  594. url: this.$api.sceneLibrary.batchDeleteSceneReference,
  595. data: { sceneNames: obj },
  596. }).then((res) => {
  597. if (res.code == 200) {
  598. this.doSearch()
  599. this.$message.success('删除成功')
  600. } else {
  601. this.$message.error(res.message || '删除失败')
  602. }
  603. })
  604. }
  605. },
  606. searchInit() {
  607. this.$axios({
  608. method: 'post',
  609. url: this.$api.common.getDictListsByTypes,
  610. data: { dictTypes: "egoAction,targetAction,sceneLibWeather,sceneLibrodeType,roadPlaneGeometry,roadProfileGeometry,supportedAdas,rodeSection,complexityLevel,riskLevel" },
  611. }).then((res) => {
  612. if (res.code == 200) {
  613. this.dictionaryList = res.info
  614. } else {
  615. this.$message.error(res.message || '查询失败')
  616. }
  617. })
  618. },
  619. },
  620. async mounted() {
  621. this.searchInit()
  622. },
  623. }
  624. </script>
  625. <style lang='less' scoped>
  626. @import './common/util.less';
  627. .generalizationScenarioListPanel {
  628. .inputBox {
  629. .label {
  630. min-width: 90px;
  631. }
  632. }
  633. .btnsPanel {
  634. text-align: right;
  635. }
  636. .generalizationDia {
  637. /deep/ .el-dialog__body {
  638. position: relative;
  639. padding: 20px 60px;
  640. .changeBtn {
  641. position: absolute;
  642. top: 20px;
  643. right: 60px;
  644. }
  645. }
  646. }
  647. }
  648. </style>