Skip to content

Commit b3dc7b0

Browse files
committed
修复符号库显示问题;
1 parent 84cdf04 commit b3dc7b0

8 files changed

Lines changed: 66 additions & 46 deletions

File tree

‎src/components/TableList/styles.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default StyleSheet.create({
1717
flex: 1,
1818
// width: '100%',
1919
flexDirection: 'row',
20-
height: scaleSize(80),
20+
height: scaleSize(120),
2121
// justifyContent: 'space-around',
2222
alignItems: 'center',
2323
// backgroundColor:"blue"

‎src/constants/ConstInfo.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ export default {
2020
MODULE_ALREADY_OPENED: '该模板已经打开',
2121

2222
OUT_OF_MAP_BOUNDS: '不再地图范围内',
23+
24+
CHOOSE_EDIT_OBJ: '请选择编辑对象',
2325
}

‎src/containers/workspace/componets/FunctionToolbar/FunctionToolbar.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import * as React from 'react'
77
import { View, FlatList, Animated, Alert } from 'react-native'
88
import { MTBtn } from '../../../../components'
9-
import { ConstToolType, Const } from '../../../../constants'
10-
import { scaleSize } from '../../../../utils'
9+
import { ConstToolType, Const, ConstInfo } from '../../../../constants'
10+
import { scaleSize, Toast } from '../../../../utils'
1111
// import MoreToolbar from '../MoreToolbar'
1212
import styles from './styles'
1313
import Orientation from 'react-native-orientation'
@@ -346,6 +346,7 @@ export default class FunctionToolbar extends React.Component {
346346
height,
347347
tableType,
348348
})
349+
Toast.show(ConstInfo.CHOOSE_EDIT_OBJ)
349350
}
350351
}
351352

‎src/containers/workspace/componets/ToolBar/ThemeMenuData.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,4 @@ export default {
921921
getThemeThreeMenu,
922922
getThemeMapCreate,
923923
getThemeMapParam,
924-
createThemeUniqueMap,
925-
createThemeRangeMap,
926-
createUniformLabelMap,
927924
}

‎src/containers/workspace/componets/ToolBar/ToolBar.js‎

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ export default class ToolBar extends React.Component {
11391139
: table,
11401140
},
11411141
() => {
1142-
if (this.height < newHeight) {
1142+
if (this.height <= newHeight) {
11431143
this.height = newHeight
11441144
this.showToolbarAndBox(isShow, type)
11451145
!isShow && this.props.existFullMap && this.props.existFullMap()
@@ -1149,7 +1149,7 @@ export default class ToolBar extends React.Component {
11491149
)
11501150
}.bind(this)
11511151

1152-
if (this.height >= newHeight) {
1152+
if (this.height > newHeight && this.height > 0) {
11531153
this.height = newHeight
11541154
this.showToolbarAndBox(isShow, type)
11551155
!isShow && this.props.existFullMap && this.props.existFullMap()
@@ -1228,13 +1228,6 @@ export default class ToolBar extends React.Component {
12281228

12291229
close = (type = this.state.type) => {
12301230
GLOBAL.currentToolbarType = ''
1231-
// 关闭采集, type 为number时为采集类型,若有冲突再更改
1232-
if (
1233-
typeof type === 'number' ||
1234-
(typeof type === 'string' && type.indexOf('MAP_COLLECTION_') >= 0)
1235-
) {
1236-
SCollector.stopCollect()
1237-
}
12381231
if (type === ConstToolType.MAP_EDIT_TAGGING) {
12391232
SMap.setAction(Action.PAN)
12401233
} else if (
@@ -1267,6 +1260,13 @@ export default class ToolBar extends React.Component {
12671260
}
12681261
this.props.existFullMap && this.props.existFullMap()
12691262
}
1263+
// 关闭采集, type 为number时为采集类型,若有冲突再更改
1264+
if (
1265+
typeof type === 'number' ||
1266+
(typeof type === 'string' && type.indexOf('MAP_COLLECTION_') >= 0)
1267+
) {
1268+
SCollector.stopCollect()
1269+
}
12701270
}
12711271

12721272
clearCurrentLabel = () => {
@@ -1362,7 +1362,14 @@ export default class ToolBar extends React.Component {
13621362
// this.showToolbar(false)
13631363
if (typeof type === 'string' && type.indexOf('MAP_EDIT_') >= 0) {
13641364
SMap.submit()
1365-
SMap.setAction(Action.PAN)
1365+
if (
1366+
type !== ConstToolType.MAP_EDIT_DEFAULT &&
1367+
type !== ConstToolType.MAP_EDIT_TAGGING
1368+
) {
1369+
SMap.setAction(Action.SELECT)
1370+
} else {
1371+
SMap.setAction(Action.PAN)
1372+
}
13661373
}
13671374
// this.props.existFullMap && this.props.existFullMap()
13681375
}
@@ -1525,27 +1532,32 @@ export default class ToolBar extends React.Component {
15251532
this.state.type === ConstToolType.MAP_THEME_PARAM_CREATE_DATASETS
15261533
) {
15271534
//新建专题图数据集列表
1528-
(async function () {
1529-
let data = await SThemeCartography.getThemeExpressByDatasetName(item.title)
1535+
(async function() {
1536+
let data = await SThemeCartography.getThemeExpressByDatasetName(
1537+
item.title,
1538+
)
15301539
let dataset = data.dataset
1531-
let datalist = [{
1532-
title: dataset.datasetName,
1533-
data: data.list,
1534-
}]
1535-
this.setState({
1536-
themeDatasetName: item.title,
1537-
isFullScreen: false,
1538-
isTouchProgress: false,
1539-
isSelectlist: false,
1540-
containerType: 'list',
1541-
data: datalist,
1542-
buttons: [ToolbarBtnType.THEME_CANCEL],
1543-
type: ConstToolType.MAP_THEME_PARAM_CREATE_EXPRESSION,
1544-
},
1545-
() => {
1546-
this.height = ConstToolType.THEME_HEIGHT[6]
1547-
this.scrollListToLocation()
1548-
},
1540+
let datalist = [
1541+
{
1542+
title: dataset.datasetName,
1543+
data: data.list,
1544+
},
1545+
]
1546+
this.setState(
1547+
{
1548+
themeDatasetName: item.title,
1549+
isFullScreen: false,
1550+
isTouchProgress: false,
1551+
isSelectlist: false,
1552+
containerType: 'list',
1553+
data: datalist,
1554+
buttons: [ToolbarBtnType.THEME_CANCEL],
1555+
type: ConstToolType.MAP_THEME_PARAM_CREATE_EXPRESSION,
1556+
},
1557+
() => {
1558+
this.height = ConstToolType.THEME_HEIGHT[6]
1559+
this.scrollListToLocation()
1560+
},
15491561
)
15501562
}.bind(this)())
15511563
} else if (

‎src/containers/workspace/componets/ToolBar/styles.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { scaleSize, screen } from '../../../../utils'
33
import { color, zIndexLevel, size } from '../../../../styles'
44
import { ConstToolType } from '../../../../constants'
55
// 地图按钮栏默认高度
6-
const BUTTON_HEIGHT = scaleSize(80)
6+
export const BUTTON_HEIGHT = scaleSize(80)
77

88
export default StyleSheet.create({
99
fullContainer: {
@@ -36,6 +36,12 @@ export default StyleSheet.create({
3636
backgroundColor: color.theme,
3737
// zIndex: zIndexLevel.FOUR,
3838
},
39+
// box: {
40+
// position: 'absolute',
41+
// left: 0,
42+
// right: 0,
43+
// bottom: BUTTON_HEIGHT,
44+
// },
3945
buttonz: {
4046
flexDirection: 'row',
4147
height: BUTTON_HEIGHT,

‎src/models/map.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ export const exportWorkspace = (params, cb = () => {}) => async (
250250
Toast.show('请稍后再试')
251251
return false
252252
}
253+
isExporting = true
253254
let userName = getState().user.toJS().currentUser.userName || 'Customer'
254255
let workspace = getState().map.toJS().workspace
255256
let path = params.outPath,
@@ -283,7 +284,7 @@ export const exportWorkspace = (params, cb = () => {}) => async (
283284
}
284285
// 删除导出的工作空间
285286
await FileTools.deleteFile(parentPath)
286-
isExporting = true
287+
isExporting = false
287288
cb && cb(result, zipPath)
288289
}
289290

‎src/models/symbol.js‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,16 @@ export default handleActions(
6060
[`${SET_CURRENT_SYMBOL}`]: (state, { payload }) => {
6161
let newData = state.toJS().latestSymbols || []
6262
let maxLength = state.toJS().maxLength || initialState.toJS().maxLength
63-
let index = newData.indexOf(payload.id)
64-
index > -1 && newData.splice(index, 1)
65-
newData.unshift(payload.id)
66-
if (newData.length >= maxLength) {
67-
newData = newData.slice(0, maxLength)
63+
if (payload.id) {
64+
let index = newData.indexOf(payload.id)
65+
index > -1 && newData.splice(index, 1)
66+
newData.unshift(payload.id)
67+
if (newData.length >= maxLength) {
68+
newData = newData.slice(0, maxLength)
69+
}
70+
state.setIn(['latestSymbols'], fromJS(newData))
6871
}
69-
return state
70-
.setIn(['currentSymbol'], fromJS(payload))
71-
.setIn(['latestSymbols'], fromJS(newData))
72+
return state.setIn(['currentSymbol'], fromJS(payload))
7273
},
7374
[REHYDRATE]: state => {
7475
// return payload && payload.nav ? fromJS(payload.nav) : state

0 commit comments

Comments
 (0)