standardRegulationSimulationScenarioList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <template>
  2. <div>
  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. maxlength="60"
  10. clearable
  11. placeholder="请输入"
  12. @keyup.enter.native="doSearch"
  13. >
  14. </el-input>
  15. </template>
  16. <template slot="searchItem2">
  17. <span class="label">法规类型</span>
  18. <el-select
  19. v-model="searchParams.regulationType"
  20. multiple
  21. clearable
  22. size="small"
  23. >
  24. <el-option
  25. v-for="item in regulationTypeList"
  26. :label="item.caption"
  27. :value="item.code"
  28. :key="item.code"
  29. ></el-option>
  30. </el-select>
  31. </template>
  32. <template slot="searchItem3">
  33. <span class="label">标准类型</span>
  34. <el-input
  35. v-model="searchParams.standardType"
  36. size="small"
  37. maxlength="60"
  38. clearable
  39. placeholder="请输入"
  40. @keyup.enter.native="doSearch"
  41. >
  42. </el-input>
  43. </template>
  44. <!-- 复杂度 -->
  45. <template slot="searchItem6">
  46. <span class="label">复杂度</span>
  47. <el-input
  48. v-model="searchParams.a"
  49. size="small"
  50. clearable
  51. placeholder="请输入"
  52. maxlength="60"
  53. @keyup.enter.native="doSearch"
  54. style="width: 100px"
  55. >
  56. </el-input>
  57. <span class="dateSeparator">至</span>
  58. <el-input
  59. v-model="searchParams.b"
  60. size="small"
  61. clearable
  62. placeholder="请输入"
  63. maxlength="60"
  64. @keyup.enter.native="doSearch"
  65. style="width: 100px"
  66. >
  67. </el-input>
  68. </template>
  69. <!-- 危险度 -->
  70. <template slot="searchItem6">
  71. <span class="label">危险度</span>
  72. <el-input
  73. v-model="searchParams.a"
  74. size="small"
  75. clearable
  76. placeholder="请输入"
  77. maxlength="60"
  78. @keyup.enter.native="doSearch"
  79. style="width: 100px"
  80. >
  81. </el-input>
  82. <span class="dateSeparator">至</span>
  83. <el-input
  84. v-model="searchParams.b"
  85. size="small"
  86. clearable
  87. placeholder="请输入"
  88. maxlength="60"
  89. @keyup.enter.native="doSearch"
  90. style="width: 100px"
  91. >
  92. </el-input>
  93. </template>
  94. <template slot="searchItem8">
  95. <span class="label">复杂度等级</span>
  96. <el-select
  97. v-model="searchParams.scenarioRoadType"
  98. multiple
  99. size="small"
  100. clearable
  101. >
  102. <el-option
  103. v-for="item in scenarioRoadTypeList"
  104. :label="item.caption"
  105. :value="item.code"
  106. :key="item.code"
  107. ></el-option>
  108. </el-select>
  109. </template>
  110. <template slot="searchItem8">
  111. <span class="label">危险度等级</span>
  112. <el-select
  113. v-model="searchParams.scenarioRoadType"
  114. multiple
  115. size="small"
  116. clearable
  117. >
  118. <el-option
  119. v-for="item in scenarioRoadTypeList"
  120. :label="item.caption"
  121. :value="item.code"
  122. :key="item.code"
  123. ></el-option>
  124. </el-select>
  125. </template>
  126. <template slot="searchItem27">
  127. <!-- <el-checkbox-group v-model="labels">
  128. <el-checkbox-button label="ISO" :key="1" class="labelA"
  129. >ISO</el-checkbox-button
  130. >
  131. <el-checkbox-button label="GB" :key="2" class="labelB"
  132. >GB</el-checkbox-button
  133. >
  134. <el-checkbox-button label="C-NCAP" :key="3" class="labelC"
  135. >C-NCAP</el-checkbox-button
  136. >
  137. <el-checkbox-button label="E-NCAP" :key="4" class="labelD"
  138. >E-NCAP</el-checkbox-button
  139. >
  140. </el-checkbox-group> -->
  141. <div class="labelsBox">
  142. <b class="labelA" @click="conditions(1)">ISO</b>
  143. <b class="labelB" @click="conditions(2)">GB</b>
  144. <b class="labelC" @click="conditions(3)">C-NCAP</b>
  145. <b class="labelD" @click="conditions(4)">E-NCAP</b>
  146. </div>
  147. </template>
  148. <template slot="searchBtn1">
  149. <el-button type="primary" @click="doSearch">查询</el-button>
  150. </template>
  151. <template slot="searchBtn2">
  152. <el-button type="primary" @click="doReset">重置</el-button>
  153. </template>
  154. </search-layout>
  155. <div class="myTabsBox">
  156. <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
  157. <el-tab-pane label="公有" name="1"></el-tab-pane>
  158. <el-tab-pane label="私有" name="2"></el-tab-pane>
  159. </el-tabs>
  160. </div>
  161. <tableList
  162. ref="table"
  163. style="margin: 0 30px 30px"
  164. :columns="columns"
  165. :getDataWay="getDataWay"
  166. :pagination="pagination"
  167. index
  168. >
  169. <el-table-column label="操作" slot="cgInfos" align="center" width="180">
  170. <template v-slot="scope">
  171. <i
  172. @click="viewRow(scope.row)"
  173. class="el-icon-view elIcon cursor"
  174. title="查看"
  175. >
  176. </i>
  177. <span @click="jumpScene(scope.row)" class="elIcon"> 场景评价 </span>
  178. </template>
  179. </el-table-column>
  180. </tableList>
  181. <el-dialog
  182. :title="videoDiaTitle"
  183. :visible.sync="dialogVisible"
  184. width="690px"
  185. :close-on-click-modal="false"
  186. :close-on-press-escape="false"
  187. :before-close="diaClose"
  188. >
  189. <div class="videoBox">
  190. <video autoplay :src="videoSrc" controls></video>
  191. </div>
  192. </el-dialog>
  193. </div>
  194. </template>
  195. <script>
  196. import searchLayout from '@/components/grid/searchLayout'
  197. import tableList from '@/components/grid/TableList'
  198. import { mapState } from 'vuex'
  199. export default {
  200. name: 'standardRegulationSimulationScenarioList', // 标准法规场景
  201. components: { searchLayout, tableList },
  202. data() {
  203. return {
  204. activeName: '2',
  205. searchParams: {
  206. //搜索参数
  207. sceneName: '', //场景名称
  208. regulationType: [], //法规类型
  209. standardType: '', //标准类型
  210. label: [],
  211. share: '0',
  212. },
  213. labels: [], // 标签
  214. regulationTypeList: [],
  215. columns: [
  216. //表格列
  217. {
  218. label: '场景名称',
  219. prop: 'sceneName',
  220. },
  221. {
  222. label: '法规类型',
  223. prop: 'regulationType',
  224. },
  225. {
  226. label: '标准类型',
  227. prop: 'standardType',
  228. },
  229. {
  230. label: '标签',
  231. prop: 'regulationType',
  232. },
  233. {
  234. label: '复杂度',
  235. prop: 'complexity',
  236. },
  237. {
  238. label: '复杂度等级',
  239. prop: 'complexityLevel',
  240. },
  241. {
  242. label: '危险度',
  243. prop: 'risk',
  244. },
  245. {
  246. label: '危险度等级',
  247. prop: 'riskLevel',
  248. },
  249. {
  250. label: '操作',
  251. prop: 'cgInfos',
  252. template: true,
  253. // videoAddress
  254. },
  255. ],
  256. pagination: {
  257. //分页使用
  258. currentPage: 1,
  259. pageSize: 10,
  260. position: 'right',
  261. pageSizes: [10, 30, 50, 100, 200],
  262. layout: 'sizes, total, prev, pager, next, jumper',
  263. },
  264. getDataWay: {
  265. //加载表格数据
  266. dataType: 'url',
  267. type: 'post',
  268. // firstRequest: false,
  269. data: this.$api.sceneLibrary.queryStandardsRegulationsList,
  270. param: {
  271. share: '0',
  272. },
  273. },
  274. dialogVisible: false,
  275. autoplay: false,
  276. videoSrc: '',
  277. objectPath: '',
  278. videoDiaTitle: '',
  279. }
  280. },
  281. computed: {
  282. ...mapState(['fileHost', 'fileUrl']),
  283. },
  284. methods: {
  285. doSearch() {
  286. // this.searchParams.label = [...this.labels];
  287. this.searchParams.share = this.activeName === '1' ? '1' : '0'
  288. this.refreshList(this.searchParams)
  289. },
  290. //刷新table
  291. refreshList(param) {
  292. param
  293. ? this.$refs['table'].loadData(param)
  294. : this.$refs['table'].loadData()
  295. },
  296. doReset() {
  297. this.searchParams = {
  298. sceneName: '',
  299. regulationType: [],
  300. standardType: '',
  301. label: [],
  302. share: this.activeName === '1' ? '1' : '0',
  303. }
  304. // this.labels = [];
  305. this.doSearch()
  306. },
  307. pageControl(data) {
  308. this.activeName = data.name
  309. this.doSearch()
  310. },
  311. conditions(v) {
  312. switch (v) {
  313. case 1:
  314. if (!this.searchParams.regulationType.includes('ISO')) {
  315. this.searchParams.regulationType = [
  316. ...this.searchParams.regulationType,
  317. 'ISO',
  318. ]
  319. }
  320. break
  321. case 2:
  322. if (!this.searchParams.regulationType.includes('GB')) {
  323. this.searchParams.regulationType = [
  324. ...this.searchParams.regulationType,
  325. 'GB',
  326. ]
  327. }
  328. break
  329. case 3:
  330. if (!this.searchParams.regulationType.includes('C-NCAP')) {
  331. this.searchParams.regulationType = [
  332. ...this.searchParams.regulationType,
  333. 'C-NCAP',
  334. ]
  335. }
  336. break
  337. case 4:
  338. if (!this.searchParams.regulationType.includes('E-NCAP')) {
  339. this.searchParams.regulationType = [
  340. ...this.searchParams.regulationType,
  341. 'E-NCAP',
  342. ]
  343. }
  344. break
  345. default:
  346. break
  347. }
  348. },
  349. jumpScene(row) {
  350. this.$store.commit('getSceneId', row.regulationsId)
  351. this.$router.push({
  352. path: '/sceneEvaluation',
  353. })
  354. },
  355. viewRow(row) {
  356. if (!row.videoAddress) {
  357. this.$message.warning('本场景无仿真视频')
  358. return
  359. }
  360. this.dialogVisible = true
  361. this.videoDiaTitle = row.sceneName
  362. let url = ''
  363. if (process.env.VUE_APP_IS_DEV == 'true') {
  364. url = this.fileHost + this.fileUrl
  365. } else {
  366. url = this.fileUrl
  367. }
  368. let token = localStorage.getItem('Authorization').split(' ')[1]
  369. this.videoSrc = `${url}?objectName=${row.videoAddress}&access_token=${token}`
  370. this.autoplay = true
  371. },
  372. delRow(row) {
  373. this.$confirm('确认是否删除?', '提示', {
  374. confirmButtonText: '确定',
  375. cancelButtonText: '取消',
  376. type: 'warning',
  377. }).then(() => {
  378. this.$axios({
  379. method: 'post',
  380. url: this.$api.sceneLibrary.deleteStandardsRegulations,
  381. data: {
  382. regulationsId: row.regulationsId,
  383. },
  384. }).then((res) => {
  385. if (res.code == 200) {
  386. this.$message.success('删除成功')
  387. } else {
  388. this.$message.error(res.message || '删除失败')
  389. }
  390. this.doSearch()
  391. })
  392. })
  393. },
  394. diaClose(done) {
  395. this.autoplay = false
  396. this.videoSrc = ''
  397. done()
  398. },
  399. openFileDia() {
  400. this.objectPath = Math.random().toString()
  401. this.$refs.fileDialog.fileVisible = true
  402. },
  403. fileClose() {
  404. this.objectPath = ''
  405. this.doSearch()
  406. },
  407. },
  408. async mounted() {
  409. await this.$dicsListsInit({
  410. regulationTypeList: 'regulationType',
  411. })
  412. },
  413. }
  414. </script>
  415. <style lang='less' scoped>
  416. @import './common/util.less';
  417. .btnsPanel {
  418. text-align: right;
  419. }
  420. </style>