xzjg.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <div class="xzjg">
  3. <div>项目名称XXXXXX</div>
  4. <div class="box-sizing" style="height: 47%; 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 @click="download">导出报告</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: 47%; 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. scjgObj: {
  132. type: Object,
  133. },
  134. },
  135. data() {
  136. return {
  137. bgList: [],
  138. model: null,
  139. layer: null,
  140. reportText: "生成报告",
  141. rwObj: {
  142. bsm: "6d39b2d4307b46e2a4cf6f8c68a30c31",
  143. sjy: "SDE.XZYDYH",
  144. sjymc: "国土空间总体规划",
  145. ydbsm: "0",
  146. ydmc: null,
  147. ydmjbegin: "0",
  148. ydmjend: "100",
  149. xmmc: "111",
  150. jsdw: "111",
  151. fxbg: "/file/statics/shape/辅助选址报告/6d39b2d4307b46e2a4cf6f8c68a30c31/111(选址报告)_1676448756708.pdf",
  152. rwzt: 2,
  153. fwlx: 1,
  154. xzfw: null,
  155. zip: "/file/statics/shape/辅助选址报告/6d39b2d4307b46e2a4cf6f8c68a30c31/111_1676448756708.zip",
  156. },
  157. geoJsonEntities: null,
  158. xzjgObj: ghjgData,
  159. tempObj: ghjgData,
  160. copyData:null,
  161. };
  162. },
  163. mounted() {
  164. this.copyData = JSON.parse(JSON.stringify(ghjgData))
  165. this.addPolygon("规划结果", "ghjg");
  166. this.addPolygon("draw", "draw");
  167. },
  168. methods: {
  169. download() {
  170. window.open(this.$props.scjgObj.task.fxbg);
  171. },
  172. viewReport() {
  173. window.open(
  174. this.$props.scjgObj.task.fxbg.replace(".docx", ".pdf"),
  175. "_blank"
  176. );
  177. },
  178. // 加载GeoJSON数据
  179. addPolygon(label, id) {
  180. let _this = this;
  181. let polygon = Cesium.GeoJsonDataSource.load(
  182. `static/data/${label}.geojson`,
  183. {
  184. clampToGround: true,
  185. stroke: Cesium.Color.BLUE,
  186. fill: Cesium.Color.WHITE.withAlpha(0.3), //注意:颜色必须大写,即不能为blue
  187. strokeWidth: 5,
  188. }
  189. );
  190. polygon.then(function (dataSource) {
  191. // dataSource.id = id;
  192. // 将数据源添加到Cesium Viewer
  193. viewer.dataSources.add(dataSource);
  194. viewer.zoomTo(dataSource);
  195. _this.dataSources[id] = dataSource;
  196. });
  197. },
  198. addprogramme(e, item) {
  199. e.stopPropagation();
  200. const list = this.bgList.filter((item1) => {
  201. return item1 == item;
  202. });
  203. if (list.length == 0) {
  204. this.bgList.push(item);
  205. const list = this.xzjgObj.features.filter((item1) => {
  206. return item1.properties.dkbm != item.properties.dkbm;
  207. });
  208. this.xzjgObj.features = list;
  209. }
  210. },
  211. deleteprogramme(e, item) {
  212. e.stopPropagation();
  213. this.bgList = this.bgList.filter((item1) => {
  214. return item1.properties.dkbm != item.properties.dkbm;
  215. });
  216. const temp = JSON.parse(
  217. JSON.stringify(
  218. this.tempObj.items.filter((item1) => {
  219. return item1.properties.dkbm == item.properties.dkbm;
  220. })
  221. )
  222. );
  223. this.xzjgObj.features.push(temp[0]);
  224. },
  225. resetAll() {
  226. // this.xzjgObj = JSON.parse(JSON.stringify(this.tempObj))
  227. // parent.emit("update:xzjgObj", JSON.parse(JSON.stringify(this.tempObj)));
  228. this.xzjgObj = this.copyData
  229. this.reportText = "生成报告";
  230. this.bgList = [];
  231. },
  232. mapview(item) {
  233. // e.stopPropagation()
  234. // console.log(item, "=====");
  235. // console.log(item.geometry.coordinates[0][0][0][0],'item.geometry.coordinates[0][0]');
  236. // viewer.camera.flyTo({
  237. // destination: Cesium.Cartesian3.fromDegrees(
  238. // item.geometry.coordinates[0][0][0][0],
  239. // item.geometry.coordinates[0][0][0][1],
  240. // 15000.0
  241. // ),
  242. // orientation: {
  243. // heading: Cesium.Math.toRadians(20.0),
  244. // pitch: Cesium.Math.toRadians(-35.0),
  245. // roll: 0.0,
  246. // },
  247. // });
  248. let tempArr = item.geometry.coordinates[0];
  249. let entity = new Cesium.Entity({
  250. name: "地块",
  251. show: true,
  252. position: Cesium.Cartesian3.fromDegrees(
  253. obj.centroid[0],
  254. res.properties.centroid[1],
  255. 5000
  256. ),
  257. clampToGround: true,
  258. stroke: Cesium.Color.BLUE,
  259. fill: Cesium.Color.WHITE.withAlpha(0.3), //注意:颜色必须大写,即不能为blue
  260. strokeWidth: 5,
  261. });
  262. earth.czm.viewer.entities.add(entity);
  263. // 存ID
  264. this.arrww.push(entity.id);
  265. },
  266. submit() {
  267. console.log("生成报告");
  268. },
  269. downReport() {
  270. window.open(this.model.zip, "_blank");
  271. },
  272. loadJgMap() {},
  273. loadJg(bsm) {
  274. console.log(bsm, "bsm");
  275. },
  276. initData() {
  277. this.model = this.rwObj;
  278. this.bgList = this.tempObj.items.filter(
  279. (item) =>
  280. !this.xzjgObj.features.some(
  281. (ele) => ele.properties.dkbm === item.properties.dkbm
  282. )
  283. );
  284. this.bgList.sort(function (a, b) {
  285. return parseInt(a.yxfa) - parseInt(b.yxfa);
  286. });
  287. },
  288. },
  289. watch: {
  290. activeTabs(newValue, oldValue) {
  291. if (newValue == "scjg") {
  292. this.initData();
  293. }
  294. },
  295. },
  296. beforeDestroy() {
  297. viewer.dataSources.removeAll();
  298. },
  299. };
  300. </script>
  301. <style lang="scss" scoped>
  302. .xzjg {
  303. // height: calc(100vh - 108px);
  304. height: 49vh;
  305. min-width: 300px;
  306. box-sizing: border-box;
  307. padding: 0px 10px;
  308. .blue {
  309. color: #409eff;
  310. }
  311. .title {
  312. button {
  313. padding: 0;
  314. float: right;
  315. margin-right: 5px;
  316. min-height: unset;
  317. }
  318. }
  319. .el-form-item {
  320. margin-bottom: 0;
  321. }
  322. .xz-btn {
  323. width: 100%;
  324. position: absolute;
  325. height: 55px;
  326. z-index: 2;
  327. bottom: 0;
  328. right: 0;
  329. display: flex;
  330. align-items: center;
  331. }
  332. .clat-title {
  333. padding-left: 10px;
  334. padding-right: 5px;
  335. display: inline-flex;
  336. .clat-title-head {
  337. display: inline-block;
  338. max-width: 280px;
  339. overflow: hidden;
  340. text-overflow: ellipsis;
  341. }
  342. }
  343. }
  344. .tools {
  345. position: absolute;
  346. right: 30px;
  347. }
  348. .collapseCon {
  349. p {
  350. width: 100%;
  351. height: 30px;
  352. line-height: 30px;
  353. // background-color: pink;
  354. color: #fff;
  355. }
  356. .oneItem {
  357. span {
  358. border: 1px solid #02a7f0;
  359. padding: 3px 5px;
  360. border-radius: 5px;
  361. }
  362. }
  363. }
  364. </style>