Commit c0996d3f by 李萌萌

文本信息放到point图层中

parent efa2a985
<!--
* @Author: your name
* @Date: 2021-12-24 09:50:39
* @LastEditTime: 2022-01-13 16:22:13
* @LastEditTime: 2022-01-14 13:56:36
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \founder_vue\src\views\SystemManage\QueryPermission.vue
......@@ -38,7 +38,9 @@
<el-checkbox class="ckbAuto" fill="#055FE7" v-model="isAutoDistribute"
>省厅总数自动分配</el-checkbox
>
<button @click="autoDistribute" class="f-primary-button">一键分配</button>
<button @click="autoDistribute" class="f-primary-button">
一键分配
</button>
</div>
<div class="stTongji">
<div>省/区厅发查询总数:</div>
......@@ -226,24 +228,44 @@ export default {
features: featuresP,
}),
style: function(feature) {
const style = new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(255, 255, 255, 1)",
const style = [
new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(255, 255, 255, 1)",
}),
offsetY: -35,
textAlign: "center",
text: feature.get("totalCount") || "",
}),
image: new Icon({
anchor: [0.5, 120],
scale: 0.5,
anchorXUnits: "fraction",
anchorYUnits: "pixels",
src: marker,
}),
offsetY: -35,
textAlign: "center",
text: feature.get("totalCount") || "",
}),
image: new Icon({
anchor: [0.5, 120],
scale: 0.5,
anchorXUnits: "fraction",
anchorYUnits: "pixels",
src: marker,
new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(255, 255, 255, 1)",
}),
backgroundFill: new Fill({
color: "rgba(0, 0, 0, 0.6) ",
}),
backgroundStroke: new Stroke({
color: "rgba(255, 255, 255, 1)",
width: 1,
}),
textAlign: "center",
padding: [3, 1, 0, 3],
text: feature.get("MC"),
}),
}),
});
];
return style;
},
});
......@@ -258,22 +280,6 @@ export default {
color: "#fff",
width: 2,
}),
text: new Text({
font: "14px HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(255, 255, 255, 1)",
}),
backgroundFill: new Fill({
color: "rgba(0, 0, 0, 0.6) ",
}),
backgroundStroke: new Stroke({
color: "rgba(255, 255, 255, 1)",
width: 1,
}),
textAlign: "center",
padding: [3, 1, 0, 3],
text: feature.get("MC"),
}),
});
return style;
},
......@@ -281,24 +287,6 @@ export default {
selectedRegionLayer = new VectorLayer({
source: new VectorSource(),
style: function(feature) {
const pstyle = new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({
color: "#333333",
}),
offsetY: -35,
textAlign: "center",
text: feature.get("totalCount") || "",
}),
image: new Icon({
scale: 0.5,
anchor: [0.5, 120],
anchorXUnits: "fraction",
anchorYUnits: "pixels",
src: markers,
}),
});
const rstyle = new Style({
fill: new Fill({
color: "rgba(154, 218, 252, 0)",
......@@ -307,67 +295,48 @@ export default {
color: "#055FE7",
width: 3,
}),
text: new Text({
font: "14px HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(51, 51, 51, 1)",
}),
backgroundFill: new Fill({
color: "rgba(255, 255, 255, 1)",
}),
textAlign: "center",
padding: [3, 1, 0, 3],
text: feature.get("MC"),
}),
});
const isPoint = feature.getGeometry() instanceof Point;
return isPoint ? pstyle : rstyle;
return rstyle;
},
});
selectedPointLayer = new VectorLayer({
source: new VectorSource(),
style: function(feature) {
const pstyle = new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({
color: "#333333",
const pstyle = [
new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({
color: "#333333",
}),
offsetY: -35,
textAlign: "center",
text: feature.get("totalCount") || "",
}),
offsetY: -35,
textAlign: "center",
text: feature.get("totalCount") || "",
}),
image: new Icon({
scale: 0.5,
anchor: [0.5, 120],
anchorXUnits: "fraction",
anchorYUnits: "pixels",
src: markers,
}),
});
const rstyle = new Style({
fill: new Fill({
color: "rgba(154, 218, 252, 0)",
}),
stroke: new Stroke({
color: "#055FE7",
width: 3,
}),
text: new Text({
font: "14px HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(51, 51, 51, 1)",
image: new Icon({
scale: 0.5,
anchor: [0.5, 120],
anchorXUnits: "fraction",
anchorYUnits: "pixels",
src: markers,
}),
backgroundFill: new Fill({
color: "rgba(255, 255, 255, 1)",
}),
new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(51, 51, 51, 1)",
}),
backgroundFill: new Fill({
color: "rgba(255, 255, 255, 1)",
}),
textAlign: "center",
padding: [3, 1, 0, 3],
text: feature.get("MC"),
}),
textAlign: "center",
padding: [3, 1, 0, 3],
text: feature.get("MC"),
}),
});
const isPoint = feature.getGeometry() instanceof Point;
return isPoint ? pstyle : rstyle;
];
return pstyle;
},
});
......@@ -878,14 +847,14 @@ export default {
}
}
.f-primary-button {
cursor: pointer;
background: #055fe7 !important;
&:hover {
background: #377fec !important;
}
&:active {
background: #044cb9 !important;
}
cursor: pointer;
background: #055fe7 !important;
&:hover {
background: #377fec !important;
}
&:active {
background: #044cb9 !important;
}
}
// @import "@/assets/css/globalBase.scss";
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment