particulars.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. <template>
  2. <div class="page-particulars">
  3. <div class="page-particulars-header">
  4. <h2 class="page-particulars-title">项目明细</h2>
  5. <div class="page-particulars-actions">
  6. <button type="button" class="page-particulars-btn is-outline">
  7. 导出Word
  8. </button>
  9. <button type="button" class="page-particulars-btn is-primary">
  10. <icon-svg name="" size="16px" />
  11. <span>新增项目</span>
  12. </button>
  13. </div>
  14. </div>
  15. <div class="page-particulars-panel">
  16. <div class="page-particulars-panel-header">
  17. <div class="page-particulars-panel-left">
  18. <div class="page-particulars-panel-title">项目列表</div>
  19. <div class="page-particulars-legend">
  20. <span
  21. v-for="item in tableLegend"
  22. :key="item.key"
  23. class="page-particulars-legend-item"
  24. >
  25. <i
  26. class="page-particulars-legend-dot"
  27. :class="`is-${item.key}`"
  28. ></i>
  29. {{ item.label }}
  30. </span>
  31. </div>
  32. </div>
  33. <el-select v-model="listFilter" size="small" style="width: 120px">
  34. <el-option
  35. v-for="opt in listFilterOptions"
  36. :key="opt.value"
  37. :label="opt.label"
  38. :value="opt.value"
  39. />
  40. </el-select>
  41. </div>
  42. <div class="page-particulars-table-scroll">
  43. <table class="page-particulars-table">
  44. <thead>
  45. <tr>
  46. <th rowspan="2" class="col-name">项目名称</th>
  47. <th rowspan="2" class="col-risk">环境风险</th>
  48. <th colspan="4" class="group-feasibility group-title">可行性研究</th>
  49. <th colspan="4" class="group-basic group-title">基础设计</th>
  50. <th colspan="4" class="group-detail group-title">详细设计/建造安装</th>
  51. <th rowspan="2" class="col-action">操作</th>
  52. </tr>
  53. <tr>
  54. <th
  55. v-for="col in phaseSubColumns"
  56. :key="`f-${col.key}`"
  57. class="group-feasibility"
  58. >
  59. {{ col.label }}
  60. </th>
  61. <th
  62. v-for="col in phaseSubColumns"
  63. :key="`b-${col.key}`"
  64. class="group-basic"
  65. >
  66. {{ col.label }}
  67. </th>
  68. <th
  69. v-for="col in phaseSubColumns"
  70. :key="`d-${col.key}`"
  71. class="group-detail"
  72. >
  73. {{ col.label }}
  74. </th>
  75. </tr>
  76. </thead>
  77. <tbody>
  78. <template v-for="(row, rowIndex) in tableRows" :key="rowIndex">
  79. <tr v-if="row.isGap" class="page-particulars-gap-row">
  80. <td colspan="15"></td>
  81. </tr>
  82. <tr v-else>
  83. <td
  84. v-if="row.isFirst"
  85. class="col-name"
  86. :rowspan="row.rowspan"
  87. >
  88. {{ row.project.name }}
  89. </td>
  90. <td
  91. v-if="row.isFirst"
  92. class="col-risk"
  93. :rowspan="row.rowspan"
  94. >
  95. {{ row.project.risk }}
  96. </td>
  97. <td>{{ row.feasibility?.name || "—" }}</td>
  98. <td :class="dateClass(row.feasibility?.planStatus)">
  99. {{ formatDate(row.feasibility?.planTime) }}
  100. </td>
  101. <td :class="dateClass(row.feasibility?.actualStatus)">
  102. {{ formatDate(row.feasibility?.actualTime) }}
  103. </td>
  104. <td>{{ row.feasibility?.unit || "—" }}</td>
  105. <td>{{ row.basic?.name || "—" }}</td>
  106. <td :class="dateClass(row.basic?.planStatus)">
  107. {{ formatDate(row.basic?.planTime) }}
  108. </td>
  109. <td :class="dateClass(row.basic?.actualStatus)">
  110. {{ formatDate(row.basic?.actualTime) }}
  111. </td>
  112. <td>{{ row.basic?.unit || "—" }}</td>
  113. <td>{{ row.detail?.name || "—" }}</td>
  114. <td :class="dateClass(row.detail?.planStatus)">
  115. {{ formatDate(row.detail?.planTime) }}
  116. </td>
  117. <td :class="dateClass(row.detail?.actualStatus)">
  118. {{ formatDate(row.detail?.actualTime) }}
  119. </td>
  120. <td>{{ row.detail?.unit || "—" }}</td>
  121. <td
  122. v-if="row.isFirst"
  123. class="col-action"
  124. :rowspan="row.rowspan"
  125. >
  126. <div class="page-particulars-ops">
  127. <button type="button" class="page-particulars-op-btn">
  128. <icon-svg name="edit_blue" size="16px" />
  129. <span>明细</span>
  130. </button>
  131. <button type="button" class="page-particulars-op-btn">
  132. <icon-svg name="edit_blue" size="16px" />
  133. <span>进展</span>
  134. </button>
  135. </div>
  136. </td>
  137. </tr>
  138. </template>
  139. </tbody>
  140. </table>
  141. </div>
  142. </div>
  143. </div>
  144. </template>
  145. <script setup>
  146. import { computed, ref } from "vue";
  147. defineOptions({
  148. name: "ProjectParticulars",
  149. });
  150. const tableLegend = [
  151. { key: "warning", label: "预警" },
  152. { key: "delay", label: "滞后" },
  153. ];
  154. const listFilter = ref("all");
  155. const listFilterOptions = [
  156. { label: "全部", value: "all" },
  157. { label: "预警", value: "warning" },
  158. { label: "滞后", value: "delay" },
  159. ];
  160. const phaseSubColumns = [
  161. { key: "name", label: "报告名称" },
  162. { key: "planTime", label: "计划完成时间" },
  163. { key: "actualTime", label: "实际完成时间" },
  164. { key: "unit", label: "报告编制单位" },
  165. ];
  166. const projectList = [
  167. {
  168. id: 1,
  169. name: "垦利10-1油田开发项目",
  170. risk: "环境风险较大",
  171. feasibility: [
  172. {
  173. name: "环境质量现状调查",
  174. planTime: "2026-03-15",
  175. actualTime: "2026-03-12",
  176. unit: "邦厉有限公司",
  177. },
  178. {
  179. name: "渔业资源现状调查",
  180. planTime: "2026-04-20",
  181. actualTime: "2026-04-22",
  182. actualStatus: "delay",
  183. unit: "邦厉有限公司",
  184. },
  185. {
  186. name: "环境风险预评价",
  187. planTime: "2026-05-10",
  188. actualTime: "2026-05-08",
  189. unit: "邦厉有限公司",
  190. },
  191. {
  192. name: "桌面路由方案",
  193. planTime: "2026-06-01",
  194. actualTime: "2026-05-28",
  195. unit: "邦厉有限公司",
  196. },
  197. {
  198. name: "通航安全影响咨询",
  199. planTime: "2026-07-30",
  200. actualTime: "",
  201. unit: "邦厉有限公司",
  202. },
  203. ],
  204. basic: [
  205. {
  206. name: "安全预评价",
  207. planTime: "2026-03-20",
  208. actualTime: "2026-03-18",
  209. unit: "邦厉有限公司",
  210. },
  211. {
  212. name: "职业病危害预评价",
  213. planTime: "2026-04-15",
  214. actualTime: "2026-04-16",
  215. unit: "邦厉有限公司",
  216. },
  217. {
  218. name: "环境影响报告",
  219. planTime: "2026-05-20",
  220. actualTime: "2026-05-22",
  221. unit: "邦厉有限公司",
  222. },
  223. {
  224. name: "海域使用论证",
  225. planTime: "2026-06-10",
  226. actualTime: "2026-06-12",
  227. unit: "邦厉有限公司",
  228. },
  229. {
  230. name: "海洋倾废论证",
  231. planTime: "2026-07-05",
  232. actualTime: "",
  233. unit: "邦厉有限公司",
  234. },
  235. {
  236. name: "航道通航条件影响评价",
  237. planTime: "2026-08-01",
  238. actualTime: "",
  239. unit: "邦厉有限公司",
  240. },
  241. ],
  242. detail: [
  243. {
  244. name: "详细设计审查",
  245. planTime: "2026-09-01",
  246. actualTime: "",
  247. unit: "邦厉有限公司",
  248. },
  249. {
  250. name: "设备采购",
  251. planTime: "2026-10-01",
  252. actualTime: "",
  253. unit: "邦厉有限公司",
  254. },
  255. {
  256. name: "建造安装",
  257. planTime: "2026-11-01",
  258. actualTime: "",
  259. unit: "邦厉有限公司",
  260. },
  261. {
  262. name: "竣工验收",
  263. planTime: "2026-12-01",
  264. actualTime: "",
  265. unit: "邦厉有限公司",
  266. },
  267. ],
  268. },
  269. {
  270. id: 2,
  271. name: "蓬莱19-3油田开发项目",
  272. risk: "环境风险一般",
  273. feasibility: [
  274. {
  275. name: "环境质量现状调查",
  276. planTime: "2026-08-30",
  277. planStatus: "warning",
  278. actualTime: "",
  279. unit: "海蓝工程咨询",
  280. },
  281. {
  282. name: "环境影响评价",
  283. planTime: "2026-09-15",
  284. actualTime: "",
  285. unit: "海蓝工程咨询",
  286. },
  287. ],
  288. basic: [
  289. {
  290. name: "安全预评价",
  291. planTime: "2026-10-01",
  292. actualTime: "",
  293. unit: "海蓝工程咨询",
  294. },
  295. ],
  296. detail: [
  297. {
  298. name: "详细设计",
  299. planTime: "2026-11-01",
  300. actualTime: "",
  301. unit: "海蓝工程咨询",
  302. },
  303. ],
  304. },
  305. {
  306. id: 3,
  307. name: "中新天津生态城水系提升项目",
  308. risk: "环境风险较小",
  309. feasibility: [
  310. {
  311. name: "可行性研究报告",
  312. planTime: "2026-05-01",
  313. actualTime: "2026-04-28",
  314. unit: "生态城研究院",
  315. },
  316. ],
  317. basic: [
  318. {
  319. name: "基本设计审查",
  320. planTime: "2026-06-01",
  321. actualTime: "2026-06-03",
  322. unit: "生态城研究院",
  323. },
  324. ],
  325. detail: [
  326. {
  327. name: "详细设计/建造安装",
  328. planTime: "2026-08-01",
  329. actualTime: "",
  330. unit: "生态城研究院",
  331. },
  332. ],
  333. },
  334. ];
  335. const getProjectRowCount = (project) =>
  336. Math.max(
  337. project.feasibility?.length || 0,
  338. project.basic?.length || 0,
  339. project.detail?.length || 0,
  340. 1,
  341. );
  342. const tableRows = computed(() => {
  343. const rows = [];
  344. projectList.forEach((project) => {
  345. rows.push({ isGap: true });
  346. const rowspan = getProjectRowCount(project);
  347. for (let i = 0; i < rowspan; i += 1) {
  348. rows.push({
  349. project,
  350. isFirst: i === 0,
  351. rowspan,
  352. feasibility: project.feasibility[i] || null,
  353. basic: project.basic[i] || null,
  354. detail: project.detail[i] || null,
  355. });
  356. }
  357. });
  358. return rows;
  359. });
  360. const formatDate = (value) => value || "—";
  361. const dateClass = (status) => {
  362. if (status === "warning") return "is-warning";
  363. if (status === "delay") return "is-delay";
  364. return "";
  365. };
  366. </script>
  367. <style scoped lang="scss">
  368. .page-particulars {
  369. box-sizing: border-box;
  370. display: flex;
  371. flex-direction: column;
  372. gap: 16px;
  373. width: 100%;
  374. min-height: 100%;
  375. padding: 24px;
  376. background: #f3f7fc;
  377. }
  378. .page-particulars-header {
  379. display: flex;
  380. align-items: center;
  381. justify-content: space-between;
  382. gap: 16px;
  383. }
  384. .page-particulars-title {
  385. margin: 0;
  386. font-family: PingFang SC, PingFang SC;
  387. font-weight: 600;
  388. font-size: 18px;
  389. color: #16213a;
  390. line-height: 25px;
  391. text-align: left;
  392. }
  393. .page-particulars-actions {
  394. display: flex;
  395. align-items: center;
  396. gap: 24px;
  397. }
  398. .page-particulars-btn {
  399. display: inline-flex;
  400. align-items: center;
  401. padding: 6px 16px;
  402. font-family: PingFang SC, PingFang SC;
  403. font-weight: 500;
  404. font-size: 14px;
  405. line-height: 20px;
  406. text-align: left;
  407. border-radius: 2px;
  408. box-shadow: 0px 4px 10px 0px rgba(35, 130, 231, 0.2);
  409. cursor: pointer;
  410. &.is-outline {
  411. color: #2382e7;
  412. background: #ffffff;
  413. border: 1px solid #2382e7;
  414. &:hover {
  415. border-color: #2382e7;
  416. }
  417. }
  418. &.is-primary {
  419. gap: 4px;
  420. color: #ffffff;
  421. background: #2382e7;
  422. border: 1px solid #2382e7;
  423. &:hover {
  424. border-color: #2382e7;
  425. }
  426. }
  427. }
  428. .page-particulars-panel {
  429. box-sizing: border-box;
  430. display: flex;
  431. flex-direction: column;
  432. gap: 14px;
  433. padding: 16px;
  434. background: #ffffff;
  435. border-radius: 4px;
  436. }
  437. .page-particulars-panel-header {
  438. display: flex;
  439. align-items: center;
  440. justify-content: space-between;
  441. gap: 16px;
  442. }
  443. .page-particulars-panel-left {
  444. display: flex;
  445. align-items: center;
  446. gap: 16px;
  447. min-width: 0;
  448. }
  449. .page-particulars-panel-title {
  450. position: relative;
  451. padding-left: 10px;
  452. font-family: PingFang SC, PingFang SC;
  453. font-weight: 600;
  454. font-size: 14px;
  455. color: #16213a;
  456. line-height: 20px;
  457. &::before {
  458. position: absolute;
  459. top: 50%;
  460. left: 0;
  461. width: 4px;
  462. height: 14px;
  463. background: #2382e7;
  464. border-radius: 0 2px 2px 0;
  465. transform: translateY(-50%);
  466. content: "";
  467. }
  468. }
  469. .page-particulars-legend {
  470. display: flex;
  471. align-items: center;
  472. gap: 12px;
  473. }
  474. .page-particulars-legend-item {
  475. display: inline-flex;
  476. align-items: center;
  477. gap: 4px;
  478. font-size: 14px;
  479. color: #9aa5b8;
  480. line-height: 20px;
  481. white-space: nowrap;
  482. }
  483. .page-particulars-legend-dot {
  484. width: 6px;
  485. height: 6px;
  486. border-radius: 50%;
  487. background: #d0d5dd;
  488. &.is-warning {
  489. background: #ff8e38;
  490. }
  491. &.is-delay {
  492. background: #f54848;
  493. }
  494. }
  495. .page-particulars-table-scroll {
  496. width: 100%;
  497. overflow-x: auto;
  498. }
  499. .page-particulars-table {
  500. width: 100%;
  501. min-width: 1400px;
  502. border-collapse: separate;
  503. border-spacing: 0;
  504. table-layout: fixed;
  505. font-size: 13px;
  506. color: #16213a;
  507. th,
  508. td {
  509. box-sizing: border-box;
  510. padding: 10px 12px;
  511. border: 1px solid #dfe3e7;
  512. text-align: left;
  513. vertical-align: middle;
  514. word-break: break-word;
  515. background: #ffffff;
  516. }
  517. th {
  518. font-family: PingFang SC, PingFang SC;
  519. font-weight: 400;
  520. font-size: 14px;
  521. color: #58657c;
  522. background: #edf1f6;
  523. white-space: nowrap;
  524. word-break: keep-all;
  525. }
  526. .group-feasibility {
  527. background: #e8f3fc;
  528. }
  529. .group-basic {
  530. background: #e9f7ef;
  531. }
  532. .group-detail {
  533. background: #eef0fb;
  534. }
  535. .group-title {
  536. text-align: center;
  537. }
  538. .col-name,
  539. .col-action {
  540. position: sticky;
  541. z-index: 2;
  542. }
  543. th.col-name,
  544. th.col-action {
  545. z-index: 4;
  546. background: #edf1f6;
  547. }
  548. td.col-name,
  549. td.col-action {
  550. background: #ffffff;
  551. }
  552. .col-name {
  553. left: 0;
  554. width: 140px;
  555. min-width: 140px;
  556. box-shadow: 2px 0 6px rgba(22, 33, 58, 0.08);
  557. }
  558. .col-risk {
  559. width: 140px;
  560. min-width: 140px;
  561. white-space: nowrap;
  562. }
  563. .col-action {
  564. right: 0;
  565. width: 100px;
  566. min-width: 100px;
  567. box-shadow: -2px 0 6px rgba(22, 33, 58, 0.08);
  568. }
  569. td.is-warning {
  570. color: #ff8e38;
  571. }
  572. td.is-delay {
  573. color: #f54848;
  574. }
  575. .page-particulars-gap-row td {
  576. height: 16px;
  577. padding: 0;
  578. border: none;
  579. background: transparent;
  580. }
  581. }
  582. .page-particulars-ops {
  583. display: flex;
  584. flex-direction: column;
  585. align-items: flex-start;
  586. gap: 8px;
  587. }
  588. .page-particulars-op-btn {
  589. display: inline-flex;
  590. align-items: center;
  591. gap: 4px;
  592. padding: 0;
  593. font-family: PingFang SC, PingFang SC;
  594. font-size: 13px;
  595. color: #2382e7;
  596. line-height: 18px;
  597. background: transparent;
  598. border: none;
  599. cursor: pointer;
  600. &:hover {
  601. border-color: transparent;
  602. }
  603. }
  604. </style>