interDetails.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <template>
  2. <div>
  3. <div class="DetilsCon">
  4. <div class="sm-panel sm-function-module-query" v-drag>
  5. <div class="sm-panel-header">
  6. <span>占压耕地图斑</span>
  7. <i class="el-icon-close" @click="closeInster"></i>
  8. </div>
  9. <div class="tableCon">
  10. <el-table
  11. :header-cell-style="{
  12. background: 'rgba(10, 25, 38, 0.6)',
  13. color: '#66b1ff',
  14. fontSize: '14px',
  15. fontFamily: 'Microsoft YaHei',
  16. fontWeight: '400',
  17. }"
  18. :data="tableData"
  19. style="width: 100%"
  20. height="731"
  21. >
  22. <el-table-column
  23. show-overflow-tooltip="true"
  24. prop="id"
  25. label="图斑编号"
  26. >
  27. </el-table-column>
  28. <el-table-column
  29. show-overflow-tooltip="true"
  30. prop="siweiarea"
  31. label="图斑面积(㎡)"
  32. >
  33. </el-table-column>
  34. <el-table-column width="100" label="操作">
  35. <template slot-scope="scope">
  36. <!-- <span>编辑</span> -->
  37. <el-button size="mini" type="text" @click="flyTo(scope.row)"
  38. >定位</el-button
  39. >
  40. <el-button
  41. size="mini"
  42. type="text"
  43. @click="handleView(scope.row)"
  44. >详情</el-button
  45. >
  46. </template>
  47. </el-table-column></el-table
  48. >
  49. </div>
  50. </div>
  51. </div>
  52. <div class="conViews" v-if="isShallow">
  53. <div class="sm-panel sm-function-module-query" v-drag>
  54. <div class="sm-panel-header">
  55. <span>图斑详情</span>
  56. <i class="el-icon-close" @click="isShallow = false"></i>
  57. </div>
  58. <el-tabs
  59. type="border-card"
  60. class="xz_box info"
  61. v-model="activeTabs"
  62. stretch
  63. >
  64. <el-tab-pane label="套合结果" name="thjg">
  65. <!-- <div class="inter_result"></div> -->
  66. <div class="Integration inter_result">
  67. <div
  68. class="Integration_list"
  69. v-for="(item, i) in yzjgData"
  70. :key="i"
  71. >
  72. <div
  73. v-for="(item2, c) in item.mx_data"
  74. :key="c"
  75. class="list_Cont"
  76. >
  77. <div class="list_item">
  78. <div class="listText">
  79. <span style="color: #fff">{{ item2.bsmmc }}图斑数</span>
  80. <span
  81. style="
  82. color: #2d8cf0;
  83. font-weight: bold;
  84. cursor: pointer;
  85. "
  86. @click="resultDeatils(item2, item.mx_bsm)"
  87. >{{ item2.sumcount }}个</span
  88. >
  89. </div>
  90. </div>
  91. <div class="list_item">
  92. <div class="listText">
  93. <span style="color: #fff">{{ item2.bsmmc }}面积(㎡)</span>
  94. <span color="#80FFFF">{{ item2.sumvalue }}</span>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </el-tab-pane>
  101. <!-- -->
  102. <el-tab-pane label="基本信息" name="jbxx">
  103. <div class="inter_result" v-if="activeTabs == 'jbxx'">
  104. <el-table
  105. :header-cell-style="{
  106. background: 'rgba(10, 25, 38, 0.6)',
  107. color: '#66b1ff',
  108. fontSize: '14px',
  109. fontFamily: 'Microsoft YaHei',
  110. fontWeight: '400',
  111. }"
  112. :data="jbxxData"
  113. height="455"
  114. style="width: 100%"
  115. >
  116. <el-table-column
  117. show-overflow-tooltip="true"
  118. prop="name"
  119. label="属性名称"
  120. >
  121. </el-table-column>
  122. <el-table-column
  123. show-overflow-tooltip="true"
  124. prop="value"
  125. label="属性值"
  126. >
  127. </el-table-column>
  128. </el-table>
  129. <el-carousel indicator-position="outside">
  130. <el-carousel-item v-for="item in 4" :key="item">
  131. <h3>{{ item }}</h3>
  132. </el-carousel-item>
  133. </el-carousel>
  134. </div>
  135. </el-tab-pane>
  136. </el-tabs>
  137. </div>
  138. </div>
  139. </div>
  140. </template>
  141. <script>
  142. import { name } from "file-loader";
  143. import { getYZ, getgeoms, getOneDetail } from "../../../api/ghss/gdbh.js";
  144. import { loadGeoJSON } from "@/utils/MapHelper/help.js";
  145. let layerSources = {};
  146. export default {
  147. props: {
  148. interObj: {
  149. type: Object,
  150. },
  151. },
  152. data() {
  153. return {
  154. activeTabs: "thjg",
  155. tableData: [],
  156. viewsData: null,
  157. isShallow: false,
  158. jbxxData: null,
  159. yzjgData: [],
  160. tempdataLayerId: null,
  161. };
  162. },
  163. mounted() {
  164. // this.init();
  165. },
  166. methods: {
  167. //关闭套合结果详情
  168. closeInster() {
  169. this.$emit("updateParent", "showInter", false);
  170. this.isShallow = false;
  171. viewer.entities.removeAll();
  172. viewer.dataSources.removeAll();
  173. },
  174. flyTo(item) {
  175. let id = "h_" + item.id;
  176. this.tempdataLayerId = id;
  177. loadGeoJSON(item.geom, "#ff0000", { isfly: true }, (data) => {
  178. layerSources[id] = data;
  179. });
  180. },
  181. handleView(val) {
  182. this.isShallow = true;
  183. getOneDetail({
  184. bsm: this.interObj.bsm,
  185. id: val.id,
  186. }).then((res) => {
  187. if (res.statuscode == 200) {
  188. this.viewsData = res.data;
  189. this.yzjgData = res.data.yzjg;
  190. this.jbxxData = Object.keys(res.data.tbxx).map((key) => ({
  191. name: key,
  192. value: res.data.tbxx[key],
  193. }));
  194. } else {
  195. this.$message.error(res.message);
  196. }
  197. });
  198. this.isShallow = true;
  199. },
  200. init() {
  201. if (!this.interObj.mxbsm) {
  202. this.getAll();
  203. } else {
  204. this.getYZ();
  205. }
  206. },
  207. getYZ() {
  208. getYZ(this.interObj).then((res) => {
  209. if (res.statuscode == 200) {
  210. this.tableData = res.data;
  211. this.active_tableData(this.tableData);
  212. } else {
  213. this.$message.error(res.message);
  214. }
  215. });
  216. },
  217. getAll() {
  218. getgeoms(this.interObj).then((res) => {
  219. if (res.statuscode == 200) {
  220. this.tableData = res.data.dataListMap;
  221. this.active_tableData(res.data.dataListMap);
  222. } else {
  223. this.$message.error(res.message);
  224. }
  225. });
  226. },
  227. active_tableData(newVal) {
  228. newVal.forEach((res, index) => {
  229. res.type = "图斑上图";
  230. if (res.geom)
  231. loadGeoJSON(res.geom, "#55A1E3", { isfly: false }, (data) => {
  232. layerSources[res.id] = data;
  233. });
  234. });
  235. },
  236. },
  237. mounted() {},
  238. watch: {
  239. // interObj(newValue) {
  240. // this.init();
  241. // },
  242. interObj: {
  243. handler(newVal) {
  244. this.init();
  245. },
  246. deep: true,
  247. immediate: true,
  248. },
  249. tempdataLayerId(newVal, oldVal) {
  250. if (oldVal && layerSources[oldVal]) {
  251. viewer.dataSources.remove(layerSources[oldVal]);
  252. layerSources[oldVal] = null;
  253. }
  254. },
  255. },
  256. };
  257. </script>
  258. <style lang="scss" scoped>
  259. .DetilsCon {
  260. position: relative;
  261. right: 57%;
  262. }
  263. .tableCon {
  264. height: 48rem;
  265. // /deep/ .el-table tr {
  266. // background: rgba(10, 25, 38, 0.5) !important;
  267. // }
  268. // /deep/ .el-table td.el-table__cell,
  269. // .el-table th.el-table__cell.is-leaf {
  270. // background: rgba(10, 25, 38, 0.5) !important;
  271. // border-bottom: 0px solid #ebeef5;
  272. // }
  273. // .el-table {
  274. // color: #fff;
  275. // background: rgba(10, 25, 38, 0.5) !important;
  276. // }
  277. // /deep/ .el-table__fixed-right::before,
  278. // .el-table__fixed::before {
  279. // background: rgba(10, 25, 38, 0.9) !important;
  280. // }
  281. // /deep/ .el-table__fixed-right-patch {
  282. // background: rgba(10, 25, 38, 0.9) !important;
  283. // }
  284. // /deep/ .el-table--border::after,
  285. // .el-table--group::after,
  286. // .el-table::before {
  287. // background: rgba(10, 25, 38, 0) !important;
  288. // }
  289. }
  290. /deep/ .el-icon-close:before {
  291. position: absolute;
  292. top: 10px;
  293. right: 10px;
  294. font-size: larger;
  295. font-weight: bold;
  296. &:hover {
  297. color: aqua;
  298. }
  299. }
  300. /deep/ .el-carousel--horizontal {
  301. margin-top: 15px;
  302. }
  303. /deep/ .el-carousel__item h3 {
  304. color: #475669;
  305. font-size: 18px;
  306. opacity: 0.75;
  307. line-height: 200px;
  308. text-align: center;
  309. margin: 0;
  310. }
  311. /deep/ .el-carousel__container {
  312. height: 200px;
  313. }
  314. /deep/ .el-carousel__item:nth-child(2n) {
  315. background-color: #99a9bf;
  316. }
  317. /deep/ .el-carousel__item:nth-child(2n + 1) {
  318. background-color: #d3dce6;
  319. }
  320. .inter_result {
  321. // height: 580px;
  322. height: 695px;
  323. }
  324. .Integration {
  325. // max-height: 580px;
  326. height: 695px;
  327. overflow: hidden;
  328. overflow-y: auto;
  329. .Integration_list {
  330. background-color: #0f7bc875;
  331. display: flex;
  332. justify-content: space-between;
  333. margin-top: 8px;
  334. flex-wrap: wrap;
  335. padding: 10px;
  336. .listCol {
  337. width: 49%;
  338. display: flex;
  339. align-items: center;
  340. white-space: nowrap;
  341. margin-bottom: 5px;
  342. .listText {
  343. width: 100%;
  344. display: flex;
  345. flex-direction: column;
  346. span {
  347. height: 20px;
  348. height: 20px;
  349. line-height: 20px;
  350. }
  351. }
  352. }
  353. .list_Cont {
  354. width: 100%;
  355. display: flex;
  356. align-items: center;
  357. white-space: nowrap;
  358. margin-bottom: 5px;
  359. .list_item {
  360. width: 50%;
  361. .listText {
  362. width: 100%;
  363. display: flex;
  364. flex-direction: column;
  365. span {
  366. height: 20px;
  367. line-height: 20px;
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. .sm-function-module-query {
  375. max-height: 800px !important;
  376. top: 28px !important;
  377. }
  378. </style>