9292 </Content >
9393 <Layout >
9494 <Content
95- :style =" !isQtWebView() ? { height: '100%', background: '#fff', borderLeft: '1px solid #ccc' } : { height: '100%', background: '#fff' }" >
95+ :style =" !isQtWebView() ? { height: '100%', minWidth: '800px', background: '#fff', borderLeft: '1px solid #ccc' } : { height: '100%', background: '#fff' }" >
9696 <Spin size =" large" fix v-if =" keyLoading && isQtWebView()" >
9797 <span style =" color : firebrick ; font-size : 16px ;" >正在读取: {{ currentLoadingKey }}</span >
9898 </Spin >
134134 </div >
135135 <div v-else style =" margin-top : 4px ; height : 100% " >
136136 <Row type =" flex" >
137- <Col span =" 16 " >
137+ <Col span =" 18 " >
138138 <Table :highlightRow =" true" @on-row-click =" getRowData" ref =" currentRowTable"
139- border height =" 370 " :columns =" getColumns(data.type)"
140- :data =" formatItem(data.type, data.data)" />
139+ border height =" 470 " :columns =" getColumns(data.type)"
140+ :data =" formatItem(data.type, data.data, data.current, data.size )" />
141141 </Col >
142- <Col span =" 8 " >
143- <Card style =" height :370 px ;border-left : none ;" dis-hover >
142+ <Col span =" 6 " >
143+ <Card style =" height :470 px ;border-left : none ;" dis-hover >
144144 <p slot =" title" >
145145 操作
146146 </p >
147- <ButtonGroup style =" width : 100% ;" >
148- <Button style =" width : 33% " >
149- <Icon type =" chevron-left" ></Icon >
150- 上一页
151- </Button >
152- <Button style =" float :right ;width : 33% " >
153- 下一页
154- <Icon type =" chevron-right" ></Icon >
155- </Button >
156- </ButtonGroup >
147+ <div style =" text-align : center ;" >
148+ <Alert v-if =" data.count > data.size" type =" warning" >共有{{ data.count
149+ }}条,本次仅返回{{ data.size }}条</Alert >
150+ <Page :current =" data.current" :page-size =" data.size" :total =" data.count"
151+ :transfer =" true" @on-change =" (page) => changePage(page, data)"
152+ simple >
153+ </Page >
154+ </div >
157155 <br />
158156 <br />
159157 <Button long @click =" addRow(key, data)" >插入行</Button >
@@ -590,6 +588,9 @@ export default {
590588 }
591589 },
592590 methods: {
591+ changePage (page , data ) {
592+ data .current = page
593+ },
593594 showMoveKeyModal (key ) {
594595 this .moveKey .modal = true
595596 this .moveKey .key = key
@@ -943,7 +944,6 @@ export default {
943944 rowIndex = this .currentSelectRowData .index
944945 newRowKey = this .currentSelectRowData .key
945946 newRowValue = this .currentSelectRowData .value
946- // console.log('this.currentSelectRowData', this.currentSelectRowData)
947947 if (! newRowValue) {
948948 this .$Message .error (' 请设置要操作Key / Value' )
949949 return
@@ -1072,7 +1072,6 @@ export default {
10721072 let node = nodes[0 ]
10731073
10741074 const childs = this .$refs [node .title ].at (0 ).$el .parentElement .childNodes
1075- console .log (childs)
10761075 for (let i in childs) {
10771076 try {
10781077 childs[i].style .backgroundColor = ' #fff'
@@ -1127,7 +1126,10 @@ export default {
11271126 this .currentKey = key
11281127 this .currentSelectRowData = {}
11291128 },
1130- formatItem (type , data ) {
1129+ formatItem (type , data , page ) {
1130+ if (! page) page = 1
1131+ const size = 50
1132+ const offset = (page - 1 ) * size
11311133 let res = []
11321134 const strlen = 80
11331135 switch (type) {
@@ -1176,7 +1178,7 @@ export default {
11761178 }
11771179 }
11781180 }
1179- return res .slice (0 , 200 )
1181+ return res .slice (offset, offset + size )
11801182 },
11811183 getColumns (type ) {
11821184 let cols = []
@@ -1194,7 +1196,7 @@ export default {
11941196 key: ' key'
11951197 },
11961198 {
1197- title: ' 值 (性能考虑,默认显示200条,请使用查询) ' ,
1199+ title: ' 值' ,
11981200 key: ' value'
11991201 }
12001202 ]
@@ -1225,7 +1227,7 @@ export default {
12251227 align: ' center'
12261228 },
12271229 {
1228- title: ' 值 (性能考虑,默认显示200条,请使用查询) ' ,
1230+ title: ' 值' ,
12291231 width: 400 ,
12301232 key: ' value'
12311233 },
@@ -1245,7 +1247,7 @@ export default {
12451247 align: ' center'
12461248 },
12471249 {
1248- title: ' 值 (性能考虑,默认显示200条,请使用查询) ' ,
1250+ title: ' 值' ,
12491251 key: ' value'
12501252 }
12511253 ]
0 commit comments