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 4545 < sm-web-map server-url ="https://iportal.supermap.io/iportal " map-id ="801571284 " @load ="mapLoad ">
4646 </ sm-web-map >
4747 < 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 ">
4949 </ sm-attribute-panel >
5050 </ div >
5151 </ div >
6565 computed : {
6666 panelTitle ( ) {
6767 return this . title || resources . text_attributePanel
68- } ,
69- tableColumns ( ) {
70- return [ {
71- dataIndex : 'attribute'
72- } ,
73- {
74- dataIndex : 'attributeValue'
75- }
76- ] ;
7768 }
7869 } ,
7970 methods : {
9182 vm . title = matchFature . layer . id ;
9283 vm . attrbiutes = Object . keys ( matchFature . properties ) . map ( function ( prop ) {
9384 return {
94- attribute : prop ,
95- attributeValue : matchFature . properties [ prop ]
85+ title : prop ,
86+ value : matchFature . properties [ prop ]
9687 }
9788 } ) ;
89+ vm . attrbiutes = vm . attrbiutes . slice ( 4 ) ;
9890 vm . addHighlightLayer ( matchFature ) ;
9991 } else {
10092 vm . attrbiutes = [ ] ;
133125 if ( this . map . getLayer ( 'highlight' ) ) {
134126 this . map . removeLayer ( 'highlight' ) ;
135127 }
128+ } ,
129+ customValueRender ( text , record , index ) {
130+ if ( index === 3 ) {
131+ return '第 ' + record . value + ' 名' ;
132+ }
133+ return record . value ;
136134 }
137135 }
138136 } ) ;
You can’t perform that action at this time.
0 commit comments