xzjg.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <div class="xzjg">
  3. <div>项目名称XXXXXX</div>
  4. <div class="box-sizing" style="height: 35%; width: 100%">
  5. <div class="title site-title">
  6. <!-- <span class="block-title"
  7. >意向地块{{ bgList ? bgList.length : 0 }})</span
  8. > -->
  9. 意向地块({{ bgList ? bgList.length : 0 }})
  10. <span>导出报告</span>
  11. </div>
  12. <el-scrollbar
  13. class="height-100-50 max-width"
  14. style="border: 1px solid #e8e8e8"
  15. >
  16. <!-- {{ xzjgObj }} -->
  17. <el-collapse accordion v-model="activeNames">
  18. <el-collapse-item
  19. :name="'gb' + index1"
  20. v-for="(item1, index1) in bgList"
  21. :key="index1"
  22. >
  23. <template slot="title">
  24. <!-- 地块编号B_P_123 -->
  25. 地块编号{{ item1.properties.dkbm }} ({{
  26. item1.properties.ydmj.toFixed(0)
  27. }})
  28. <span class="tools">
  29. <i
  30. class="header-icon el-icon-place"
  31. @click="mapview(item1)"
  32. ></i>
  33. <i
  34. class="header-icon el-icon-delete"
  35. @click="deleteprogramme($event, item1)"
  36. ></i>
  37. </span>
  38. </template>
  39. <div class="collapseCon">
  40. <p class="oneItem">
  41. <span>{{ item1.properties.kzxxgydmc }}</span>
  42. <span>{{ item1.properties.ydmj.toFixed(2) }}平方米</span>
  43. </p>
  44. <p>
  45. 基准地标价:<span style="color: #02a7f0"
  46. >{{ item1.properties.landPrice }}万元</span
  47. >
  48. </p>
  49. </div>
  50. </el-collapse-item>
  51. </el-collapse>
  52. </el-scrollbar>
  53. </div>
  54. <div class="box-sizing padding-bottom-60" style="height: 35%; width: 100%">
  55. <div class="title height-50 flex-box align-center">
  56. <span class="block-title"
  57. >备选地块({{
  58. xzjgObj.features ? xzjgObj.features.length : 0
  59. }})</span
  60. >
  61. </div>
  62. <el-scrollbar
  63. class="height-100-50 max-width"
  64. style="border: 1px solid #e8e8e8"
  65. >
  66. <el-collapse accordion v-model="activeNames">
  67. <el-collapse-item
  68. :name="index"
  69. v-for="(item, index) in xzjgObj.features"
  70. :key="item.properties.dkbm"
  71. >
  72. <template slot="title">
  73. <!-- 地块编号B_P_123 -->
  74. 地块编号{{ item.properties.dkbm }} ({{
  75. item.properties.ydmj.toFixed(0)
  76. }})
  77. <span class="tools">
  78. <i class="header-icon el-icon-place" @click="mapview(item)"></i>
  79. <i
  80. class="header-icon el-icon-plus"
  81. @click="addprogramme($event, item)"
  82. ></i>
  83. </span>
  84. </template>
  85. <div class="collapseCon">
  86. <p class="oneItem">
  87. <span>{{ item.properties.kzxxgydmc }}</span>
  88. <span>{{ item.properties.ydmj.toFixed(2) }}平方米</span>
  89. </p>
  90. <p>
  91. 基准地标价:<span style="color: #02a7f0"
  92. >{{ item.properties.landPrice }}万元</span
  93. >
  94. </p>
  95. </div>
  96. </el-collapse-item>
  97. </el-collapse>
  98. </el-scrollbar>
  99. </div>
  100. <div class="xz-btn flex-box" style="justify-content: space-between">
  101. <div class="max-height flex-box align-center margin-left-22"></div>
  102. <div class="max-height flex-box align-center">
  103. <el-button round class="btn-style" @click="resetAll">重选</el-button>
  104. <el-button
  105. round
  106. class="btn-style"
  107. @click="downReport"
  108. v-if="reportText == '查看报告'"
  109. >下载报告</el-button
  110. >
  111. <el-button
  112. type="primary"
  113. round
  114. class="btn-style margin-right-22"
  115. @click="submit"
  116. >{{ reportText }}</el-button
  117. >
  118. </div>
  119. </div>
  120. </div>
  121. </template>
  122. <script>
  123. import drawData from "./draw.json";
  124. import ghjgData from "./规划结果.json";
  125. export default {
  126. components: {},
  127. props: {
  128. activeTabs: {
  129. type: String,
  130. },
  131. },
  132. data() {
  133. return {
  134. bgList: [],
  135. model: null,
  136. layer: null,
  137. reportText: "生成报告",
  138. tempObj: [],
  139. // xzjgObj: {
  140. // bsm: "6d39b2d4307b46e2a4cf6f8c68a30c31",
  141. // xmmc: "111",
  142. // jsdw: "111",
  143. // fxbg: "/file/statics/shape/辅助选址报告/6d39b2d4307b46e2a4cf6f8c68a30c31/111(选址报告)_1676448756708.pdf",
  144. // items: [
  145. // {
  146. // objectid: 13761,
  147. // bsm: "7fe39bc0ad0811eda6d9f0def1935d90",
  148. // rwbsm: "6d39b2d4307b46e2a4cf6f8c68a30c31",
  149. // dlb: "SDE.XZYDYH",
  150. // dlbm: "0602",
  151. // dlmc: "种植设施建设用地",
  152. // cjsj: "2023-02-15T16:12:34.000+08:00",
  153. // yxfa: "0",
  154. // bz: null,
  155. // tbmj: 25.0850187,
  156. // xzqdm: "150502",
  157. // xzqmc: "科尔沁区",
  158. // fxyzjg: [],
  159. // },
  160. // ],
  161. // },
  162. // tempObj: {
  163. // bsm: "6d39b2d4307b46e2a4cf6f8c68a30c31",
  164. // xmmc: "111",
  165. // jsdw: "111",
  166. // fxbg: "/file/statics/shape/辅助选址报告/6d39b2d4307b46e2a4cf6f8c68a30c31/111(选址报告)_1676448756708.pdf",
  167. // items: [
  168. // {
  169. // objectid: 13761,
  170. // bsm: "7fe39bc0ad0811eda6d9f0def1935d90",
  171. // rwbsm: "6d39b2d4307b46e2a4cf6f8c68a30c31",
  172. // dlb: "SDE.XZYDYH",
  173. // dlbm: "0602",
  174. // dlmc: "种植设施建设用地",
  175. // cjsj: "2023-02-15T16:12:34.000+08:00",
  176. // yxfa: "0",
  177. // bz: null,
  178. // tbmj: 25.0850187,
  179. // xzqdm: "150502",
  180. // xzqmc: "科尔沁区",
  181. // fxyzjg: [],
  182. // },
  183. // ],
  184. // rwBsm: "6d39b2d4307b46e2a4cf6f8c68a30c31",
  185. // },
  186. rwObj: {
  187. bsm: "6d39b2d4307b46e2a4cf6f8c68a30c31",
  188. sjy: "SDE.XZYDYH",
  189. sjymc: "国土空间总体规划",
  190. ydbsm: "0",
  191. ydmc: null,
  192. ydmjbegin: "0",
  193. ydmjend: "100",
  194. xmmc: "111",
  195. jsdw: "111",
  196. fxbg: "/file/statics/shape/辅助选址报告/6d39b2d4307b46e2a4cf6f8c68a30c31/111(选址报告)_1676448756708.pdf",
  197. rwzt: 2,
  198. fwlx: 1,
  199. xzfw: null,
  200. zip: "/file/statics/shape/辅助选址报告/6d39b2d4307b46e2a4cf6f8c68a30c31/111_1676448756708.zip",
  201. },
  202. geoJsonEntities: null,
  203. xzjgObj: ghjgData,
  204. tempObj: ghjgData,
  205. };
  206. },
  207. mounted() {
  208. console.log(drawData, "drawData", ghjgData);
  209. this.addPolygon("规划结果", "ghjg");
  210. this.addPolygon("draw", "draw");
  211. },
  212. methods: {
  213. // 加载GeoJSON数据
  214. addPolygon(label, id) {
  215. let _this = this;
  216. let polygon = Cesium.GeoJsonDataSource.load(
  217. `static/data/${label}.geojson`,
  218. {
  219. clampToGround: true,
  220. stroke: Cesium.Color.BLUE,
  221. fill: Cesium.Color.WHITE.withAlpha(0.3), //注意:颜色必须大写,即不能为blue
  222. strokeWidth: 5,
  223. }
  224. );
  225. polygon.then(function (dataSource) {
  226. // dataSource.id = id;
  227. // 将数据源添加到Cesium Viewer
  228. viewer.dataSources.add(dataSource);
  229. viewer.zoomTo(dataSource);
  230. _this.dataSources[id] = dataSource;
  231. });
  232. },
  233. addprogramme(e, item) {
  234. e.stopPropagation();
  235. const list = this.bgList.filter((item1) => {
  236. return item1 == item;
  237. });
  238. if (list.length == 0) {
  239. this.bgList.push(item);
  240. const list = this.xzjgObj.features.filter((item1) => {
  241. return item1.properties.dkbm != item.properties.dkbm;
  242. });
  243. this.xzjgObj.features = list;
  244. }
  245. },
  246. deleteprogramme(e, item) {
  247. e.stopPropagation();
  248. this.bgList = this.bgList.filter((item1) => {
  249. return item1.properties.dkbm != item.properties.dkbm;
  250. });
  251. const temp = JSON.parse(
  252. JSON.stringify(
  253. this.tempObj.items.filter((item1) => {
  254. return item1.properties.dkbm == item.properties.dkbm;
  255. })
  256. )
  257. );
  258. this.xzjgObj.features.push(temp[0]);
  259. },
  260. resetAll() {
  261. // parent.emit("update:xzjgObj", JSON.parse(JSON.stringify(this.tempObj)));
  262. this.reportText = "生成报告";
  263. this.bgList = [];
  264. },
  265. mapview(item) {
  266. // e.stopPropagation()
  267. console.log(item, "=====");
  268. console.log(item.geometry.coordinates[0][0][0][0],'item.geometry.coordinates[0][0]');
  269. viewer.camera.flyTo({
  270. destination: Cesium.Cartesian3.fromDegrees(
  271. item.geometry.coordinates[0][0][0][0],
  272. item.geometry.coordinates[0][0][0][1],
  273. 15000.0
  274. ),
  275. orientation: {
  276. heading: Cesium.Math.toRadians(20.0),
  277. pitch: Cesium.Math.toRadians(-35.0),
  278. roll: 0.0,
  279. },
  280. });
  281. },
  282. submit() {
  283. console.log("生成报告");
  284. },
  285. downReport() {
  286. window.open(this.model.zip, "_blank");
  287. },
  288. loadJgMap() {},
  289. loadJg(bsm) {
  290. console.log(bsm, "bsm");
  291. },
  292. initData() {
  293. this.model = this.rwObj;
  294. this.bgList = this.tempObj.items.filter(
  295. (item) =>
  296. !this.xzjgObj.features.some(
  297. (ele) => ele.properties.dkbm === item.properties.dkbm
  298. )
  299. );
  300. this.bgList.sort(function (a, b) {
  301. return parseInt(a.yxfa) - parseInt(b.yxfa);
  302. });
  303. },
  304. },
  305. watch: {
  306. activeTabs(newValue, oldValue) {
  307. if (newValue == "scjg") {
  308. this.initData();
  309. }
  310. },
  311. },
  312. beforeDestroy() {
  313. viewer.dataSources.removeAll();
  314. },
  315. };
  316. </script>
  317. <style lang="scss" scoped>
  318. .xzjg {
  319. height: calc(100vh - 108px);
  320. min-width: 300px;
  321. box-sizing: border-box;
  322. padding: 0px 10px;
  323. ::v-deep(.el-scrollbar__bar) {
  324. right: -15px;
  325. }
  326. td {
  327. padding-left: 15px;
  328. }
  329. .el-collapse-item__header {
  330. font-size: 18px;
  331. .fanan-caozuo {
  332. position: absolute;
  333. right: 20px;
  334. box-sizing: border-box;
  335. padding-right: 20px;
  336. }
  337. }
  338. .el-collapse-item__content {
  339. padding-bottom: 0;
  340. }
  341. ::v-deep(.el-collapse-item__header) {
  342. color: #303133 !important;
  343. position: relative;
  344. cursor: auto;
  345. }
  346. .blue {
  347. color: #409eff;
  348. }
  349. ::v-deep(.el-tabs__item) {
  350. height: 55px;
  351. }
  352. ::v-deep(.el-form-item__content) {
  353. line-height: 40px;
  354. }
  355. ::v-deep(.el-form-item__label) {
  356. line-height: 40px;
  357. }
  358. .title {
  359. button {
  360. padding: 0;
  361. float: right;
  362. margin-right: 5px;
  363. min-height: unset;
  364. }
  365. }
  366. .el-form-item {
  367. margin-bottom: 0;
  368. }
  369. .xz-btn {
  370. width: 100%;
  371. position: absolute;
  372. height: 55px;
  373. z-index: 2;
  374. bottom: 0;
  375. right: 0;
  376. display: flex;
  377. align-items: center;
  378. }
  379. ::v-deep(.el-descriptions :not(.is-bordered) td),
  380. ::v-deep(.el-descriptions :not(.is-bordered) th) {
  381. padding-bottom: 3px;
  382. }
  383. ::v-deep(.el-collapse-item__content) {
  384. padding-bottom: 10px;
  385. }
  386. ::v-deep(.el-collapse-item__header) {
  387. cursor: pointer;
  388. &:hover {
  389. background-color: rgba(64, 158, 255, 0.09);
  390. }
  391. }
  392. .clat-title {
  393. padding-left: 10px;
  394. padding-right: 5px;
  395. display: inline-flex;
  396. .clat-title-head {
  397. display: inline-block;
  398. max-width: 280px;
  399. overflow: hidden;
  400. text-overflow: ellipsis;
  401. }
  402. }
  403. }
  404. .tools {
  405. position: absolute;
  406. right: 30px;
  407. }
  408. .collapseCon {
  409. p {
  410. width: 100%;
  411. height: 30px;
  412. line-height: 30px;
  413. // background-color: pink;
  414. }
  415. .oneItem {
  416. span {
  417. border: 1px solid #02a7f0;
  418. padding: 3px 5px;
  419. border-radius: 5px;
  420. }
  421. }
  422. }
  423. </style>