restorePlantingPopup.vue 24 KB

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