generalizationScenarioList.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <div class="generalizationScenarioListPanel">
  3. <search-layout :needBox="true">
  4. <template slot="searchItem1">
  5. <span class="label">场景编号</span>
  6. <el-input v-model="searchParams.sceneId" size="small" clearable placeholder="请输入" maxlength="60"
  7. @keyup.enter.native="doSearch">
  8. </el-input>
  9. </template>
  10. <template slot="searchItem2">
  11. <span class="label">功能模块</span>
  12. <el-select v-model="searchParams.fileName" multiple size="small" clearable>
  13. <el-option v-for="item in fileNameList" :label="item.caption" :value="item.code"
  14. :key="item.code"></el-option>
  15. </el-select>
  16. </template>
  17. <template slot="searchItem3">
  18. <span class="label">道路类型</span>
  19. <el-select v-model="searchParams.scenarioRoadType" multiple size="small" clearable>
  20. <el-option v-for="item in scenarioRoadTypeList" :label="item.caption" :value="item.code"
  21. :key="item.code"></el-option>
  22. </el-select>
  23. </template>
  24. <template slot="searchItem4">
  25. <span class="label">场景简述</span>
  26. <el-input v-model="searchParams.scenarioResume" size="small" clearable placeholder="请输入" maxlength="300"
  27. @keyup.enter.native="doSearch">
  28. </el-input>
  29. </template>
  30. <template slot="searchBtn1">
  31. <el-button type="primary" @click="doSearch">查询</el-button>
  32. </template>
  33. <template slot="searchBtn2">
  34. <el-button type="primary" @click="doReset">重置</el-button>
  35. </template>
  36. </search-layout>
  37. <div class="myTabsBox">
  38. <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
  39. <el-tab-pane label="公有" name="1"></el-tab-pane>
  40. <el-tab-pane label="私有" name="2"></el-tab-pane>
  41. </el-tabs>
  42. </div>
  43. <tableList ref="table" style="margin: 0 30px 30px" :columns="columns" :getDataWay="getDataWay"
  44. :pagination="pagination" index>
  45. <el-table-column label="操作" slot="cgInfos" align="center" width="180">
  46. <template v-slot="scope">
  47. <span @click="viewRow(scope.row)" class="elIcon">
  48. 查看模板
  49. </span>
  50. </template>
  51. </el-table-column>
  52. </tableList>
  53. <el-dialog v-if="generalizationVisible" :visible.sync="generalizationVisible" :title="generalizationDiaTitle"
  54. width="90%" class="generalizationDia" :close-on-click-modal="false" :close-on-press-escape="false"
  55. :before-close="generalizationCancel">
  56. <div>
  57. <generalization-detail ref="generalizationDetail" :disabled="true" :id="generalizationId"
  58. :genUrlType="1"></generalization-detail>
  59. </div>
  60. </el-dialog>
  61. </div>
  62. </template>
  63. <script>
  64. import searchLayout from "@/components/grid/searchLayout";
  65. import tableList from "@/components/grid/TableList";
  66. import generalizationDetail from "./components/generalizationDetail";
  67. import { mapState } from "vuex";
  68. export default {
  69. name: "generalizationScenarioList", // 泛化场景模板
  70. components: { searchLayout, tableList, generalizationDetail },
  71. data() {
  72. return {
  73. activeName: "2",
  74. searchParams: {
  75. //搜索参数
  76. sceneId: "", // 场景编号
  77. fileName: [], // 功能模块
  78. scenarioRoadType: [], // 道路类型
  79. scenarioResume: "", // 场景简述
  80. share: "0",
  81. // scenarioWeather: [], // 天气
  82. // scenarioTime: "", // 场景发生时刻
  83. },
  84. fileNameList: [],
  85. scenarioRoadTypeList: [],
  86. // scenarioWeatherList: [],
  87. props: {
  88. multiple: true,
  89. label: "dictName",
  90. value: "dictCode",
  91. },
  92. columns: [
  93. //表格列
  94. {
  95. label: "场景编号",
  96. prop: "sceneId",
  97. },
  98. {
  99. label: "场景名称",
  100. prop: "scenarioName",
  101. },
  102. {
  103. label: "功能模块",
  104. prop: "fileName",
  105. },
  106. {
  107. label: "道路类型",
  108. prop: "scenarioRoadType",
  109. },
  110. {
  111. label: "场景简述",
  112. prop: "scenarioResume",
  113. },
  114. {
  115. label: '复杂度',
  116. prop: 'complexity',
  117. },
  118. {
  119. label: '复杂度等级',
  120. prop: 'complexityLevel',
  121. },
  122. {
  123. label: '危险度',
  124. prop: 'risk',
  125. },
  126. {
  127. label: '危险度等级',
  128. prop: 'riskLevel',
  129. },
  130. // {
  131. // label: "场景发生时刻",
  132. // prop: "scenarioTime",
  133. // },
  134. // {
  135. // label: "天气",
  136. // prop: "scenarioWeather",
  137. // },
  138. {
  139. label: "操作",
  140. prop: "cgInfos",
  141. template: true,
  142. },
  143. ],
  144. pagination: {
  145. //分页使用
  146. currentPage: 1,
  147. pageSize: 10,
  148. position: "right",
  149. pageSizes: [10, 30, 50, 100, 200],
  150. layout: "sizes, total, prev, pager, next, jumper",
  151. },
  152. getDataWay: {
  153. //加载表格数据
  154. dataType: "url",
  155. type: "post",
  156. // firstRequest: false,
  157. data: this.$api.sceneLibrary.querySceneGeneralTemplateList,
  158. param: {
  159. share: "0",
  160. },
  161. },
  162. generalizationVisible: false, // 泛化dialog
  163. generalizationId: "", // 泛化详情id
  164. generalizationDiaTitle: "",
  165. };
  166. },
  167. computed: {
  168. ...mapState(["fileHost", "fileUrl"]),
  169. },
  170. methods: {
  171. doSearch() {
  172. this.searchParams.share = this.activeName === "1" ? "1" : "0";
  173. this.refreshList(this.searchParams);
  174. },
  175. //刷新table
  176. refreshList(param) {
  177. param
  178. ? this.$refs["table"].loadData(param)
  179. : this.$refs["table"].loadData();
  180. },
  181. doReset() {
  182. this.searchParams = {
  183. sceneId: "",
  184. fileName: [],
  185. scenarioRoadType: [],
  186. scenarioResume: "",
  187. share: this.activeName === "1" ? "1" : "0",
  188. // scenarioWeather: [],
  189. // scenarioTime: "",
  190. };
  191. this.doSearch();
  192. },
  193. pageControl(data) {
  194. this.activeName = data.name;
  195. this.doSearch();
  196. },
  197. viewRow(row) {
  198. this.generalizationId = row.id;
  199. this.generalizationDiaTitle = "泛化模板- " + (row.sceneId || "");
  200. this.generalizationVisible = true;
  201. },
  202. getFileNameList() {
  203. this.$axios({
  204. method: "post",
  205. url: this.$api.sceneLibrary.queryType,
  206. data: {},
  207. }).then((res) => {
  208. if (res.code == 200 && res.info) {
  209. let arr = [];
  210. res.info.forEach((item, i) => {
  211. arr[i] = {
  212. code: item,
  213. caption: item,
  214. };
  215. });
  216. this.fileNameList = arr;
  217. } else {
  218. this.$message.error(res.message || "获取功能模块列表失败");
  219. }
  220. });
  221. },
  222. // 泛化-取消
  223. generalizationCancel() {
  224. this.generalizationVisible = false;
  225. },
  226. },
  227. async mounted() {
  228. await this.$dicsListsInit({
  229. // scenarioWeatherList: "scenarioWeather",
  230. scenarioRoadTypeList: "scenarioRoadType",
  231. });
  232. this.getFileNameList();
  233. },
  234. };
  235. </script>
  236. <style lang='less' scoped>
  237. @import "./common/util.less";
  238. .generalizationScenarioListPanel {
  239. .inputBox {
  240. .label {
  241. min-width: 90px;
  242. }
  243. }
  244. .btnsPanel {
  245. text-align: right;
  246. }
  247. .generalizationDia {
  248. /deep/ .el-dialog__body {
  249. position: relative;
  250. padding: 20px 60px;
  251. .changeBtn {
  252. position: absolute;
  253. top: 20px;
  254. right: 60px;
  255. }
  256. }
  257. }
  258. }
  259. </style>