standardRegulationSimulationScenarioList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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
  170. label="操作"
  171. slot="cgInfos"
  172. align="center"
  173. width="180"
  174. >
  175. <template v-slot="scope">
  176. <i
  177. @click="viewRow(scope.row)"
  178. class="el-icon-view elIcon cursor"
  179. title="查看"
  180. >
  181. </i>
  182. </template>
  183. </el-table-column>
  184. </tableList>
  185. <el-dialog
  186. :title="videoDiaTitle"
  187. :visible.sync="dialogVisible"
  188. width="690px"
  189. :close-on-click-modal="false"
  190. :close-on-press-escape="false"
  191. :before-close="diaClose"
  192. >
  193. <div class="videoBox">
  194. <video autoplay :src="videoSrc" controls></video>
  195. </div>
  196. </el-dialog>
  197. </div>
  198. </template>
  199. <script>
  200. import searchLayout from "@/components/grid/searchLayout";
  201. import tableList from "@/components/grid/TableList";
  202. import { mapState } from "vuex";
  203. export default {
  204. name: "standardRegulationSimulationScenarioList", // 标准法规场景
  205. components: { searchLayout, tableList },
  206. data() {
  207. return {
  208. activeName: "2",
  209. searchParams: {
  210. //搜索参数
  211. sceneName: "", //场景名称
  212. regulationType: [], //法规类型
  213. standardType: "", //标准类型
  214. label: [],
  215. share: "0",
  216. },
  217. labels: [], // 标签
  218. regulationTypeList: [],
  219. columns: [
  220. //表格列
  221. {
  222. label: "场景名称",
  223. prop: "sceneName",
  224. },
  225. {
  226. label: "法规类型",
  227. prop: "regulationType",
  228. },
  229. {
  230. label: "标准类型",
  231. prop: "standardType",
  232. },
  233. {
  234. label: "标签",
  235. prop: "regulationType",
  236. },
  237. {
  238. label: '复杂度',
  239. prop: 'complexity',
  240. },
  241. {
  242. label: '复杂度等级',
  243. prop: 'complexityLevel',
  244. },
  245. {
  246. label: '危险度',
  247. prop: 'risk',
  248. },
  249. {
  250. label: '危险度等级',
  251. prop: 'riskLevel',
  252. },
  253. {
  254. label: "操作",
  255. prop: "cgInfos",
  256. template: true,
  257. // videoAddress
  258. },
  259. ],
  260. pagination: {
  261. //分页使用
  262. currentPage: 1,
  263. pageSize: 10,
  264. position: "right",
  265. pageSizes: [10, 30, 50, 100, 200],
  266. layout: "sizes, total, prev, pager, next, jumper",
  267. },
  268. getDataWay: {
  269. //加载表格数据
  270. dataType: "url",
  271. type: "post",
  272. // firstRequest: false,
  273. data: this.$api.sceneLibrary.queryStandardsRegulationsList,
  274. param: {
  275. share: "0",
  276. },
  277. },
  278. dialogVisible: false,
  279. autoplay: false,
  280. videoSrc: "",
  281. objectPath: "",
  282. videoDiaTitle: "",
  283. };
  284. },
  285. computed: {
  286. ...mapState(["fileHost", "fileUrl"]),
  287. },
  288. methods: {
  289. doSearch() {
  290. // this.searchParams.label = [...this.labels];
  291. this.searchParams.share = this.activeName === "1" ? "1" : "0";
  292. this.refreshList(this.searchParams);
  293. },
  294. //刷新table
  295. refreshList(param) {
  296. param
  297. ? this.$refs["table"].loadData(param)
  298. : this.$refs["table"].loadData();
  299. },
  300. doReset() {
  301. this.searchParams = {
  302. sceneName: "",
  303. regulationType: [],
  304. standardType: "",
  305. label: [],
  306. share: this.activeName === "1" ? "1" : "0",
  307. };
  308. // this.labels = [];
  309. this.doSearch();
  310. },
  311. pageControl(data) {
  312. this.activeName = data.name;
  313. this.doSearch();
  314. },
  315. conditions(v) {
  316. switch (v) {
  317. case 1:
  318. if (!this.searchParams.regulationType.includes("ISO")) {
  319. this.searchParams.regulationType = [
  320. ...this.searchParams.regulationType,
  321. "ISO",
  322. ];
  323. }
  324. break;
  325. case 2:
  326. if (!this.searchParams.regulationType.includes("GB")) {
  327. this.searchParams.regulationType = [
  328. ...this.searchParams.regulationType,
  329. "GB",
  330. ];
  331. }
  332. break;
  333. case 3:
  334. if (!this.searchParams.regulationType.includes("C-NCAP")) {
  335. this.searchParams.regulationType = [
  336. ...this.searchParams.regulationType,
  337. "C-NCAP",
  338. ];
  339. }
  340. break;
  341. case 4:
  342. if (!this.searchParams.regulationType.includes("E-NCAP")) {
  343. this.searchParams.regulationType = [
  344. ...this.searchParams.regulationType,
  345. "E-NCAP",
  346. ];
  347. }
  348. break;
  349. default:
  350. break;
  351. }
  352. },
  353. viewRow(row) {
  354. if (!row.videoAddress) {
  355. this.$message.warning("本场景无仿真视频");
  356. return;
  357. }
  358. this.dialogVisible = true;
  359. this.videoDiaTitle = row.sceneName;
  360. let url = "";
  361. if (process.env.VUE_APP_IS_DEV == "true") {
  362. url = this.fileHost + this.fileUrl;
  363. } else {
  364. url = this.fileUrl;
  365. }
  366. let token = localStorage.getItem("Authorization").split(" ")[1];
  367. this.videoSrc = `${url}?objectName=${row.videoAddress}&access_token=${token}`;
  368. this.autoplay = true;
  369. },
  370. delRow(row) {
  371. this.$confirm("确认是否删除?", "提示", {
  372. confirmButtonText: "确定",
  373. cancelButtonText: "取消",
  374. type: "warning",
  375. }).then(() => {
  376. this.$axios({
  377. method: "post",
  378. url: this.$api.sceneLibrary.deleteStandardsRegulations,
  379. data: {
  380. regulationsId: row.regulationsId,
  381. },
  382. }).then((res) => {
  383. if (res.code == 200) {
  384. this.$message.success("删除成功");
  385. } else {
  386. this.$message.error(res.message || "删除失败");
  387. }
  388. this.doSearch();
  389. });
  390. });
  391. },
  392. diaClose(done) {
  393. this.autoplay = false;
  394. this.videoSrc = "";
  395. done();
  396. },
  397. openFileDia() {
  398. this.objectPath = Math.random().toString();
  399. this.$refs.fileDialog.fileVisible = true;
  400. },
  401. fileClose() {
  402. this.objectPath = "";
  403. this.doSearch();
  404. },
  405. },
  406. async mounted() {
  407. await this.$dicsListsInit({
  408. regulationTypeList: "regulationType",
  409. });
  410. },
  411. };
  412. </script>
  413. <style lang='less' scoped>
  414. @import "./common/util.less";
  415. .btnsPanel {
  416. text-align: right;
  417. }
  418. </style>