12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /*
- * app基本信息
- *
- */
- const state = {
- user: {},
- organization: {},
- project: {},
- codeNumber: 60,
- identity: {},
- coordinates: '116.38,39.9',
- activeCity: {
- cityName: '北京市',
- cityCode: '110100'
- }
- }
- const mutations = {
- CHANGE_USER: (state, user) => {
- state.user = user;
- },
- CHANGE_ORGANIZATION: (state, organization) => {
- state.organization = organization;
- },
- CHANGE_PROJECT: (state, project) => {
- state.project = project;
- },
- CHANGE_CODENUMBER: (state, num) => {
- state.codeNumber = num;
- },
- CHANGE_IDENTITY: (state, identity) => {
- state.identity = identity;
- },
- CHANGE_COORDINATES: (state, coordinates) => {
- state.coordinates = coordinates;
- },
- CHANGE_ACTIVECITY: (state, activeCity) => {
- state.activeCity = activeCity;
- },
- }
- const actions = {
- changeUser({
- commit
- }, user) {
- commit('CHANGE_USER', user);
- },
- changeOrganization({
- commit
- }, organization) {
- commit('CHANGE_ORGANIZATION', organization);
- },
- changeProject({
- commit,
- }, project) {
- commit('CHANGE_PROJECT', project);
- },
- changeCodeNumber({
- commit,
- }, num) {
- commit('CHANGE_CODENUMBER', num < 0 ? 60 : num);
- },
- changeIdentity({
- commit,
- }, identity) {
- commit('CHANGE_IDENTITY', identity);
- },
- changeCoordinates({
- commit,
- }, coordinates) {
- commit('CHANGE_COORDINATES', coordinates);
- },
- changeActiveCity({
- commit,
- }, activeCity) {
- commit('CHANGE_ACTIVECITY', activeCity);
- },
- }
- export default {
- namespaced: true,
- state,
- mutations,
- actions
- }
|