plan.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <template>
  2. <div class="plan-page">
  3. <custom-header name="农事规划"></custom-header>
  4. <div class="plan-content">
  5. <div class="filter-wrap">
  6. <div class="season-tabs">
  7. <div
  8. v-for="s in seasons"
  9. :key="s.value"
  10. class="season-tab"
  11. :class="{ active: s.value === activeSeason }"
  12. @click="handleSeasonClick(s.value)"
  13. >
  14. {{ s.label }}
  15. </div>
  16. </div>
  17. <div class="status-filter">
  18. <div v-for="status in statusList" :key="status.value" class="status-item" :class="status.color">
  19. <div class="status-dot"></div>
  20. <span class="status-text">{{ status.label }}</span>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="timeline-container" ref="timelineContainerRef">
  25. <div class="timeline-list" :style="getListStyle">
  26. <div class="timeline-middle-line"></div>
  27. <!-- 物候期覆盖条(progress 为起点,progress2 为终点,单位 %) -->
  28. <div
  29. v-for="(p, idx) in phenologyList"
  30. :key="p.id ?? idx"
  31. class="phenology-bar"
  32. :style="getPhenologyBarStyle(p)"
  33. >
  34. <div class="reproductive-list">
  35. <div
  36. v-for="(r, rIdx) in Array.isArray(p.reproductiveList) ? p.reproductiveList : []"
  37. :key="r.id ?? rIdx"
  38. class="reproductive-item"
  39. :class="{
  40. 'horizontal-text': getReproductiveItemHeight(p) < 30,
  41. 'vertical-lr-text': getReproductiveItemHeight(p) >= 30
  42. }"
  43. :style="getReproductiveItemHeight(p) < 30 ? { '--item-height': `${getReproductiveItemHeight(p)}px` } : {}"
  44. >
  45. {{ r.name }}
  46. <div class="arranges" :class="{ 'no-wrap': getReproductiveItemHeight(p) <= 35 }">
  47. <div
  48. v-for="(fw, aIdx) in Array.isArray(r.farmWorkArrangeList)
  49. ? r.farmWorkArrangeList
  50. : []"
  51. :key="fw.id ?? aIdx"
  52. class="arrange-box"
  53. :class="[
  54. getArrangeStatusClass(fw),
  55. {
  56. 'small-height': getReproductiveItemHeight(p) <= 35,
  57. 'two-chars': fw.farmWorkName && fw.farmWorkName.trim().length === 2,
  58. 'text-4-6': fw.farmWorkName && getTextLengthClass(fw.farmWorkName) === 'text-4-6',
  59. 'text-7-8': fw.farmWorkName && getTextLengthClass(fw.farmWorkName) === 'text-7-8'
  60. }
  61. ]"
  62. @click="handleRowClick(fw)"
  63. >
  64. <span class="arrange-text">{{ fw.farmWorkName }}</span>
  65. <div
  66. v-if="
  67. getArrangeStatusClass(fw) === 'status-complete' ||
  68. getArrangeStatusClass(fw) === 'status-warning'
  69. "
  70. class="status-icon"
  71. :class="getArrangeStatusClass(fw)"
  72. >
  73. <el-icon
  74. v-if="getArrangeStatusClass(fw) === 'status-complete'"
  75. size="16"
  76. color="#1CA900"
  77. >
  78. <SuccessFilled />
  79. </el-icon>
  80. <el-icon v-else size="18" color="#FF953D">
  81. <WarnTriangleFilled />
  82. </el-icon>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <div v-for="t in solarTerms" :key="t.id" class="timeline-term" :style="getTermStyle(t)">
  90. <span class="term-name">{{ t.displayName }}</span>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="control-section">
  95. <div class="toggle-group">
  96. <el-switch v-model="isDefaultEnabled" />
  97. <span class="toggle-label">{{ isDefaultEnabled ? "默认" : "" }}发起农情需求</span>
  98. </div>
  99. <div class="add-button-group">
  100. <div class="add-button button" @click="addNewTask">新增农事</div>
  101. <div class="button" @click="manageTask">农事管理</div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <!-- 农事信息弹窗 -->
  107. <detail-dialog ref="detailDialogRef" @triggerFarmWork="triggerFarmWork"></detail-dialog>
  108. <!-- 新增:激活上传弹窗 -->
  109. <active-upload-popup @handleUploadSuccess="getFarmWorkPlan"></active-upload-popup>
  110. </template>
  111. <script setup>
  112. import { reactive, ref, onMounted, computed, nextTick } from "vue";
  113. import customHeader from "@/components/customHeader.vue";
  114. import { useRouter, useRoute } from "vue-router";
  115. import detailDialog from "@/components/detailDialog.vue";
  116. import eventBus from "@/api/eventBus";
  117. import activeUploadPopup from "@/components/popup/activeUploadPopup.vue";
  118. import { SuccessFilled, WarningFilled } from "@element-plus/icons-vue";
  119. const router = useRouter();
  120. const route = useRoute();
  121. // 状态列表数据
  122. const seasons = reactive([
  123. { value: "spring", label: "春季" },
  124. { value: "summer", label: "夏季" },
  125. { value: "autumn", label: "秋季" },
  126. { value: "winter", label: "冬季" },
  127. ]);
  128. const activeSeason = ref("");
  129. const statusList = reactive([
  130. { value: "pending", label: "待触发", color: "gray" },
  131. { value: "executing", label: "待完成", color: "blue" },
  132. { value: "completed", label: "已完成", color: "green" },
  133. { value: "expired", label: "已过期", color: "orange" },
  134. ]);
  135. const solarTerms = ref([]);
  136. const phenologyList = ref([]);
  137. // 获取当前季节
  138. const getCurrentSeason = () => {
  139. const month = new Date().getMonth() + 1; // 1-12
  140. if (month >= 3 && month <= 5) {
  141. return "spring"; // 春季:3-5月
  142. } else if (month >= 6 && month <= 8) {
  143. return "summer"; // 夏季:6-8月
  144. } else if (month >= 9 && month <= 10) {
  145. return "autumn"; // 秋季:9-10月
  146. } else {
  147. return "winter"; // 冬季:12-2月
  148. }
  149. };
  150. onMounted(() => {
  151. getFarmWorkPlan();
  152. });
  153. const getFarmWorkPlan = () => {
  154. // 如果不是首次加载,保存当前滚动位置
  155. let savedScrollTop = 0;
  156. if (!isInitialLoad.value && timelineContainerRef.value) {
  157. savedScrollTop = timelineContainerRef.value.scrollTop || 0;
  158. }
  159. VE_API.monitor
  160. .farmWorkPlan({ farmId: route.query.farmId })
  161. .then(({ data, code }) => {
  162. if (code === 0) {
  163. const list = Array.isArray(data?.solarTermsList) ? data.solarTermsList : [];
  164. const filtered = list
  165. .filter((t) => t && t.type === 1)
  166. .map((t) => ({
  167. id:
  168. t.id ??
  169. t.solarTermsId ??
  170. t.termId ??
  171. `${t.name || t.solarTermsName || t.termName || "term"}-${t.createDate || ""}`,
  172. displayName: t.name || t.solarTermsName || t.termName || "节气",
  173. createDate: t.createDate || null,
  174. progress: Number(t.progress) || 0,
  175. }));
  176. solarTerms.value = filtered;
  177. // 物候期数据
  178. phenologyList.value = Array.isArray(data?.phenologyList)
  179. ? data.phenologyList.map((it) => ({
  180. id: it.id ?? it.phenologyId ?? it.name ?? `${it.progress}-${it.progress2}`,
  181. progress: Number(it.progress) || 0, // 起点 %
  182. progress2: Number(it.progress2) || 0, // 终点 %
  183. // 兼容多种可能的开始时间字段
  184. startTimeMs: safeParseDate(
  185. it.startDate || it.beginDate || it.startTime || it.start || it.start_at
  186. ),
  187. reproductiveList: Array.isArray(it.reproductiveList) ? it.reproductiveList : [],
  188. }))
  189. : [];
  190. // 等待 DOM 更新后处理滚动
  191. nextTick(() => {
  192. if (isInitialLoad.value) {
  193. // 首次加载:设置默认季节为当前季节,并自动滚动到对应位置
  194. const currentSeason = getCurrentSeason();
  195. handleSeasonClick(currentSeason);
  196. isInitialLoad.value = false;
  197. } else {
  198. // 非首次加载:恢复之前的滚动位置
  199. if (timelineContainerRef.value && savedScrollTop > 0) {
  200. timelineContainerRef.value.scrollTop = savedScrollTop;
  201. }
  202. }
  203. });
  204. }
  205. })
  206. .catch((error) => {
  207. console.error("获取农事规划数据失败:", error);
  208. });
  209. };
  210. // 切换开关状态
  211. const isDefaultEnabled = ref(true);
  212. // 新增农事
  213. const addNewTask = () => {
  214. router.push({
  215. path: "/modify_work",
  216. query: { data: JSON.stringify(["生长异常"]), gardenId: 766, isAdd: true },
  217. });
  218. };
  219. const triggerFarmWork = () => {
  220. eventBus.emit("activeUpload:show", {
  221. gardenIdVal: route.query.farmId,
  222. problemTitleVal: '请选择您出现' + curFarmObj.value.farmWorkName + '的时间',
  223. arrangeIdVal: curFarmObj.value.id,
  224. });
  225. };
  226. const curFarmObj = ref({});
  227. const handleRowClick = (item) => {
  228. curFarmObj.value = item;
  229. // 0:默认,1-4:正常,5:完成,6:预警
  230. if (item.flowStatus === 5) {
  231. router.push({
  232. path: "/review_work",
  233. query: {
  234. json: JSON.stringify({ id: item.farmWorkRecordId,goBack: true }),
  235. },
  236. });
  237. } else if (item.flowStatus === null) {
  238. detailDialogRef.value.showDialog(item.farmWorkId);
  239. } else if (item.flowStatus === 6 || (item.flowStatus < 5 && item.flowStatus >= 0)) {
  240. router.push({
  241. path: "/completed_work",
  242. query: {
  243. json: JSON.stringify({ id: item.farmWorkRecordId }),
  244. },
  245. });
  246. }
  247. };
  248. const manageTask = () => {
  249. router.push({
  250. path: "/agri_services_manage",
  251. query: {
  252. type: "manage",
  253. },
  254. });
  255. };
  256. const detailDialogRef = ref(null);
  257. const timelineContainerRef = ref(null);
  258. // 标记是否为首次加载
  259. const isInitialLoad = ref(true);
  260. // 安全解析时间到时间戳(ms)
  261. const safeParseDate = (val) => {
  262. if (!val) return NaN;
  263. if (val instanceof Date) return val.getTime();
  264. if (typeof val === "number") return val;
  265. if (typeof val === "string") {
  266. // 兼容 "YYYY-MM-DD HH:mm:ss" -> Safari
  267. const s = val.replace(/-/g, "/").replace("T", " ");
  268. const d = new Date(s);
  269. return isNaN(d.getTime()) ? NaN : d.getTime();
  270. }
  271. return NaN;
  272. };
  273. // 计算节气列表容器高度与项位置
  274. const getListStyle = computed(() => {
  275. const total = (solarTerms.value?.length || 0) * 100;
  276. const minH = 50 + total + 50; // 上下各 50
  277. return { minHeight: `${minH}px` };
  278. });
  279. const getTermStyle = (t) => {
  280. const p = Math.max(0, Math.min(100, Number(t?.progress) || 0));
  281. const total = (solarTerms.value?.length || 0) * 100;
  282. const top = 50 + (p / 100) * total;
  283. return {
  284. position: "absolute",
  285. top: `${top}px`,
  286. left: 0,
  287. transform: "translateY(-50%)",
  288. width: "30px",
  289. height: "20px",
  290. display: "flex",
  291. alignItems: "center",
  292. };
  293. };
  294. // 点击季节 → 滚动到对应节气(立春/立夏/立秋/立冬)
  295. const handleSeasonClick = (seasonValue) => {
  296. activeSeason.value = seasonValue;
  297. const mapping = {
  298. spring: "立春",
  299. summer: "立夏",
  300. autumn: "立秋",
  301. winter: "立冬",
  302. };
  303. const targetName = mapping[seasonValue];
  304. if (!targetName) return;
  305. const target = (solarTerms.value || []).find((t) => (t?.displayName || "") === targetName);
  306. if (!target) return;
  307. const p = Math.max(0, Math.min(100, Number(target.progress) || 0));
  308. const total = (solarTerms.value?.length || 0) * 100;
  309. const targetTop = 50 + (p / 100) * total; // 内容内的像素位置
  310. const wrap = timelineContainerRef.value;
  311. if (!wrap) return;
  312. const viewH = wrap.clientHeight || 0;
  313. const maxScroll = Math.max(0, wrap.scrollHeight - viewH);
  314. // 将目标位置稍微靠上(使用 0.35 视口高度做偏移)
  315. let scrollTop = Math.max(0, targetTop - viewH * 0.1);
  316. if (scrollTop > maxScroll) scrollTop = maxScroll;
  317. wrap.scrollTo({ top: scrollTop, behavior: "smooth" });
  318. };
  319. // 物候期覆盖条样式(使用像素计算,避免 100% 高度为 0 的问题)
  320. const getPhenologyBarStyle = (item) => {
  321. const p1 = Math.max(0, Math.min(100, Number(item?.progress) || 0));
  322. const p2 = Math.max(0, Math.min(100, Number(item?.progress2) || 0));
  323. const start = Math.min(p1, p2);
  324. const end = Math.max(p1, p2);
  325. const total = (solarTerms.value?.length || 0) * 100; // 有效绘制区高度(px)
  326. const topPx = 50 + (start / 100) * total;
  327. const heightPx = Math.max(2, ((end - start) / 100) * total);
  328. const now = Date.now();
  329. const isFuture = Number.isFinite(item?.startTimeMs) ? item.startTimeMs > now : start > 0; // 无开始时间时按起点>0近似
  330. // 反转:大于当前时间用灰色,小于等于当前时间用蓝色
  331. const barColor = isFuture ? "rgba(145, 145, 145, 0.1)" : "#2199F8";
  332. const beforeBg = isFuture ? "rgba(145, 145, 145, 0.1)" : "rgba(33, 153, 248, 0.1)";
  333. return {
  334. position: "absolute",
  335. left: "46px",
  336. width: "25px",
  337. top: `${topPx}px`,
  338. height: `${heightPx}px`,
  339. background: barColor,
  340. color: isFuture ? "#747778" : "#fff",
  341. "--bar-before-bg": beforeBg,
  342. zIndex: 2,
  343. };
  344. };
  345. // 农事状态样式映射(0:默认,1-4:正常,5:完成,6:预警)
  346. const getArrangeStatusClass = (fw) => {
  347. const t = fw?.flowStatus;
  348. if (t == null) return "status-default";
  349. if (t >= 0 && t <= 4) return "status-normal";
  350. if (t === 5) return "status-complete";
  351. if (t === 6) return "status-warning";
  352. return "status-default";
  353. };
  354. // 计算 phenology-bar 的高度(px)
  355. const getPhenologyBarHeight = (item) => {
  356. const p1 = Math.max(0, Math.min(100, Number(item?.progress) || 0));
  357. const p2 = Math.max(0, Math.min(100, Number(item?.progress2) || 0));
  358. const start = Math.min(p1, p2);
  359. const end = Math.max(p1, p2);
  360. const total = (solarTerms.value?.length || 0) * 100;
  361. const heightPx = Math.max(2, ((end - start) / 100) * total);
  362. return heightPx;
  363. };
  364. // 计算 reproductive-item 的高度(px)
  365. // 由于 reproductive-list 使用 grid-auto-rows: 1fr,每个 item 会等分 phenology-bar 的高度
  366. const getReproductiveItemHeight = (phenologyItem) => {
  367. const barHeight = getPhenologyBarHeight(phenologyItem);
  368. const listLength = Array.isArray(phenologyItem?.reproductiveList) ? phenologyItem.reproductiveList.length : 1;
  369. // 如果列表为空,返回 barHeight;否则等分
  370. return listLength > 0 ? barHeight / listLength : barHeight;
  371. };
  372. // 根据文字长度返回对应的 class
  373. const getTextLengthClass = (text) => {
  374. if (!text || typeof text !== "string") return "";
  375. const len = text.trim().length;
  376. if (len > 4 && len <= 6) return "text-4-6";
  377. if (len > 6 && len <= 8) return "text-7-8";
  378. return "";
  379. };
  380. </script>
  381. <style scoped lang="scss">
  382. .plan-page {
  383. width: 100%;
  384. height: 100vh;
  385. background: #fff;
  386. .plan-content {
  387. .filter-wrap {
  388. background: #fff;
  389. padding: 13px 12px;
  390. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  391. border-radius: 0 0 20px 20px;
  392. .status-filter {
  393. background: #fff;
  394. padding: 3px 17px;
  395. display: flex;
  396. align-items: center;
  397. gap: 16px;
  398. font-size: 12px;
  399. .status-item {
  400. display: flex;
  401. align-items: center;
  402. justify-content: center;
  403. gap: 6px;
  404. flex: 1;
  405. &.gray {
  406. color: #c4c6c9;
  407. .status-dot {
  408. background-color: #c4c6c9;
  409. }
  410. }
  411. &.blue {
  412. color: #2199f8;
  413. .status-dot {
  414. background-color: #2199f8;
  415. }
  416. }
  417. &.green {
  418. color: #1ca900;
  419. .status-dot {
  420. background-color: #1ca900;
  421. }
  422. }
  423. &.orange {
  424. color: #ff953d;
  425. .status-dot {
  426. background-color: #ff953d;
  427. }
  428. }
  429. .status-dot {
  430. width: 6px;
  431. height: 6px;
  432. border-radius: 50%;
  433. }
  434. }
  435. }
  436. .season-tabs {
  437. display: flex;
  438. gap: 8px;
  439. margin-bottom: 12px;
  440. .season-tab {
  441. flex: 1;
  442. padding: 7px;
  443. text-align: center;
  444. background: #f3f3f3;
  445. color: #898a8a;
  446. border-radius: 3px;
  447. border: 1px solid transparent;
  448. font-size: 12px;
  449. }
  450. .season-tab.active {
  451. background: #ffffff;
  452. color: #2199f8;
  453. border-color: #2199f8;
  454. }
  455. }
  456. }
  457. .timeline-container {
  458. height: calc(100vh - 93px - 40px - 73px);
  459. overflow: auto;
  460. position: relative;
  461. box-sizing: border-box;
  462. padding: 0 12px;
  463. .timeline-list {
  464. position: relative;
  465. }
  466. .timeline-middle-line {
  467. position: absolute;
  468. left: 15px; /* 位于节气文字列中间(列宽约30px) */
  469. top: 50px;
  470. bottom: 50px;
  471. width: 2px;
  472. background: #e8e8e8;
  473. z-index: 1;
  474. }
  475. .phenology-bar {
  476. display: flex;
  477. align-items: stretch;
  478. justify-content: center;
  479. box-sizing: border-box;
  480. &::before {
  481. content: "";
  482. position: absolute;
  483. top: 0;
  484. left: 25px;
  485. width: calc(100vw - 100px);
  486. height: 100%;
  487. background: var(--bar-before-bg, rgba(201, 201, 201, 0.1));
  488. z-index: 1;
  489. }
  490. .reproductive-list {
  491. display: grid;
  492. grid-auto-rows: 1fr; /* 子项等高,整体等分父高度 */
  493. align-items: stretch;
  494. justify-items: center; /* 子项居中 */
  495. width: 100%;
  496. height: 100%;
  497. box-sizing: border-box;
  498. }
  499. .reproductive-item {
  500. font-size: 12px;
  501. text-align: center;
  502. word-break: break-all;
  503. writing-mode: vertical-rl;
  504. text-orientation: upright;
  505. letter-spacing: 3px;
  506. width: 100%;
  507. line-height: 23px;
  508. color: inherit;
  509. position: relative;
  510. &.horizontal-text {
  511. writing-mode: horizontal-tb;
  512. text-orientation: mixed;
  513. letter-spacing: normal;
  514. line-height: calc(var(--item-height, 15px) - 3px);
  515. }
  516. &.vertical-lr-text {
  517. writing-mode: vertical-lr;
  518. text-orientation: upright;
  519. letter-spacing: 3px;
  520. line-height: 26px;
  521. }
  522. .arranges {
  523. position: absolute;
  524. left: 48px; /* 列与中线右侧一段距离 */
  525. top: 50%;
  526. transform: translateY(-50%);
  527. z-index: 3;
  528. display: flex;
  529. flex-wrap: wrap;
  530. flex-direction: row;
  531. align-items: center;
  532. max-width: calc(100vw - 100px);
  533. gap: 16px;
  534. &.no-wrap {
  535. flex-wrap: nowrap;
  536. }
  537. .arrange-box {
  538. width: 36px;
  539. height: 36px;
  540. border: 1px solid rgba(199, 199, 199, 0.6);
  541. border-radius: 2px;
  542. background: #fff;
  543. color: #a5a7a9;
  544. display: flex;
  545. align-items: center;
  546. justify-content: center;
  547. box-sizing: border-box;
  548. position: relative;
  549. font-size: 12px;
  550. flex-shrink: 0;
  551. &.small-height {
  552. height: 20px;
  553. width: 70px;
  554. &.two-chars {
  555. width: 35px;
  556. }
  557. &.text-4-6 {
  558. width: 64px;
  559. }
  560. &.text-7-8 {
  561. width: 66px;
  562. }
  563. .arrange-text {
  564. writing-mode: vertical-lr;
  565. }
  566. }
  567. &.text-4-6 {
  568. width: 64px;
  569. }
  570. &.text-7-8 {
  571. width: 66px;
  572. }
  573. .arrange-text {
  574. writing-mode: horizontal-tb;
  575. line-height: 14px;
  576. text-align: center;
  577. padding-left: 3px;
  578. }
  579. .status-icon {
  580. position: absolute;
  581. right: -10px;
  582. bottom: -10px;
  583. z-index: 3;
  584. }
  585. &::before {
  586. content: "";
  587. position: absolute;
  588. left: -4px;
  589. top: 50%;
  590. transform: translateY(-50%);
  591. width: 0;
  592. height: 0;
  593. border-top: 4px solid transparent;
  594. border-bottom: 4px solid transparent;
  595. border-right: 4px solid currentColor; /* 与文字/边框颜色一致 */
  596. }
  597. }
  598. .arrange-box.status-warning {
  599. border-color: #ff953d;
  600. color: #ff953d;
  601. }
  602. .arrange-box.status-complete {
  603. border-color: #1ca900;
  604. color: #1ca900;
  605. }
  606. .arrange-box.status-normal {
  607. border-color: #2199f8;
  608. color: #2199f8;
  609. }
  610. }
  611. }
  612. }
  613. .reproductive-item + .reproductive-item {
  614. border-top: 2px solid #fff;
  615. }
  616. .phenology-bar + .phenology-bar {
  617. border-top: 2px solid #fff;
  618. }
  619. .timeline-term {
  620. position: absolute;
  621. width: 30px;
  622. padding-right: 16px;
  623. display: flex;
  624. align-items: center;
  625. z-index: 2; /* 置于中线之上 */
  626. .term-name {
  627. display: inline-block;
  628. width: 100%;
  629. height: 46px;
  630. line-height: 30px;
  631. background: #fff;
  632. font-size: 13px;
  633. word-break: break-all;
  634. writing-mode: vertical-rl;
  635. text-orientation: upright;
  636. color: rgba(174, 174, 174, 0.6);
  637. letter-spacing: 2px;
  638. text-align: center;
  639. }
  640. }
  641. }
  642. // 控制区域样式
  643. .control-section {
  644. position: fixed;
  645. width: 100%;
  646. left: 0;
  647. box-sizing: border-box;
  648. bottom: 0px;
  649. background: #fff;
  650. padding: 16px 12px;
  651. display: flex;
  652. justify-content: space-between;
  653. align-items: center;
  654. border-top: 1px solid #f0f0f0;
  655. .toggle-group {
  656. display: flex;
  657. align-items: center;
  658. gap: 8px;
  659. .toggle-label {
  660. font-size: 13px;
  661. color: #141414;
  662. }
  663. }
  664. .add-button-group {
  665. display: flex;
  666. align-items: center;
  667. gap: 8px;
  668. .button {
  669. color: #2199f8;
  670. border-radius: 25px;
  671. padding: 9px 15px;
  672. border: 1px solid #2199f8;
  673. }
  674. .add-button {
  675. background: linear-gradient(120deg, #76c3ff 0%, #2199f8 100%);
  676. color: white;
  677. border: 1px solid transparent;
  678. }
  679. }
  680. }
  681. }
  682. }
  683. </style>