evaluationReport.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <div class="evaluationReportPanel">
  3. <h1>评价报告</h1>
  4. <div class="evaluationInfo">
  5. <div class="evaluationBox">
  6. <div class="box">
  7. <span>算法名称:</span>
  8. <b>{{ info.algorithmName }}</b>
  9. </div>
  10. <div class="box">
  11. <span>算法得分:</span>
  12. <b>{{ info.algorithmScore }}</b>
  13. </div>
  14. <div class="box">
  15. <span>测试等级:</span>
  16. <b>{{ info.evaluationLevel }}</b>
  17. </div>
  18. </div>
  19. <div class="desBox">
  20. <span>算法描述:</span>
  21. <b>{{ info.algorithmDescribe }}</b>
  22. </div>
  23. <div class="evaBox">
  24. <span>算法简评:</span>
  25. <b>{{ info.algorithmEvaluation }}</b>
  26. </div>
  27. </div>
  28. <div class="tableBox tableBoxA">
  29. <div class="title">测试得分表</div>
  30. <tableList :columns="columns" :getDataWay="getDataWay"> </tableList>
  31. </div>
  32. <div class="tableBox tableBoxB">
  33. <div class="title">评价等级</div>
  34. <tableList
  35. :columns="columnsA"
  36. :getDataWay="getDataWayA"
  37. class="colorfulTable"
  38. >
  39. </tableList>
  40. </div>
  41. <div class="tableBox tableBoxC">
  42. <div class="title">算法测试评分细则</div>
  43. <tableList
  44. :columns="columnsB"
  45. :getDataWay="getDataWayB"
  46. :span-method="arraySpanMethod"
  47. >
  48. </tableList>
  49. </div>
  50. <div class="tableBox tableBoxD">
  51. <div class="title">详情得分情况</div>
  52. <tableList
  53. :columns="columnsC"
  54. :getDataWay="getDataWayC"
  55. :row-class-name="errRow"
  56. >
  57. </tableList>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import tableList from "@/components/grid/TableList";
  63. export default {
  64. name: "evaluationReport", // 评价报告
  65. components: { tableList },
  66. data() {
  67. return {
  68. id: "",
  69. columns: [
  70. {
  71. label: "测试项目",
  72. prop: "projectName",
  73. },
  74. {
  75. label: "场景数量",
  76. prop: "sceneNum",
  77. },
  78. {
  79. label: "测试权重%",
  80. prop: "weight",
  81. },
  82. {
  83. label: "测试得分",
  84. prop: "score",
  85. },
  86. {
  87. label: "得分率%",
  88. prop: "scoreRatio",
  89. },
  90. ],
  91. pagination: {
  92. //分页使用
  93. currentPage: 1,
  94. pageSize: 10,
  95. position: "right",
  96. pageSizes: [10, 30, 50, 100, 200],
  97. layout: "sizes, total, prev, pager, next, jumper",
  98. },
  99. getDataWay: {
  100. //加载表格数据
  101. dataType: "data",
  102. type: "post",
  103. firstRequest: false,
  104. data: [],
  105. param: {},
  106. },
  107. columnsA: [
  108. {
  109. label: "测试项目",
  110. prop: "name",
  111. },
  112. {
  113. label: "90<总分<100",
  114. prop: "levelA",
  115. },
  116. {
  117. label: "80<总分<90",
  118. prop: "levelB",
  119. },
  120. {
  121. label: "70<总分<80",
  122. prop: "levelC",
  123. },
  124. {
  125. label: "0<总分<70",
  126. prop: "levelD",
  127. },
  128. ],
  129. getDataWayA: {
  130. //加载表格数据
  131. dataType: "data",
  132. type: "post",
  133. firstRequest: false,
  134. data: [
  135. {
  136. index: 1,
  137. name: "评价等级",
  138. levelA: "优秀(G)",
  139. levelB: "良好(A)",
  140. levelC: "一般(M)",
  141. levelD: "较差(P)",
  142. },
  143. {
  144. index: 2,
  145. name: "评价等级",
  146. levelA: "++++++",
  147. levelB: "+++++",
  148. levelC: "++++",
  149. levelD: "+++",
  150. },
  151. ],
  152. param: {},
  153. },
  154. columnsB: [],
  155. getDataWayB: {
  156. //加载表格数据
  157. dataType: "data",
  158. type: "post",
  159. data: [],
  160. param: {},
  161. },
  162. columnsC: [],
  163. getDataWayC: {
  164. //加载表格数据
  165. dataType: "data",
  166. type: "post",
  167. data: [],
  168. param: {},
  169. },
  170. info: {},
  171. sublistNameObj1: {}, // 存储一级指标名称对应的次数
  172. sublistNameObj2: {}, // 存储二级指标名称对应的次数
  173. sublistNameObj3: {}, // 存储三级指标名称对应的次数
  174. sublistNameObj4: {}, // 存储四级指标名称对应的次数
  175. sublistNameObj5: {}, // 存储五级指标名称对应的次数
  176. sublistNameObj6: {}, // 存储六级指标名称对应的次数
  177. subIndexArr1: [], // 存储一级指标名称第一次出现对应的下标
  178. subIndexArr2: [], // 存储二级指标名称第一次出现对应的下标
  179. subIndexArr3: [], // 存储三级指标名称第一次出现对应的下标
  180. subIndexArr4: [], // 存储四级指标名称第一次出现对应的下标
  181. subIndexArr5: [], // 存储五级指标名称第一次出现对应的下标
  182. subIndexArr6: [], // 存储六级指标名称第一次出现对应的下标
  183. };
  184. },
  185. computed: {},
  186. methods: {
  187. arraySpanMethod({ row, column, rowIndex, columnIndex }) {
  188. if (columnIndex === 0 || columnIndex === this.columnsB.length - 1) {
  189. if (this.subIndexArr1.includes(rowIndex)) {
  190. return [this.sublistNameObj1[row.sublistName1], 1];
  191. } else {
  192. return [0, 0];
  193. }
  194. } else if (columnIndex === 1) {
  195. if (this.subIndexArr2.includes(rowIndex)) {
  196. return [this.sublistNameObj2[row.sublistName2], 1];
  197. } else {
  198. if (row.sublistName2) {
  199. return [0, 0];
  200. } else {
  201. return [1, 1];
  202. }
  203. }
  204. } else if (columnIndex === 2) {
  205. if (this.subIndexArr3.includes(rowIndex)) {
  206. return [this.sublistNameObj3[row.sublistName3], 1];
  207. } else {
  208. if (row.sublistName3) {
  209. return [0, 0];
  210. } else {
  211. return [1, 1];
  212. }
  213. }
  214. } else if (columnIndex === 3) {
  215. if (this.subIndexArr4.includes(rowIndex)) {
  216. return [this.sublistNameObj4[row.sublistName4], 1];
  217. } else {
  218. if (row.sublistName4) {
  219. return [0, 0];
  220. } else {
  221. return [1, 1];
  222. }
  223. }
  224. } else if (columnIndex === 4) {
  225. if (this.subIndexArr5.includes(rowIndex)) {
  226. return [this.sublistNameObj5[row.sublistName5], 1];
  227. } else {
  228. if (row.sublistName5) {
  229. return [0, 0];
  230. } else {
  231. return [1, 1];
  232. }
  233. }
  234. } else if (columnIndex === 5) {
  235. if (this.subIndexArr6.includes(rowIndex)) {
  236. return [this.sublistNameObj6[row.sublistName6], 1];
  237. } else {
  238. if (row.sublistName6) {
  239. return [0, 0];
  240. } else {
  241. return [1, 1];
  242. }
  243. }
  244. }
  245. },
  246. errRow({ row, rowIndex }) {
  247. if (row.runState === "Failed") {
  248. return "errColor";
  249. }
  250. },
  251. // 处理数据,通关于配合表格进行合并单元行
  252. dataHandle(data) {
  253. let arr = data;
  254. let lastRowSublistName1 = "";
  255. let lastRowSublistName2 = "";
  256. let lastRowSublistName3 = "";
  257. let lastRowSublistName4 = "";
  258. let lastRowSublistName5 = "";
  259. let lastRowSublistName6 = "";
  260. let sublistNameObj1 = {};
  261. let sublistNameObj2 = {};
  262. let sublistNameObj3 = {};
  263. let sublistNameObj4 = {};
  264. let sublistNameObj5 = {};
  265. let sublistNameObj6 = {};
  266. arr.forEach((item, i) => {
  267. let sublistName1 = item.sublistName1;
  268. if (sublistName1 === lastRowSublistName1) {
  269. sublistNameObj1[sublistName1]++;
  270. } else {
  271. lastRowSublistName1 = sublistName1;
  272. this.subIndexArr1.push(i);
  273. sublistNameObj1[sublistName1] = 1;
  274. }
  275. if (item.sublistName2) {
  276. // 一级后的指标名称可能不存在
  277. let sublistName2 = item.sublistName2;
  278. if (sublistName2 === lastRowSublistName2) {
  279. sublistNameObj2[sublistName2]++;
  280. } else {
  281. lastRowSublistName2 = sublistName2;
  282. this.subIndexArr2.push(i);
  283. sublistNameObj2[sublistName2] = 1;
  284. }
  285. }
  286. if (item.sublistName3) {
  287. let sublistName3 = item.sublistName3;
  288. if (sublistName3 === lastRowSublistName3) {
  289. sublistNameObj3[sublistName3]++;
  290. } else {
  291. lastRowSublistName3 = sublistName3;
  292. this.subIndexArr3.push(i);
  293. sublistNameObj3[sublistName3] = 1;
  294. }
  295. }
  296. if (item.sublistName4) {
  297. let sublistName4 = item.sublistName4;
  298. if (sublistName4 === lastRowSublistName4) {
  299. sublistNameObj4[sublistName4]++;
  300. } else {
  301. lastRowSublistName4 = sublistName4;
  302. this.subIndexArr4.push(i);
  303. sublistNameObj4[sublistName4] = 1;
  304. }
  305. }
  306. if (item.sublistName5) {
  307. let sublistName5 = item.sublistName5;
  308. if (sublistName5 === lastRowSublistName5) {
  309. sublistNameObj5[sublistName5]++;
  310. } else {
  311. lastRowSublistName5 = sublistName5;
  312. this.subIndexArr5.push(i);
  313. sublistNameObj5[sublistName5] = 1;
  314. }
  315. }
  316. if (item.sublistName6) {
  317. let sublistName6 = item.sublistName6;
  318. if (sublistName6 === lastRowSublistName6) {
  319. sublistNameObj6[sublistName6]++;
  320. } else {
  321. lastRowSublistName6 = sublistName6;
  322. this.subIndexArr6.push(i);
  323. sublistNameObj6[sublistName6] = 1;
  324. }
  325. }
  326. });
  327. this.sublistNameObj1 = sublistNameObj1;
  328. this.sublistNameObj2 = sublistNameObj2;
  329. this.sublistNameObj3 = sublistNameObj3;
  330. this.sublistNameObj4 = sublistNameObj4;
  331. this.sublistNameObj5 = sublistNameObj5;
  332. this.sublistNameObj6 = sublistNameObj6;
  333. },
  334. },
  335. mounted() {
  336. if (this.$route.query.id) {
  337. this.id = this.$route.query.id;
  338. if (this.id) {
  339. this.$axios({
  340. method: "post",
  341. url: this.$api.workManagement.selectProjectReportById,
  342. data: {
  343. id: this.id,
  344. },
  345. }).then((res) => {
  346. if (res.code == 200 && res.info) {
  347. this.info = res.info;
  348. this.getDataWay.data = res.info.algorithmScoreList;
  349. this.columnsB = res.info.subListScoreLiTitle;
  350. this.dataHandle(res.info.subListScoreLi);
  351. this.getDataWayB.data = res.info.subListScoreLi;
  352. this.columnsC = res.info.sceneScoreLiTitle;
  353. this.getDataWayC.data = res.info.sceneScoreLi;
  354. } else {
  355. this.$message.error(res.message || "获取信息失败");
  356. }
  357. });
  358. }
  359. }
  360. },
  361. };
  362. </script>
  363. <style lang='less' scoped>
  364. .evaluationReportPanel {
  365. min-width: 900px;
  366. width: 60%;
  367. margin: 0 auto;
  368. h1 {
  369. padding: 40px 0 60px;
  370. font-size: 36px;
  371. color: @themeColor;
  372. text-align: center;
  373. }
  374. .evaluationInfo {
  375. font-size: 16px;
  376. span,
  377. b {
  378. display: block;
  379. font-weight: normal;
  380. }
  381. span {
  382. width: 80px;
  383. color: @gray;
  384. }
  385. b {
  386. flex: 1;
  387. }
  388. }
  389. .evaluationBox {
  390. display: flex;
  391. justify-content: space-between;
  392. .box {
  393. display: flex;
  394. width: 30%;
  395. span {
  396. padding-right: 10px;
  397. // color: @color;
  398. }
  399. b {
  400. padding-bottom: 3px;
  401. border-bottom: 1px solid @gray;
  402. text-align: center;
  403. }
  404. }
  405. }
  406. .desBox,
  407. .evaBox {
  408. display: flex;
  409. b {
  410. padding: 12px;
  411. border: 1px solid @gray;
  412. }
  413. }
  414. .desBox {
  415. padding: 40px 0;
  416. }
  417. .tableBox {
  418. padding: 60px 0;
  419. .title {
  420. padding-bottom: 20px;
  421. font-size: 18px;
  422. text-align: center;
  423. font-weight: bold;
  424. }
  425. }
  426. .tableBoxB,
  427. .tableBoxC,
  428. .tableBoxD {
  429. padding: 0 0 60px;
  430. }
  431. .colorfulTable {
  432. /deep/ .el-table__body {
  433. .el-table__row:nth-child(2) {
  434. td:nth-child(2) {
  435. background-color: #c1db69;
  436. }
  437. td:nth-child(3) {
  438. background-color: #faf54a;
  439. }
  440. td:nth-child(4) {
  441. background-color: #ff9d33;
  442. }
  443. td:last-child {
  444. background-color: #f56c6c;
  445. }
  446. }
  447. }
  448. }
  449. /deep/ .el-table .errColor td {
  450. color: red;
  451. }
  452. }
  453. </style>