Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
35174d87
Commit
35174d87
authored
Apr 16, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化新增、编辑颜色、国家布局 地图字加粗 ,选字体,地图标记滚动
parent
54fd6d73
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
240 additions
and
53 deletions
+240
-53
common.css
src/assets/styles/common.css
+10
-0
MarkAttributes.vue
src/components/Maps/MapAttributes/MarkAttributes.vue
+50
-1
index.vue
src/components/Maps/MapAttributes/index.vue
+2
-1
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+178
-51
No files found.
src/assets/styles/common.css
View file @
35174d87
...
...
@@ -416,6 +416,16 @@ page {
.q-ma-lg
{
margin
:
20px
}
.q-ma-xs
{
margin-right
:
5px
;
margin-left
:
5px
;
}
.q-mr-xs
{
margin-right
:
5px
;
}
.q-ml-xs
{
margin-left
:
5px
;
}
.q-pa-lg
{
padding
:
20px
}
...
...
src/components/Maps/MapAttributes/MarkAttributes.vue
View file @
35174d87
...
...
@@ -53,7 +53,22 @@
<IconPlus
class=
"handler-item viewport-size q-ml-md pointer"
@
click=
"AddSubtract('+',2)"
/>
</div>
</div>
<div
class=
"attr-items flex items-center grey-bg q-mt-lg"
>
<div
style=
"font-size: 11px;width:50px;"
>
加粗
</div>
<div
class=
"col flex"
>
<IconMinus
class=
"handler-item viewport-size q-mr-md pointer"
@
click=
"AddSubtract('-',3)"
/>
<Slider
class=
"filter-slider grow"
:max=
"800"
:min=
"400"
:step=
"200"
:value=
"attrs.fontWeight"
@
update:value=
"value =>
{updateLabFontSizeHandler(value as number),attrs.fontWeight=value}" />
<IconPlus
class=
"handler-item viewport-size q-ml-md pointer"
@
click=
"AddSubtract('+',3)"
/>
</div>
</div>
<div
class=
"attr-items flex items-center q-mt-md"
>
<div
style=
"font-size: 11px;width:50px;"
>
字体
</div>
<el-select
size=
"mini"
v-model=
"attrs.fontFamily"
filterable
@
change=
"val=>updateLabFontFamilyHandler(val as number)"
placeholder=
"请选择"
>
<el-option
v-for=
"item in formatFonts"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
<div
class=
"attr-items flex items-center q-mt-md"
>
<div
style=
"font-size: 11px;width:50px;"
>
对齐
</div>
<el-select
size=
"mini"
v-model=
"attrs.fontAlign"
@
change=
"val=>setAlignChangeHandler(val as number)"
placeholder=
"请选择"
>
...
...
@@ -106,12 +121,16 @@ import tinycolor from 'tinycolor2';
import
{
color
as
am4coreColor
,
Label
}
from
"@amcharts/amcharts4/core"
;
import
{
watch
}
from
'vue'
;
import
MapService
from
'@/services/MapService'
;
import
{
useFontStore
}
from
'@/store'
const
mapStore
=
useMapStore
()
const
{
current
,
fillColor
}
=
storeToRefs
(
mapStore
)
const
{
formatFonts
}
=
storeToRefs
(
useFontStore
())
const
attrs
=
reactive
({
arrow
:
-
1
,
textEnable
:
false
,
fontSize
:
12
,
fontWeight
:
400
,
fontFamily
:
''
,
fontAlign
:
0
,
fontText
:
''
,
fontColor
:
'#000'
,
...
...
@@ -151,6 +170,14 @@ const AddSubtract = (symbol: string,val: number) => {
}
value
=
attrs
.
fontSize
updateLabFontSizeHandler
(
value
as
number
)
}
if
(
val
==
3
){
if
(
symbol
==
'-'
&&
attrs
.
fontWeight
>
400
){
attrs
.
fontWeight
=
attrs
.
fontWeight
-
200
}
if
(
symbol
==
'+'
&&
attrs
.
fontWeight
<
800
){
attrs
.
fontWeight
=
attrs
.
fontWeight
+
200
}
value
=
attrs
.
fontWeight
updateLabFontWeightHandler
(
value
as
number
)
}
}
const
updateFilter
=
(
t
:
number
,
val
:
number
)
=>
{
...
...
@@ -213,6 +240,8 @@ const createLabel = ()=>{
//label.fontWeight = 'bold'
attrs
.
fontSize
=
13
attrs
.
fontWeight
=
400
attrs
.
fontFamily
=
'Microsoft Yahei'
attrs
.
fill
=
fillColor
.
value
.
realColor
attrs
.
text
=
'文字内容'
attrs
.
fontAlign
=
0
...
...
@@ -293,6 +322,24 @@ const updateLabFontSizeHandler = (val:number) =>{
},
500
);
}
}
const
updateLabFontWeightHandler
=
(
val
:
number
)
=>
{
let
lab
=
getCurrentLabel
()
if
(
lab
){
lab
.
fontWeight
=
val
setTimeout
(()
=>
{
asyncAllMarkHandler
()
},
500
);
}
}
const
updateLabFontFamilyHandler
=
(
val
:
number
)
=>
{
let
lab
=
getCurrentLabel
()
if
(
lab
){
lab
.
fontFamily
=
val
setTimeout
(()
=>
{
asyncAllMarkHandler
()
},
500
);
}
}
const
setLabelTextHandler
=
(
val
:
string
)
=>
{
let
lab
=
getCurrentLabel
()
if
(
lab
){
...
...
@@ -335,6 +382,8 @@ const setAttribute = ()=>{
attrs
.
textEnable
=
true
attrs
.
fontText
=
lab
.
text
attrs
.
fontSize
=
lab
.
fontSize
??
15
attrs
.
fontWeight
=
lab
.
fontWeight
??
400
attrs
.
fontFamily
=
lab
.
fontFamily
??
'Microsoft Yahei'
attrs
.
fontAlign
=
lab
.
marginBottom
attrs
.
fontColor
=
tinycolor
(
lab
.
fill
?.
hex
??
'#000000'
).
toHex8String
()
//attrs.fontSize =
...
...
@@ -357,4 +406,4 @@ setAttribute()
watch
(()
=>
current
.
value
,()
=>
{
setAttribute
()
})
</
script
>
</
script
>
\ No newline at end of file
src/components/Maps/MapAttributes/index.vue
View file @
35174d87
...
...
@@ -31,9 +31,10 @@ const { current } = storeToRefs(mapStore)
right
:
20px
;
left
:
unset
;
top
:
45px
;
bottom
:
200px
;
position
:
absolute
;
z-index
:
9
;
overflow
:
auto
;
}
.attr-box
.attr-header
{
...
...
src/views/Editor/Toolbar/ElementTemplateData.vue
View file @
35174d87
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment