| | |
| | | <template> |
| | | <div id="app" @contextmenu.prevent=""> |
| | | <div id="app" @contextmenu.prevent> |
| | | <tools></tools> |
| | | <desktop></desktop> |
| | | <tools-entry ref="dock_model"></tools-entry> |
| | |
| | | import ToolsEntry from './components/ToolsEntry'; |
| | | import axios from 'axios' |
| | | |
| | | import { getApps } from '@/api/app' |
| | | |
| | | export default { |
| | | name: 'app', |
| | | components: { |
| | |
| | | |
| | | mounted() { |
| | | document.getElementById('app').style.backgroundImage = process.env.VUE_APP_MAIN_URL; |
| | | let _that = this; |
| | | let user_res = require("./mock/userData.json") |
| | | if (user_res.success) { |
| | | user_res.data.docks.forEach(function (item) { |
| | | _that.$store.commit('desktop/addDock', item); |
| | | }); |
| | | } |
| | | this.showApps(); |
| | | |
| | | let _that = this; |
| | | let msgResp = require("./mock/messages.json") |
| | | if (msgResp.success) { |
| | | msgResp.data.forEach(function (item) { |
| | |
| | | }, 1000); |
| | | }, |
| | | methods: { |
| | | showApps() { |
| | | let _that = this; |
| | | |
| | | getApps().then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | rsp.data.forEach(function (item) { |
| | | _that.$store.commit('desktop/addDock', item); |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | addMessage: function (message, ding) { |
| | | this.$store.dispatch('desktop/addMessage', message); |
| | | // if (ding) { |