├── dist
├── web
│ └── .gitkeep
└── electron
│ └── .gitkeep
├── static
├── .gitkeep
├── imgs
│ ├── ZIP.png
│ ├── Folder.png
│ └── logo@2x.png
└── mock
│ └── fileList.json
├── src
├── renderer
│ ├── assets
│ │ ├── .gitkeep
│ │ └── logo.png
│ ├── components
│ │ ├── panContent
│ │ │ ├── panContent.scss
│ │ │ └── panContent.vue
│ │ ├── mainPage
│ │ │ ├── mainPage.scss
│ │ │ └── mainPage.vue
│ │ ├── uploading
│ │ │ └── uploading.vue
│ │ ├── downloaded
│ │ │ └── downloaded.vue
│ │ ├── mainContent
│ │ │ ├── mainContentController.ts
│ │ │ └── mainContent.vue
│ │ ├── panHeader
│ │ │ ├── panHeader.vue
│ │ │ └── panHeader.scss
│ │ ├── LandingPage
│ │ │ └── SystemInformation.vue
│ │ ├── LandingPage.vue
│ │ ├── floatingWindow
│ │ │ └── floatingWindow.vue
│ │ ├── downloadDemo
│ │ │ └── downloadDemo.vue
│ │ ├── v-bigIconList
│ │ │ └── v-bigIconList.vue
│ │ ├── downloading
│ │ │ └── downloading.vue
│ │ └── sideBar
│ │ │ └── sideBar.vue
│ ├── store
│ │ ├── index.ts
│ │ └── modules
│ │ │ ├── index.ts
│ │ │ └── Counter.ts
│ ├── App.vue
│ ├── main.ts
│ ├── router
│ │ └── index.ts
│ └── basic
│ │ ├── v-table
│ │ └── v-table.vue
│ │ └── v-contextMenu
│ │ └── v-contextMenu.vue
├── vue-shim.d.ts
├── index.ejs
├── main
│ ├── index.dev.ts
│ └── index.ts
├── controller
│ ├── database.ts
│ └── downLoad.ts
└── db
│ └── datafile
├── .eslintignore
├── assets
├── pan.gif
├── pan.demo2.gif
└── pan.demo3.gif
├── tslint.json
├── .gitignore
├── test
├── .eslintrc
└── unit
│ ├── specs
│ └── LandingPage.spec.js
│ ├── index.js
│ └── karma.conf.js
├── README.md
├── tsconfig.json
├── appveyor.yml
├── .babelrc
├── .eslintrc.js
├── .electron-vue
├── dev-client.js
├── webpack.main.config.js
├── build.js
├── webpack.web.config.js
├── dev-runner.js
└── webpack.renderer.config.js
├── .travis.yml
└── package.json
/dist/web/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dist/electron/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/renderer/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | test/unit/coverage/**
2 | test/unit/*.js
3 | test/e2e/*.js
4 |
--------------------------------------------------------------------------------
/assets/pan.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhangyy62/electron-vue-pan/HEAD/assets/pan.gif
--------------------------------------------------------------------------------
/assets/pan.demo2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhangyy62/electron-vue-pan/HEAD/assets/pan.demo2.gif
--------------------------------------------------------------------------------
/assets/pan.demo3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhangyy62/electron-vue-pan/HEAD/assets/pan.demo3.gif
--------------------------------------------------------------------------------
/static/imgs/ZIP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhangyy62/electron-vue-pan/HEAD/static/imgs/ZIP.png
--------------------------------------------------------------------------------
/src/vue-shim.d.ts:
--------------------------------------------------------------------------------
1 | declare module "*.vue" {
2 | import Vue from "vue";
3 | export default Vue;
4 | }
--------------------------------------------------------------------------------
/static/imgs/Folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhangyy62/electron-vue-pan/HEAD/static/imgs/Folder.png
--------------------------------------------------------------------------------
/static/imgs/logo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhangyy62/electron-vue-pan/HEAD/static/imgs/logo@2x.png
--------------------------------------------------------------------------------
/src/renderer/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhangyy62/electron-vue-pan/HEAD/src/renderer/assets/logo.png
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "tslint-config-standard",
3 | "globals": {
4 | "require": true
5 | }
6 | }
--------------------------------------------------------------------------------
/src/renderer/components/panContent/panContent.scss:
--------------------------------------------------------------------------------
1 | .panContent {
2 | display: flex;
3 | width: 100%;
4 | height: 100%;
5 | }
--------------------------------------------------------------------------------
/src/renderer/components/mainPage/mainPage.scss:
--------------------------------------------------------------------------------
1 | .mainPage {
2 | height: 100%;
3 | width: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | dist/electron/*
3 | dist/web/*
4 | build/*
5 | !build/icons
6 | coverage
7 | node_modules/
8 | npm-debug.log
9 | npm-debug.log.*
10 | thumbs.db
11 | !.gitkeep
12 |
--------------------------------------------------------------------------------
/test/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "mocha": true
4 | },
5 | "globals": {
6 | "assert": true,
7 | "expect": true,
8 | "should": true,
9 | "__static": true
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/renderer/components/uploading/uploading.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 上传
4 |
5 |
6 |
7 |
12 |
13 |
16 |
--------------------------------------------------------------------------------
/src/renderer/components/downloaded/downloaded.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 传输完成
4 |
5 |
6 |
7 |
12 |
13 |
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # electron版百度网盘
2 |
3 | ## 项目介绍
4 | 用electron + vue2.x开发简易百度网盘PC版,实现简易界面和交互。
5 |
6 | ## 项目安装
7 |
8 | ``` bash
9 | # 安装依赖
10 | npm install / cnpm install
11 |
12 | # 启动调试
13 | npm run dev
14 |
15 | # 打包
16 | npm run build
17 | ```
18 | ## 预览
19 |
20 | #### 主界面1
21 | 
22 |
23 | #### 主界面2
24 | 
25 |
26 | #### 浮动窗口
27 | 
28 |
29 | ## TODO
30 | - [ ] 尝试玩玩webassembly, 2019.11
31 |
--------------------------------------------------------------------------------
/src/renderer/store/index.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 |
4 | import { createPersistedState, createSharedMutations } from 'vuex-electron';
5 |
6 | import modules from './modules';
7 |
8 | Vue.use(Vuex)
9 | declare var process: any;
10 |
11 | export default new Vuex.Store({
12 | modules,
13 | plugins: [
14 | createPersistedState(),
15 | createSharedMutations()
16 | ],
17 | strict: process.env.NODE_ENV !== 'production'
18 | });
19 |
--------------------------------------------------------------------------------
/src/renderer/store/modules/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * The file enables `@/store/index.js` to import all vuex modules
3 | * in a one-shot manner. There should not be any reason to edit this file.
4 | */
5 | declare var require: any
6 | const files = require.context('.', false, /\.ts$/)
7 | const modules = {}
8 |
9 | files.keys().forEach(key => {
10 | if (key === './index.ts') return
11 | modules[key.replace(/(\.\/|\.ts)/g, '')] = files(key).default
12 | })
13 |
14 | export default modules
15 |
--------------------------------------------------------------------------------
/test/unit/specs/LandingPage.spec.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import LandingPage from '@/components/LandingPage';
3 |
4 | describe('LandingPage.vue', () => {
5 | it('should render correct contents', () => {
6 | const vm = new Vue({
7 | el: document.createElement('div'),
8 | render: h => h(LandingPage)
9 | }).$mount();
10 |
11 | expect(vm.$el.querySelector('.title').textContent).to.contain('Welcome to your new project!');
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/src/renderer/store/modules/Counter.ts:
--------------------------------------------------------------------------------
1 | const state = {
2 | main: 0
3 | };
4 |
5 | const mutations = {
6 | DECREMENT_MAIN_COUNTER (state: any) {
7 | state.main--
8 | },
9 | INCREMENT_MAIN_COUNTER (state: any) {
10 | state.main++
11 | }
12 | }
13 |
14 | const actions = {
15 | someAsyncTask ({ commit }: any) {
16 | // do something async
17 | console.log(12321312312)
18 | commit('INCREMENT_MAIN_COUNTER')
19 | }
20 | }
21 |
22 | export default {
23 | state,
24 | mutations,
25 | actions
26 | };
27 |
--------------------------------------------------------------------------------
/test/unit/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | Vue.config.devtools = false
3 | Vue.config.productionTip = false
4 |
5 | // require all test files (files that ends with .spec.js)
6 | const testsContext = require.context('./specs', true, /\.spec$/)
7 | testsContext.keys().forEach(testsContext)
8 |
9 | // require all src files except main.js for coverage.
10 | // you can also change this to match only the subset of files that
11 | // you want coverage for.
12 | const srcContext = require.context('../../src/renderer', true, /^\.\/(?!main(\.js)?$)/)
13 | srcContext.keys().forEach(srcContext)
14 |
--------------------------------------------------------------------------------
/src/renderer/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
14 |
15 |
34 |
--------------------------------------------------------------------------------
/src/renderer/components/panContent/panContent.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
21 |
22 |
25 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "exclude": [
3 | "node_modules"
4 | ],
5 | "compilerOptions": {
6 | "allowSyntheticDefaultImports": true,
7 | "experimentalDecorators": true,
8 | "module": "es6",
9 | "target": "es6",
10 | "moduleResolution": "node",
11 | "isolatedModules": true,
12 | "typeRoots": [
13 | "./types",
14 | "./node_modules/vue/types"
15 | ],
16 | "lib": [
17 | "dom",
18 | "es5",
19 | "es2015.promise",
20 | "es6"
21 | ],
22 | "sourceMap": true,
23 | "pretty": true
24 | }
25 | }
--------------------------------------------------------------------------------
/src/renderer/main.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import axios from 'axios'
3 | import App from './App.vue'
4 | import router from './router/index'
5 | import store from './store/index'
6 | import electron from 'vue-electron';
7 | import vContextMenu from '@/basic/v-contextMenu/v-contextMenu.vue';
8 |
9 | declare var process: any;
10 |
11 | if (!process.env.IS_WEB) Vue.use(electron)
12 | Vue.prototype.$http = axios
13 |
14 | Vue.config.productionTip = false
15 |
16 | /* eslint-disable no-new */
17 | new Vue({
18 | components: { App, vContextMenu },
19 | router,
20 | store,
21 | template: ''
22 | }).$mount('#app')
23 |
--------------------------------------------------------------------------------
/src/renderer/components/mainPage/mainPage.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
26 |
27 |
30 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | # Commented sections below can be used to run tests on the CI server
2 | # https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing
3 | version: 0.1.{build}
4 |
5 | branches:
6 | only:
7 | - master
8 |
9 | image: Visual Studio 2017
10 | platform:
11 | - x64
12 |
13 | cache:
14 | - node_modules
15 | - '%APPDATA%\npm-cache'
16 | - '%USERPROFILE%\.electron'
17 | - '%USERPROFILE%\AppData\Local\Yarn\cache'
18 |
19 | init:
20 | - git config --global core.autocrlf input
21 |
22 | install:
23 | - ps: Install-Product node 8 x64
24 | - git reset --hard HEAD
25 | - yarn
26 | - node --version
27 |
28 | build_script:
29 | #- yarn test
30 | - yarn build
31 |
32 | test: off
33 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "comments": false,
3 | "env": {
4 | "test": {
5 | "presets": [
6 | ["env", {
7 | "targets": { "node": 7 }
8 | }],
9 | "stage-0"
10 | ],
11 | "plugins": ["istanbul"]
12 | },
13 | "main": {
14 | "presets": [
15 | ["env", {
16 | "targets": { "node": 7 }
17 | }],
18 | "stage-0"
19 | ]
20 | },
21 | "renderer": {
22 | "presets": [
23 | ["env", {
24 | "modules": false
25 | }],
26 | "stage-0"
27 | ]
28 | },
29 | "web": {
30 | "presets": [
31 | ["env", {
32 | "modules": false
33 | }],
34 | "stage-0"
35 | ]
36 | }
37 | },
38 | "plugins": ["transform-runtime"]
39 | }
40 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: 'babel-eslint',
4 | parserOptions: {
5 | sourceType: 'module'
6 | },
7 | env: {
8 | browser: true,
9 | node: true
10 | },
11 | extends: 'airbnb',
12 | globals: {
13 | __static: true
14 | },
15 | plugins: [
16 | 'html'
17 | ],
18 | 'rules': {
19 | // allow paren-less arrow functions
20 | 'arrow-parens': 0,
21 | // allow async-await
22 | 'generator-star-spacing': 0,
23 | // allow debugger during development
24 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
25 | 'indent': [2, 4],
26 | 'comma-dangle': [2, 'never'],
27 | 'no-plusplus': ["error", { 'allowForLoopAfterthoughts': true }],
28 | 'import/no-unresolved': 0,
29 | 'import/extensions': 'off'
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | pan
6 | <% if (htmlWebpackPlugin.options.nodeModules) { %>
7 |
8 |
11 | <% } %>
12 |
13 |
14 |
15 |
16 | <% if (!process.browser) { %>
17 |
20 | <% } %>
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/main/index.dev.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is used specifically and only for development. It installs
3 | * `electron-debug` & `vue-devtools`. There shouldn't be any need to
4 | * modify this file, but it can be used to extend your development
5 | * environment.
6 | */
7 |
8 | /* eslint-disable */
9 | /* tslint:disable */
10 |
11 | // Install `electron-debug` with `devtron`
12 | require('electron-debug')({ showDevTools: true })
13 |
14 | // Install `vue-devtools`
15 | require('electron').app.on('ready', () => {
16 | let installExtension = require('electron-devtools-installer')
17 | installExtension.default(installExtension.VUEJS_DEVTOOLS)
18 | .then(() => {})
19 | .catch(err => {
20 | console.log('Unable to install `vue-devtools`: \n', err)
21 | })
22 | })
23 |
24 | import '../renderer/store/index.ts';
25 |
26 | // Require `main` process to boot app
27 | // require('./index')
28 | import './index.ts'
--------------------------------------------------------------------------------
/src/renderer/components/mainContent/mainContentController.ts:
--------------------------------------------------------------------------------
1 | class MainContentController {
2 |
3 | computeRows(datas: Array