| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659 |
- <template>
- <div class="page-particulars">
- <div class="page-particulars-header">
- <h2 class="page-particulars-title">项目明细</h2>
- <div class="page-particulars-actions">
- <button type="button" class="page-particulars-btn is-outline">
- 导出Word
- </button>
- <button type="button" class="page-particulars-btn is-primary">
- <icon-svg name="" size="16px" />
- <span>新增项目</span>
- </button>
- </div>
- </div>
- <div class="page-particulars-panel">
- <div class="page-particulars-panel-header">
- <div class="page-particulars-panel-left">
- <div class="page-particulars-panel-title">项目列表</div>
- <div class="page-particulars-legend">
- <span
- v-for="item in tableLegend"
- :key="item.key"
- class="page-particulars-legend-item"
- >
- <i
- class="page-particulars-legend-dot"
- :class="`is-${item.key}`"
- ></i>
- {{ item.label }}
- </span>
- </div>
- </div>
- <el-select v-model="listFilter" size="small" style="width: 120px">
- <el-option
- v-for="opt in listFilterOptions"
- :key="opt.value"
- :label="opt.label"
- :value="opt.value"
- />
- </el-select>
- </div>
- <div class="page-particulars-table-scroll">
- <table class="page-particulars-table">
- <thead>
- <tr>
- <th rowspan="2" class="col-name">项目名称</th>
- <th rowspan="2" class="col-risk">环境风险</th>
- <th colspan="4" class="group-feasibility group-title">可行性研究</th>
- <th colspan="4" class="group-basic group-title">基础设计</th>
- <th colspan="4" class="group-detail group-title">详细设计/建造安装</th>
- <th rowspan="2" class="col-action">操作</th>
- </tr>
- <tr>
- <th
- v-for="col in phaseSubColumns"
- :key="`f-${col.key}`"
- class="group-feasibility"
- >
- {{ col.label }}
- </th>
- <th
- v-for="col in phaseSubColumns"
- :key="`b-${col.key}`"
- class="group-basic"
- >
- {{ col.label }}
- </th>
- <th
- v-for="col in phaseSubColumns"
- :key="`d-${col.key}`"
- class="group-detail"
- >
- {{ col.label }}
- </th>
- </tr>
- </thead>
- <tbody>
- <template v-for="(row, rowIndex) in tableRows" :key="rowIndex">
- <tr v-if="row.isGap" class="page-particulars-gap-row">
- <td colspan="15"></td>
- </tr>
- <tr v-else>
- <td
- v-if="row.isFirst"
- class="col-name"
- :rowspan="row.rowspan"
- >
- {{ row.project.name }}
- </td>
- <td
- v-if="row.isFirst"
- class="col-risk"
- :rowspan="row.rowspan"
- >
- {{ row.project.risk }}
- </td>
- <td>{{ row.feasibility?.name || "—" }}</td>
- <td :class="dateClass(row.feasibility?.planStatus)">
- {{ formatDate(row.feasibility?.planTime) }}
- </td>
- <td :class="dateClass(row.feasibility?.actualStatus)">
- {{ formatDate(row.feasibility?.actualTime) }}
- </td>
- <td>{{ row.feasibility?.unit || "—" }}</td>
- <td>{{ row.basic?.name || "—" }}</td>
- <td :class="dateClass(row.basic?.planStatus)">
- {{ formatDate(row.basic?.planTime) }}
- </td>
- <td :class="dateClass(row.basic?.actualStatus)">
- {{ formatDate(row.basic?.actualTime) }}
- </td>
- <td>{{ row.basic?.unit || "—" }}</td>
- <td>{{ row.detail?.name || "—" }}</td>
- <td :class="dateClass(row.detail?.planStatus)">
- {{ formatDate(row.detail?.planTime) }}
- </td>
- <td :class="dateClass(row.detail?.actualStatus)">
- {{ formatDate(row.detail?.actualTime) }}
- </td>
- <td>{{ row.detail?.unit || "—" }}</td>
- <td
- v-if="row.isFirst"
- class="col-action"
- :rowspan="row.rowspan"
- >
- <div class="page-particulars-ops">
- <button type="button" class="page-particulars-op-btn">
- <icon-svg name="edit_blue" size="16px" />
- <span>明细</span>
- </button>
- <button type="button" class="page-particulars-op-btn">
- <icon-svg name="edit_blue" size="16px" />
- <span>进展</span>
- </button>
- </div>
- </td>
- </tr>
- </template>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import { computed, ref } from "vue";
- defineOptions({
- name: "ProjectParticulars",
- });
- const tableLegend = [
- { key: "warning", label: "预警" },
- { key: "delay", label: "滞后" },
- ];
- const listFilter = ref("all");
- const listFilterOptions = [
- { label: "全部", value: "all" },
- { label: "预警", value: "warning" },
- { label: "滞后", value: "delay" },
- ];
- const phaseSubColumns = [
- { key: "name", label: "报告名称" },
- { key: "planTime", label: "计划完成时间" },
- { key: "actualTime", label: "实际完成时间" },
- { key: "unit", label: "报告编制单位" },
- ];
- const projectList = [
- {
- id: 1,
- name: "垦利10-1油田开发项目",
- risk: "环境风险较大",
- feasibility: [
- {
- name: "环境质量现状调查",
- planTime: "2026-03-15",
- actualTime: "2026-03-12",
- unit: "邦厉有限公司",
- },
- {
- name: "渔业资源现状调查",
- planTime: "2026-04-20",
- actualTime: "2026-04-22",
- actualStatus: "delay",
- unit: "邦厉有限公司",
- },
- {
- name: "环境风险预评价",
- planTime: "2026-05-10",
- actualTime: "2026-05-08",
- unit: "邦厉有限公司",
- },
- {
- name: "桌面路由方案",
- planTime: "2026-06-01",
- actualTime: "2026-05-28",
- unit: "邦厉有限公司",
- },
- {
- name: "通航安全影响咨询",
- planTime: "2026-07-30",
- actualTime: "",
- unit: "邦厉有限公司",
- },
- ],
- basic: [
- {
- name: "安全预评价",
- planTime: "2026-03-20",
- actualTime: "2026-03-18",
- unit: "邦厉有限公司",
- },
- {
- name: "职业病危害预评价",
- planTime: "2026-04-15",
- actualTime: "2026-04-16",
- unit: "邦厉有限公司",
- },
- {
- name: "环境影响报告",
- planTime: "2026-05-20",
- actualTime: "2026-05-22",
- unit: "邦厉有限公司",
- },
- {
- name: "海域使用论证",
- planTime: "2026-06-10",
- actualTime: "2026-06-12",
- unit: "邦厉有限公司",
- },
- {
- name: "海洋倾废论证",
- planTime: "2026-07-05",
- actualTime: "",
- unit: "邦厉有限公司",
- },
- {
- name: "航道通航条件影响评价",
- planTime: "2026-08-01",
- actualTime: "",
- unit: "邦厉有限公司",
- },
- ],
- detail: [
- {
- name: "详细设计审查",
- planTime: "2026-09-01",
- actualTime: "",
- unit: "邦厉有限公司",
- },
- {
- name: "设备采购",
- planTime: "2026-10-01",
- actualTime: "",
- unit: "邦厉有限公司",
- },
- {
- name: "建造安装",
- planTime: "2026-11-01",
- actualTime: "",
- unit: "邦厉有限公司",
- },
- {
- name: "竣工验收",
- planTime: "2026-12-01",
- actualTime: "",
- unit: "邦厉有限公司",
- },
- ],
- },
- {
- id: 2,
- name: "蓬莱19-3油田开发项目",
- risk: "环境风险一般",
- feasibility: [
- {
- name: "环境质量现状调查",
- planTime: "2026-08-30",
- planStatus: "warning",
- actualTime: "",
- unit: "海蓝工程咨询",
- },
- {
- name: "环境影响评价",
- planTime: "2026-09-15",
- actualTime: "",
- unit: "海蓝工程咨询",
- },
- ],
- basic: [
- {
- name: "安全预评价",
- planTime: "2026-10-01",
- actualTime: "",
- unit: "海蓝工程咨询",
- },
- ],
- detail: [
- {
- name: "详细设计",
- planTime: "2026-11-01",
- actualTime: "",
- unit: "海蓝工程咨询",
- },
- ],
- },
- {
- id: 3,
- name: "中新天津生态城水系提升项目",
- risk: "环境风险较小",
- feasibility: [
- {
- name: "可行性研究报告",
- planTime: "2026-05-01",
- actualTime: "2026-04-28",
- unit: "生态城研究院",
- },
- ],
- basic: [
- {
- name: "基本设计审查",
- planTime: "2026-06-01",
- actualTime: "2026-06-03",
- unit: "生态城研究院",
- },
- ],
- detail: [
- {
- name: "详细设计/建造安装",
- planTime: "2026-08-01",
- actualTime: "",
- unit: "生态城研究院",
- },
- ],
- },
- ];
- const getProjectRowCount = (project) =>
- Math.max(
- project.feasibility?.length || 0,
- project.basic?.length || 0,
- project.detail?.length || 0,
- 1,
- );
- const tableRows = computed(() => {
- const rows = [];
- projectList.forEach((project) => {
- rows.push({ isGap: true });
- const rowspan = getProjectRowCount(project);
- for (let i = 0; i < rowspan; i += 1) {
- rows.push({
- project,
- isFirst: i === 0,
- rowspan,
- feasibility: project.feasibility[i] || null,
- basic: project.basic[i] || null,
- detail: project.detail[i] || null,
- });
- }
- });
- return rows;
- });
- const formatDate = (value) => value || "—";
- const dateClass = (status) => {
- if (status === "warning") return "is-warning";
- if (status === "delay") return "is-delay";
- return "";
- };
- </script>
- <style scoped lang="scss">
- .page-particulars {
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- gap: 16px;
- width: 100%;
- min-height: 100%;
- padding: 24px;
- background: #f3f7fc;
- }
- .page-particulars-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 16px;
- }
- .page-particulars-title {
- margin: 0;
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 18px;
- color: #16213a;
- line-height: 25px;
- text-align: left;
- }
- .page-particulars-actions {
- display: flex;
- align-items: center;
- gap: 24px;
- }
- .page-particulars-btn {
- display: inline-flex;
- align-items: center;
- padding: 6px 16px;
- font-family: PingFang SC, PingFang SC;
- font-weight: 500;
- font-size: 14px;
- line-height: 20px;
- text-align: left;
- border-radius: 2px;
- box-shadow: 0px 4px 10px 0px rgba(35, 130, 231, 0.2);
- cursor: pointer;
- &.is-outline {
- color: #2382e7;
- background: #ffffff;
- border: 1px solid #2382e7;
- &:hover {
- border-color: #2382e7;
- }
- }
- &.is-primary {
- gap: 4px;
- color: #ffffff;
- background: #2382e7;
- border: 1px solid #2382e7;
- &:hover {
- border-color: #2382e7;
- }
- }
- }
- .page-particulars-panel {
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- gap: 14px;
- padding: 16px;
- background: #ffffff;
- border-radius: 4px;
- }
- .page-particulars-panel-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 16px;
- }
- .page-particulars-panel-left {
- display: flex;
- align-items: center;
- gap: 16px;
- min-width: 0;
- }
- .page-particulars-panel-title {
- position: relative;
- padding-left: 10px;
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 14px;
- color: #16213a;
- line-height: 20px;
- &::before {
- position: absolute;
- top: 50%;
- left: 0;
- width: 4px;
- height: 14px;
- background: #2382e7;
- border-radius: 0 2px 2px 0;
- transform: translateY(-50%);
- content: "";
- }
- }
- .page-particulars-legend {
- display: flex;
- align-items: center;
- gap: 12px;
- }
- .page-particulars-legend-item {
- display: inline-flex;
- align-items: center;
- gap: 4px;
- font-size: 14px;
- color: #9aa5b8;
- line-height: 20px;
- white-space: nowrap;
- }
- .page-particulars-legend-dot {
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background: #d0d5dd;
- &.is-warning {
- background: #ff8e38;
- }
- &.is-delay {
- background: #f54848;
- }
- }
- .page-particulars-table-scroll {
- width: 100%;
- overflow-x: auto;
- }
- .page-particulars-table {
- width: 100%;
- min-width: 1400px;
- border-collapse: separate;
- border-spacing: 0;
- table-layout: fixed;
- font-size: 13px;
- color: #16213a;
- th,
- td {
- box-sizing: border-box;
- padding: 10px 12px;
- border: 1px solid #dfe3e7;
- text-align: left;
- vertical-align: middle;
- word-break: break-word;
- background: #ffffff;
- }
- th {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #58657c;
- background: #edf1f6;
- white-space: nowrap;
- word-break: keep-all;
- }
- .group-feasibility {
- background: #e8f3fc;
- }
- .group-basic {
- background: #e9f7ef;
- }
- .group-detail {
- background: #eef0fb;
- }
- .group-title {
- text-align: center;
- }
- .col-name,
- .col-action {
- position: sticky;
- z-index: 2;
- }
- th.col-name,
- th.col-action {
- z-index: 4;
- background: #edf1f6;
- }
- td.col-name,
- td.col-action {
- background: #ffffff;
- }
- .col-name {
- left: 0;
- width: 140px;
- min-width: 140px;
- box-shadow: 2px 0 6px rgba(22, 33, 58, 0.08);
- }
- .col-risk {
- width: 140px;
- min-width: 140px;
- white-space: nowrap;
- }
- .col-action {
- right: 0;
- width: 100px;
- min-width: 100px;
- box-shadow: -2px 0 6px rgba(22, 33, 58, 0.08);
- }
- td.is-warning {
- color: #ff8e38;
- }
- td.is-delay {
- color: #f54848;
- }
- .page-particulars-gap-row td {
- height: 16px;
- padding: 0;
- border: none;
- background: transparent;
- }
- }
- .page-particulars-ops {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- gap: 8px;
- }
- .page-particulars-op-btn {
- display: inline-flex;
- align-items: center;
- gap: 4px;
- padding: 0;
- font-family: PingFang SC, PingFang SC;
- font-size: 13px;
- color: #2382e7;
- line-height: 18px;
- background: transparent;
- border: none;
- cursor: pointer;
- &:hover {
- border-color: transparent;
- }
- }
- </style>
|