restorePlantingPopup.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  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 v-model:show="showSuccessPopup" 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 = base_img_url2 + PATROL_GUIDE_IMAGE_PATH;
  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. selectedPeriodCode.value = "";
  260. };
  261. /** 暂未到达 → 前一个;已过 → 后一个 */
  262. const movePhenology = (direction) => {
  263. const keys = interactKeys.value;
  264. const idx = keys.indexOf(String(currentInteractKey.value));
  265. if (idx < 0) return false;
  266. const nextIdx = direction === "prev" ? idx - 1 : idx + 1;
  267. if (nextIdx < 0 || nextIdx >= keys.length) {
  268. showWarning(direction === "prev" ? "已是最早物候期" : "已是最晚物候期");
  269. return false;
  270. }
  271. applyPhenologyByKey(keys[nextIdx]);
  272. phenologyAnswer.value = "";
  273. return true;
  274. };
  275. const applyQuestionData = (data) => {
  276. hasDateInteract.value = !!data?.date_interact;
  277. hasOptionsInteract.value = !!data?.options_interact?.interact;
  278. if (hasDateInteract.value) {
  279. applyDateInteract(data.date_interact);
  280. }
  281. if (hasOptionsInteract.value) {
  282. interactMap.value = data.options_interact.interact || {};
  283. const startKey = String(data.options_interact.start_with ?? interactKeys.value[0] ?? "");
  284. applyPhenologyByKey(startKey);
  285. }
  286. // 有时间题优先展示;仅物候题则直接进入问题二
  287. questionType.value = hasDateInteract.value ? "time" : "phenology";
  288. visible.value = hasDateInteract.value || hasOptionsInteract.value;
  289. };
  290. /** 请求接口判断是否展示,并填充问题内容 */
  291. const checkShouldShow = async () => {
  292. const seq = ++requestSeq;
  293. const zoneId = resolveZoneId();
  294. const fetchKey = getFarmFetchKey();
  295. if (!pageActive) return;
  296. if (zoneId == null || zoneId === "") {
  297. visible.value = false;
  298. lastFetchedFarmKey = fetchKey;
  299. return;
  300. }
  301. try {
  302. const res = await VE_API.questionnaire.getInitialInteraction({
  303. zone_id: zoneId,
  304. date: formatToday(),
  305. });
  306. // 已切页或已有更新的请求时,丢弃这次结果,避免弹窗叠加
  307. if (seq !== requestSeq || !pageActive) return;
  308. if (res?.code === 200 && res.data) {
  309. applyQuestionData(res.data);
  310. } else {
  311. visible.value = false;
  312. }
  313. lastFetchedFarmKey = fetchKey;
  314. } catch (e) {
  315. if (seq !== requestSeq || !pageActive) return;
  316. visible.value = false;
  317. }
  318. };
  319. // ---------------------------------------------------------------------------
  320. // 事件处理 / 生命周期
  321. // ---------------------------------------------------------------------------
  322. // 进入 / 从其他页返回时重新请求;离开时已关弹窗,不能因「农场未变」跳过
  323. onActivated(() => {
  324. pageActive = true;
  325. visible.value = false;
  326. resetForm();
  327. checkShouldShow();
  328. });
  329. onDeactivated(() => {
  330. pageActive = false;
  331. requestSeq += 1;
  332. visible.value = false;
  333. lastFetchedFarmKey = "";
  334. });
  335. /**
  336. * 暂未到达 / 已过:立刻切到相邻物候期;
  337. * 已到达:选中并记下当前 period_code,供提交使用
  338. */
  339. const handlePhenologySelect = (value) => {
  340. if (value === "not_reached") {
  341. movePhenology("prev");
  342. return;
  343. }
  344. if (value === "passed") {
  345. movePhenology("next");
  346. return;
  347. }
  348. phenologyAnswer.value = "reached";
  349. const current = interactMap.value[currentInteractKey.value];
  350. selectedPeriodCode.value = current?.period_code || "";
  351. };
  352. /**
  353. * 组装保存感知结果载荷
  354. * @param {'time'|'phenology'} type 问题一不含 period_code;问题二不含 interact_code
  355. */
  356. const buildSubmitPayload = (type = "time") => {
  357. const payload = {
  358. zone_id: Number(resolveZoneId()) || resolveZoneId(),
  359. date: toApiDate(selectedDate.value) || formatToday(),
  360. };
  361. if (type === "time") {
  362. payload.interact_code = dateInteractData.value?.interact_code || "";
  363. } else {
  364. payload.period_code = selectedPeriodCode.value || "";
  365. }
  366. return payload;
  367. };
  368. /** 从 axios 错误中取出可读信息 */
  369. const getRequestErrorMessage = (err) => {
  370. const data = err?.response?.data;
  371. if (typeof data === "string" && data) return data;
  372. if (data?.msg) return data.msg;
  373. if (data?.message) return data.message;
  374. if (err?.message) return err.message;
  375. return "提交失败,请稍后再试";
  376. };
  377. /**
  378. * 调用保存感知结果接口
  379. * @param {'time'|'phenology'} type
  380. * @param {{ closeOnSuccess?: boolean }} options closeOnSuccess=false 时成功后不关弹窗(用于继续答问题二)
  381. */
  382. const submitInteractResult = async (type = "time", { closeOnSuccess = true } = {}) => {
  383. if (submitting.value) return false;
  384. submitting.value = true;
  385. try {
  386. const res = await VE_API.questionnaire.saveInteractResult(buildSubmitPayload(type));
  387. if (res?.code === 200) {
  388. if (closeOnSuccess) {
  389. showMessage(res.msg || "提交成功", "success");
  390. visible.value = false;
  391. resetForm();
  392. showSuccessPopup.value = true;
  393. emit("success");
  394. }
  395. return true;
  396. }
  397. showMessage(res?.msg || "提交失败,请稍后再试", "error");
  398. return false;
  399. } catch (err) {
  400. showMessage(getRequestErrorMessage(err), "error");
  401. return false;
  402. } finally {
  403. submitting.value = false;
  404. }
  405. };
  406. const handleConfirm = async () => {
  407. if (submitting.value) return;
  408. // 问题一:立即确认 → 提交(不含 period_code)
  409. if (questionType.value === "time") {
  410. if (!selectedDate.value) {
  411. showWarning(t("agriFile.selectTime"));
  412. return;
  413. }
  414. const ok = await submitInteractResult("time", {
  415. // 还有问题二则提交成功后继续展示,不关弹窗
  416. closeOnSuccess: !hasOptionsInteract.value,
  417. });
  418. if (ok && hasOptionsInteract.value) {
  419. questionType.value = "phenology";
  420. }
  421. return;
  422. }
  423. // 问题二:需已选择「已到达」并写入 period_code;提交不含 interact_code
  424. if (phenologyAnswer.value !== "reached" || !selectedPeriodCode.value) {
  425. const current = interactMap.value[currentInteractKey.value];
  426. if (phenologyAnswer.value === "reached" && current?.period_code) {
  427. selectedPeriodCode.value = current.period_code;
  428. } else {
  429. showWarning("请确认当前物候期是否已到达");
  430. return;
  431. }
  432. }
  433. await submitInteractResult("phenology");
  434. };
  435. defineExpose({
  436. checkShouldShow,
  437. buildSubmitPayload,
  438. selectedPeriodCode,
  439. });
  440. </script>
  441. <style scoped lang="scss">
  442. .restore-planting-popup {
  443. width: 86%;
  444. padding: 18px 14px 16px;
  445. box-sizing: border-box;
  446. background: linear-gradient(180deg, #d7ecff 0%, #ffffff 28%);
  447. overflow: visible;
  448. &__header {
  449. display: flex;
  450. align-items: flex-start;
  451. justify-content: space-between;
  452. }
  453. &__title {
  454. font-size: 22px;
  455. line-height: 25px;
  456. color: #111;
  457. div {
  458. font-family: "PangMenZhengDao";
  459. }
  460. }
  461. .popup-content {
  462. position: relative;
  463. }
  464. &__decor {
  465. position: absolute;
  466. top: -8px;
  467. right: -4px;
  468. width: 78px;
  469. height: 78px;
  470. object-fit: contain;
  471. pointer-events: none;
  472. }
  473. &__card {
  474. margin-top: 12px;
  475. padding: 10px 12px 12px;
  476. border-radius: 12px;
  477. background: #eaf5ff;
  478. box-sizing: border-box;
  479. position: relative;
  480. z-index: 2;
  481. }
  482. &__question {
  483. font-size: 15px;
  484. line-height: 24px;
  485. color: #252525;
  486. font-weight: 500;
  487. }
  488. &__keyword {
  489. color: #2199f8;
  490. }
  491. &__hint {
  492. margin-top: 4px;
  493. font-size: 12px;
  494. line-height: 16px;
  495. color: #9e9e9e;
  496. }
  497. &__photo {
  498. position: relative;
  499. margin: 12px 0;
  500. border-radius: 8px;
  501. overflow: hidden;
  502. height: 148px;
  503. // background: #dfeaf5;
  504. img {
  505. display: block;
  506. width: 100%;
  507. height: 148px;
  508. border-radius: 8px;
  509. object-fit: cover;
  510. }
  511. &--guide img {
  512. height: 132px;
  513. }
  514. }
  515. &__guide-btn {
  516. position: absolute;
  517. top: 8px;
  518. right: 8px;
  519. height: 28px;
  520. padding: 0 10px;
  521. border-radius: 14px;
  522. background: rgba(0, 0, 0, 0.55);
  523. color: #fff;
  524. font-size: 12px;
  525. display: flex;
  526. align-items: center;
  527. justify-content: center;
  528. }
  529. &__options {
  530. margin-top: 12px;
  531. display: flex;
  532. gap: 8px;
  533. }
  534. &__option {
  535. position: relative;
  536. flex: 1;
  537. height: 36px;
  538. border-radius: 8px;
  539. background: #fff;
  540. border: 1px solid transparent;
  541. display: flex;
  542. align-items: center;
  543. justify-content: center;
  544. font-size: 13px;
  545. color: #333;
  546. box-sizing: border-box;
  547. &.active {
  548. border-color: #2199f8;
  549. color: #2199f8;
  550. }
  551. }
  552. &__option-check {
  553. position: absolute;
  554. top: 0;
  555. right: 0;
  556. width: 16px;
  557. height: 16px;
  558. border-radius: 0 6px 0 6px;
  559. background: #2199f8;
  560. color: #fff;
  561. display: flex;
  562. align-items: center;
  563. justify-content: center;
  564. font-size: 10px;
  565. }
  566. &__date-picker {
  567. width: 100%;
  568. :deep(.el-input__wrapper) {
  569. height: 40px;
  570. border-radius: 8px;
  571. box-shadow: none !important;
  572. background: #fff;
  573. padding: 0 12px;
  574. }
  575. :deep(.el-input__inner) {
  576. font-size: 14px;
  577. color: #333;
  578. }
  579. :deep(.el-input__prefix),
  580. :deep(.el-input__suffix) {
  581. color: rgba(0, 0, 0, 0.35);
  582. }
  583. }
  584. &__actions {
  585. margin-top: 12px;
  586. display: flex;
  587. align-items: center;
  588. justify-content: center;
  589. }
  590. &__btn {
  591. height: 40px;
  592. line-height: 40px;
  593. padding: 0 30px;
  594. border-radius: 20px;
  595. display: flex;
  596. align-items: center;
  597. justify-content: center;
  598. font-size: 16px;
  599. font-weight: 500;
  600. box-sizing: border-box;
  601. &--primary {
  602. // flex: 1;
  603. background: linear-gradient(180deg, #76c3ff 0%, #2199f8 100%);
  604. color: #fff;
  605. &.disabled {
  606. opacity: 0.6;
  607. pointer-events: none;
  608. }
  609. &-btn-loading {
  610. line-height: 16px;
  611. margin-right: 4px;
  612. }
  613. }
  614. }
  615. }
  616. .bottom-btn-container {
  617. display: flex;
  618. justify-content: space-between;
  619. gap: 12px;
  620. width: 100%;
  621. .bottom-btn {
  622. padding: 0 25px;
  623. border-radius: 4px;
  624. font-size: 16px;
  625. height: 40px;
  626. line-height: 40px;
  627. box-sizing: border-box;
  628. font-weight: 500;
  629. text-align: center;
  630. &.primary-btn {
  631. flex: 1;
  632. background: #2199f8;
  633. color: #fff;
  634. }
  635. }
  636. }
  637. </style>
  638. <!-- 日期面板 / 图片预览 / Message teleport 到 body,需高于弹窗 z-index: 20000 -->
  639. <style lang="scss">
  640. .restore-planting-date-popper {
  641. z-index: 30000 !important;
  642. }
  643. .PhotoSlider__Wrapper {
  644. z-index: 30001 !important;
  645. }
  646. .el-message.restore-planting-message {
  647. z-index: 40000 !important;
  648. }
  649. </style>