File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change 45
45
< sm-web-map server-url ="https://iportal.supermap.io/iportal " map-id ="801571284 " @load ="mapLoad ">
46
46
</ sm-web-map >
47
47
< div class ="panel-wrapper ">
48
- < sm-attribute-panel :attributes ="attrbiutes " :columns =" tableColumns " :title ="panelTitle ">
48
+ < sm-attribute-panel :attributes ="attrbiutes " :value-render =" customValueRender " :title ="panelTitle ">
49
49
</ sm-attribute-panel >
50
50
</ div >
51
51
</ div >
65
65
computed : {
66
66
panelTitle ( ) {
67
67
return this . title || resources . text_attributePanel
68
- } ,
69
- tableColumns ( ) {
70
- return [ {
71
- dataIndex : 'attribute'
72
- } ,
73
- {
74
- dataIndex : 'attributeValue'
75
- }
76
- ] ;
77
68
}
78
69
} ,
79
70
methods : {
91
82
vm . title = matchFature . layer . id ;
92
83
vm . attrbiutes = Object . keys ( matchFature . properties ) . map ( function ( prop ) {
93
84
return {
94
- attribute : prop ,
95
- attributeValue : matchFature . properties [ prop ]
85
+ title : prop ,
86
+ value : matchFature . properties [ prop ]
96
87
}
97
88
} ) ;
89
+ vm . attrbiutes = vm . attrbiutes . slice ( 4 ) ;
98
90
vm . addHighlightLayer ( matchFature ) ;
99
91
} else {
100
92
vm . attrbiutes = [ ] ;
133
125
if ( this . map . getLayer ( 'highlight' ) ) {
134
126
this . map . removeLayer ( 'highlight' ) ;
135
127
}
128
+ } ,
129
+ customValueRender ( text , record , index ) {
130
+ if ( index === 3 ) {
131
+ return '第 ' + record . value + ' 名' ;
132
+ }
133
+ return record . value ;
136
134
}
137
135
}
138
136
} ) ;
You can’t perform that action at this time.
0 commit comments