plan.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  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">{{ formatTextWithLineBreak(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. // 处理文本,在括号前换行
  381. const formatTextWithLineBreak = (text) => {
  382. if (!text || typeof text !== "string") return text;
  383. // 在左括号前添加换行符
  384. return text.replace(/([((])/g, "\n$1");
  385. };
  386. </script>
  387. <style scoped lang="scss">
  388. .plan-page {
  389. width: 100%;
  390. height: 100vh;
  391. background: #fff;
  392. .plan-content {
  393. .filter-wrap {
  394. background: #fff;
  395. padding: 13px 12px;
  396. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  397. border-radius: 0 0 20px 20px;
  398. .status-filter {
  399. background: #fff;
  400. padding: 3px 17px;
  401. display: flex;
  402. align-items: center;
  403. gap: 16px;
  404. font-size: 12px;
  405. .status-item {
  406. display: flex;
  407. align-items: center;
  408. justify-content: center;
  409. gap: 6px;
  410. flex: 1;
  411. &.gray {
  412. color: #c4c6c9;
  413. .status-dot {
  414. background-color: #c4c6c9;
  415. }
  416. }
  417. &.blue {
  418. color: #2199f8;
  419. .status-dot {
  420. background-color: #2199f8;
  421. }
  422. }
  423. &.green {
  424. color: #1ca900;
  425. .status-dot {
  426. background-color: #1ca900;
  427. }
  428. }
  429. &.orange {
  430. color: #ff953d;
  431. .status-dot {
  432. background-color: #ff953d;
  433. }
  434. }
  435. .status-dot {
  436. width: 6px;
  437. height: 6px;
  438. border-radius: 50%;
  439. }
  440. }
  441. }
  442. .season-tabs {
  443. display: flex;
  444. gap: 8px;
  445. margin-bottom: 12px;
  446. .season-tab {
  447. flex: 1;
  448. padding: 7px;
  449. text-align: center;
  450. background: #f3f3f3;
  451. color: #898a8a;
  452. border-radius: 3px;
  453. border: 1px solid transparent;
  454. font-size: 12px;
  455. }
  456. .season-tab.active {
  457. background: #ffffff;
  458. color: #2199f8;
  459. border-color: #2199f8;
  460. }
  461. }
  462. }
  463. .timeline-container {
  464. height: calc(100vh - 93px - 40px - 73px);
  465. overflow: auto;
  466. position: relative;
  467. box-sizing: border-box;
  468. padding: 0 12px;
  469. .timeline-list {
  470. position: relative;
  471. }
  472. .timeline-middle-line {
  473. position: absolute;
  474. left: 15px; /* 位于节气文字列中间(列宽约30px) */
  475. top: 50px;
  476. bottom: 50px;
  477. width: 2px;
  478. background: #e8e8e8;
  479. z-index: 1;
  480. }
  481. .phenology-bar {
  482. display: flex;
  483. align-items: stretch;
  484. justify-content: center;
  485. box-sizing: border-box;
  486. &::before {
  487. content: "";
  488. position: absolute;
  489. top: 0;
  490. left: 25px;
  491. width: calc(100vw - 100px);
  492. height: 100%;
  493. background: var(--bar-before-bg, rgba(201, 201, 201, 0.1));
  494. z-index: 1;
  495. }
  496. .reproductive-list {
  497. display: grid;
  498. grid-auto-rows: 1fr; /* 子项等高,整体等分父高度 */
  499. align-items: stretch;
  500. justify-items: center; /* 子项居中 */
  501. width: 100%;
  502. height: 100%;
  503. box-sizing: border-box;
  504. }
  505. .reproductive-item {
  506. font-size: 12px;
  507. text-align: center;
  508. word-break: break-all;
  509. writing-mode: vertical-rl;
  510. text-orientation: upright;
  511. letter-spacing: 3px;
  512. width: 100%;
  513. line-height: 23px;
  514. color: inherit;
  515. position: relative;
  516. &.horizontal-text {
  517. writing-mode: horizontal-tb;
  518. text-orientation: mixed;
  519. letter-spacing: normal;
  520. line-height: calc(var(--item-height, 15px) - 3px);
  521. }
  522. &.vertical-lr-text {
  523. writing-mode: vertical-lr;
  524. text-orientation: upright;
  525. letter-spacing: 3px;
  526. line-height: 26px;
  527. }
  528. .arranges {
  529. position: absolute;
  530. left: 48px; /* 列与中线右侧一段距离 */
  531. top: 50%;
  532. transform: translateY(-50%);
  533. z-index: 3;
  534. display: flex;
  535. flex-wrap: wrap;
  536. flex-direction: row;
  537. align-items: center;
  538. max-width: calc(100vw - 100px);
  539. gap: 16px;
  540. &.no-wrap {
  541. flex-wrap: nowrap;
  542. }
  543. .arrange-box {
  544. width: 36px;
  545. height: 36px;
  546. border: 1px solid rgba(199, 199, 199, 0.6);
  547. border-radius: 2px;
  548. background: #fff;
  549. color: #a5a7a9;
  550. display: flex;
  551. align-items: center;
  552. justify-content: center;
  553. box-sizing: border-box;
  554. position: relative;
  555. font-size: 12px;
  556. flex-shrink: 0;
  557. &.small-height {
  558. height: 20px;
  559. width: 70px;
  560. &.two-chars {
  561. width: 35px;
  562. }
  563. &.text-4-6 {
  564. width: 65px;
  565. }
  566. &.text-7-8 {
  567. width: 66px;
  568. }
  569. .arrange-text {
  570. writing-mode: vertical-lr;
  571. white-space: pre-line;
  572. }
  573. }
  574. &.text-4-6 {
  575. width: 65px;
  576. }
  577. &.text-7-8 {
  578. width: 66px;
  579. }
  580. .arrange-text {
  581. writing-mode: horizontal-tb;
  582. line-height: 14px;
  583. text-align: center;
  584. padding-left: 3px;
  585. white-space: pre-line;
  586. }
  587. .status-icon {
  588. position: absolute;
  589. right: -10px;
  590. bottom: -10px;
  591. z-index: 3;
  592. }
  593. &::before {
  594. content: "";
  595. position: absolute;
  596. left: -4px;
  597. top: 50%;
  598. transform: translateY(-50%);
  599. width: 0;
  600. height: 0;
  601. border-top: 4px solid transparent;
  602. border-bottom: 4px solid transparent;
  603. border-right: 4px solid currentColor; /* 与文字/边框颜色一致 */
  604. }
  605. }
  606. .arrange-box.status-warning {
  607. border-color: #ff953d;
  608. color: #ff953d;
  609. }
  610. .arrange-box.status-complete {
  611. border-color: #1ca900;
  612. color: #1ca900;
  613. }
  614. .arrange-box.status-normal {
  615. border-color: #2199f8;
  616. color: #2199f8;
  617. }
  618. }
  619. }
  620. }
  621. .reproductive-item + .reproductive-item {
  622. border-top: 2px solid #fff;
  623. }
  624. .phenology-bar + .phenology-bar {
  625. border-top: 2px solid #fff;
  626. }
  627. .timeline-term {
  628. position: absolute;
  629. width: 30px;
  630. padding-right: 16px;
  631. display: flex;
  632. align-items: center;
  633. z-index: 2; /* 置于中线之上 */
  634. .term-name {
  635. display: inline-block;
  636. width: 100%;
  637. height: 46px;
  638. line-height: 30px;
  639. background: #fff;
  640. font-size: 13px;
  641. word-break: break-all;
  642. writing-mode: vertical-rl;
  643. text-orientation: upright;
  644. color: rgba(174, 174, 174, 0.6);
  645. letter-spacing: 2px;
  646. text-align: center;
  647. }
  648. }
  649. }
  650. // 控制区域样式
  651. .control-section {
  652. position: fixed;
  653. width: 100%;
  654. left: 0;
  655. box-sizing: border-box;
  656. bottom: 0px;
  657. background: #fff;
  658. padding: 16px 12px;
  659. display: flex;
  660. justify-content: space-between;
  661. align-items: center;
  662. border-top: 1px solid #f0f0f0;
  663. .toggle-group {
  664. display: flex;
  665. align-items: center;
  666. gap: 8px;
  667. .toggle-label {
  668. font-size: 13px;
  669. color: #141414;
  670. }
  671. }
  672. .add-button-group {
  673. display: flex;
  674. align-items: center;
  675. gap: 8px;
  676. .button {
  677. color: #2199f8;
  678. border-radius: 25px;
  679. padding: 9px 15px;
  680. border: 1px solid #2199f8;
  681. }
  682. .add-button {
  683. background: linear-gradient(120deg, #76c3ff 0%, #2199f8 100%);
  684. color: white;
  685. border: 1px solid transparent;
  686. }
  687. }
  688. }
  689. }
  690. }
  691. </style>