基本完成
|
Before Width: | Height: | Size: 523 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 750 B |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 965 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
@ -15,6 +15,10 @@
|
||||
"autoBuildDoc": "node ./scripts/autoBuildDoc.js",
|
||||
"buildDoc": "node ./scripts/buildDoc.js",
|
||||
"electron:build": "vue-cli-service electron:build",
|
||||
"electron:build-all": "vue-cli-service electron:build -p never -mwl",
|
||||
"electron:build-mac": "vue-cli-service electron:build -p never -m",
|
||||
"electron:build-win": "vue-cli-service electron:build -p never -w",
|
||||
"electron:build-linux": "vue-cli-service electron:build -p never -l",
|
||||
"electron:serve": "vue-cli-service electron:serve",
|
||||
"buildLibrary": "vue-cli-service build --target lib --name simpleMindMap ../simple-mind-map/full.js --dest ../simple-mind-map/dist && esbuild ../simple-mind-map/full.js --bundle --external:buffer --format=esm --outfile=../simple-mind-map/dist/simpleMindMap.esm.js",
|
||||
"format": "prettier --write src/* src/*/* src/*/*/* src/*/*/*/*",
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2479351 */
|
||||
src: url('iconfont.woff2?t=1678265970945') format('woff2'),
|
||||
url('iconfont.woff?t=1678265970945') format('woff'),
|
||||
url('iconfont.ttf?t=1678265970945') format('truetype');
|
||||
src: url('iconfont.woff2?t=1679621707211') format('woff2'),
|
||||
url('iconfont.woff?t=1679621707211') format('woff'),
|
||||
url('iconfont.ttf?t=1679621707211') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
||||
BIN
web/src/assets/img/icon.png
Normal file
|
After Width: | Height: | Size: 276 KiB |
@ -35,7 +35,7 @@ async function createMainWindow() {
|
||||
await mainWindow.loadURL(
|
||||
process.env.WEBPACK_DEV_SERVER_URL + '/#/workbenche'
|
||||
)
|
||||
if (!process.env.IS_TEST) mainWindow.webContents.openDevTools()
|
||||
// if (!process.env.IS_TEST) mainWindow.webContents.openDevTools()
|
||||
} else {
|
||||
createProtocol('app')
|
||||
// 非开发环境时加载index.html
|
||||
|
||||
@ -50,7 +50,7 @@ export const bindFileHandleEvent = ({ mainWindow }) => {
|
||||
win.loadURL(
|
||||
process.env.WEBPACK_DEV_SERVER_URL + '/#/workbenche/edit/' + id
|
||||
)
|
||||
if (!process.env.IS_TEST) win.webContents.openDevTools()
|
||||
// if (!process.env.IS_TEST) win.webContents.openDevTools()
|
||||
} else {
|
||||
// Load the index.html when not in development
|
||||
win.loadURL('app://./index.html/#/workbenche/edit/' + id)
|
||||
|
||||
@ -9,6 +9,9 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'Workbenche',
|
||||
created () {
|
||||
document.title = '思绪思维导图'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
92
web/src/pages/Workbenche/components/AboutDialog.vue
Normal file
@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="aboutDialog"
|
||||
title="关于"
|
||||
:visible.sync="dialogVisible"
|
||||
width="480px"
|
||||
@close="onClose"
|
||||
>
|
||||
<div class="aboutBox">
|
||||
<img src="../../../assets/img/icon.png" alt="" />
|
||||
<h2>思绪思维导图</h2>
|
||||
<p>版本:{{ version }}</p>
|
||||
<p>
|
||||
获取源码:<a href="https://github.com/wanglin2/mind-map/tree/electron"
|
||||
>mind-map</a
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
下载最新版本:<a href="https://github.com/wanglin2/mind-map/releases"
|
||||
>releases</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pkg from '../../../../package.json'
|
||||
|
||||
export default {
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
version: pkg.version
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(val, oldVal) {
|
||||
this.dialogVisible = val
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClose() {
|
||||
this.$emit('change', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.aboutDialog {
|
||||
/deep/ .el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.aboutBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-bottom: 30px;
|
||||
|
||||
img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 10px;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -43,6 +43,7 @@ export default {
|
||||
watch: {
|
||||
fileName(val) {
|
||||
this.name = val
|
||||
document.title = val
|
||||
},
|
||||
name(val) {
|
||||
if (!val.trim()) return
|
||||
|
||||
@ -9,11 +9,20 @@
|
||||
<div class="workbencheHomeHeader">
|
||||
<MacControl></MacControl>
|
||||
<WinControl></WinControl>
|
||||
<div class="rightBar">
|
||||
<el-dropdown @command="handleCommand">
|
||||
<span class="settingBtn el-icon-setting"></span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="about">关于软件</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="workbencheHomeContent">
|
||||
<Sidebar></Sidebar>
|
||||
<FileList></FileList>
|
||||
</div>
|
||||
<AboutDialog v-model="showAboutDialog"></AboutDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -22,15 +31,32 @@ import WinControl from '../components/WinControl.vue'
|
||||
import MacControl from '../components/MacControl.vue'
|
||||
import Sidebar from '../components/Sidebar.vue'
|
||||
import FileList from '../components/FileList.vue'
|
||||
import AboutDialog from '../components/AboutDialog.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
WinControl,
|
||||
MacControl,
|
||||
Sidebar,
|
||||
FileList
|
||||
FileList,
|
||||
AboutDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showAboutDialog: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCommand(command) {
|
||||
switch (command) {
|
||||
case 'about':
|
||||
this.showAboutDialog = true
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
onDrop(e) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
@ -54,9 +80,11 @@ export default {
|
||||
window.electronAPI.openFile(dropFiles[0].path)
|
||||
} else if (dropFiles.length > 1) {
|
||||
// 否则添加到最近文件列表
|
||||
window.electronAPI.addRecentFileList(dropFiles.map((file) => {
|
||||
return file.path
|
||||
}))
|
||||
window.electronAPI.addRecentFileList(
|
||||
dropFiles.map(file => {
|
||||
return file.path
|
||||
})
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
@ -87,6 +115,7 @@ export default {
|
||||
flex-direction: column;
|
||||
|
||||
.workbencheHomeHeader {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background-color: #ebeef1;
|
||||
@ -94,6 +123,21 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.rightBar {
|
||||
-webkit-app-region: no-drag;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.settingBtn {
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.workbencheHomeContent {
|
||||
|
||||