|
|
@@ -30,10 +30,10 @@ class OftenFuncManage extends Component {
|
|
|
document.title = '常用管理'
|
|
|
|
|
|
const { docState } = this.props
|
|
|
- console.log(docState)
|
|
|
if (!isObjEmpty(docState, docState.docFuncGroupList)) {
|
|
|
this.setState({
|
|
|
- docFuncGroupStateList: docState.docFuncGroupList,
|
|
|
+ docFuncGroupStateList: JSON.parse(
|
|
|
+ JSON.stringify(docState.docFuncGroupList)),
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -95,14 +95,12 @@ class OftenFuncManage extends Component {
|
|
|
|
|
|
onOperationClick = (funcObj) => {
|
|
|
let { docFuncGroupStateList } = this.state
|
|
|
- if (!isObjNull(docFuncGroupStateList[funcObj.groupIndex])
|
|
|
- && !isObjNull(
|
|
|
- docFuncGroupStateList[funcObj.groupIndex].funcList[funcObj.childIndex])) {
|
|
|
- if (!docFuncGroupStateList[funcObj.groupIndex].funcList[funcObj.childIndex].often &&
|
|
|
- this.oftenSize >= 12) {
|
|
|
+
|
|
|
+ if (!isObjNull(funcObj)) {
|
|
|
+ if (!funcObj.often && this.oftenSize >= 12) {
|
|
|
Toast.fail('最多添加 12 个常用应用')
|
|
|
} else {
|
|
|
- docFuncGroupStateList[funcObj.groupIndex].funcList[funcObj.childIndex].often = !docFuncGroupStateList[funcObj.groupIndex].funcList[funcObj.childIndex].often
|
|
|
+ funcObj.often = !funcObj.often
|
|
|
this.setState({ docFuncGroupStateList })
|
|
|
}
|
|
|
}
|