projectInfo.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <template>
  2. <div class="projectInfoPanel">
  3. <div class="flexBox topPanel">
  4. <div class="box panel">
  5. <div class="titlePanel">
  6. <div class="titlePanelBor">基本信息</div>
  7. </div>
  8. <div class="boxContent">
  9. <div class="info">
  10. <span>项目ID:</span>
  11. <b>{{ info.projectId }}</b>
  12. </div>
  13. <div class="info">
  14. <span>项目名称:</span>
  15. <b>{{ info.projectName }}</b>
  16. </div>
  17. <div class="info">
  18. <span>项目描述:</span>
  19. <b>{{ info.projectDescribe }}</b>
  20. </div>
  21. <div class="info">
  22. <span>创建时间:</span>
  23. <b>{{ info.startTime }}</b>
  24. </div>
  25. <div class="info">
  26. <span>完成时间:</span>
  27. <b>{{ info.finishTime }}</b>
  28. </div>
  29. <div class="info">
  30. <span>完成进度:</span>
  31. <b>{{ info.nowRunStateName }}</b>
  32. </div>
  33. <div class="info">
  34. <span>结果等级:</span>
  35. <b>{{ info.evaluationLevel }}</b>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="box panel boxB">
  40. <div class="titlePanel">
  41. <div class="titlePanelBor">算法配置</div>
  42. </div>
  43. <div class="boxContent">
  44. <div class="info">
  45. <span>算法名称:</span>
  46. <b>{{ info.algorithmName }}</b>
  47. </div>
  48. <div class="info">
  49. <span>算法描述:</span>
  50. <b>{{ info.algorithmDescribe }}</b>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="box panel">
  55. <div class="titlePanel">
  56. <div class="titlePanelBor">测试报告</div>
  57. <i
  58. class="el-icon-download download"
  59. v-bind:class="{ cursor: info.nowRunState === '30' }"
  60. @click="toReport"
  61. ></i>
  62. </div>
  63. <div class="boxContent boxContentC">
  64. <div class="cbox" @click="toReport">
  65. <img
  66. :src="downImgSrc"
  67. width="100%"
  68. v-bind:class="{ cursor: info.nowRunState === '30' }"
  69. />
  70. <div
  71. v-bind:class="{ cursor: info.nowRunState === '30' }"
  72. >
  73. 仿真云测试报告
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="centerPanel panel">
  80. <div class="titlePanel">
  81. <div class="titlePanelBor">车辆配置</div>
  82. </div>
  83. <div class="box">
  84. <div class="boxContentA">
  85. <div class="info">
  86. <span>车辆名称:</span>
  87. <b>{{ info.vehicleName }}</b>
  88. </div>
  89. <div class="info">
  90. <span>车辆描述:</span>
  91. <b>{{ info.vehicleDescribe }}</b>
  92. </div>
  93. </div>
  94. <div class="boxContentB">
  95. <div class="list">
  96. <handle-config-list
  97. :showBtns="false"
  98. :curOne="curOne"
  99. :configList="configList"
  100. @curItem="curItem"
  101. :needHighline="false"
  102. ></handle-config-list>
  103. </div>
  104. <div class="canvasBox">
  105. <!-- <img
  106. src="../../assets/common/image/others/2.png"
  107. width="100%"
  108. /> -->
  109. <canvas-sensor
  110. v-if="modelImgSrc"
  111. :modelImgSrc="modelImgSrc"
  112. :configList="configList"
  113. ></canvas-sensor>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="bottomPanel panel">
  119. <div class="titlePanel">
  120. <div class="titlePanelBor">任务信息</div>
  121. </div>
  122. <div class="box">
  123. <div class="boxContentA">
  124. <div class="chart">
  125. <div class="pieTitle">任务运行状态统计:</div>
  126. <div class="pie">
  127. <pie-chart
  128. id="projectInfoPieA"
  129. :stateList="stateList"
  130. stateName="stateName"
  131. ></pie-chart>
  132. </div>
  133. </div>
  134. <div class="chart">
  135. <div class="pieTitle">结果动态统计:</div>
  136. <div class="pie">
  137. <pie-chart
  138. id="projectInfoPieB"
  139. :stateList="resultList"
  140. stateName="resultName"
  141. ></pie-chart>
  142. </div>
  143. </div>
  144. </div>
  145. <div>
  146. <tableList
  147. ref="table"
  148. style="margin: 0 30px"
  149. :columns="columns"
  150. :getDataWay="getDataWay"
  151. :pagination="pagination"
  152. >
  153. <el-table-column
  154. label="操作"
  155. slot="cgInfos"
  156. align="center"
  157. >
  158. <template v-slot="scope">
  159. <i
  160. @click="viewRow(scope.row)"
  161. class="el-icon-view elIcon"
  162. title="查看"
  163. ></i>
  164. </template>
  165. </el-table-column>
  166. </tableList>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </template>
  172. <script>
  173. import handleConfigList from "../modelLibrary/components/handleConfigList.vue";
  174. import tableList from "@/components/grid/TableList";
  175. import pieChart from "@/components/echarts/pieChart";
  176. import canvasSensor from "./components/canvasProjectInfo.vue";
  177. import { mapState } from "vuex";
  178. export default {
  179. name: "projectInfo", // 项目详情
  180. components: { handleConfigList, tableList, pieChart, canvasSensor },
  181. data() {
  182. return {
  183. id: "",
  184. info: {},
  185. columns: [
  186. {
  187. label: "ID",
  188. prop: "id",
  189. },
  190. {
  191. label: "场景名称",
  192. prop: "sceneName",
  193. },
  194. {
  195. label: "运行开始时间",
  196. prop: "runStartTimeFmt",
  197. },
  198. {
  199. label: "运行结束时间",
  200. prop: "runEndTimeFmt",
  201. },
  202. {
  203. label: "运行状态",
  204. prop: "runState",
  205. },
  206. {
  207. label: "运行结果",
  208. prop: "runResult",
  209. },
  210. {
  211. label: "操作",
  212. prop: "cgInfos",
  213. template: true,
  214. },
  215. ],
  216. pagination: {
  217. //分页使用
  218. currentPage: 1,
  219. pageSize: 10,
  220. position: "right",
  221. pageSizes: [10, 30, 50, 100, 200],
  222. layout: "sizes, total, prev, pager, next, jumper",
  223. },
  224. getDataWay: {
  225. //加载表格数据
  226. dataType: "url",
  227. type: "post",
  228. // firstRequest: false,
  229. data: this.$api.workManagement.selectProjectTaskList,
  230. param: {
  231. id: this.$route.query.id,
  232. },
  233. },
  234. // 传感器对象集合
  235. configList: {
  236. camera: [],
  237. ogt: [],
  238. lidar: [],
  239. gps: [],
  240. },
  241. // 用于当前选中项的展示
  242. curOne: {
  243. name: "",
  244. index: -1,
  245. },
  246. downImgSrc: require("@/assets/common/image/others/noDoc.png"),
  247. // modelImgSrc: require("@/assets/common/image/others/carTopView.png"), // 车辆图片地址
  248. modelImgSrc: "", // 车辆图片地址
  249. stateList: [], // 任务运行状态统计数据
  250. resultList: [],
  251. };
  252. },
  253. computed: {
  254. ...mapState(["fileHost", "fileUrl"]),
  255. },
  256. methods: {
  257. viewRow() {
  258. this.$router.push({ path: "/taskInfo" });
  259. },
  260. toReport() {
  261. if (this.info.nowRunState === "30") {
  262. this.$router.push({
  263. path: "/evaluationReport",
  264. query: { id: this.id },
  265. });
  266. }
  267. },
  268. curItem(item) {
  269. this.curOne = item;
  270. },
  271. getImgUrl(addr) {
  272. let url = "";
  273. if (process.env.VUE_APP_IS_DEV == "true") {
  274. url = this.fileHost + this.fileUrl;
  275. } else {
  276. url = this.fileUrl;
  277. }
  278. let token = localStorage.getItem("Authorization").split(" ")[1];
  279. let src = `${url}?objectName=${addr}&access_token=${token}`;
  280. return src;
  281. },
  282. },
  283. mounted() {
  284. if (this.$route.query.id) {
  285. this.id = this.$route.query.id;
  286. if (this.id) {
  287. this.$axios({
  288. method: "post",
  289. url: this.$api.workManagement.selectProjectDetailsById,
  290. data: {
  291. id: this.id,
  292. },
  293. }).then((res) => {
  294. if (res.code == 200 && res.info) {
  295. this.info = res.info;
  296. this.configList.camera =
  297. res.info.sensorCameraList || [];
  298. this.configList.ogt = res.info.sensorOgtList || [];
  299. this.configList.lidar = res.info.sensorLidarList || [];
  300. this.configList.gps = res.info.sensorGpsList || [];
  301. this.modelImgSrc = this.getImgUrl(
  302. res.info.vehicleImage
  303. );
  304. if (this.info.nowRunState === "30") {
  305. this.downImgSrc = require("@/assets/common/image/others/hasDoc.png");
  306. } else {
  307. this.downImgSrc = require("@/assets/common/image/others/noDoc.png");
  308. }
  309. this.stateList = res.info.stateList;
  310. this.resultList = res.info.resultList;
  311. } else {
  312. this.$message.error(res.message || "获取信息失败");
  313. }
  314. });
  315. }
  316. }
  317. },
  318. };
  319. </script>
  320. <style lang='less' scoped>
  321. .projectInfoPanel {
  322. padding: 18px;
  323. .panel {
  324. border: 1px solid #dfdfdf;
  325. padding: 12px 24px;
  326. box-shadow: 0 4px 9px #dcdcdc;
  327. border-radius: 3px;
  328. }
  329. .titlePanel {
  330. padding-bottom: 6px;
  331. border-bottom: 1px dotted @gray;
  332. }
  333. .topPanel {
  334. .box {
  335. flex: 1;
  336. }
  337. .boxB {
  338. margin: 0 18px;
  339. }
  340. .titlePanel {
  341. position: relative;
  342. .download {
  343. position: absolute;
  344. top: 0;
  345. right: 0;
  346. color: @themeColor;
  347. font-size: 18px;
  348. // cursor: pointer;
  349. }
  350. }
  351. .boxContent {
  352. padding: 18px 15px;
  353. }
  354. .info {
  355. display: flex;
  356. margin-bottom: 12px;
  357. span {
  358. display: block;
  359. width: 75px;
  360. color: @gray;
  361. }
  362. b {
  363. flex: 1;
  364. font-weight: normal;
  365. }
  366. }
  367. .boxContentC {
  368. display: flex;
  369. justify-content: center;
  370. align-items: center;
  371. height: 100%;
  372. .cbox {
  373. text-align: center;
  374. color: @themeColor;
  375. // cursor: pointer;
  376. > div {
  377. margin-top: 18px;
  378. }
  379. }
  380. }
  381. }
  382. .centerPanel {
  383. margin: 25px 0;
  384. .boxContentA {
  385. padding: 18px 15px;
  386. .info {
  387. display: flex;
  388. margin-bottom: 12px;
  389. span {
  390. display: block;
  391. width: 75px;
  392. color: @gray;
  393. }
  394. b {
  395. flex: 1;
  396. font-weight: normal;
  397. }
  398. }
  399. }
  400. .boxContentB {
  401. display: flex;
  402. justify-content: space-around;
  403. padding-top: 30px;
  404. .canvasBox {
  405. flex: 1;
  406. }
  407. }
  408. }
  409. .bottomPanel {
  410. .boxContentA {
  411. display: flex;
  412. justify-content: space-around;
  413. padding: 45px 0;
  414. }
  415. .chart {
  416. width: 50%;
  417. .pieTitle {
  418. padding: 0 0 30px;
  419. text-align: center;
  420. font-size: 16px;
  421. font-weight: bold;
  422. }
  423. .pie {
  424. height: calc(40vh);
  425. }
  426. }
  427. }
  428. }
  429. </style>