CropAlertPanel.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. <template>
  2. <div class="crop-alert-floating-panel">
  3. <floating-panel
  4. class="floating-panel"
  5. :class="{ 'background-panel': isBackground }"
  6. :style="{ bottom: `${tabBarHeight}px` }"
  7. v-model:height="height"
  8. :anchors="anchors"
  9. :content-draggable="true"
  10. @height-change="handleHeightChange"
  11. >
  12. <div class="floating-panel-content">
  13. <div class="panel-shell" ref="panelShellRef">
  14. <div class="crop-header">
  15. <div class="crop-info">
  16. <el-avatar class="crop-avatar" :size="24" :src="cropAvatar" />
  17. <span class="crop-name">{{ currentCropName }}</span>
  18. <span class="crop-badge">当前作物</span>
  19. </div>
  20. <div class="switch-wrap">
  21. <el-tooltip
  22. v-model:visible="cropMenuVisible"
  23. placement="bottom"
  24. trigger="click"
  25. effect="light"
  26. :show-arrow="true"
  27. popper-class="crop-switch-tooltip"
  28. :teleported="true"
  29. >
  30. <template #content>
  31. <div class="crop-option-list">
  32. <div
  33. v-for="(item, index) in cropOptions"
  34. :key="index"
  35. class="crop-option-item"
  36. :class="{ active: index === activeIndex }"
  37. @click="handleSelectCrop(index)"
  38. >
  39. {{ item }}
  40. </div>
  41. </div>
  42. </template>
  43. <div
  44. class="switch-btn"
  45. :class="{ 'is-open': cropMenuVisible }"
  46. @click="dismissGuide"
  47. >
  48. <span>{{ t("growthReport.switchCategory") }}</span>
  49. <el-icon
  50. class="switch-btn__icon"
  51. :class="{ 'is-open-icon': cropMenuVisible }"
  52. >
  53. <CaretBottom />
  54. </el-icon>
  55. </div>
  56. </el-tooltip>
  57. <div v-if="guideVisible" class="crop-guide-bubble">
  58. <span class="crop-guide-bubble__arrow"></span>
  59. <div class="crop-guide-bubble__content">
  60. 当下作物为<span class="crop-guide-bubble__crop">{{ currentCropName }}</span>,请录入拟种植的作物,之后变为对应作物的气象预警
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="alert-list" v-show="!isBackground">
  66. <div
  67. v-for="(item, index) in alertCards"
  68. :key="index"
  69. class="alert-card"
  70. >
  71. <div class="alert-card__header">
  72. <div class="alert-card__title-wrap">
  73. <img class="alert-card__icon" :src="item.icon" alt="" />
  74. <span class="alert-card__title">{{ item.title }}</span>
  75. </div>
  76. <span class="alert-card__link" @click="handleViewDetail(item)">
  77. 查看详情
  78. </span>
  79. </div>
  80. <div class="alert-card__content-wrap">
  81. <span class="alert-card__content">{{ item.content }}</span>
  82. <span
  83. v-if="item.patrolTip && item.title !== '正常气象'"
  84. class="alert-card__patrol"
  85. @click="handlePatrolTip(item)"
  86. >
  87. <el-icon class="alert-card__patrol-icon"><Link /></el-icon>
  88. <span>{{ item.patrolTip }}</span>
  89. </span>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </floating-panel>
  96. </div>
  97. </template>
  98. <script setup>
  99. import { FloatingPanel } from "vant";
  100. import { CaretBottom, Link } from "@element-plus/icons-vue";
  101. import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, watch } from "vue";
  102. import { useStore } from "vuex";
  103. import { useI18n } from "@/i18n";
  104. import { useRouter } from "vue-router";
  105. const router = useRouter();
  106. const store = useStore();
  107. const { t } = useI18n();
  108. const GUIDE_STORAGE_KEY = "GROWTH_REPORT_CROP_SWITCH_GUIDE";
  109. const CARD_ID = {
  110. WARNING: "warning",
  111. STRESS: 2,
  112. };
  113. const props = defineProps({
  114. /** 当前选中农场 id,切换农场后触发分区 / 预警重拉 */
  115. farmId: {
  116. type: [String, Number],
  117. default: "",
  118. },
  119. cropName: {
  120. type: String,
  121. default: "",
  122. },
  123. cropAvatar: {
  124. type: String,
  125. default: "https://birdseye-img.sysuimars.com/dinggou-mini/defalut-icon.png",
  126. },
  127. });
  128. /** 分区列表(getZones),选项文案用 zone_name */
  129. const zoneList = ref([]);
  130. const cropOptions = ref([]);
  131. const selectedZoneId = ref(null);
  132. const activeIndex = ref(0);
  133. const emit = defineEmits(["viewDetail", "heightChange", "zoneChange"]);
  134. const weatherIcon = require("@/assets/img/report/weather.png");
  135. /** 底部 tabBar 高度(含小程序安全区),优先读 DOM / store */
  136. const resolveTabBarHeight = () => {
  137. const fromDom = document.querySelector(".van-tabbar")?.offsetHeight;
  138. const fromStore = Number(store.state.home.tabBarHeight) || 0;
  139. const fromStorage = Number(localStorage.getItem("tabBarHeight")) || 0;
  140. return fromDom || fromStore || fromStorage || 50;
  141. };
  142. const tabBarHeight = ref(resolveTabBarHeight());
  143. const currentCropName = ref(props.cropName || "");
  144. const cropMenuVisible = ref(false);
  145. const guideVisible = ref(false);
  146. /** 防止切换农场时旧请求回写覆盖新数据 */
  147. let reloadToken = 0;
  148. /** 展示名:优先当前分区 zone_name,其次 props / 农场缓存(新建农场尚无分区时用) */
  149. const resolveCropNameDisplay = () => {
  150. const zone = zoneList.value[activeIndex.value];
  151. if (zone?.variety_name) return zone.variety_name;
  152. const farm = getSelectedFarm();
  153. return (
  154. farm.variety_name ||
  155. farm.crop_name ||
  156. farm.farm_variety ||
  157. ""
  158. );
  159. };
  160. const syncCropNameDisplay = () => {
  161. currentCropName.value = resolveCropNameDisplay();
  162. };
  163. watch(
  164. () => props.cropName,
  165. () => {
  166. syncCropNameDisplay();
  167. }
  168. );
  169. watch(
  170. () => props.farmId,
  171. (id, prev) => {
  172. if (String(id ?? "") === String(prev ?? "")) return;
  173. syncCropNameDisplay();
  174. nextTick(() => reloadFarmAlerts());
  175. }
  176. );
  177. const dismissGuide = () => {
  178. if (!guideVisible.value) return;
  179. guideVisible.value = false;
  180. localStorage.setItem(GUIDE_STORAGE_KEY, "1");
  181. };
  182. const tryShowGuide = () => {
  183. if (localStorage.getItem(GUIDE_STORAGE_KEY)) return;
  184. guideVisible.value = true;
  185. };
  186. const handleOutsideClick = (event) => {
  187. if (!guideVisible.value) return;
  188. const target = event.target;
  189. if (target?.closest?.(".crop-guide-bubble") || target?.closest?.(".switch-btn")) return;
  190. dismissGuide();
  191. };
  192. watch(cropMenuVisible, (visible) => {
  193. if (visible) dismissGuide();
  194. });
  195. const applySelectedZone = (index) => {
  196. const zone = zoneList.value[index];
  197. if (!zone) {
  198. activeIndex.value = 0;
  199. selectedZoneId.value = null;
  200. syncCropNameDisplay();
  201. emit("zoneChange", null);
  202. return;
  203. }
  204. activeIndex.value = index;
  205. selectedZoneId.value = zone.zone_id ?? null;
  206. syncCropNameDisplay();
  207. emit("zoneChange", selectedZoneId.value);
  208. };
  209. const handleSelectCrop = (index) => {
  210. dismissGuide();
  211. cropMenuVisible.value = false;
  212. if (index === activeIndex.value) return;
  213. applySelectedZone(index);
  214. fetchAlertCards();
  215. };
  216. const PANEL_HEADER_BAR = 14; // van-floating-panel 原生 header 高度
  217. const PANEL_BOTTOM_GAP = 12;
  218. /** 收起态:仅作物头,高度不含 tabBar(tabBar 用 bottom 顶开) */
  219. const COLLAPSED_CONTENT_HEIGHT = 72;
  220. /** 锚点只算面板自身高度,底部用 style.bottom 避开 tabBar,避免高度+padding 重复抬高 */
  221. const getCollapsedAnchor = () => COLLAPSED_CONTENT_HEIGHT;
  222. const anchors = ref([getCollapsedAnchor(), 280]);
  223. const height = ref(anchors.value[1]);
  224. const isBackground = ref(false);
  225. const panelShellRef = ref(null);
  226. let resizeObserver = null;
  227. let syncing = false;
  228. const emitPanelHeight = (panelH = height.value) => {
  229. // 对外抛出「距视口底」的占用高度,方便邀请按钮等避让
  230. emit("heightChange", panelH + tabBarHeight.value);
  231. };
  232. const syncMidAnchor = () => {
  233. const shell = panelShellRef.value;
  234. if (!shell || syncing) return;
  235. tabBarHeight.value = resolveTabBarHeight();
  236. const collapsed = getCollapsedAnchor();
  237. // scrollHeight 才是内容真实高度;offsetHeight 在被裁切时会偏小
  238. const contentH = shell.scrollHeight;
  239. const idealMid = Math.round(contentH + PANEL_HEADER_BAR + PANEL_BOTTOM_GAP);
  240. // 留一点顶部空间,并扣掉底部 tabBar
  241. const maxMid = Math.round(window.innerHeight - tabBarHeight.value) - 48;
  242. const nextMid = Math.max(collapsed + 80, Math.min(idealMid, maxMid));
  243. if (
  244. Math.abs(nextMid - anchors.value[1]) < 2 &&
  245. Math.abs(collapsed - anchors.value[0]) < 2
  246. ) {
  247. return;
  248. }
  249. syncing = true;
  250. const wasAtMid = Math.abs(height.value - anchors.value[1]) < 2;
  251. const wasCollapsed = Math.abs(height.value - anchors.value[0]) < 2;
  252. anchors.value = [collapsed, nextMid];
  253. if (wasAtMid) {
  254. height.value = nextMid;
  255. } else if (wasCollapsed) {
  256. height.value = collapsed;
  257. }
  258. nextTick(() => {
  259. syncing = false;
  260. emitPanelHeight();
  261. });
  262. };
  263. watch(
  264. () => store.state.home.tabBarHeight,
  265. (val) => {
  266. if (!val) return;
  267. tabBarHeight.value = val;
  268. syncMidAnchor();
  269. }
  270. );
  271. const alertCards = ref([
  272. {
  273. id: CARD_ID.WARNING,
  274. source: "warning",
  275. title: "",
  276. icon: weatherIcon,
  277. content: "",
  278. patrolTip: "",
  279. },
  280. {
  281. id: CARD_ID.STRESS,
  282. source: "stress",
  283. type: "abnormal",
  284. title: "",
  285. icon: weatherIcon,
  286. content: "",
  287. patrolTip: "异常态势巡园要点",
  288. },
  289. ]);
  290. const getSelectedFarm = () => {
  291. try {
  292. return JSON.parse(localStorage.getItem("selectedFarmData") || "{}");
  293. } catch {
  294. return {};
  295. }
  296. };
  297. /** 以缓存为准,避免 onActivated 时 props.farmId 尚未跟上父组件同步 */
  298. const resolveFarmId = () => {
  299. const farm = getSelectedFarm();
  300. const id =
  301. localStorage.getItem("selectedFarmId") ||
  302. farm.farm_id ||
  303. farm.id ||
  304. props.farmId;
  305. return id != null && id !== "" ? id : "";
  306. };
  307. /** 保证有zone_id */
  308. const resolveZoneId = () => {
  309. const farm = getSelectedFarm();
  310. return farm.zone_id || "";
  311. };
  312. const formatLocalDate = (date) => {
  313. const y = date.getFullYear();
  314. const m = String(date.getMonth() + 1).padStart(2, "0");
  315. const d = String(date.getDate()).padStart(2, "0");
  316. return `${y}-${m}-${d}`;
  317. };
  318. /** 用当前选中农场 + 分区 + 当天日期(zone 只信面板选中态,避免缓存滞后) */
  319. const getQueryParams = () => {
  320. return {
  321. farm_id: resolveFarmId(),
  322. zone_id: selectedZoneId.value || resolveZoneId(),
  323. date: formatLocalDate(new Date()),
  324. };
  325. };
  326. /** 拉取分区列表,填充切换作物下拉 */
  327. const fetchZones = async (token = reloadToken) => {
  328. const farmId = resolveFarmId();
  329. if (farmId == null || farmId === "") {
  330. zoneList.value = [];
  331. cropOptions.value = [];
  332. applySelectedZone(-1);
  333. return;
  334. }
  335. try {
  336. const res = await VE_API.questionnaire.getZones({ farm_id: farmId });
  337. // 旧请求回包时不覆盖当前选中分区
  338. if (token !== reloadToken) return;
  339. const zones = Array.isArray(res?.data?.zones) ? res.data.zones : [];
  340. zoneList.value = zones;
  341. cropOptions.value = zones.map((item) => item.zone_name || "");
  342. applySelectedZone(zones.length ? 0 : -1);
  343. } catch (e) {
  344. if (token !== reloadToken) return;
  345. console.warn("[CropAlertPanel] getZones failed", e);
  346. zoneList.value = [];
  347. cropOptions.value = [];
  348. applySelectedZone(-1);
  349. }
  350. };
  351. /** 切换农场 / 回页:先清旧 zone,再拉分区,最后拉预警 */
  352. const reloadFarmAlerts = async () => {
  353. const token = ++reloadToken;
  354. selectedZoneId.value = null;
  355. activeIndex.value = 0;
  356. zoneList.value = [];
  357. cropOptions.value = [];
  358. syncCropNameDisplay();
  359. await fetchZones(token);
  360. if (token !== reloadToken) return;
  361. await fetchAlertCards(token);
  362. };
  363. /** 接口可能返回对象或数组,统一取第一条 */
  364. const pickFirstRecord = (res) => {
  365. const data = res?.data ?? res;
  366. if (Array.isArray(data)) return data[0] || null;
  367. if (data && typeof data === "object") return data;
  368. return null;
  369. };
  370. const patchAlertCard = (cardId, patch) => {
  371. const card = alertCards.value.find((item) => item.id === cardId);
  372. if (!card) return;
  373. Object.assign(card, patch);
  374. };
  375. const applyWeatherRisk = (record) => {
  376. patchAlertCard(CARD_ID.WARNING, {
  377. title: record?.risk_name || "",
  378. content: record?.explain_simple || "",
  379. });
  380. };
  381. const applyWeatherStress = (record) => {
  382. patchAlertCard(CARD_ID.STRESS, {
  383. title: record?.stress_name || "",
  384. content: record?.explain_simple || "",
  385. });
  386. };
  387. const fetchAlertCards = async (token = reloadToken) => {
  388. const queryParams = getQueryParams();
  389. if (queryParams.farm_id == null || queryParams.farm_id === "") {
  390. if (token !== reloadToken) return;
  391. applyWeatherRisk(null);
  392. applyWeatherStress(null);
  393. nextTick(() => syncMidAnchor());
  394. return;
  395. }
  396. const [riskRes, stressRes] = await Promise.allSettled([
  397. VE_API.questionnaire.getWeatherRisk(queryParams),
  398. VE_API.questionnaire.getWeatherStress(queryParams),
  399. ]);
  400. // 切换农场期间若有更新请求,丢弃旧回包
  401. if (token !== reloadToken) return;
  402. // 成功但无数据时清空旧卡片,避免切换农场后残留
  403. applyWeatherRisk(riskRes.status === "fulfilled" ? pickFirstRecord(riskRes.value) : null);
  404. applyWeatherStress(stressRes.status === "fulfilled" ? pickFirstRecord(stressRes.value) : null);
  405. nextTick(() => syncMidAnchor());
  406. };
  407. const handleViewDetail = (item) => {
  408. router.push({
  409. path: "/alert_detail",
  410. query: {
  411. title: item?.title || "具体预警",
  412. type: item?.source || "warning",
  413. },
  414. });
  415. };
  416. const handlePatrolTip = (item) => {
  417. const isAbnormal = item?.type === "abnormal";
  418. router.push({
  419. path: isAbnormal ? "/abnormal_track" : "/growth_track",
  420. query: {
  421. id: item.id,
  422. },
  423. });
  424. };
  425. const handleHeightChange = ({ height: nextHeight }) => {
  426. isBackground.value = nextHeight < anchors.value[1];
  427. emitPanelHeight(nextHeight);
  428. };
  429. onMounted(() => {
  430. nextTick(() => {
  431. tabBarHeight.value = resolveTabBarHeight();
  432. // 等布局完成后再量一次,避免首屏高度偏小;小程序里 tabBar 可能稍晚才量到
  433. requestAnimationFrame(() => {
  434. syncMidAnchor();
  435. setTimeout(() => {
  436. tabBarHeight.value = resolveTabBarHeight();
  437. syncMidAnchor();
  438. emitPanelHeight();
  439. tryShowGuide();
  440. }, 80);
  441. setTimeout(() => {
  442. tabBarHeight.value = resolveTabBarHeight();
  443. syncMidAnchor();
  444. }, 600);
  445. });
  446. if (!panelShellRef.value || typeof ResizeObserver === "undefined") return;
  447. resizeObserver = new ResizeObserver(() => {
  448. syncMidAnchor();
  449. emitPanelHeight();
  450. });
  451. resizeObserver.observe(panelShellRef.value);
  452. });
  453. document.addEventListener("click", handleOutsideClick, true);
  454. });
  455. /** 进入 / 从切换农场返回:nextTick 等父组件 syncSelectedFarmId 落盘后再拉 */
  456. onActivated(() => {
  457. syncCropNameDisplay();
  458. nextTick(() => {
  459. syncCropNameDisplay();
  460. reloadFarmAlerts();
  461. });
  462. });
  463. onBeforeUnmount(() => {
  464. document.removeEventListener("click", handleOutsideClick, true);
  465. resizeObserver?.disconnect?.();
  466. resizeObserver = null;
  467. });
  468. defineExpose({ refreshAlerts: fetchAlertCards, refreshZones: fetchZones, reloadFarmAlerts });
  469. </script>
  470. <style lang="scss" scoped>
  471. .van-floating-panel {
  472. border-radius: 0;
  473. }
  474. .floating-panel {
  475. background: transparent;
  476. ::v-deep {
  477. .van-floating-panel__header {
  478. background: transparent;
  479. height: 16px;
  480. }
  481. .van-floating-panel__header-bar {
  482. width: 36px;
  483. height: 4px;
  484. background: rgba(255, 255, 255, 0.5);
  485. border-radius: 4px;
  486. }
  487. .van-floating-panel__content {
  488. background: transparent;
  489. overflow-y: auto;
  490. }
  491. }
  492. .floating-panel-content {
  493. width: calc(100% - 20px);
  494. margin: 0 auto;
  495. // margin: 14px auto 0; // 补偿隐藏 header 的 10px,原本30px,整体下移
  496. box-sizing: border-box;
  497. }
  498. .panel-shell {
  499. padding: 12px;
  500. border-radius: 16px;
  501. background: linear-gradient(180deg, #b2dbfb 0%, #cbe8ff 100%);
  502. box-sizing: border-box;
  503. }
  504. .crop-header {
  505. display: flex;
  506. align-items: center;
  507. justify-content: space-between;
  508. gap: 10px;
  509. margin-bottom: 10px;
  510. }
  511. .crop-info {
  512. display: flex;
  513. align-items: center;
  514. gap: 6px;
  515. min-width: 0;
  516. }
  517. .crop-avatar {
  518. flex-shrink: 0;
  519. }
  520. .crop-name {
  521. font-size: 18px;
  522. font-weight: 500;
  523. color: #000000;
  524. line-height: 26px;
  525. }
  526. .crop-badge {
  527. flex-shrink: 0;
  528. height: 20px;
  529. padding: 0 5px;
  530. border-radius: 2px;
  531. background: #2199f8;
  532. color: #fff;
  533. backdrop-filter: blur(4px);
  534. font-size: 12px;
  535. line-height: 20px;
  536. }
  537. .switch-wrap {
  538. position: relative;
  539. flex-shrink: 0;
  540. z-index: 5;
  541. }
  542. .crop-guide-bubble {
  543. position: absolute;
  544. top: calc(100% + 10px);
  545. right: 20px;
  546. width: 216px;
  547. padding: 6px 10px;
  548. border-radius: 6px;
  549. background: rgba(0, 0, 0, 0.8);
  550. box-sizing: border-box;
  551. z-index: 20;
  552. pointer-events: auto;
  553. &__arrow {
  554. position: absolute;
  555. top: -5px;
  556. right: 12px;
  557. width: 0;
  558. height: 0;
  559. border-left: 6px solid transparent;
  560. border-right: 6px solid transparent;
  561. border-bottom: 6px solid rgba(0, 0, 0, 0.8);
  562. }
  563. &__content {
  564. font-size: 14px;
  565. line-height: 22px;
  566. color: #fff;
  567. word-break: break-all;
  568. text-align: justify;
  569. }
  570. &__crop {
  571. padding: 0 2px;
  572. color: #2199f8;
  573. }
  574. }
  575. .switch-btn {
  576. display: flex;
  577. align-items: center;
  578. gap: 2px;
  579. flex-shrink: 0;
  580. height: 28px;
  581. padding: 0 10px;
  582. border-radius: 14px;
  583. border: 1px solid #2199f8;
  584. background: #fff;
  585. color: #2199f8;
  586. font-size: 12px;
  587. &.is-open {
  588. border-color: #2199f8;
  589. box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.15);
  590. }
  591. &__icon {
  592. font-size: 14px;
  593. color: #2199f8;
  594. transition: transform 0.3s ease;
  595. }
  596. .is-open-icon {
  597. transform: rotate(180deg);
  598. }
  599. }
  600. .alert-list {
  601. display: flex;
  602. flex-direction: column;
  603. gap: 10px;
  604. }
  605. .alert-card {
  606. padding: 12px;
  607. border-radius: 12px;
  608. background: #fff;
  609. box-sizing: border-box;
  610. &__header {
  611. display: flex;
  612. align-items: center;
  613. justify-content: space-between;
  614. gap: 8px;
  615. }
  616. &__title-wrap {
  617. display: flex;
  618. align-items: flex-end;
  619. gap: 6px;
  620. min-width: 0;
  621. }
  622. &__icon {
  623. width: 17px;
  624. height: 17px;
  625. flex-shrink: 0;
  626. }
  627. &__title {
  628. font-size: 14px;
  629. font-weight: 500;
  630. color: #000000;
  631. }
  632. &__link {
  633. flex-shrink: 0;
  634. font-size: 12px;
  635. color: #2199f8;
  636. }
  637. &__content-wrap {
  638. margin-top: 8px;
  639. }
  640. &__content {
  641. font-size: 14px;
  642. line-height: 21px;
  643. color: rgba(6, 6, 6, 0.5);
  644. word-break: break-all;
  645. }
  646. &__patrol {
  647. padding-left: 6px;
  648. display: inline-flex;
  649. align-items: center;
  650. gap: 4px;
  651. font-size: 14px;
  652. color: #2199f8;
  653. text-decoration: underline;
  654. text-underline-offset: 4px;
  655. }
  656. &__patrol-icon {
  657. font-size: 16px;
  658. }
  659. }
  660. &.background-panel {
  661. .panel-shell {
  662. padding: 6px 10px 10px 10px;
  663. background: url("@/assets/img/report/type-bg.png");
  664. background-size: calc(100vw - 20px) 40px;
  665. background-repeat: no-repeat;
  666. background-position: center top;
  667. .crop-header {
  668. // padding-bottom: 60px;
  669. }
  670. }
  671. }
  672. }
  673. </style>
  674. <style lang="scss">
  675. .crop-switch-tooltip {
  676. z-index: 3000 !important;
  677. padding: 8px 0 !important;
  678. min-width: 120px;
  679. border: none !important;
  680. border-radius: 12px !important;
  681. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  682. background: #fff !important;
  683. .el-popper__arrow::before {
  684. background: #fff !important;
  685. border: none !important;
  686. }
  687. .crop-option-list {
  688. display: flex;
  689. flex-direction: column;
  690. }
  691. .crop-option-item {
  692. padding: 10px 20px;
  693. font-size: 14px;
  694. line-height: 20px;
  695. color: #333;
  696. cursor: pointer;
  697. &:active,
  698. &.active {
  699. color: #2199f8;
  700. background: rgba(33, 153, 248, 0.06);
  701. }
  702. }
  703. }
  704. </style>