index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <div class="base-container">
  3. <fnHeader :hideSwitch="true" :hideShadow="true" showDate></fnHeader>
  4. <div class="content">
  5. <div class="content-left">
  6. <div class="btn" @click="goBack">
  7. <img src="@/assets/images/common/back-icon.png" alt="" />
  8. 返回
  9. </div>
  10. <chart-box class="left-cont" name="品种列表" color="yellow">
  11. <div class="box">
  12. <div class="add-cont">
  13. <div>暂无数据</div>
  14. <div class="tips-text">请先添加品种,再框选右侧区域,进行品种确权</div>
  15. <div class="button" @click="handleAdd">
  16. <el-icon class="icon"><Plus /></el-icon>
  17. 添加品种
  18. </div>
  19. </div>
  20. </div>
  21. </chart-box>
  22. </div>
  23. <div class="content-right">
  24. <div class="map-header">
  25. <div class="title">
  26. <img src="@/assets/images/common/area-icon.png" alt="" />
  27. 品种确权
  28. </div>
  29. <div class="button" @click="handleClear">清除框选</div>
  30. </div>
  31. <div class="map">
  32. <my-map></my-map>
  33. <div class="checkbox-list">
  34. <span class="text">全部设置为</span>
  35. <el-checkbox-group class="checkbox" v-model="checkedCities" @change="handleCheckedCitiesChange">
  36. <el-checkbox v-for="city in cities" :key="city" :label="city.label" :value="city.value">
  37. {{ city.label }}
  38. </el-checkbox>
  39. </el-checkbox-group>
  40. <div class="add" @click="handleAdd">
  41. <el-icon class="icon"><Plus /></el-icon>
  42. 添加品种
  43. </div>
  44. </div>
  45. <div class="footer-btn">
  46. <div class="cancel">取消</div>
  47. <div>保存</div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <!-- 添加品种弹窗 -->
  54. <el-dialog
  55. v-model="dialogVisible"
  56. body-class="custom-dialog"
  57. title="添加品种"
  58. width="500"
  59. align-center
  60. :before-close="handleClose"
  61. >
  62. <el-input class="input" size="large" v-model="input" placeholder="请输入品种名称" />
  63. <template #footer>
  64. <div class="dialog-footer">
  65. <div class="btn" @click="dialogVisible = false">取消</div>
  66. <div @click="dialogVisible = false">确定</div>
  67. </div>
  68. </template>
  69. </el-dialog>
  70. </template>
  71. <script setup>
  72. import { onMounted, onUnmounted, ref } from "vue";
  73. import { ElMessage } from "element-plus";
  74. import fnHeader from "@/components/fnHeader.vue";
  75. import myMap from "./map";
  76. import chartBox from "@/components/chartBox.vue";
  77. import { useRouter, useRoute } from "vue-router";
  78. import { useStore } from "vuex";
  79. import eventBus from "@/api/eventBus";
  80. const store = useStore();
  81. const router = useRouter();
  82. const route = useRoute();
  83. onMounted(() => {
  84. getList();
  85. eventBus.on('map:list',getMapList)
  86. });
  87. onUnmounted(()=>{
  88. eventBus.off('map:list',getMapList)
  89. })
  90. function getMapList(arr){
  91. console.log('arr',arr);
  92. }
  93. //清除框选
  94. const handleClear = () =>{
  95. eventBus.emit('handle:clear')
  96. }
  97. const getList = () => {
  98. console.log("000");
  99. };
  100. const checkedCities = ref(["0"]);
  101. const cities = [
  102. {
  103. label:"品种1",
  104. value:"0"
  105. },
  106. {
  107. label:"品种2",
  108. value:"1"
  109. }
  110. ];
  111. const handleCheckedCitiesChange = (value) => {
  112. };
  113. const goBack = () => {
  114. router.go(-1);
  115. };
  116. //添加品种弹窗
  117. const dialogVisible = ref(false);
  118. const input = ref("");
  119. const handleAdd = () => {
  120. dialogVisible.value = true;
  121. };
  122. const handleClose = () => {
  123. dialogVisible.value = false;
  124. input.value = "";
  125. };
  126. </script>
  127. <style lang="scss" scoped>
  128. .base-container {
  129. width: 100%;
  130. height: 100vh;
  131. color: #fff;
  132. position: relative;
  133. box-sizing: border-box;
  134. z-index: 1;
  135. background: #000;
  136. .content {
  137. width: 100%;
  138. height: calc(100% - 74px);
  139. display: flex;
  140. justify-content: space-between;
  141. box-sizing: border-box;
  142. padding: 20px;
  143. .content-left {
  144. width: 473px;
  145. height: 100%;
  146. box-sizing: border-box;
  147. .btn {
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. border: 1px solid rgba(255, 255, 255, 0.78);
  152. border-radius: 4px;
  153. padding: 9px;
  154. margin-bottom: 13px;
  155. width: 104px;
  156. cursor: pointer;
  157. img {
  158. width: 14px;
  159. margin-right: 5px;
  160. }
  161. }
  162. .left-cont {
  163. width: 100%;
  164. height: calc(100% - 48px - 4px);
  165. .box {
  166. width: 100%;
  167. height: calc(100% - 58px);
  168. padding: 16px 12px;
  169. box-sizing: border-box;
  170. overflow-y: auto;
  171. .add-cont {
  172. display: flex;
  173. flex-direction: column;
  174. align-items: center;
  175. font-size: 16px;
  176. .tips-text {
  177. width: 220px;
  178. text-align: center;
  179. color: #9f9f9f;
  180. font-size: 15px;
  181. margin: 8px 0 24px 0;
  182. }
  183. .button {
  184. color: #ffd489;
  185. display: flex;
  186. align-items: center;
  187. border-radius: 8px;
  188. border: 1px solid #ffd489;
  189. padding: 8px 16px;
  190. background: rgba(255, 212, 137, 0.1);
  191. cursor: pointer;
  192. .icon {
  193. margin-right: 4px;
  194. }
  195. }
  196. }
  197. }
  198. }
  199. }
  200. .content-right {
  201. width: calc(100% - 473px - 18px);
  202. margin-left: 18px;
  203. height: 100%;
  204. background: #191919;
  205. border: 0.6px solid #444444;
  206. padding: 20px;
  207. box-sizing: border-box;
  208. border-radius: 8px;
  209. .map-header {
  210. display: flex;
  211. align-items: flex-start;
  212. justify-content: space-between;
  213. .title {
  214. font-size: 22px;
  215. display: flex;
  216. align-items: flex-end;
  217. font-family: "PangMenZhengDao";
  218. margin-bottom: 16px;
  219. img {
  220. margin-right: 8px;
  221. }
  222. }
  223. .button{
  224. color: #fff;
  225. padding: 5px 15px;
  226. border-radius: 4px;
  227. font-size: 16px;
  228. border: 1px solid #fff;
  229. cursor: pointer;
  230. }
  231. }
  232. .map {
  233. width: 100%;
  234. clip-path: inset(0px round 4px);
  235. height: calc(100% - 31px - 16px);
  236. position: relative;
  237. .checkbox-list{
  238. position: absolute;
  239. z-index: 2;
  240. right: 42px;
  241. bottom: 150px;
  242. background: rgba(0, 0, 0, 0.8);
  243. border-radius: 8px;
  244. display: flex;
  245. flex-direction: column;
  246. padding: 20px;
  247. .text{
  248. color: #9f9f9f;
  249. margin-bottom: 12px;
  250. font-size: 16px;
  251. }
  252. .checkbox{
  253. display: flex;
  254. flex-direction: column;
  255. ::v-deep{
  256. .el-checkbox__label{
  257. color: #fff;
  258. font-size: 16px;
  259. }
  260. .el-checkbox__inner{
  261. width: 18px;
  262. height: 18px;
  263. }
  264. .el-checkbox__input.is-checked .el-checkbox__inner{
  265. background: #FFD489;
  266. border-color: #FFD489;
  267. &::after{
  268. border-color: #000;
  269. border-width: 2px;
  270. height: 10px;
  271. left: 4px;
  272. width: 5px;
  273. top: 0;
  274. }
  275. }
  276. }
  277. }
  278. .add{
  279. margin-top: 12px;
  280. border: 1px solid #fff;
  281. border-radius: 4px;
  282. background: rgba(255, 255, 255, 0.2);
  283. display: flex;
  284. align-items: center;
  285. padding: 8px;
  286. cursor: pointer;
  287. .icon{
  288. margin-right: 4px;
  289. }
  290. }
  291. }
  292. .footer-btn {
  293. position: absolute;
  294. right: 42px;
  295. bottom: 28px;
  296. z-index: 2;
  297. display: flex;
  298. width: 520px;
  299. div {
  300. text-align: center;
  301. width: calc(100% - 20px - 200px);
  302. font-size: 20px;
  303. color: #1d1d1d;
  304. background: #f7be5a;
  305. border-radius: 8px;
  306. border: 2px solid #fff;
  307. padding: 13px;
  308. cursor: pointer;
  309. }
  310. .cancel {
  311. margin-right: 20px;
  312. width: 200px;
  313. background: rgba(0, 0, 0, 0.6);
  314. color: #fff;
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. .custom-dialog {
  322. .el-dialog__body {
  323. margin-top: 10px;
  324. }
  325. .input {
  326. width: 100%;
  327. }
  328. }
  329. .dialog-footer {
  330. display: flex;
  331. width: 100%;
  332. margin-top: 25px;
  333. div {
  334. flex: 1;
  335. padding: 10px;
  336. background: #ffd489;
  337. border-radius: 5px;
  338. color: #1d1d1d;
  339. text-align: center;
  340. }
  341. .btn {
  342. border: 1px solid #9f9f9f;
  343. background: #fff;
  344. margin-right: 14px;
  345. }
  346. }
  347. </style>