imgManage.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="img-manage">
  3. <div class="select-group">
  4. <el-date-picker
  5. class="date-picker"
  6. v-model="dateTime"
  7. @change="changeDate"
  8. size="large"
  9. type="date"
  10. format="YYYY年MM月DD日"
  11. value-format="YYYY-MM-DD"
  12. :style="{ width: '100%' }"
  13. />
  14. <el-select class="select" v-model="value" size="large">
  15. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  16. </el-select>
  17. </div>
  18. <div class="fly-box">
  19. <img class="icon" src="@/assets/images/home/fly-icon.png" alt="" />
  20. <div class="fly-r">
  21. <div class="text">
  22. <el-icon color="#2199F8" size="20"><WarningFilled /></el-icon>
  23. <span>飞鸟提醒 今日是飞巡日,请立即飞巡</span>
  24. </div>
  25. <div class="btn">立即巡飞</div>
  26. </div>
  27. </div>
  28. <div class="photo-list">
  29. <div class="photo-item" v-for="(item, index) in imageList" :key="index">
  30. <album-carousel-item
  31. lbum-carousel-item
  32. :key="index"
  33. :name="item.code"
  34. :farmId="766"
  35. :images="[item]"
  36. :lock="false"
  37. ></album-carousel-item>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script setup>
  43. import { onMounted, onUnmounted, ref } from "vue";
  44. import albumCarouselItem from "../../album_compoents/albumCarouselItem.vue";
  45. import config from "@/api/config";
  46. const resize = "?imageView/1/w/240/h/240";
  47. function getCurrentMonth() {
  48. const now = new Date();
  49. const formattedDate = now.toISOString().slice(0, 10);
  50. return formattedDate;
  51. }
  52. const dateTime = ref(getCurrentMonth());
  53. const changeDate = () => {
  54. geImgaeList();
  55. };
  56. const value = ref("Option1");
  57. const options = [
  58. {
  59. value: "Option1",
  60. label: "全部区",
  61. },
  62. {
  63. value: "Option2",
  64. label: "Option2",
  65. },
  66. {
  67. value: "Option3",
  68. label: "Option3",
  69. },
  70. {
  71. value: "Option4",
  72. label: "Option4",
  73. },
  74. {
  75. value: "Option5",
  76. label: "Option5",
  77. },
  78. ];
  79. const imageList = ref([]);
  80. const geImgaeList = () => {
  81. // VE_API.image.imageList({ date: dateTime.value }).then((res) => {
  82. let imgsArr = [];
  83. const obj = [
  84. {
  85. address: "",
  86. angle: "",
  87. baseMap: "",
  88. bigPeriodId: null,
  89. bigPeriodName: "",
  90. blueZoneId: null,
  91. detail1: null,
  92. detail2: null,
  93. district: '"广州市增城区"',
  94. gardenId: null,
  95. gardenImgCount: null,
  96. gardenImgIndex: null,
  97. gardenName: "农场2",
  98. growText: '当前属于<span style="color: #f8c404">小果</span>,未检测到生长异常<br/>未发现病虫害',
  99. id: "710541621225066496",
  100. imageCode: null,
  101. localPath: "",
  102. localResPath: "",
  103. location: "POINT (113.740975 23.468493)",
  104. markText: "",
  105. miniUserId: null,
  106. miniUserName: "",
  107. modelId: null,
  108. pingzhong: "",
  109. planId: null,
  110. regionId: null,
  111. regionImgCount: null,
  112. regionImgIndex: null,
  113. regionName: "",
  114. resFilename: "",
  115. shotCode: "",
  116. smallPeriodId: null,
  117. smallPeriodName: "",
  118. source: "app",
  119. sourceCode: "",
  120. speciesId2: "02-02",
  121. status: null,
  122. sysId: null,
  123. treeGeoHash: "ws0vs0rdjkcd",
  124. treeId: 164701,
  125. uploadDate: "2025-05-14",
  126. watermarks: [],
  127. weather: null,
  128. workspaceId: "",
  129. code: formatDatePart("2505111813_T_WSPM_110.802_21.473"),
  130. treeCode: "2505111813_T_WSPM_110.802_21.473",
  131. sampleId: "873",
  132. filename: "shuichan/DJI_20250511181340_0001_T_code-w7yf1kgwzqhb.JPG",
  133. url: "https://birdseye-img.sysuimars.com/shuichan/DJI_20250514163710_0004_T_code-w7ydmzr9ctry.JPG?imageView/1/w/240/h/240",
  134. },
  135. ];
  136. // res.data.map((item) => {
  137. // imgsArr.push({ ...obj, uploadDate: formatDatePart(item.code), treeCode: item.code, filename: item.url });
  138. // });
  139. imageList.value = obj;
  140. // });
  141. };
  142. onMounted(() => {
  143. geImgaeList();
  144. });
  145. // 提取前6位并转换为日期格式
  146. function formatDatePart(originalStr) {
  147. // 提取前6位数字
  148. const datePart = originalStr.substring(0, 6);
  149. // 解析为日期格式
  150. const year = "20" + datePart.substring(0, 2); // 前两位是年份,加上20前缀
  151. const month = datePart.substring(2, 4); // 中间两位是月份
  152. const day = datePart.substring(4, 6); // 最后两位是日
  153. // 组合成YYYY-MM-DD格式
  154. const formattedDate = `${year}-${month}-${day}`;
  155. // 返回新字符串(不改变原字符串)
  156. return formattedDate;
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .img-manage {
  161. width: 100%;
  162. height: 100%;
  163. .select-group {
  164. display: flex;
  165. margin: 10px 0;
  166. .select {
  167. width: 140px;
  168. margin-left: 5px;
  169. }
  170. ::v-deep {
  171. //日历
  172. .el-input__prefix,.el-input__suffix {
  173. color: #fff;
  174. text-align: center;
  175. }
  176. .el-input__wrapper {
  177. background: #2199f8;
  178. box-shadow: none;
  179. }
  180. .el-input__inner {
  181. color: #fff;
  182. }
  183. //下拉框
  184. .el-select__placeholder,.el-select__caret{
  185. color: #2199f8;
  186. }
  187. .el-select__wrapper {
  188. box-shadow: none;
  189. border: 1px solid #2199F8;
  190. }
  191. }
  192. }
  193. .fly-box {
  194. margin-bottom: 10px;
  195. border: 1px solid rgba(33, 153, 248, 0.74);
  196. border-radius: 5px;
  197. padding: 7px 10px;
  198. display: flex;
  199. align-items: center;
  200. .icon {
  201. width: 48px;
  202. height: 48px;
  203. margin-right: 10px;
  204. }
  205. .fly-r {
  206. .text {
  207. display: flex;
  208. align-items: center;
  209. color: #000;
  210. font-weight: 500;
  211. span {
  212. margin-left: 5px;
  213. }
  214. }
  215. .btn {
  216. margin-top: 6px;
  217. text-align: center;
  218. font-size: 12px;
  219. width: 68px;
  220. padding: 5px 0;
  221. border-radius: 5px;
  222. background: #2199f8;
  223. font-family: "PangMenZhengDao";
  224. }
  225. }
  226. }
  227. .photo-list {
  228. display: flex;
  229. flex-direction: row;
  230. flex-wrap: wrap;
  231. overflow: auto;
  232. width: 100%;
  233. height: calc(100% - 100px);
  234. .photo-item {
  235. width: calc(50% - 5px);
  236. .img {
  237. width: 100%;
  238. height: 100%;
  239. object-fit: cover;
  240. border-radius: 4px;
  241. }
  242. ::v-deep {
  243. .carousel-item .tag-box.leftTop {
  244. display: none;
  245. }
  246. .carousel-item img {
  247. border-radius: 4px;
  248. }
  249. }
  250. }
  251. .photo-item:nth-last-child(2n) {
  252. margin-left: 10px;
  253. margin-bottom: 10px;
  254. }
  255. }
  256. }
  257. </style>