index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <!--合规性分析-->
  2. <template>
  3. <div class="ghzc basicGeographic">
  4. <EntityManage class="innerContainer leftPane" @detail="detail" @checkChange="checkChange"></EntityManage>
  5. <div class="sm-panel rightWrap" v-show="showInter" :class="fold ? 'HideRight' : ''" v-loading="graloading">
  6. <div class="sm-panel-header">
  7. <span>实体关系</span>
  8. <span class="closeBtn foldBtn" :class="`el-icon-s-${fold ? '' : 'un'}fold`" @click="fold = !fold"></span>
  9. <span class="closeBtn" @click="HideGraph">&times;</span>
  10. </div>
  11. <div style="width: 50%;">
  12. <el-input placeholder="请输入查询内容" prefix-icon="el-icon-search" v-model="graphText" size="small"
  13. @change="setSelected">
  14. </el-input>
  15. </div>
  16. <graph id="first_pie" ref="graphEchart" @click="click"></graph>
  17. <div id="myContext" class="myContextMenu" style="display: none;">
  18. <div @click="fly"> 定位</div>
  19. <div @click="info">详情</div>
  20. </div>
  21. </div>
  22. <div class="sm-panel infoDiv" v-show="showinfo">
  23. <Info :data="jbxxData"></Info>
  24. </div>
  25. <!-- <interDetails :rzBsm="rzBsm" @updateParent="changeData" :interObj="interObj" v-if="showInter"></interDetails>
  26. <RzDtails :rzBsm="rzBsm" :rzMc="nowObj.xmmc" @updateParent="changeData"></RzDtails> --> -->
  27. </div>
  28. </template>
  29. <script>
  30. let data = [
  31. {
  32. name: "李富贵",
  33. id: "lfg",
  34. tooltip: {
  35. formatter: "{b} <br/>定位<br/>详情",
  36. },
  37. category: 0
  38. },
  39. {
  40. tooltip: {
  41. formatter: "{b} <br/>性别:男<br/>出生年月:19951114<br/>星座:处女座",
  42. },
  43. name: "王桂花",
  44. id: "wgh",
  45. }
  46. ];
  47. let categors = [
  48. {
  49. name: "李富贵",
  50. itemStyle: {
  51. normal: {
  52. color: "#FCBB5B",
  53. borderColor: "#FCBB5B",
  54. shadowColor: "#FCBB5B",
  55. },
  56. },
  57. },
  58. {
  59. name: '类别',
  60. itemStyle: {
  61. normal: {
  62. color: '#87ceeb' // 分类2的颜色
  63. }
  64. }
  65. }]
  66. import Info from "../Idleland/components/info.vue";
  67. import EntityManage from "./entityManage.vue";
  68. import graph from "@/components/echartsTemplate/graph.vue";
  69. import { getData, getRelationship } from "@/api/basicGeographic.js";
  70. import { loadGeoJSON, removeGeoJSON } from "@/utils/MapHelper/help.js";
  71. export default {
  72. name: "BasicGeographic",
  73. components: {
  74. EntityManage,
  75. graph,
  76. Info
  77. },
  78. data() {
  79. return {
  80. graphText: "",
  81. nowObj: {},
  82. loading: false,
  83. showInter: false,
  84. fold: false,
  85. geoSources: {},
  86. showinfo: false,
  87. jbxxData: [],
  88. graloading: false,
  89. graphdata: [],
  90. gralinks: []
  91. };
  92. },
  93. created() { },
  94. mounted() {
  95. this.detail({ id: 'MA1001NE103K103501003XXXXXXXXXXX2501010000' })//MA1001NE103K103501004XXXXXXXXXXX2203040000
  96. },
  97. methods: {
  98. click(params) {
  99. console.log(params, "paramsparams");
  100. this.getRelationship(params.data)
  101. },
  102. checkChange(obj, checked) {
  103. if (checked) this.getData(obj)
  104. else removeGeoJSON(obj.id)
  105. },
  106. detail(obj) {
  107. this.showInter = true
  108. this.graphdata = []
  109. this.gralinks = []
  110. this.graphdata.push({ name: obj.label, id: obj.id, category: 0, })
  111. this.getRelationship(obj)
  112. },
  113. HideGraph() {
  114. this.showInter = false
  115. },
  116. setSelected() {
  117. let sdata = this.graphdata.map((node) => {
  118. console.log();
  119. return {
  120. name: node.name,
  121. value: node.value,
  122. selected: node.name.includes(this.graphText)
  123. };
  124. })
  125. this.$refs.graphEchart.setOptions(sdata, this.gralinks, categors);
  126. // this.$refs.graphEchart.setOptions(this.graphdata, this.gralinks, categors);
  127. },
  128. getData(obj) {
  129. getData({ entityid: obj.id }).then((res) => {
  130. if (res.statuscode == 200) {
  131. this.showinfo = true;
  132. Object.keys(res.data.info).forEach((key) => {
  133. this.jbxxData.push({ name: key, value: res.data.info[key], });
  134. });
  135. res.data.geom.forEach(item => {
  136. console.log(obj.id, item)
  137. loadGeoJSON(item.siweigeomewkt, "#facd91", { isfly: true }, (data) => {
  138. geoSources[obj.id] = data;
  139. data.name = obj.id;
  140. });
  141. });
  142. }
  143. });
  144. },
  145. getRelationship(obj) {
  146. this.graloading = true
  147. getRelationship({ entityid: obj.id }).then((res) => {
  148. if (res.statuscode == 200) {
  149. res.data.data.forEach((item, i) => {
  150. if (item.info.entityid && !this.graphdata.find(gi => gi.id == item.info.entityid)) {
  151. this.graphdata.push({
  152. name: item.info.entityname != 'null' ? item.info.entityname : item.info.entityid,
  153. id: item.info.entityid,
  154. })
  155. }
  156. })
  157. this.gralinks = [...this.gralinks, ...res.data.links]
  158. this.$refs.graphEchart.setOptions(this.graphdata, this.gralinks, categors);
  159. this.graloading = false
  160. }
  161. });
  162. },
  163. fly() {
  164. console.log('fly,', '---');
  165. },
  166. info() {
  167. console.log('info', '---');
  168. }
  169. },
  170. watch: {
  171. // graphText(newValue) {
  172. // },
  173. },
  174. };
  175. </script>
  176. <style lang="less" scoped>
  177. .basicGeographic {
  178. .rightWrap {
  179. width: 40%;
  180. height: 85vh;
  181. max-width: 40%;
  182. min-width: 40%;
  183. top: 60px;
  184. z-index: 999;
  185. transition-property: right, background;
  186. transition-duration: 0.5s, 1s;
  187. .foldBtn {
  188. right: 40px;
  189. }
  190. }
  191. .HideRight {
  192. right: -40% !important;
  193. .foldBtn {
  194. right: 100%;
  195. }
  196. }
  197. #first_pie {
  198. width: 38vw;
  199. height: 75vh;
  200. margin-top: 20px;
  201. }
  202. /deep/ .el-input--small .el-input__inner {
  203. color: white !important;
  204. background: rgba(100, 218, 255, 0.1);
  205. border-radius: 2px 10px 2px 10px;
  206. border-color: #5ecef09a;
  207. }
  208. .myContextMenu {
  209. background-color: #041c32 !important;
  210. border: 1px solid rgba(15, 122, 200, 0.4) !important;
  211. width: 80px;
  212. height: 80px;
  213. color: #fff;
  214. position: absolute;
  215. border-radius: 2px;
  216. text-align: center;
  217. line-height: 40px;
  218. }
  219. .infoDiv {
  220. right: 40%;
  221. }
  222. // }
  223. }
  224. </style>
  225. <style lang="scss">
  226. @import "../complianceAnalysis//ghzc.scss";
  227. @keyframes toRight {
  228. from {
  229. transform: translateX(0);
  230. opacity: 0;
  231. }
  232. to {
  233. transform: translateX(100%);
  234. opacity: 1;
  235. }
  236. }
  237. .sliding-element {
  238. animation: toLeft 1s forwards
  239. }
  240. </style>