|
@@ -1,19 +1,13 @@
|
|
|
<template>
|
|
|
- <div class="map-ditu" v-loading="loading">
|
|
|
+ <div class="map-ditu">
|
|
|
<Tmap ref="map" :maplist="maplist" @feature-click="featureClick"></Tmap>
|
|
|
<div class="ledata">
|
|
|
- <selecttree
|
|
|
- placeholder="请选择上级单位"
|
|
|
- :list="parentOpt"
|
|
|
- type="1"
|
|
|
- v-model="companyCode"
|
|
|
- @change="parentChange"
|
|
|
+ <selecttree placeholder="请选择上级单位" :list="parentOpt" type="1" v-model="companyCode" @change="parentChange"
|
|
|
:defaultParentProps="{
|
|
|
children: 'children',
|
|
|
label: 'companyName',
|
|
|
value: 'codeNumber',
|
|
|
- }"
|
|
|
- >
|
|
|
+ }">
|
|
|
</selecttree>
|
|
|
|
|
|
<p>
|
|
@@ -48,21 +42,11 @@
|
|
|
<span class="yellow"></span>
|
|
|
<span class="green"></span>
|
|
|
</p>
|
|
|
- <el-switch
|
|
|
- v-model="value1"
|
|
|
- active-text="显示"
|
|
|
- inactive-text="隐藏"
|
|
|
- @change="handleSwitchChange"
|
|
|
- >
|
|
|
+ <el-switch v-model="value1" active-text="显示" inactive-text="隐藏" @change="handleSwitchChange">
|
|
|
</el-switch>
|
|
|
</div>
|
|
|
- <Rightdata
|
|
|
- v-show="ShowRi"
|
|
|
- ref="childRef"
|
|
|
- :maplistArr="maplistArr"
|
|
|
- :defaultdata="defaultdata"
|
|
|
- class="ridata"
|
|
|
- ></Rightdata>
|
|
|
+ <Rightdata v-show="ShowRi" ref="childRef" :maplistArr="maplistArr" :defaultdata="defaultdata" class="ridata">
|
|
|
+ </Rightdata>
|
|
|
<router-view></router-view>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -84,13 +68,12 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- loading: false,
|
|
|
ShowRi: true,
|
|
|
treeval: "",
|
|
|
value1: true,
|
|
|
treeval: "", // 绑定的输入框值
|
|
|
showTree: false, // 控制树列表显示
|
|
|
- treeData: [], // 树列表数据,根据实际需求自行替换
|
|
|
+ treeData: [],
|
|
|
maplist: [],
|
|
|
maplistArr: {},
|
|
|
totalList: [],
|
|
@@ -121,31 +104,19 @@ export default {
|
|
|
methods: {
|
|
|
// 获取总数
|
|
|
GETtotal() {
|
|
|
- this.loading = true;
|
|
|
- getCompanyFieldNumberVo()
|
|
|
- .then((res) => {
|
|
|
- this.totalList = res.data;
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.error(err, "err");
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+ getCompanyFieldNumberVo().then((res) => {
|
|
|
+ this.totalList = res.data;
|
|
|
+ });
|
|
|
},
|
|
|
// 获取企业数
|
|
|
async GETtree() {
|
|
|
- this.loading = true;
|
|
|
- try {
|
|
|
- const res = await getSysOrganizationAuthTreeByRoleId();
|
|
|
- const treedata = res.data;
|
|
|
- const processedData = this.processTreeData(treedata);
|
|
|
- this.parentOpt = processedData;
|
|
|
- this.defaultdata = res.data[0];
|
|
|
- this.loading = false;
|
|
|
- } catch (err) {
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
+ const res = await getSysOrganizationAuthTreeByRoleId();
|
|
|
+ const treedata = res.data;
|
|
|
+ const processedData = this.processTreeData(treedata);
|
|
|
+ this.parentOpt = processedData;
|
|
|
+ this.defaultdata = res.data[0];
|
|
|
},
|
|
|
+
|
|
|
//过滤数据
|
|
|
processTreeData(treeData) {
|
|
|
const processedData = [];
|
|
@@ -163,9 +134,10 @@ export default {
|
|
|
processNode(root);
|
|
|
processedData.push(root);
|
|
|
});
|
|
|
-
|
|
|
return processedData;
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
parseCoordinates(input) {
|
|
|
if (input && typeof input === "string") {
|
|
|
return input.split(",").map(Number);
|
|
@@ -194,7 +166,7 @@ export default {
|
|
|
console.log(element);
|
|
|
if (
|
|
|
this.parseCoordinates(element.longitudeAndLatitudeString).length >
|
|
|
- 0 &&
|
|
|
+ 0 &&
|
|
|
element.codeType === "field"
|
|
|
) {
|
|
|
this.$refs.map.addMarker({
|