restorePlantingPopup.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <template>
  2. <popup
  3. v-model:show="visible"
  4. round
  5. teleport="body"
  6. :z-index="20000"
  7. class="restore-planting-popup"
  8. :close-on-click-overlay="true"
  9. >
  10. <div class="popup-content">
  11. <img
  12. class="restore-planting-popup__decor"
  13. src="@/assets/img/agricultural/question.png"
  14. alt=""
  15. />
  16. <div class="restore-planting-popup__header">
  17. <div class="restore-planting-popup__title">
  18. <div>{{ t("agriFile.restoreFillQuestions") }}</div>
  19. <div>{{ t("agriFile.restorePlantingService") }}</div>
  20. </div>
  21. </div>
  22. <!-- 问题一:选择时间 -->
  23. <div v-if="questionType === 'time'" class="restore-planting-popup__card">
  24. <div class="restore-planting-popup__question">
  25. <template v-if="highlightWord && questionText.includes(highlightWord)">
  26. <span>{{ questionText.split(highlightWord)[0] }}</span>
  27. <span class="restore-planting-popup__keyword">{{ highlightWord }}</span>
  28. <span>{{ questionText.split(highlightWord).slice(1).join(highlightWord) }}</span>
  29. </template>
  30. <template v-else>{{ questionText }}</template>
  31. </div>
  32. <div class="restore-planting-popup__hint">{{ hintText }}</div>
  33. <div class="restore-planting-popup__photo">
  34. <img :src="sampleImage" alt="" />
  35. </div>
  36. <el-date-picker
  37. v-model="selectedDate"
  38. class="restore-planting-popup__date-picker"
  39. type="date"
  40. format="YYYY.MM.DD"
  41. value-format="YYYY.MM.DD"
  42. :placeholder="t('agriFile.selectTime')"
  43. :editable="false"
  44. :clearable="false"
  45. teleported
  46. popper-class="restore-planting-date-popper"
  47. style="width: 100%"
  48. />
  49. </div>
  50. <!-- 问题二:物候期选择 -->
  51. <div v-else class="restore-planting-popup__card">
  52. <div class="restore-planting-popup__question">
  53. <template v-if="phenologyHighlight && phenologyQuestion.includes(phenologyHighlight)">
  54. <span>{{ phenologyQuestion.split(phenologyHighlight)[0] }}</span>
  55. <span class="restore-planting-popup__keyword">{{ phenologyHighlight }}</span>
  56. <span>{{ phenologyQuestion.split(phenologyHighlight).slice(1).join(phenologyHighlight) }}</span>
  57. </template>
  58. <template v-else>{{ phenologyQuestion }}</template>
  59. </div>
  60. <div class="restore-planting-popup__photo restore-planting-popup__photo--guide">
  61. <img :src="phenologyImage" alt="" />
  62. <photo-provider :photo-closable="true">
  63. <photo-consumer :src="patrolGuideImage" :intro="patrolGuideImage">
  64. <div class="restore-planting-popup__guide-btn">
  65. {{ t("agriFile.viewPatrolGuide") }}
  66. </div>
  67. </photo-consumer>
  68. </photo-provider>
  69. </div>
  70. <div class="restore-planting-popup__options">
  71. <div
  72. v-for="item in phenologyOptions"
  73. :key="item.value"
  74. class="restore-planting-popup__option"
  75. :class="{ active: phenologyAnswer === item.value }"
  76. @click="handlePhenologySelect(item.value)"
  77. >
  78. <span>{{ item.label }}</span>
  79. <span v-if="phenologyAnswer === item.value" class="restore-planting-popup__option-check">
  80. <el-icon><Check /></el-icon>
  81. </span>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="restore-planting-popup__actions">
  86. <div
  87. class="restore-planting-popup__btn restore-planting-popup__btn--primary"
  88. :class="{ disabled: submitting }"
  89. @click="handleConfirm"
  90. >
  91. <span v-if="submitting" class="restore-planting-popup__btn-loading">
  92. <el-icon><Loading /></el-icon>
  93. </span>
  94. {{ questionType === "time" ? t("agriFile.confirmNow") : t("agriFile.submitInfo") }}
  95. </div>
  96. </div>
  97. </div>
  98. </popup>
  99. <tip-popup class="restore-planting-success-popup" v-model:show="showSuccessPopup" :zIndex="20000" type="executeSuccess" text="物候期已确认" text2="正在生成专属农事方案" hideBtn>
  100. <template #footer>
  101. <div class="bottom-btn-container">
  102. <div class="bottom-btn primary-btn" @click="showSuccessPopup=false">完成</div>
  103. </div>
  104. </template>
  105. </tip-popup>
  106. </template>
  107. <script setup>
  108. import { computed, onActivated, onDeactivated, ref } from "vue";
  109. import { Popup } from "vant";
  110. import { Check } from "@element-plus/icons-vue";
  111. import { ElMessage } from "element-plus";
  112. import { useI18n } from "@/i18n";
  113. import { base_img_url2 } from "@/api/config";
  114. import tipPopup from "@/components/popup/tipPopup.vue";
  115. const { t } = useI18n();
  116. const emit = defineEmits(["success"]);
  117. // ---------------------------------------------------------------------------
  118. // Props
  119. // ---------------------------------------------------------------------------
  120. const props = defineProps({
  121. /** 分区 id;不传则读当前选中农场缓存 */
  122. zoneId: { type: [Number, String], default: null },
  123. });
  124. // ---------------------------------------------------------------------------
  125. // 常量
  126. // ---------------------------------------------------------------------------
  127. const PHENOLOGY_PREFIX = "您的农场是否进入到 ";
  128. const DEFAULT_SAMPLE_IMAGE = require("@/assets/img/agricultural/baidian.png");
  129. const DEFAULT_PHENOLOGY_IMAGE = require("@/assets/img/common/sd-1.jpg");
  130. /** 巡园向导预览图 */
  131. const PATROL_GUIDE_IMAGE_PATH =
  132. "e84a8f1b-9842-434c-951f-068ff6963f31/6c8b7135-95b7-4c04-82ef-a2daeb674d0c/DJI_202608190758_001_6c8b7135-95b7-4c04-82ef-a2daeb674d0c/DJI_20260819080818_0085_V_code-ws0fsmg8zg8u.jpeg";
  133. const patrolGuideImage = ref("");
  134. // ---------------------------------------------------------------------------
  135. // 页面状态
  136. // ---------------------------------------------------------------------------
  137. /** 弹窗显隐由接口数据控制,默认不展示 */
  138. const visible = ref(false);
  139. const questionType = ref("time"); // time | phenology
  140. const selectedDate = ref("");
  141. const phenologyAnswer = ref("");
  142. const submitting = ref(false);
  143. const hasDateInteract = ref(false);
  144. const hasOptionsInteract = ref(false);
  145. /** date_interact 原始数据,提交时可能用到 */
  146. const dateInteractData = ref(null);
  147. /** options_interact.interact 映射表,key 为 start_with 同类序号 */
  148. const interactMap = ref({});
  149. /** 当前展示的物候期序号(对应 interact 的 key) */
  150. const currentInteractKey = ref("");
  151. /** 用户确认「已到达」后写入,提交接口使用 */
  152. const selectedPeriodCode = ref("");
  153. const questionText = ref("");
  154. const highlightWord = ref("");
  155. const hintText = ref("");
  156. const sampleImage = ref(DEFAULT_SAMPLE_IMAGE);
  157. const phenologyQuestion = ref("");
  158. const phenologyHighlight = ref("");
  159. const phenologyImage = ref(DEFAULT_PHENOLOGY_IMAGE);
  160. const showSuccessPopup = ref(false);
  161. // ---------------------------------------------------------------------------
  162. // 计算属性
  163. // ---------------------------------------------------------------------------
  164. const phenologyOptions = computed(() => [
  165. { value: "not_reached", label: t("agriFile.notReached") },
  166. { value: "reached", label: t("agriFile.reached") },
  167. { value: "passed", label: t("agriFile.passed") },
  168. ]);
  169. const interactKeys = computed(() =>
  170. Object.keys(interactMap.value).sort((a, b) => Number(a) - Number(b))
  171. );
  172. const getSelectedFarmId = () => {
  173. try {
  174. const farm = JSON.parse(localStorage.getItem("selectedFarmData") || "{}");
  175. return String(
  176. localStorage.getItem("selectedFarmId") || farm.farm_id || farm.id || ""
  177. );
  178. } catch {
  179. return String(localStorage.getItem("selectedFarmId") || "");
  180. }
  181. };
  182. const getSelectedZoneId = () => {
  183. try {
  184. const farm = JSON.parse(localStorage.getItem("selectedFarmData") || "{}");
  185. return farm.zone_id ?? farm.zoneId ?? null;
  186. } catch {
  187. return null;
  188. }
  189. };
  190. /** 每次实时读缓存,避免 computed 缓存旧 zone_id */
  191. const resolveZoneId = () => props.zoneId ?? getSelectedZoneId();
  192. /** 上次成功请求对应的农场/分区 */
  193. let lastFetchedFarmKey = "";
  194. /** 递增后旧请求的返回不再打开弹窗 */
  195. let requestSeq = 0;
  196. /** 当前页是否处于前台,离开后迟到的响应不展示 */
  197. let pageActive = false;
  198. const getFarmFetchKey = () => `${getSelectedFarmId()}|${resolveZoneId() ?? ""}`;
  199. // ---------------------------------------------------------------------------
  200. // 工具函数
  201. // ---------------------------------------------------------------------------
  202. /** 当天日期 YYYY-MM-DD */
  203. const formatToday = () => {
  204. const d = new Date();
  205. const y = d.getFullYear();
  206. const m = String(d.getMonth() + 1).padStart(2, "0");
  207. const day = String(d.getDate()).padStart(2, "0");
  208. return `${y}-${m}-${day}`;
  209. };
  210. /** 日期选择器 YYYY.MM.DD → 接口 YYYY-MM-DD */
  211. const toApiDate = (value) => (value ? String(value).replace(/\./g, "-") : "");
  212. /** 拼接 CDN 图片地址 */
  213. const resolveImageUrl = (path) => {
  214. if (!path) return "";
  215. if (/^https?:\/\//i.test(path)) return path;
  216. return base_img_url2 + String(path).replace(/^\//, "");
  217. };
  218. /** 从 interact_theme 引号中提取高亮词,如「来梢」 */
  219. const extractHighlightWord = (text) => {
  220. if (!text) return "";
  221. const match = String(text).match(/[“"「]([^”"」]+)[”"」]/);
  222. return match ? match[1] : "";
  223. };
  224. /** Message 需高于弹窗 z-index: 20000 */
  225. const showMessage = (message, type = "warning") => {
  226. ElMessage({
  227. message,
  228. type,
  229. customClass: "restore-planting-message",
  230. zIndex: 40000,
  231. });
  232. };
  233. const showWarning = (message) => showMessage(message, "warning");
  234. const resetForm = () => {
  235. questionType.value = hasDateInteract.value ? "time" : "phenology";
  236. selectedDate.value = "";
  237. phenologyAnswer.value = "";
  238. selectedPeriodCode.value = "";
  239. };
  240. // ---------------------------------------------------------------------------
  241. // 业务逻辑:填充问题 / 物候期切换
  242. // ---------------------------------------------------------------------------
  243. const applyDateInteract = (data) => {
  244. dateInteractData.value = data;
  245. questionText.value = data.interact_theme || "";
  246. highlightWord.value = extractHighlightWord(data.interact_theme);
  247. hintText.value = data.interact_reason || "";
  248. sampleImage.value = resolveImageUrl(data.guide_url) || DEFAULT_SAMPLE_IMAGE;
  249. };
  250. /** 按 interact key 刷新问题二文案与配图 */
  251. const applyPhenologyByKey = (key) => {
  252. const item = interactMap.value[key];
  253. if (!item) return;
  254. currentInteractKey.value = String(key);
  255. const name = item.period_name || "";
  256. phenologyHighlight.value = name;
  257. phenologyQuestion.value = `${PHENOLOGY_PREFIX}${name} ?`;
  258. phenologyImage.value = resolveImageUrl(item.pheno_pic_url) || DEFAULT_PHENOLOGY_IMAGE;
  259. patrolGuideImage.value = resolveImageUrl(item.interact_pic_url) || (base_img_url2 + PATROL_GUIDE_IMAGE_PATH);
  260. selectedPeriodCode.value = "";
  261. };
  262. /** 暂未到达 → 前一个;已过 → 后一个 */
  263. const movePhenology = (direction) => {
  264. const keys = interactKeys.value;
  265. const idx = keys.indexOf(String(currentInteractKey.value));
  266. if (idx < 0) return false;
  267. const nextIdx = direction === "prev" ? idx - 1 : idx + 1;
  268. if (nextIdx < 0 || nextIdx >= keys.length) {
  269. showWarning(direction === "prev" ? "已是最早物候期" : "已是最晚物候期");
  270. return false;
  271. }
  272. applyPhenologyByKey(keys[nextIdx]);
  273. phenologyAnswer.value = "";
  274. return true;
  275. };
  276. const applyQuestionData = (data) => {
  277. hasDateInteract.value = !!data?.date_interact;
  278. hasOptionsInteract.value = !!data?.options_interact?.interact;
  279. if (hasDateInteract.value) {
  280. applyDateInteract(data.date_interact);
  281. }
  282. if (hasOptionsInteract.value) {
  283. interactMap.value = data.options_interact.interact || {};
  284. const startKey = String(data.options_interact.start_with ?? interactKeys.value[0] ?? "");
  285. applyPhenologyByKey(startKey);
  286. }
  287. // 有时间题优先展示;仅物候题则直接进入问题二
  288. questionType.value = hasDateInteract.value ? "time" : "phenology";
  289. visible.value = hasDateInteract.value || hasOptionsInteract.value;
  290. };
  291. /** 请求接口判断是否展示,并填充问题内容 */
  292. const checkShouldShow = async () => {
  293. const seq = ++requestSeq;
  294. const zoneId = resolveZoneId();
  295. const fetchKey = getFarmFetchKey();
  296. if (!pageActive) return;
  297. if (zoneId == null || zoneId === "") {
  298. visible.value = false;
  299. lastFetchedFarmKey = fetchKey;
  300. return;
  301. }
  302. try {
  303. const res = await VE_API.questionnaire.getInitialInteraction({
  304. zone_id: zoneId,
  305. date: formatToday(),
  306. });
  307. // 已切页或已有更新的请求时,丢弃这次结果,避免弹窗叠加
  308. if (seq !== requestSeq || !pageActive) return;
  309. if (res?.code === 200 && res.data) {
  310. applyQuestionData(res.data);
  311. } else {
  312. visible.value = false;
  313. }
  314. lastFetchedFarmKey = fetchKey;
  315. } catch (e) {
  316. if (seq !== requestSeq || !pageActive) return;
  317. visible.value = false;
  318. }
  319. };
  320. // ---------------------------------------------------------------------------
  321. // 事件处理 / 生命周期
  322. // ---------------------------------------------------------------------------
  323. // 进入 / 从其他页返回时重新请求;离开时已关弹窗,不能因「农场未变」跳过
  324. onActivated(() => {
  325. pageActive = true;
  326. visible.value = false;
  327. resetForm();
  328. checkShouldShow();
  329. });
  330. onDeactivated(() => {
  331. pageActive = false;
  332. requestSeq += 1;
  333. visible.value = false;
  334. lastFetchedFarmKey = "";
  335. });
  336. /**
  337. * 暂未到达 / 已过:立刻切到相邻物候期;
  338. * 已到达:选中并记下当前 period_code,供提交使用
  339. */
  340. const handlePhenologySelect = (value) => {
  341. if (value === "not_reached") {
  342. movePhenology("prev");
  343. return;
  344. }
  345. if (value === "passed") {
  346. movePhenology("next");
  347. return;
  348. }
  349. phenologyAnswer.value = "reached";
  350. const current = interactMap.value[currentInteractKey.value];
  351. selectedPeriodCode.value = current?.period_code || "";
  352. };
  353. /**
  354. * 组装保存感知结果载荷
  355. * @param {'time'|'phenology'} type 问题一不含 period_code;问题二不含 interact_code
  356. */
  357. const buildSubmitPayload = (type = "time") => {
  358. const payload = {
  359. zone_id: Number(resolveZoneId()) || resolveZoneId(),
  360. date: toApiDate(selectedDate.value) || formatToday(),
  361. };
  362. if (type === "time") {
  363. payload.interact_code = dateInteractData.value?.interact_code || "";
  364. } else {
  365. payload.period_code = selectedPeriodCode.value || "";
  366. }
  367. return payload;
  368. };
  369. /** 从 axios 错误中取出可读信息 */
  370. const getRequestErrorMessage = (err) => {
  371. const data = err?.response?.data;
  372. if (typeof data === "string" && data) return data;
  373. if (data?.msg) return data.msg;
  374. if (data?.message) return data.message;
  375. if (err?.message) return err.message;
  376. return "提交失败,请稍后再试";
  377. };
  378. /**
  379. * 调用保存感知结果接口
  380. * @param {'time'|'phenology'} type
  381. * @param {{ closeOnSuccess?: boolean }} options closeOnSuccess=false 时成功后不关弹窗(用于继续答问题二)
  382. */
  383. const submitInteractResult = async (type = "time", { closeOnSuccess = true } = {}) => {
  384. if (submitting.value) return false;
  385. submitting.value = true;
  386. try {
  387. const res = await VE_API.questionnaire.saveInteractResult(buildSubmitPayload(type));
  388. if (res?.code === 200) {
  389. if (closeOnSuccess) {
  390. // showMessage(res.msg || "提交成功", "success");
  391. visible.value = false;
  392. resetForm();
  393. showSuccessPopup.value = true;
  394. emit("success");
  395. }
  396. return true;
  397. }
  398. showMessage(res?.msg || "提交失败,请稍后再试", "error");
  399. return false;
  400. } catch (err) {
  401. showMessage(getRequestErrorMessage(err), "error");
  402. return false;
  403. } finally {
  404. submitting.value = false;
  405. }
  406. };
  407. const handleConfirm = async () => {
  408. if (submitting.value) return;
  409. // 问题一:立即确认 → 提交(不含 period_code)
  410. if (questionType.value === "time") {
  411. if (!selectedDate.value) {
  412. showWarning(t("agriFile.selectTime"));
  413. return;
  414. }
  415. const ok = await submitInteractResult("time", {
  416. // 还有问题二则提交成功后继续展示,不关弹窗
  417. closeOnSuccess: !hasOptionsInteract.value,
  418. });
  419. if (ok && hasOptionsInteract.value) {
  420. questionType.value = "phenology";
  421. }
  422. return;
  423. }
  424. // 问题二:需已选择「已到达」并写入 period_code;提交不含 interact_code
  425. if (phenologyAnswer.value !== "reached" || !selectedPeriodCode.value) {
  426. const current = interactMap.value[currentInteractKey.value];
  427. if (phenologyAnswer.value === "reached" && current?.period_code) {
  428. selectedPeriodCode.value = current.period_code;
  429. } else {
  430. showWarning("请确认当前物候期是否已到达");
  431. return;
  432. }
  433. }
  434. await submitInteractResult("phenology");
  435. };
  436. defineExpose({
  437. checkShouldShow,
  438. buildSubmitPayload,
  439. selectedPeriodCode,
  440. });
  441. </script>
  442. <style scoped lang="scss">
  443. .restore-planting-popup {
  444. width: 86%;
  445. padding: 18px 14px 16px;
  446. box-sizing: border-box;
  447. background: linear-gradient(180deg, #d7ecff 0%, #ffffff 28%);
  448. overflow: visible;
  449. &__header {
  450. display: flex;
  451. align-items: flex-start;
  452. justify-content: space-between;
  453. }
  454. &__title {
  455. font-size: 22px;
  456. line-height: 25px;
  457. color: #111;
  458. div {
  459. font-family: "PangMenZhengDao";
  460. }
  461. }
  462. .popup-content {
  463. position: relative;
  464. }
  465. &__decor {
  466. position: absolute;
  467. top: -8px;
  468. right: -4px;
  469. width: 78px;
  470. height: 78px;
  471. object-fit: contain;
  472. pointer-events: none;
  473. }
  474. &__card {
  475. margin-top: 12px;
  476. padding: 10px 12px 12px;
  477. border-radius: 12px;
  478. background: #eaf5ff;
  479. box-sizing: border-box;
  480. position: relative;
  481. z-index: 2;
  482. }
  483. &__question {
  484. font-size: 15px;
  485. line-height: 24px;
  486. color: #252525;
  487. font-weight: 500;
  488. }
  489. &__keyword {
  490. color: #2199f8;
  491. }
  492. &__hint {
  493. margin-top: 4px;
  494. font-size: 12px;
  495. line-height: 16px;
  496. color: #9e9e9e;
  497. }
  498. &__photo {
  499. position: relative;
  500. margin: 12px 0;
  501. border-radius: 8px;
  502. overflow: hidden;
  503. height: 148px;
  504. // background: #dfeaf5;
  505. img {
  506. display: block;
  507. width: 100%;
  508. height: 148px;
  509. border-radius: 8px;
  510. object-fit: cover;
  511. }
  512. &--guide img {
  513. height: 132px;
  514. }
  515. }
  516. &__guide-btn {
  517. position: absolute;
  518. top: 8px;
  519. right: 8px;
  520. height: 28px;
  521. padding: 0 10px;
  522. border-radius: 14px;
  523. background: rgba(0, 0, 0, 0.55);
  524. color: #fff;
  525. font-size: 12px;
  526. display: flex;
  527. align-items: center;
  528. justify-content: center;
  529. }
  530. &__options {
  531. margin-top: 12px;
  532. display: flex;
  533. gap: 8px;
  534. }
  535. &__option {
  536. position: relative;
  537. flex: 1;
  538. height: 36px;
  539. border-radius: 8px;
  540. background: #fff;
  541. border: 1px solid transparent;
  542. display: flex;
  543. align-items: center;
  544. justify-content: center;
  545. font-size: 13px;
  546. color: #333;
  547. box-sizing: border-box;
  548. &.active {
  549. border-color: #2199f8;
  550. color: #2199f8;
  551. }
  552. }
  553. &__option-check {
  554. position: absolute;
  555. top: 0;
  556. right: 0;
  557. width: 16px;
  558. height: 16px;
  559. border-radius: 0 6px 0 6px;
  560. background: #2199f8;
  561. color: #fff;
  562. display: flex;
  563. align-items: center;
  564. justify-content: center;
  565. font-size: 10px;
  566. }
  567. &__date-picker {
  568. width: 100%;
  569. :deep(.el-input__wrapper) {
  570. height: 40px;
  571. border-radius: 8px;
  572. box-shadow: none !important;
  573. background: #fff;
  574. padding: 0 12px;
  575. }
  576. :deep(.el-input__inner) {
  577. font-size: 14px;
  578. color: #333;
  579. }
  580. :deep(.el-input__prefix),
  581. :deep(.el-input__suffix) {
  582. color: rgba(0, 0, 0, 0.35);
  583. }
  584. }
  585. &__actions {
  586. margin-top: 12px;
  587. display: flex;
  588. align-items: center;
  589. justify-content: center;
  590. }
  591. &__btn {
  592. height: 40px;
  593. line-height: 40px;
  594. padding: 0 30px;
  595. border-radius: 20px;
  596. display: flex;
  597. align-items: center;
  598. justify-content: center;
  599. font-size: 16px;
  600. font-weight: 500;
  601. box-sizing: border-box;
  602. &--primary {
  603. // flex: 1;
  604. background: linear-gradient(180deg, #76c3ff 0%, #2199f8 100%);
  605. color: #fff;
  606. &.disabled {
  607. opacity: 0.6;
  608. pointer-events: none;
  609. }
  610. &-btn-loading {
  611. line-height: 16px;
  612. margin-right: 4px;
  613. }
  614. }
  615. }
  616. }
  617. .bottom-btn-container {
  618. display: flex;
  619. justify-content: space-between;
  620. gap: 12px;
  621. width: 100%;
  622. .bottom-btn {
  623. padding: 0 25px;
  624. border-radius: 4px;
  625. font-size: 16px;
  626. height: 40px;
  627. line-height: 40px;
  628. box-sizing: border-box;
  629. font-weight: 500;
  630. text-align: center;
  631. &.primary-btn {
  632. flex: 1;
  633. background: #2199f8;
  634. color: #fff;
  635. }
  636. }
  637. }
  638. </style>
  639. <!-- 日期面板 / 图片预览 / Message teleport 到 body,需高于弹窗 z-index: 20000 -->
  640. <style lang="scss">
  641. .restore-planting-date-popper {
  642. z-index: 30000 !important;
  643. }
  644. .PhotoSlider__Wrapper {
  645. z-index: 30001 !important;
  646. }
  647. .el-message.restore-planting-message {
  648. z-index: 40000 !important;
  649. }
  650. .restore-planting-success-popup {
  651. &.tip-popup {
  652. z-index: 20000 !important;
  653. }
  654. }
  655. </style>