index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <div ref="ref_dom" class="gis-overlay-qy">
  3. <div class="qy-bg-icon qy-bg-icon-1"/>
  4. <div class="qy-bg-icon qy-bg-icon-2"/>
  5. <div class="qy-bg-icon qy-bg-icon-3"/>
  6. <div class="qy-bg-icon qy-bg-icon-4"/>
  7. <div class="qy-main">
  8. <div class="qy-main-head">
  9. <div class="qy-main-head-tips">【企业】</div>
  10. <div class="qy-main-head-name">{{ qyInfoCpt.name }}</div>
  11. <SvgIcon class="__hover" name="close_4" size="14" color="#8FFFFF" @click="$store.dispatch('gis/LOAD_GIS_PARAMS_QY_RESET')"/>
  12. </div>
  13. <div class="qy-main-tab">
  14. <template v-for="item in [
  15. {label: '基本信息', value: '1', disabled: false},
  16. {label: '税收信息', value: '2', disabled: true},
  17. {label: '运输车辆', value: '3', disabled: true},
  18. {label: '能耗消息', value: '4', disabled: true},
  19. {label: '周边设备', value: '5', disabled: false},
  20. ]">
  21. <div class="qy-main-tab-item __hover" :class="{active: item.value === qyInfoCpt.tab, disabled: item.disabled}" @click="item.disabled ? undefined : qyInfoCpt.tab = item.value">{{item.label}}</div>
  22. </template>
  23. </div>
  24. <div v-if="qyInfoCpt.tab === '1'" class="qy-main-content-1">
  25. <div>企业名称:{{qyInfoCpt['1'].name}}</div>
  26. <div>企业法人:{{qyInfoCpt['1'].people}}</div>
  27. <div>统一社会信用代码:{{qyInfoCpt['1'].number}}</div>
  28. <div>经营地址:{{qyInfoCpt['1'].address}}</div>
  29. </div>
  30. <div v-else-if="qyInfoCpt.tab === '5'" class="qy-main-content-5">
  31. <div class="qy-main-content-5-radius">
  32. 周边范围:
  33. <div class="radius-min __hover" @click="qyInfoCpt['5'].radius > 1 ? (qyInfoCpt['5'].radius--, handleRangeInput(qyInfoCpt['5'].radius)) : undefined">-</div>
  34. <CusFormColumn
  35. link="number"
  36. label=""
  37. :clearable="false"
  38. v-model:param="qyInfoCpt['5'].radius"
  39. @input="handleRangeInput"/>
  40. <div class="radius-max __hover" @click="qyInfoCpt['5'].radius < 60 ? (qyInfoCpt['5'].radius++, handleRangeInput(qyInfoCpt['5'].radius)) : undefined">+</div>
  41. km
  42. <div class="submit __hover" :style="`cursor: ${qyInfoCpt['5'].radiusTips ? 'not-allowed' : ''};`" @click="onRadiusSubmit">确定</div>
  43. <div class="reset __hover" @click="onRadiusReset">重置</div>
  44. <div class="tips" v-if="qyInfoCpt['5'].radiusTips"><SvgIcon name="tips" size="16" color="#FFB878"/>请输入1~60的正整数!</div>
  45. </div>
  46. <div class="qy-main-content-5-table" :style="`height: ${25 + (qyInfoCpt['5'].tableData.length > 5 ? 5 * 25 : qyInfoCpt['5'].tableData.length * 25)}px;`" v-loading="qyInfoCpt[qyInfoCpt.tab].loading" element-loading-background="rgba(0, 0, 0, 0.3)">
  47. <V2Table
  48. :data="qyInfoCpt['5'].tableData"
  49. :center="qyInfoCpt['5'].center"
  50. />
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script lang="ts">
  57. import {
  58. defineComponent,
  59. computed,
  60. onMounted,
  61. ref,
  62. reactive,
  63. watch,
  64. getCurrentInstance,
  65. ComponentInternalInstance,
  66. toRefs,
  67. nextTick, markRaw
  68. } from 'vue'
  69. import {useStore} from 'vuex'
  70. import {useRouter, useRoute} from 'vue-router'
  71. import {ElMessage, ElMessageBox} from "element-plus";
  72. import V2Table from "./v2-table.vue";
  73. import * as turf from "@turf/turf";
  74. import * as geom from "ol/geom";
  75. import * as source from "ol/source";
  76. import * as layer from "ol/layer";
  77. import * as style from "ol/style";
  78. import * as ol from "ol";
  79. import * as format from "ol/format";
  80. import SbStyle from "@/views/gis/map-info/style/sb";
  81. import CommonStyle from "@/views/gis/map-info/style/common";
  82. export default defineComponent({
  83. name: '',
  84. components: {
  85. V2Table,
  86. },
  87. props: {},
  88. setup(props, {emit}) {
  89. const store = useStore();
  90. const router = useRouter();
  91. const route = useRoute();
  92. const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
  93. const state = reactive({
  94. qyInfo: <any>store.state.gis.gisParams.qy.info,
  95. })
  96. const qyInfoCpt = computed(() => {
  97. return store.state.gis.gisParams.qy.info
  98. })
  99. const ref_dom = ref()
  100. const handleRangeInput = (v) => {
  101. const nV = Number(v)
  102. if (!isNaN(Number(nV))) {
  103. if (nV < 1 || nV > 60) {
  104. qyInfoCpt.value['5'].radiusTips = true
  105. } else {
  106. qyInfoCpt.value['5'].radiusTips = false
  107. }
  108. }
  109. }
  110. const setCircle = () => {
  111. const circle = turf.circle(qyInfoCpt.value['5'].center, qyInfoCpt.value['5'].radius, {steps: 32, units: 'kilometers'})
  112. store.state.gis.gisParams.qy.analysisCircle.setGeometry(new geom.Polygon(circle.geometry.coordinates))
  113. }
  114. const onRadiusSubmit = () => {
  115. if (store.state.gis.analysis.wkt) {
  116. ElMessage.warning('请先关闭周边分析!')
  117. } else {
  118. if (!qyInfoCpt.value['5'].radiusTips) {
  119. store.state.gis.gisParams.qy.feature.set('isAnalysis', true)
  120. store.state.gis.gisParams.qy.feature.get('resetStyle')()
  121. store.state.gis.gisParams.default.feature?.set('isAnalysis', true)
  122. store.state.gis.gisParams.default.feature?.get('resetStyle')()
  123. store.state.gis.gisParams.qy.analysisSource.clear()
  124. store.state.gis.gisParams.qy.analysisSource.addFeature(store.state.gis.gisParams.qy.analysisCircle)
  125. setCircle()
  126. store.dispatch('gis/LOAD_GIS_PARAMS_QY_ANALYSIS')
  127. }
  128. }
  129. }
  130. const onRadiusReset = () => {
  131. qyInfoCpt.value['5'].radius = 10
  132. qyInfoCpt.value['5'].radiusTips = false
  133. onRadiusSubmit()
  134. }
  135. onMounted(() => {
  136. })
  137. return {
  138. ...toRefs(state),
  139. ref_dom,
  140. handleRangeInput,
  141. onRadiusSubmit,
  142. onRadiusReset,
  143. qyInfoCpt
  144. }
  145. },
  146. })
  147. </script>
  148. <style scoped lang="scss">
  149. .gis-overlay-qy {
  150. $bgColor: #2860CE;
  151. $footH: 10px;
  152. min-width: 315px;
  153. min-height: 168px - $footH;
  154. background-color: $bgColor;
  155. position: relative;
  156. display: flex;
  157. justify-content: center;
  158. &:after {
  159. content: '';
  160. position: absolute;
  161. bottom: -$footH;
  162. border-top: $footH solid $bgColor;
  163. border-left: $footH solid transparent;
  164. border-right: $footH solid transparent;
  165. }
  166. .qy-bg-icon {
  167. width: 16px;
  168. height: 16px;
  169. background-image: url("@/views/gis/map-info/qy-dom-icon1.png");
  170. background-repeat: no-repeat;
  171. background-size: 100% 100%;
  172. position: absolute;
  173. z-index: 1;
  174. &.qy-bg-icon-1 {
  175. left: 0;
  176. top: 0;
  177. }
  178. &.qy-bg-icon-2 {
  179. right: 0;
  180. top: 0;
  181. transform: rotate(90deg);
  182. }
  183. &.qy-bg-icon-3 {
  184. right: 0;
  185. bottom: 0;
  186. transform: rotate(180deg);
  187. }
  188. &.qy-bg-icon-4 {
  189. left: 0;
  190. bottom: 0;
  191. transform: rotate(270deg);
  192. }
  193. }
  194. .qy-main {
  195. width: 100%;
  196. height: auto;
  197. z-index: 2;
  198. padding: 12px;
  199. .qy-main-head {
  200. display: flex;
  201. align-items: center;
  202. position: relative;
  203. &:after {
  204. content: '';
  205. position: absolute;
  206. width: 100%;
  207. height: 4px;
  208. bottom: -9px;
  209. background-image: url("@/views/gis/map-info/qy-info-icon2.png");
  210. background-repeat: no-repeat;
  211. }
  212. .qy-main-head-tips {
  213. font-size: 10px;
  214. font-family: Microsoft YaHei;
  215. font-weight: bold;
  216. color: #8FFFFF;
  217. }
  218. .qy-main-head-name {
  219. font-size: 14px;
  220. font-family: Microsoft YaHei;
  221. font-weight: bold;
  222. color: #FFFFFF;
  223. }
  224. .svg-icon {
  225. margin-left: auto;
  226. }
  227. }
  228. .qy-main-tab {
  229. margin: 20px 0 10px 0;
  230. display: flex;
  231. align-items: center;
  232. .qy-main-tab-item {
  233. font-size: 12px;
  234. font-family: Microsoft YaHei;
  235. font-weight: 400;
  236. color: #CEE6FF;
  237. height: 16px;
  238. display: flex;
  239. align-items: center;
  240. justify-content: center;
  241. padding: 0 4px;
  242. border-radius: 2px;
  243. background-color: rgba(255, 255, 255, 0.2);
  244. &.active {
  245. background-color: #1280F1;
  246. color: #61FFFF;
  247. }
  248. &.disabled {
  249. cursor: not-allowed;
  250. opacity: 0.7;
  251. }
  252. &:not(:last-child) {
  253. margin-right: 2px;
  254. }
  255. }
  256. }
  257. .qy-main-content-1 {
  258. font-size: 12px;
  259. font-family: Microsoft YaHei;
  260. font-weight: 400;
  261. color: #FFFFFF;
  262. >div {
  263. line-height: 18px;
  264. }
  265. }
  266. .qy-main-content-5 {
  267. .qy-main-content-5-radius {
  268. display: flex;
  269. align-items: center;
  270. font-size: 12px;
  271. font-family: Microsoft YaHei;
  272. font-weight: 400;
  273. color: #FFFFFF;
  274. .radius-min, .radius-max {
  275. margin: 0 3px;
  276. &:hover {
  277. color: #409EFF;
  278. }
  279. }
  280. :deep(.cus-form-column) {
  281. max-width: unset;
  282. width: 44px;
  283. flex: unset;
  284. .el-form-item {
  285. margin: 0;
  286. .el-form-item__content {
  287. height: 18px;
  288. .el-input {
  289. .el-input__wrapper {
  290. padding: 0;
  291. border-radius: 5px;
  292. background-color: transparent;
  293. .el-input__inner {
  294. color: #FFFFFF;
  295. background-color: transparent;
  296. height: 100%;
  297. text-align: center;
  298. border: 1px solid #ffffff;
  299. border-radius: 5px;
  300. &::placeholder {
  301. font-size: 12px;
  302. font-family: Microsoft YaHei;
  303. }
  304. }
  305. }
  306. }
  307. }
  308. }
  309. }
  310. .submit {
  311. display: flex;
  312. align-items: center;
  313. justify-content: center;
  314. width: 36px;
  315. height: 18px;
  316. background: #8FFFFF;
  317. border-radius: 4px;
  318. font-size: 12px;
  319. font-family: Microsoft YaHei;
  320. font-weight: 400;
  321. color: #1174DB;
  322. margin-left: 10px;
  323. }
  324. .reset {
  325. display: flex;
  326. align-items: center;
  327. justify-content: center;
  328. width: 36px;
  329. height: 18px;
  330. border: 1px solid #8FFFFF;
  331. border-radius: 4px;
  332. font-size: 12px;
  333. font-family: Microsoft YaHei;
  334. font-weight: 400;
  335. color: #8FFFFF;
  336. margin-left: 8px;
  337. }
  338. .tips {
  339. margin-left: auto;
  340. display: flex;
  341. align-items: center;
  342. color: #FFB878;
  343. .svg-icon {
  344. margin-right: 2px;
  345. }
  346. }
  347. }
  348. .qy-main-content-5-table {
  349. margin-top: 10px;
  350. width: 440px;
  351. }
  352. }
  353. }
  354. }
  355. </style>