|
@@ -1,4 +1,12 @@
|
|
|
-import {deptTreeSelect, handsheDeptTreeSelect, getDict,hangsheAndOrgTree, userAndOrgTree,wholeTreeSelect } from '@/api/public'
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ deptTreeSelect,
|
|
|
|
|
+ handsheDeptTreeSelect,
|
|
|
|
|
+ getDict,
|
|
|
|
|
+ hangsheAndOrgTree,
|
|
|
|
|
+ userAndOrgTree,
|
|
|
|
|
+ wholeTreeSelect,
|
|
|
|
|
+ getDot
|
|
|
|
|
+} from '@/api/public'
|
|
|
export default {
|
|
export default {
|
|
|
state: {
|
|
state: {
|
|
|
//用户名
|
|
//用户名
|
|
@@ -20,19 +28,22 @@ export default {
|
|
|
//完整树
|
|
//完整树
|
|
|
wholeTree:[],
|
|
wholeTree:[],
|
|
|
//字典
|
|
//字典
|
|
|
- dictionary: []
|
|
|
|
|
|
|
+ dictionary: [],
|
|
|
|
|
+ //未读消息数
|
|
|
|
|
+ dotNum:0
|
|
|
},
|
|
},
|
|
|
mutations : {
|
|
mutations : {
|
|
|
|
|
+ SET_DOT_NUM(state, num) {
|
|
|
|
|
+ state.dotNum = num;
|
|
|
|
|
+ },
|
|
|
SET_USER_NAME(state, name) {
|
|
SET_USER_NAME(state, name) {
|
|
|
state.userName = name;
|
|
state.userName = name;
|
|
|
},
|
|
},
|
|
|
SET_ORGTREE: (state, val) => {
|
|
SET_ORGTREE: (state, val) => {
|
|
|
state.orgTree = val
|
|
state.orgTree = val
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
SET_ORGTREE_HANGSHE: (state, val) => {
|
|
SET_ORGTREE_HANGSHE: (state, val) => {
|
|
|
state.orgTreeHangshe = val
|
|
state.orgTreeHangshe = val
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
SET_DEPTREE: (state, val) => {
|
|
SET_DEPTREE: (state, val) => {
|
|
|
state.depTree = val
|
|
state.depTree = val
|
|
@@ -44,11 +55,16 @@ export default {
|
|
|
state.commonTree = val
|
|
state.commonTree = val
|
|
|
},
|
|
},
|
|
|
SET_DICT_ITEM(state, dictItem) {
|
|
SET_DICT_ITEM(state, dictItem) {
|
|
|
- console.log(dictItem,'dictItem' )
|
|
|
|
|
state.dictionary.push(dictItem);
|
|
state.dictionary.push(dictItem);
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
actions : {
|
|
actions : {
|
|
|
|
|
+ //获取未读消息数
|
|
|
|
|
+ redDot({commit, state}){
|
|
|
|
|
+ getDot().then(res=>{
|
|
|
|
|
+ commit('SET_DOT_NUM', res.data)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
//设置字典
|
|
//设置字典
|
|
|
setDict({commit, state}, key) {
|
|
setDict({commit, state}, key) {
|
|
|
console.log('字典已存在:',state.dictionary.some(item => item.key === key));
|
|
console.log('字典已存在:',state.dictionary.some(item => item.key === key));
|