index.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442
  1. <template>
  2. <custom-header v-if="!showClose" name="农情互动" bgColor="#f2f4f5"></custom-header>
  3. <div class="interaction-list-wrapper" :class="{ 'show-close': showClose }">
  4. <div class="interaction-card" v-if="showClose">
  5. <img v-if="listData[0]?.coverUrl" :src="listData[0]?.coverUrl" alt="">
  6. <div class="card-content">
  7. <div class="card-title">互动主题:{{ listData[0]?.subjectName }}</div>
  8. <div class="card-desc" v-if="listData[0]?.subjectRemark && listData[0]?.subjectRemark !== ''">{{ listData[0].subjectRemark }}</div>
  9. </div>
  10. </div>
  11. <div class="interaction-list" ref="interactionListRef">
  12. <!-- <div class="tips-text">由于系统审核,您照片拍摄位置与农场相差超 3 公里,请在农场现场使用水印相机重新拍摄上传,谢谢配合</div> -->
  13. <div class="list-item" v-for="(item, index) in listData" :key="item.id || index"
  14. :class="{ 'uploaded-item': item.questionStatus !== 3 }">
  15. <!-- 标题区域 -->
  16. <div class="item-header-wrapper" :class="{ 'has-status': item.questionStatus !== 3 }">
  17. <div class="item-header">
  18. <div class="header-wrapper">
  19. <div class="title title-block">{{ item.varietyName }}</div>
  20. <div class="title title-block">{{ item.interactionThemeText }}</div>
  21. </div>
  22. <div class="status title-block" :class="['urgent-' + item.urgent]" v-if="item.questionStatus === 3">
  23. {{
  24. urgentType[item.urgent] }}</div>
  25. <!-- <div class="location-error">
  26. <el-icon size="16"><InfoFilled /></el-icon>
  27. <span>提交有误</span>
  28. </div> -->
  29. </div>
  30. <div class="upload-status" v-show="item.questionStatus !== 3">
  31. <el-icon class="status-icon">
  32. <SuccessFilled />
  33. </el-icon>
  34. <span class="status-text">提交成功</span>
  35. </div>
  36. </div>
  37. <!-- 未上传状态内容 -->
  38. <div class="uploaded-content" v-show="item.questionStatus === 3 || item.expanded">
  39. <div class="content-wrapper">
  40. <span>{{ item.reason }}</span>
  41. <text-ellipsis class="item-desc" rows="0" :content="item.remark" expand-text="展开"
  42. collapse-text="收起" />
  43. <div class="tip-box">如果不确定是否发生,直接上传照片即可</div>
  44. <div class="example-wrapper">
  45. <div class="example-header">
  46. <div>示例照片</div>
  47. <div class="more" v-if="item.exampleImageWithAnnotations.length > 3"
  48. @click="openMorePopup(item)">查看更多</div>
  49. </div>
  50. <div class="example-list" v-if="item.exampleImageWithAnnotations.length > 0">
  51. <div class="image-item-wrapper"
  52. v-for="(example, exIndex) in item.exampleImageWithAnnotations"
  53. :key="example.exampleImageUrl" @click="showExample(item, exIndex)">
  54. <img class="image-item" :src="example.exampleImageUrl" alt="" />
  55. </div>
  56. </div>
  57. </div>
  58. <text-ellipsis class="patrol-suggestion" rows="2" :content="'巡园建议:' + item.patrolSuggestion">
  59. <template #action="{ expanded }"><span class="action-text">{{ expanded ? '收起' : '展开'
  60. }}</span></template>
  61. </text-ellipsis>
  62. </div>
  63. <!-- 展开状态内容 -->
  64. <div class="expanded-content" v-show="item.imagePaths.length > 0">
  65. <!-- 原因说明 -->
  66. <div class="reason-text">上传照片({{ item.imagePaths.length }}张)</div>
  67. <!-- 图片展示 -->
  68. <div class="uploaded-images">
  69. <!-- <div class="uploaded-img-wrap" v-for="(image, imgIndex) in item.imagePaths" :key="image"
  70. @click="showExample(item, imgIndex, { hideLabel: true })">
  71. <img class="uploaded-img" :src="base_img_url2 + image" alt="" />
  72. <span v-show="item.questionStatus === 3" class="uploaded-img-remove"
  73. @click.stop="removeUploadedImage(item, imgIndex)">×</span>
  74. </div> -->
  75. <photo-provider :photo-closable="true">
  76. <photo-consumer v-for="(image, imgIndex) in item.imagePaths" :key="imgIndex" :src="base_img_url2 + image">
  77. <div class="uploaded-img-wrap">
  78. <img :src="base_img_url2 + image" class="uploaded-img">
  79. <span v-show="item.questionStatus === 3" class="uploaded-img-remove"
  80. @click.stop="removeUploadedImage(item, imgIndex)">×</span>
  81. </div>
  82. </photo-consumer>
  83. </photo-provider>
  84. </div>
  85. <uploader v-show="item.questionStatus === 3" class="upload-wrap continue-upload-btn"
  86. @click="handleUploadClick(item)" multiple :max-count="10" :after-read="afterReadUpload">
  87. <div class="upload-btn">
  88. <el-icon>
  89. <Plus />
  90. </el-icon>
  91. <span>继续上传照片</span>
  92. </div>
  93. </uploader>
  94. </div>
  95. <!-- 上传按钮 -->
  96. <uploader v-if="item.imagePaths.length === 0 && item.questionStatus === 3"
  97. @click="handleUploadClick(item)" :before-read="beforeReadUpload" class="upload-wrap" multiple :max-count="10"
  98. :after-read="afterReadUpload">
  99. <div class="upload-btn">
  100. <el-icon>
  101. <Plus />
  102. </el-icon>
  103. <span>点击上传照片</span>
  104. </div>
  105. </uploader>
  106. <div class="question-wrapper" v-if="item.imagePaths.length">
  107. <div class="question-cont">
  108. <div class="question-text"
  109. v-for="(q, qIdx) in (item.questionList || [item.question].filter(Boolean))" :key="qIdx">
  110. <span class="text-title">{{ q }}</span>
  111. <el-input v-model="item.answerValues[qIdx]" :disabled="item.questionStatus !== 3"
  112. type="number" style="width: 70px">
  113. <template #suffix>
  114. <span class="text-unit">{{ item.indicators[qIdx]?.unit ?? item.indicators[0]?.unit
  115. ?? '%' }}</span>
  116. </template>
  117. </el-input>
  118. </div>
  119. </div>
  120. <div class="draw-region-btn" v-if="item.interactionTypeId != 1 && item.questionStatus === 3"
  121. @click="handleDrawRegion(item)">
  122. 编辑发生区域</div>
  123. <div class="draw-region-btn" v-if="item.rangeWkt && item.questionStatus !== 3"
  124. @click="handleViewRegion(item)">
  125. 查看发生区域</div>
  126. </div>
  127. <!-- 输入框 -->
  128. <div class="input-wrapper" v-if="item.questionStatus === 3 || item.replyText">
  129. <el-input v-model="item.replyText" :disabled="item.questionStatus !== 3" placeholder="请输入您咨询的问题"
  130. clearable />
  131. </div>
  132. <div class="cancel-text" v-if="item.isConfirmed && item.questionStatus === 2">{{ item.cancelButtonName }}</div>
  133. <!-- 按钮区域 -->
  134. <div class="button-group" v-show="item.questionStatus === 3">
  135. <div
  136. class="btn-not-reached"
  137. :class="{ 'btn-loading': isItemSubmittingCancel(item) }"
  138. @click="handleConfirm(item, false)"
  139. >
  140. {{ isItemSubmittingCancel(item) ? '提交中...' : item.cancelButtonName }}
  141. </div>
  142. <div
  143. class="btn-default"
  144. :class="{
  145. 'btn-confirm': item.imagePaths.length > 0,
  146. 'btn-loading': isItemSubmittingConfirm(item),
  147. }"
  148. @click="handleConfirm(item, true)"
  149. >
  150. {{ isItemSubmittingConfirm(item) ? '提交中...' : '确认提交' }}
  151. </div>
  152. </div>
  153. <div class="invite-btn" v-if="item.imagePaths.length === 0 && item.questionStatus === 3 && !showClose"
  154. @click="handleInvite(item)">
  155. 邀请农情互动</div>
  156. </div>
  157. <!-- 比例信息(已上传状态显示) -->
  158. <div class="proportion-info" v-show="item.questionStatus !== 3"
  159. :style="{ justifyContent: item.expanded ? 'center' : 'space-between' }">
  160. <template v-if="!item.expanded">
  161. <template v-if="!item.isConfirmed && item.questionStatus === 2">
  162. <span class="proportion-text">{{(item.questionList && item.questionList.length
  163. ? item.questionList.map((q, i) => q + ':' + (item.answerValues[i] ?? '') +
  164. (item.indicators[i]?.unit
  165. ?? item.indicators[0]?.unit ?? '%')).join('')
  166. : item.question + ':' + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%'))
  167. }}</span>
  168. </template>
  169. <template v-else>
  170. <span class="proportion-text">{{ item.cancelButtonName }}</span>
  171. </template>
  172. </template>
  173. <div class="toggle-btn" @click="toggleExpand(item)">
  174. <span>{{ item.expanded ? "收起" : "展开" }}</span>
  175. <el-icon :class="{ rotate: !item.expanded }">
  176. <CaretTop />
  177. </el-icon>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="empty-data" v-if="!loading && listData.length === 0">暂无数据</div>
  182. </div>
  183. </div>
  184. <!-- <div class="custom-bottom-fixed-btns" :class="{ 'center-btn': false }">
  185. <div class="bottom-btn secondary-btn" @click="handleShowDroneConsultPopup">获取自动飞行航线</div>
  186. <div class="bottom-btn secondary-btn">邀请农情互动</div>
  187. <div class="bottom-btn primary-btn" @click="handleSubmitAll">一键提交</div>
  188. </div> -->
  189. <!-- 农场信息完善弹窗 -->
  190. <farm-info-popup :oldUser="oldUser" :expertMiniUserId="route.query.expertMiniUserId" v-model:show="showFarmInfoPopup" />
  191. <!-- 无人机/飞行航线咨询弹窗 -->
  192. <drone-consult-popup v-model:show="showDroneConsultPopup" @copy="onCopyWechatId" />
  193. <!-- 示例照片轮播组件 -->
  194. <example-popup v-model:show="showExamplePopup" :images="exampleList" :tips="currentPhotData?.shootingMethod"
  195. :start-index="exampleStartIndex" :show-title-and-tips="exampleShowTitleAndTips" />
  196. <!-- 照片上传进度 -->
  197. <popup v-model:show="showUploadProgressPopup" round class="upload-progress-popup">
  198. <div class="upload-progress-title">
  199. <span>照片上传进度</span>
  200. <el-progress class="upload-progress" :percentage="uploadPercentage" :stroke-width="10" :format="format" />
  201. </div>
  202. <div
  203. class="upload-box"
  204. v-loading="popupImageUploadLoading"
  205. element-loading-text="上传中..."
  206. >
  207. <!-- 把已经上传成功的图片传给 upload 组件做回显,同时保持原有上传事件不变 -->
  208. <upload ref="uploadRef" :maxCount="10" :initImgArr="initImgArr" @handleUpload="handleUploadSuccess">
  209. </upload>
  210. </div>
  211. <div class="input-box">
  212. <div class="input-item"
  213. v-for="(q, qIdx) in (currentItem?.questionList?.length ? currentItem.questionList : (currentItem?.question ? [currentItem.question] : []))"
  214. :key="qIdx">
  215. <span class="label-text">{{ q }}</span>
  216. <el-input class="label-input" v-model="currentItem.answerValues[qIdx]" placeholder="请输入" type="number">
  217. <template #suffix>
  218. <span class="unit">{{ currentItem.indicators[qIdx]?.unit ?? currentItem.indicators[0]?.unit ??
  219. '%' }}</span>
  220. </template>
  221. </el-input>
  222. </div>
  223. <el-input class="input-item" v-model="currentItem.replyText" placeholder="请输入您咨询的问题" clearable />
  224. </div>
  225. <template v-if="currentItem.interactionTypeId != 1">
  226. <div class="region-tips">勾画异常发生区域,精准匹配专属农事方案</div>
  227. <div class="region-map" ref="mapContainer" @click="handleDrawRegion(currentItem)">
  228. <div class="region-map-text">点击勾画异常发生区域</div>
  229. </div>
  230. </template>
  231. <div class="confirm-btn" :class="{ 'confirm-btn-loading': confirmUploadLoading }" @click="handleConfirmUpload">
  232. {{ confirmUploadLoading ? '上传中...' : '确认上传' }}
  233. </div>
  234. </popup>
  235. <!-- 查看更多弹窗 -->
  236. <more-popup ref="morePopupRef" />
  237. <upload-tips v-model:show="showUploadTipsPopup" />
  238. </template>
  239. <script setup>
  240. import { ref, onActivated, computed, onUnmounted } from "vue";
  241. import { ElMessage } from "element-plus";
  242. import { Uploader, Popup, TextEllipsis } from "vant";
  243. import customHeader from "@/components/customHeader.vue";
  244. import upload from "@/components/upload.vue";
  245. import FarmInfoPopup from "@/components/popup/farmInfoPopup.vue";
  246. import DroneConsultPopup from "@/components/popup/droneConsultPopup.vue";
  247. import ExamplePopup from "./components/examplePopup.vue";
  248. import { useRouter, useRoute } from "vue-router";
  249. import { base_img_url2 } from "@/api/config";
  250. import DrawRegionMap from "./map/drawRegionMap.js";
  251. import UploadFile from "@/utils/upliadFile";
  252. import wx from "weixin-js-sdk";
  253. import { getFileExt } from "@/utils/util";
  254. import MorePopup from "./components/morePopup.vue";
  255. import UploadTips from "@/components/popup/uploadTips.vue";
  256. const showUploadTipsPopup = ref(false);
  257. const interactionListRef = ref(null);
  258. const SCROLL_KEY = 'interactionListScrollTop';
  259. const showDroneConsultPopup = ref(false);
  260. const handleShowDroneConsultPopup = () => {
  261. // showDroneConsultPopup.value = true;
  262. router.push(
  263. `/confirm_area`
  264. );
  265. }
  266. const showFarmInfoPopup = ref(false);
  267. const loading = ref(false);
  268. const router = useRouter();
  269. const route = useRoute();
  270. const listData = ref([]);
  271. const morePopupRef = ref(null);
  272. //照片上传进度
  273. const showUploadProgressPopup = ref(false);
  274. // 上传进度统计
  275. const totalUploadCount = ref(0); // 本次选择的总文件数(固定不随上传成功变化)
  276. const uploadedSuccessCount = ref(0); // 已上传成功的文件数
  277. const uploadPercentage = computed(() => {
  278. if (!totalUploadCount.value) return 0;
  279. return Math.round((uploadedSuccessCount.value / totalUploadCount.value) * 100);
  280. });
  281. const format = () => {
  282. if (!totalUploadCount.value) return '0/0';
  283. return `${uploadedSuccessCount.value}/${totalUploadCount.value}`;
  284. };
  285. const drawRegionMap = new DrawRegionMap();
  286. /** 上传进度弹窗内地图为只读回显时,多边形配色与列表主题蓝一致(避免沿用勾画页默认绿色) */
  287. const READONLY_AREA_STYLE_BLUE = {
  288. fill: "rgba(33, 153, 248, 0.35)",
  289. stroke: "#2199F8",
  290. };
  291. const mapContainer = ref(null);
  292. const itemSubmittingMap = ref({});
  293. const confirmUploadLoading = ref(false);
  294. const getItemSubmitKey = (item) => String(item?.id ?? "");
  295. /** 任意一种提交进行中(用于防重复点击) */
  296. const isItemSubmitting = (item) => {
  297. const key = getItemSubmitKey(item);
  298. if (!key) return false;
  299. return !!itemSubmittingMap.value[key];
  300. };
  301. const isItemSubmittingConfirm = (item) => {
  302. const key = getItemSubmitKey(item);
  303. return key ? itemSubmittingMap.value[key] === "confirm" : false;
  304. };
  305. const isItemSubmittingCancel = (item) => {
  306. const key = getItemSubmitKey(item);
  307. return key ? itemSubmittingMap.value[key] === "cancel" : false;
  308. };
  309. /** 接口长时间无响应时结束等待,避免按钮一直「提交中」 */
  310. const SUBMIT_API_TIMEOUT_MS = 120000;
  311. const raceWithTimeout = (promise, ms = SUBMIT_API_TIMEOUT_MS) =>
  312. Promise.race([
  313. Promise.resolve(promise),
  314. new Promise((_, reject) =>
  315. setTimeout(() => reject(new Error("请求超时,请稍后重试")), ms)
  316. ),
  317. ]);
  318. const clearItemSubmittingKey = (key) => {
  319. if (!key) return;
  320. const next = { ...itemSubmittingMap.value };
  321. delete next[key];
  322. itemSubmittingMap.value = next;
  323. };
  324. const renderRegionFromSession = () => {
  325. if (!drawRegionMap.kmap) return;
  326. // 先清空图层
  327. drawRegionMap.clearLayer && drawRegionMap.clearLayer();
  328. // 1)通过保存的互动项 ID,在 listData 中找到对应项,用接口 rangeWkt 回显只读区域
  329. const savedId = sessionStorage.getItem("drawRegionInteractionId");
  330. if (savedId && Array.isArray(listData.value) && listData.value.length > 0) {
  331. const targetItem = listData.value.find(
  332. (it) =>
  333. it &&
  334. it.id != null &&
  335. (String(it.id) === savedId || Number(it.id) === Number(savedId))
  336. );
  337. if (targetItem && targetItem.rangeWkt && targetItem.rangeWkt.length > 10) {
  338. // 使用 setStatusRegions 显示接口返回的区域
  339. renderRegionFromItemWkt(targetItem);
  340. }
  341. }
  342. // 2)再回显本地勾画的多边形到可编辑图层(两者可共存)
  343. const polygonStr = sessionStorage.getItem("drawRegionPolygonData");
  344. if (polygonStr) {
  345. try {
  346. const polygonData = JSON.parse(polygonStr);
  347. if (
  348. polygonData &&
  349. Array.isArray(polygonData.geometryArr) &&
  350. polygonData.geometryArr.length > 0 &&
  351. drawRegionMap.kmap &&
  352. drawRegionMap.kmap.polygonLayer
  353. ) {
  354. // 注意这里不再调用 clearLayer,避免清掉上一步 setStatusRegions 的只读区域
  355. // 此处也不单独做 fit,由下方统一调用 fitAllRegions 适配所有图层
  356. drawRegionMap.setAreaGeometry(
  357. polygonData.geometryArr,
  358. false,
  359. polygonData.mianji,
  360. READONLY_AREA_STYLE_BLUE
  361. );
  362. }
  363. } catch (e) {
  364. console.error("解析 drawRegionPolygonData 失败:", e);
  365. }
  366. }
  367. // 3)统一根据只读图层 + 可编辑图层的范围自适应视图,保证所有区域都在视野内
  368. if (drawRegionMap.fitAllRegions) {
  369. drawRegionMap.fitAllRegions();
  370. }
  371. };
  372. // 用当前项的 rangeWkt(接口返回的已保存区域)回显到地图;使用 setStatusRegions 方法显示
  373. const renderRegionFromItemWkt = (item) => {
  374. const raw = item?.rangeWkt;
  375. if (!raw || typeof raw !== 'string' || raw.length <= 10) return;
  376. if (!drawRegionMap.kmap || !drawRegionMap.staticRegionLayer) return;
  377. let geometryArr = [];
  378. const trimmed = raw.trim();
  379. if (trimmed.startsWith('{')) {
  380. try {
  381. const parsed = JSON.parse(raw);
  382. if (parsed && Array.isArray(parsed.geometryArr) && parsed.geometryArr.length > 0) {
  383. geometryArr = parsed.geometryArr;
  384. }
  385. } catch (e) {
  386. console.error("解析 rangeWkt JSON 失败:", e);
  387. return;
  388. }
  389. } else {
  390. geometryArr = [raw];
  391. }
  392. if (geometryArr.length > 0) {
  393. // 转换为 setStatusRegions 需要的格式:[{ geometry: wkt, status?: 'resolved' | 'unresolved' }]
  394. const regions = geometryArr
  395. .filter(wkt => wkt && typeof wkt === 'string' && wkt.trim().length > 10)
  396. .map(wkt => ({
  397. geometry: wkt.trim(),
  398. status: 'unresolved', // 接口返回的区域默认显示为未解决状态
  399. unresolvedBlueFill: true, // 与列表主题蓝一致,避免深灰填充
  400. }));
  401. if (regions.length > 0) {
  402. drawRegionMap.setStatusRegions(regions);
  403. }
  404. }
  405. };
  406. //
  407. const urgentType = {
  408. "0": "一般紧急",
  409. "1": "紧急",
  410. "2": "非常紧急",
  411. }
  412. const uploadFileObj = new UploadFile();
  413. const initImgArr = ref([]);
  414. const miniUserId = localStorage.getItem("MINI_USER_ID");
  415. const uploadRef = ref(null);
  416. /** 列表选择照片后,在弹窗内直传 OSS 期间,遮挡图片区域避免误操作 */
  417. const popupImageUploadLoading = ref(false);
  418. const beforeReadUpload = (file) => {
  419. showUploadProgressPopup.value = true;
  420. totalUploadCount.value = 0;
  421. uploadedSuccessCount.value = 0;
  422. initImgArr.value = [];
  423. popupImageUploadLoading.value = false;
  424. uploadRef.value && uploadRef.value.uploadReset();
  425. return true;
  426. };
  427. //弹窗问题
  428. const afterReadUpload = async (data) => {
  429. // 继续上传:回显已有图片再追加新图;首次上传:直接清空,只显示本次新传
  430. initImgArr.value = (currentItem.value?.imagePaths?.length > 0)
  431. ? [...currentItem.value.imagePaths]
  432. : [];
  433. // 本次上传的总数 = 选择的文件数量(固定,用于做进度的“总数”)
  434. if (!Array.isArray(data)) {
  435. data = [data];
  436. }
  437. totalUploadCount.value = data.length;
  438. uploadedSuccessCount.value = 0;
  439. // 仅当「编辑发生区域」和本次上传是同一项时保留勾画数据并回显;否则清除,避免数据串
  440. const savedInteractionId = sessionStorage.getItem("drawRegionInteractionId");
  441. const isSameItem = savedInteractionId != null && String(currentItem.value?.id) === savedInteractionId;
  442. if (!isSameItem) {
  443. drawRegionMap.clearLayer && drawRegionMap.clearLayer();
  444. sessionStorage.removeItem("drawRegionPolygonData");
  445. sessionStorage.removeItem("drawRegionInteractionId");
  446. }
  447. popupImageUploadLoading.value = true;
  448. try {
  449. for (let file of data) {
  450. // 将文件上传至服务器
  451. let fileVal = file.file;
  452. file.status = "uploading";
  453. file.message = "上传中...";
  454. let ext = getFileExt(fileVal.name);
  455. let key = `birdseye-look-mini/${miniUserId}/${new Date().getTime()}.${ext}`;
  456. let resFilename = await uploadFileObj.put(key, fileVal)
  457. if (resFilename) {
  458. file.status = "done";
  459. file.message = "";
  460. // 记录成功数量,用于进度条“当前成功数”
  461. uploadedSuccessCount.value += 1;
  462. // 记录已上传成功的图片路径,用于回显
  463. initImgArr.value.push(resFilename)
  464. } else {
  465. file.status = 'failed';
  466. file.message = '上传失败';
  467. ElMessage.error('图片上传失败,请稍后再试!')
  468. }
  469. }
  470. } finally {
  471. popupImageUploadLoading.value = false;
  472. }
  473. // 所有文件上传结束后再打开进度弹窗,此时 imgArr 已包含全部图片
  474. if (initImgArr.value.length > 0 && currentItem.value.interactionTypeId != 1 && currentItem.value.questionStatus === 3) {
  475. setTimeout(() => {
  476. // 只在第一次时初始化地图,后续复用已有实例
  477. if (!drawRegionMap.kmap) {
  478. drawRegionMap.initMap(
  479. localStorage.getItem('selectedFarmPoint') || "POINT (113.6142086995688 23.585836479509055)",
  480. mapContainer.value,
  481. false,
  482. false,
  483. false
  484. );
  485. }
  486. // 先清空所有图层,再按规则分别回显:接口 rangeWkt 用 setStatusRegions,本地 session 用 setAreaGeometry,可共存
  487. drawRegionMap.clearLayer && drawRegionMap.clearLayer();
  488. const savedId = sessionStorage.getItem("drawRegionInteractionId");
  489. const currentId = currentItem.value?.id;
  490. const isSameItem =
  491. savedId != null &&
  492. currentId != null &&
  493. (String(currentId) === savedId || Number(currentId) === Number(savedId));
  494. const hasSessionPolygon = !!sessionStorage.getItem("drawRegionPolygonData");
  495. // 1)接口返回的 rangeWkt:始终用 setStatusRegions 渲染到只读图层
  496. if (currentItem.value?.rangeWkt?.length > 10) {
  497. renderRegionFromItemWkt(currentItem.value);
  498. }
  499. // 2)本地刚编辑的多边形(同一项且有 session 数据):用 setAreaGeometry 渲染到可编辑图层
  500. if (isSameItem && hasSessionPolygon) {
  501. const polygonStr = sessionStorage.getItem("drawRegionPolygonData");
  502. if (polygonStr) {
  503. try {
  504. const polygonData = JSON.parse(polygonStr);
  505. if (
  506. polygonData &&
  507. Array.isArray(polygonData.geometryArr) &&
  508. polygonData.geometryArr.length > 0 &&
  509. drawRegionMap.kmap &&
  510. drawRegionMap.kmap.polygonLayer
  511. ) {
  512. // 此处不再调用 clearLayer,避免清掉上一步 setStatusRegions 的只读区域
  513. drawRegionMap.setAreaGeometry(
  514. polygonData.geometryArr,
  515. true,
  516. polygonData.mianji,
  517. READONLY_AREA_STYLE_BLUE
  518. );
  519. }
  520. } catch (e) {
  521. console.error("解析 drawRegionPolygonData 失败:", e);
  522. }
  523. }
  524. }
  525. if (drawRegionMap.fitAllRegions) {
  526. drawRegionMap.fitAllRegions();
  527. }
  528. // 3)其它情况:保持清空后的空地图
  529. }, 100);
  530. }
  531. };
  532. const currentItem = ref(null);
  533. const handleUploadClick = (item) => {
  534. currentItem.value = item;
  535. };
  536. // 示例照片轮播
  537. const showExamplePopup = ref(false);
  538. const exampleList = ref([]);
  539. const exampleStartIndex = ref(0);
  540. const exampleShowTitleAndTips = ref(true);
  541. const currentPhotData = ref({})
  542. const showExample = (item, index, options = {}) => {
  543. currentPhotData.value = item;
  544. exampleList.value = options?.hideLabel ? item.imagePaths.map(p => ({ exampleImageUrl: base_img_url2 + p })) : item.exampleImageWithAnnotations || [];
  545. exampleStartIndex.value = index || 0;
  546. exampleShowTitleAndTips.value = options.hideLabel !== true;
  547. showExamplePopup.value = true;
  548. };
  549. // 加载数据
  550. /* */
  551. const loadData = async () => {
  552. loading.value = true;
  553. try {
  554. const { data } = await VE_API.home.listTriggeredByFarm({ farmId: miniData.value.farmId, interactionTypeId: miniData.value.interactionTypeId })
  555. listData.value = data.map(item => {
  556. // question 按 || 切割成数组,用于循环渲染
  557. const questionStr = item.question != null ? String(item.question) : '';
  558. item.questionList = questionStr
  559. ? questionStr.split('||').map(s => s.trim()).filter(Boolean)
  560. : [];
  561. if (!item.questionList.length && questionStr !== '') {
  562. item.questionList = [questionStr];
  563. }
  564. // 保证 answerValues 与 questionList 长度一致,便于每项对应一个输入框
  565. if (!Array.isArray(item.answerValues)) {
  566. item.answerValues = [];
  567. }
  568. while (item.answerValues.length < item.questionList.length) {
  569. item.answerValues.push('');
  570. }
  571. // interactionTypeName 按 : 分割,取第 0 项 + reproductiveName 生成互动主题文案
  572. const interactionTypeNameStr = item.interactionTypeName != null ? String(item.interactionTypeName) : '';
  573. const interactionTypeNameList = interactionTypeNameStr
  574. ? interactionTypeNameStr.split(':').map(s => s.trim()).filter(Boolean)
  575. : [];
  576. const reproductive = item.reproductiveName || '';
  577. // 类型名各段用 : 连接;若有繁殖名则统一为「……:繁殖名」
  578. let interactionThemeText = '';
  579. if (!interactionTypeNameList.length) {
  580. interactionThemeText = reproductive;
  581. } else {
  582. interactionThemeText = interactionTypeNameList[0] + ':' + reproductive;
  583. }
  584. return {
  585. ...item,
  586. interactionTypeNameList,
  587. interactionThemeText,
  588. };
  589. });
  590. } catch (error) {
  591. // 加载数据失败时静默处理或在需要时提示
  592. } finally {
  593. loading.value = false;
  594. }
  595. };
  596. // 刷新列表数据
  597. const refreshList = async () => {
  598. listData.value = [];
  599. await loadData();
  600. };
  601. // 删除已上传的图片
  602. const removeUploadedImage = (item, imgIndex) => {
  603. item.imagePaths.splice(imgIndex, 1);
  604. };
  605. // 确认上传 / 暂未到达进程
  606. const handleConfirm = async (item, isConfirm) => {
  607. if (isItemSubmitting(item)) return;
  608. if (isConfirm) {
  609. const list = item.questionList || [];
  610. // const needFill = list.length || 1;
  611. // const hasEmpty = Array.from({ length: needFill }, (_, i) => i).some(
  612. // (i) => item.answerValues[i] === '' || item.answerValues[i] === null || item.answerValues[i] === undefined
  613. // );
  614. // if (hasEmpty) {
  615. // ElMessage.warning("请填写当前果园比例");
  616. // return;
  617. // }
  618. if (item.imagePaths.length === 0 && uploadData.value.length === 0) {
  619. ElMessage.warning("请上传图片");
  620. return;
  621. }
  622. }
  623. const parmas = {
  624. farmId: miniData.value.farmId,
  625. imagePaths: item.imagePaths.concat(uploadData.value),
  626. isUploadPhoto: item.imagePaths.concat(uploadData.value).length > 0 ? true : false,
  627. rangeWkt: sessionStorage.getItem("drawRegionPolygonData") || '',
  628. interactionId: item.id,
  629. replyText: item.replyText,
  630. answerValues: item.answerValues,
  631. regionId: '',
  632. isConfirmed: isConfirm ? true : false
  633. }
  634. const key = getItemSubmitKey(item);
  635. const submitKind = isConfirm ? "confirm" : "cancel";
  636. if (key) {
  637. itemSubmittingMap.value = { ...itemSubmittingMap.value, [key]: submitKind };
  638. }
  639. let needRefresh = false;
  640. try {
  641. await raceWithTimeout(VE_API.home.uploadAnswerData(parmas));
  642. const { code, msg } = await raceWithTimeout(VE_API.home.uploadAnswer(parmas));
  643. if (code === 0) {
  644. ElMessage.success("上传成功");
  645. uploadData.value = [];
  646. sessionStorage.removeItem("drawRegionPolygonData");
  647. sessionStorage.removeItem("drawRegionInteractionId");
  648. needRefresh = true;
  649. } else {
  650. ElMessage.error(msg || "上传失败");
  651. }
  652. } catch (error) {
  653. ElMessage.error(error?.message || "上传失败,请稍后重试");
  654. } finally {
  655. clearItemSubmittingKey(key);
  656. }
  657. if (needRefresh) {
  658. try {
  659. await refreshList();
  660. } catch (e) {
  661. ElMessage.error("列表刷新失败,请下拉重试");
  662. }
  663. }
  664. };
  665. const handleConfirmUpload = async () => {
  666. if (confirmUploadLoading.value) return;
  667. // 校验是否有上传图片
  668. if (!uploadData.value || uploadData.value.length === 0) {
  669. ElMessage.warning("请先上传照片");
  670. return;
  671. }
  672. const item = currentItem.value;
  673. const len = item?.questionList?.length || 1;
  674. // const hasEmpty = Array.from({ length: len }, (_, i) => i).some(
  675. // (i) => item.answerValues[i] === '' || item.answerValues[i] === null || item.answerValues[i] === undefined
  676. // );
  677. // if (hasEmpty) {
  678. // ElMessage.warning("请填写占比数值");
  679. // return;
  680. // }
  681. const answerVals = (item.answerValues || []).slice(0, len);
  682. const parmas = {
  683. interactionId: item.id,
  684. farmId: miniData.value.farmId,
  685. imagePaths: uploadData.value,
  686. rangeWkt: sessionStorage.getItem("drawRegionPolygonData") || '',
  687. replyText: item.replyText,
  688. answerValues: answerVals,
  689. }
  690. confirmUploadLoading.value = true;
  691. let needRefresh = false;
  692. try {
  693. const { code, msg } = await raceWithTimeout(VE_API.home.uploadAnswerData(parmas));
  694. if (code === 0) {
  695. ElMessage.success("确认成功");
  696. uploadData.value = [];
  697. sessionStorage.removeItem("drawRegionPolygonData");
  698. sessionStorage.removeItem("drawRegionInteractionId");
  699. showUploadProgressPopup.value = false;
  700. needRefresh = true;
  701. } else {
  702. ElMessage.error(msg || "确认失败");
  703. }
  704. } catch (error) {
  705. ElMessage.error(error?.message || "确认失败,请稍后重试");
  706. } finally {
  707. confirmUploadLoading.value = false;
  708. }
  709. if (needRefresh) {
  710. try {
  711. await refreshList();
  712. } catch (e) {
  713. ElMessage.error("列表刷新失败,请下拉重试");
  714. }
  715. }
  716. };
  717. // 切换展开/收起
  718. const toggleExpand = (item) => {
  719. item.expanded = !item.expanded;
  720. };
  721. const handleViewRegion = (item) => {
  722. router.push(`/draw_region?viewOnly=1&rangeWkt=${encodeURIComponent(item.rangeWkt)}&updatedTime=${item.updatedTime.slice(0, 10)}`);
  723. }
  724. const showClose = ref(false);
  725. const handleInvite = (item) => {
  726. const query = {
  727. askInfo: { title: "农情互动", content: "是否分享该农情互动给好友" },
  728. shareText: "邀请您农情互动,精准匹配种植方案",
  729. targetUrl: `interaction_list`,
  730. paramsPage: JSON.stringify({
  731. farmId: miniData.value.farmId,
  732. regionId: item.regionId,
  733. interactionTypeId: item.interactionTypeId,
  734. showClose: true
  735. }),
  736. imageUrl: 'https://birdseye-img.sysuimars.com/feiniaomini/1.png',
  737. };
  738. wx.miniProgram.navigateTo({
  739. url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=sharePage`,
  740. });
  741. }
  742. const handleDrawRegion = (item) => {
  743. if (sessionStorage.getItem("drawRegionInteractionId") != item.id) {
  744. sessionStorage.removeItem("drawRegionPolygonData");
  745. sessionStorage.removeItem("drawRegionInteractionId");
  746. }
  747. // 记录本次勾画对应的互动项 id,上传时若是同一项则保留回显,否则清除避免数据串
  748. sessionStorage.setItem("drawRegionInteractionId", String(item.id));
  749. const polygonData = sessionStorage.getItem("drawRegionPolygonData");
  750. // 记录当前滚动位置
  751. const container = interactionListRef.value;
  752. if (container && typeof container.scrollTop === 'number') {
  753. sessionStorage.setItem(SCROLL_KEY, String(container.scrollTop));
  754. }
  755. if (item.rangeWkt && item.rangeWkt.length > 10) {
  756. router.push(`/draw_region?polygonData=${polygonData}&rangeWkt=${item.rangeWkt}&updatedTime=${item.updatedTime.slice(0, 10)}&reproductiveName=${item.reproductiveName}&mapCenter=${localStorage.getItem('selectedFarmPoint') || 'POINT (113.6142086995688 23.585836479509055)'}&firstAct=ABNORMAL&secondAct=0`);
  757. } else {
  758. if (polygonData) {
  759. router.push(`/draw_region?polygonData=${polygonData}&mapCenter=${localStorage.getItem('selectedFarmPoint') || 'POINT (113.6142086995688 23.585836479509055)'}&firstAct=ABNORMAL&secondAct=0`);
  760. } else {
  761. router.push(`/draw_region?mapCenter=${localStorage.getItem('selectedFarmPoint') || 'POINT (113.6142086995688 23.585836479509055)'}&firstAct=ABNORMAL&secondAct=0`);
  762. }
  763. }
  764. };
  765. onUnmounted(() => {
  766. sessionStorage.removeItem("drawRegionPolygonData");
  767. sessionStorage.removeItem("drawRegionInteractionId");
  768. });
  769. const uploadData = ref([]);
  770. const handleUploadSuccess = (data) => {
  771. uploadData.value = data.imgArr;
  772. // 同步进度条:删除/增加图片时,总数和已上传数跟随当前列表变化
  773. const len = (data.imgArr && data.imgArr.length) || 0;
  774. totalUploadCount.value = len;
  775. uploadedSuccessCount.value = len;
  776. };
  777. const openMorePopup = (item) => {
  778. const data = item.exampleImageWithAnnotations.map(exampleItem => {
  779. return {
  780. ...exampleItem,
  781. shootingMethod: item.shootingMethod,
  782. }
  783. });
  784. morePopupRef.value.setItems(data);
  785. morePopupRef.value.openPopup();
  786. }
  787. const onCopyWechatId = () => {
  788. ElMessage.success("微信号已复制");
  789. };
  790. const oldUser = ref(false);
  791. const miniData = ref({});
  792. // 页面从勾画页返回时,如果组件被 keep-alive 缓存,则会触发 onActivated,在此再做一次回显
  793. onActivated(() => {
  794. // 重新进入页面时清空提交/上传中状态,避免上次未完成请求导致按钮一直卡在「提交中」「上传中」
  795. itemSubmittingMap.value = {};
  796. confirmUploadLoading.value = false;
  797. if(route.query.miniJson) {
  798. const data = JSON.parse(route.query.miniJson);
  799. miniData.value = JSON.parse(data.paramsPage);
  800. }else{
  801. miniData.value = route.query;
  802. }
  803. showClose.value = miniData.value?.showClose ? true : false;
  804. if (!localStorage.getItem('showUploadTipsPopup')) {
  805. showUploadTipsPopup.value = true;
  806. setTimeout(() => {
  807. showUploadTipsPopup.value = false;
  808. localStorage.setItem('showUploadTipsPopup', true);
  809. }, 3000);
  810. }
  811. // 初始化加载
  812. // getFarmList();
  813. // 加载数据
  814. loadData();
  815. renderRegionFromSession();
  816. // 恢复滚动位置
  817. const container = interactionListRef.value;
  818. const savedTop = sessionStorage.getItem(SCROLL_KEY);
  819. if (container && savedTop != null) {
  820. const top = Number(savedTop);
  821. if (!Number.isNaN(top)) {
  822. // 延迟一点,等 DOM 渲染完成后再滚动
  823. setTimeout(() => {
  824. container.scrollTop = top;
  825. }, 0);
  826. }
  827. }
  828. oldUser.value = route.query.oldUser && Boolean(route.query.oldUser);
  829. if (oldUser.value) {
  830. showFarmInfoPopup.value = true;
  831. }
  832. });
  833. const getFarmList = async () => {
  834. const { data } = await VE_API.farm.userFarmSelectOption();
  835. if (data && data.length === 0) {
  836. showFarmInfoPopup.value = true;
  837. }
  838. }
  839. const handleSubmitAll = () => {
  840. console.log("一键提交");
  841. };
  842. </script>
  843. <style scoped lang="scss">
  844. .interaction-list-wrapper{
  845. width: 100%;
  846. height: calc(100vh - 40px);
  847. background: #f2f4f5;
  848. padding: 12px;
  849. box-sizing: border-box;
  850. overflow-y: auto;
  851. &.show-close{
  852. height: 100vh;
  853. }
  854. .interaction-card{
  855. background: #ffffff;
  856. border-radius: 6px;
  857. padding: 10px;
  858. border: 1px solid #ffffff;
  859. margin-bottom: 10px;
  860. img{
  861. width: 100%;
  862. height: 145px;
  863. object-fit: cover;
  864. border-radius: 2px;
  865. }
  866. .card-content{
  867. color: #666666;
  868. margin-top: 8px;
  869. .card-title{
  870. font-size: 16px;
  871. color: #000000;
  872. font-weight: 500;
  873. }
  874. .card-desc{
  875. margin-top: 4px;
  876. }
  877. }
  878. }
  879. .interaction-list {
  880. width: 100%;
  881. .tips-text {
  882. color: #FA7406;
  883. padding: 5px 10px;
  884. border: 1px solid #FA7406;
  885. border-radius: 5px;
  886. margin-bottom: 10px;
  887. background: #fff;
  888. }
  889. .list-item {
  890. background: #ffffff;
  891. border-radius: 6px;
  892. padding: 10px;
  893. border: 1px solid #ffffff;
  894. &.uploaded-item {
  895. border: 1px solid #2199f8;
  896. }
  897. .item-header-wrapper {
  898. .item-header {
  899. display: flex;
  900. align-items: center;
  901. justify-content: space-between;
  902. .header-wrapper {
  903. display: flex;
  904. align-items: center;
  905. gap: 5px;
  906. }
  907. .title-block {
  908. font-size: 15px;
  909. color: #6f6f6f;
  910. font-family: "PangMenZhengDao";
  911. width: fit-content;
  912. background: rgba(143, 143, 143, 0.1);
  913. padding: 5px 10px;
  914. border-radius: 2px;
  915. }
  916. .status {
  917. color: #999999;
  918. background: #F1F1F1;
  919. &.urgent-0 {
  920. color: #2199f8;
  921. background: rgba(33, 153, 248, 0.1);
  922. }
  923. &.urgent-1 {
  924. color: #FF953D;
  925. background: rgba(255, 149, 61, 0.1);
  926. }
  927. &.urgent-2 {
  928. color: #EE4646;
  929. background: rgba(238, 70, 70, 0.1);
  930. }
  931. }
  932. .location-error {
  933. display: flex;
  934. align-items: center;
  935. font-family: "Helvetica Neue, Helvetica, Tahoma, Arial, sans-serif";
  936. color: #FA7406;
  937. gap: 4px;
  938. font-size: 14px;
  939. background: #fff;
  940. }
  941. }
  942. .upload-status {
  943. display: flex;
  944. align-items: center;
  945. gap: 4px;
  946. margin-left: 10px;
  947. .status-icon {
  948. color: #2199f8;
  949. font-size: 17px;
  950. }
  951. .status-text {
  952. font-size: 14px;
  953. color: #2199f8;
  954. }
  955. }
  956. &.has-status {
  957. display: flex;
  958. justify-content: space-between;
  959. align-items: center;
  960. .item-header {
  961. div {
  962. color: #2199f8;
  963. background: rgba(33, 153, 248, 0.1);
  964. }
  965. }
  966. }
  967. }
  968. .expanded-content {
  969. background: rgba(33, 153, 248, 0.1);
  970. border-radius: 5px;
  971. padding: 10px;
  972. border: 0.5px solid #2199F8;
  973. margin-top: 12px;
  974. .uploaded-images {
  975. display: flex;
  976. flex-wrap: wrap;
  977. gap: 8px;
  978. margin-top: 8px;
  979. .uploaded-img-wrap {
  980. position: relative;
  981. width: calc((100vw - 68px) / 4);
  982. height: calc((100vw - 68px) / 4);
  983. }
  984. .uploaded-img {
  985. width: 100%;
  986. height: 100%;
  987. border-radius: 4px;
  988. object-fit: cover;
  989. }
  990. .uploaded-img-remove {
  991. position: absolute;
  992. top: 0;
  993. right: 0;
  994. width: 18px;
  995. height: 18px;
  996. display: flex;
  997. justify-content: center;
  998. background: rgba(0, 0, 0, 0.6);
  999. color: #fff;
  1000. font-size: 14px;
  1001. line-height: 16px;
  1002. border-radius: 50%;
  1003. }
  1004. }
  1005. .continue-upload-btn {
  1006. border: 0.5px solid rgba(33, 153, 248, 0.5);
  1007. border-radius: 4px;
  1008. background: #FFFFFF;
  1009. cursor: pointer;
  1010. }
  1011. }
  1012. .uploaded-content {
  1013. .content-wrapper {
  1014. border: 0.5px solid rgba(0, 0, 0, 0.1);
  1015. border-radius: 4px;
  1016. padding: 10px;
  1017. margin-top: 12px;
  1018. .item-desc {
  1019. color: #3C3C3C;
  1020. margin-bottom: 10px;
  1021. display: inline-block;
  1022. }
  1023. .tip-box {
  1024. font-size: 12px;
  1025. color: #2199F8;
  1026. padding: 3px 5px;
  1027. border-radius: 4px;
  1028. margin-bottom: 10px;
  1029. background: linear-gradient(90deg, rgba(33, 153, 248, 0.2) 0%, rgba(221, 221, 221, 0) 100%);
  1030. }
  1031. .example-wrapper {
  1032. .example-header {
  1033. display: flex;
  1034. align-items: center;
  1035. justify-content: space-between;
  1036. margin-bottom: 8px;
  1037. color: #BEB9B9;
  1038. .more {
  1039. font-size: 12px;
  1040. }
  1041. }
  1042. .example-list {
  1043. display: flex;
  1044. align-items: center;
  1045. overflow: hidden;
  1046. .image-item-wrapper {
  1047. position: relative;
  1048. margin-right: 6px;
  1049. &::after {
  1050. content: '示例';
  1051. position: absolute;
  1052. top: 0;
  1053. left: 0;
  1054. background: rgba(0, 0, 0, 0.7);
  1055. color: #F2F4F5;
  1056. padding: 2px 6px;
  1057. border-radius: 8px 0 2px 0;
  1058. font-size: 10px;
  1059. z-index: 1;
  1060. }
  1061. }
  1062. .image-item {
  1063. width: calc((100vw - 68px) / 4);
  1064. height: calc((100vw - 68px) / 4);
  1065. border-radius: 8px;
  1066. object-fit: cover;
  1067. }
  1068. }
  1069. }
  1070. .patrol-suggestion {
  1071. color: rgba(60, 60, 60, 0.4);
  1072. margin-top: 10px;
  1073. .action-text {
  1074. color: #727272;
  1075. }
  1076. }
  1077. }
  1078. .upload-wrap {
  1079. width: 100%;
  1080. margin-top: 12px;
  1081. ::v-deep {
  1082. .van-uploader__input-wrapper {
  1083. width: 100%;
  1084. }
  1085. }
  1086. .upload-btn {
  1087. width: 100%;
  1088. display: flex;
  1089. align-items: center;
  1090. justify-content: center;
  1091. gap: 4px;
  1092. color: #0B84E4;
  1093. padding: 6px;
  1094. border: 0.5px solid rgba(33, 153, 248, 0.5);
  1095. border-radius: 4px;
  1096. box-sizing: border-box;
  1097. }
  1098. }
  1099. }
  1100. .input-wrapper {
  1101. margin: 12px 0;
  1102. }
  1103. .cancel-text{
  1104. color: #969696;
  1105. margin-top: 8px;
  1106. }
  1107. .button-group {
  1108. display: flex;
  1109. gap: 12px;
  1110. .btn-not-reached,
  1111. .btn-default {
  1112. flex: 1;
  1113. text-align: center;
  1114. border-radius: 4px;
  1115. padding: 6px;
  1116. }
  1117. .btn-not-reached {
  1118. max-width: fit-content;
  1119. background: #fff;
  1120. color: #585858;
  1121. min-width: 98px;
  1122. border: 1px solid rgba(88, 88, 88, 0.2);
  1123. }
  1124. .btn-default {
  1125. background: #F1F1F1;
  1126. color: #999999;
  1127. border: 1px solid #F1F1F1;
  1128. }
  1129. .btn-loading {
  1130. opacity: 0.7;
  1131. pointer-events: none;
  1132. }
  1133. .btn-confirm {
  1134. background: #2199f8;
  1135. color: #ffffff;
  1136. border: 1px solid #2199f8;
  1137. }
  1138. }
  1139. .invite-btn {
  1140. color: #2199f8;
  1141. border: 1px solid rgba(33, 153, 248, 0.2);
  1142. border-radius: 4px;
  1143. padding: 5px;
  1144. text-align: center;
  1145. margin-top: 12px;
  1146. background: rgba(33, 153, 248, 0.1);
  1147. }
  1148. .proportion-info {
  1149. display: flex;
  1150. justify-content: space-between;
  1151. align-items: center;
  1152. margin-top: 12px;
  1153. .proportion-text {
  1154. color: #969696;
  1155. font-size: 14px;
  1156. white-space: nowrap;
  1157. overflow: hidden;
  1158. text-overflow: ellipsis;
  1159. flex: 1;
  1160. margin-right: 10px;
  1161. }
  1162. .toggle-btn {
  1163. display: flex;
  1164. align-items: center;
  1165. gap: 2px;
  1166. color: #8D8D8D;
  1167. padding: 2px 10px;
  1168. border: 1px solid rgba(0, 0, 0, 0.2);
  1169. font-size: 12px;
  1170. border-radius: 25px;
  1171. background: #FFFFFF;
  1172. .rotate {
  1173. transform: rotate(180deg);
  1174. }
  1175. }
  1176. }
  1177. }
  1178. .list-item+.list-item {
  1179. margin-top: 12px;
  1180. }
  1181. .empty-data {
  1182. text-align: center;
  1183. padding: 40px 0;
  1184. color: #999999;
  1185. font-size: 14px;
  1186. }
  1187. .question-wrapper {
  1188. display: flex;
  1189. align-items: flex-start;
  1190. justify-content: space-between;
  1191. gap: 10px;
  1192. margin: 12px 0 6px;
  1193. box-sizing: border-box;
  1194. width: 100%;
  1195. .question-text {
  1196. background: #ffffff;
  1197. color: #6f6f6f;
  1198. display: flex;
  1199. align-items: center;
  1200. .text-title {
  1201. margin-right: 5px;
  1202. }
  1203. .text-unit {
  1204. margin-left: 4px;
  1205. }
  1206. }
  1207. .question-text+.question-text {
  1208. margin-top: 6px;
  1209. }
  1210. .draw-region-btn {
  1211. background: rgba(33, 153, 248, 0.1);
  1212. border-radius: 4px;
  1213. padding: 6px 10px;
  1214. color: #2199f8;
  1215. }
  1216. }
  1217. }
  1218. }
  1219. .custom-bottom-fixed-btns {
  1220. justify-content: space-between;
  1221. .secondary-btn {
  1222. padding: 10px 20px;
  1223. }
  1224. }
  1225. .center-btn {
  1226. justify-content: center;
  1227. .primary-btn {
  1228. padding: 10px 32px;
  1229. background: #2199F8;
  1230. }
  1231. }
  1232. .upload-progress-popup {
  1233. width: 100%;
  1234. padding: 20px 16px;
  1235. .upload-progress-title {
  1236. font-size: 16px;
  1237. color: #121212;
  1238. margin-bottom: 12px;
  1239. display: flex;
  1240. align-items: center;
  1241. justify-content: space-between;
  1242. .upload-progress {
  1243. width: 55%;
  1244. ::v-deep {
  1245. .el-progress__text {
  1246. min-width: fit-content;
  1247. }
  1248. }
  1249. }
  1250. }
  1251. .upload-box {
  1252. margin-bottom: 12px;
  1253. position: relative;
  1254. min-height: 88px;
  1255. }
  1256. .input-box {
  1257. .input-item {
  1258. display: flex;
  1259. align-items: center;
  1260. justify-content: space-between;
  1261. gap: 6px;
  1262. .label-input {
  1263. width: 130px;
  1264. }
  1265. }
  1266. .input-item+.input-item {
  1267. margin-top: 6px;
  1268. }
  1269. }
  1270. .region-tips {
  1271. color: #2199F8;
  1272. padding: 5px;
  1273. background: rgba(33, 153, 248, 0.1);
  1274. border-radius: 5px;
  1275. margin: 16px 0 12px 0;
  1276. text-align: center;
  1277. }
  1278. .region-map {
  1279. width: 100%;
  1280. height: 168px;
  1281. clip-path: inset(0px round 5px);
  1282. position: relative;
  1283. .region-map-text {
  1284. position: absolute;
  1285. bottom: 0;
  1286. right: 0;
  1287. color: #FFFFFF;
  1288. padding: 5px 20px;
  1289. border-radius: 5px;
  1290. background: rgba(0, 0, 0, 0.6);
  1291. z-index: 1;
  1292. }
  1293. }
  1294. .confirm-btn {
  1295. background: #2199f8;
  1296. color: #ffffff;
  1297. border-radius: 4px;
  1298. padding: 8px;
  1299. text-align: center;
  1300. font-size: 16px;
  1301. margin-top: 16px;
  1302. }
  1303. .confirm-btn-loading {
  1304. opacity: 0.7;
  1305. pointer-events: none;
  1306. }
  1307. }
  1308. </style>