index.vue 55 KB

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