no message
This commit is contained in:
parent
0cda0a7427
commit
6ee6440f04
1
electron/.gitignore
vendored
1
electron/.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
public
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
@ -10,19 +10,13 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
<title>Dootask</title>
|
<title>Dootask</title>
|
||||||
<link rel="stylesheet" type="text/css" href="./public/css/app.css">
|
<link rel="stylesheet" type="text/css" href="./css/app.css">
|
||||||
<link rel="stylesheet" type="text/css" href="./public/css/iview.css">
|
<link rel="stylesheet" type="text/css" href="./css/iview.css">
|
||||||
<script src="./public/js/jquery.min.js"></script>
|
<script src="./js/jquery.min.js"></script>
|
||||||
<script src="./public/js/bootstrap.min.js"></script>
|
<script src="./js/bootstrap.min.js"></script>
|
||||||
<script src="./public/js/language.all.js"></script>
|
<script src="./js/language.all.js"></script>
|
||||||
<script src="./public/js/scroll-into-view.min.js"></script>
|
<script src="./js/scroll-into-view.min.js"></script>
|
||||||
<script>
|
<script src="./config.js"></script>
|
||||||
window.systemInformation = {
|
|
||||||
version: "0.2.63",
|
|
||||||
origin: window.location.origin + "/",
|
|
||||||
apiUrl: null
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@ -43,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.writeln("<script src=\'./public/js/app.js?v=" + window.systemInformation.version + "\'><\/script>");
|
document.writeln("<script src=\'./js/app.js?v=" + window.systemInformation.version + "\'><\/script>");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
2
electron/main.js
vendored
2
electron/main.js
vendored
@ -15,7 +15,7 @@ function createWindow () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// and load the index.html of the app.
|
// and load the index.html of the app.
|
||||||
mainWindow.loadFile('./index.html').then(r => {
|
mainWindow.loadFile('./public/index.html').then(r => {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
111
native.js
vendored
Normal file
111
native.js
vendored
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path')
|
||||||
|
const package = require('./package.json')
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
function deleteFile(path) {
|
||||||
|
let files = [];
|
||||||
|
if( fs.existsSync(path) ) {
|
||||||
|
files = fs.readdirSync(path);
|
||||||
|
files.forEach(function(file,index){
|
||||||
|
let curPath = path + "/" + file;
|
||||||
|
if(fs.statSync(curPath).isDirectory()) {
|
||||||
|
deleteFile(curPath);
|
||||||
|
} else {
|
||||||
|
fs.unlinkSync(curPath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fs.rmdirSync(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复制文件
|
||||||
|
function copyFile(srcPath, tarPath, cb) {
|
||||||
|
let rs = fs.createReadStream(srcPath)
|
||||||
|
rs.on('error', function (err) {
|
||||||
|
if (err) {
|
||||||
|
console.log('read error', srcPath)
|
||||||
|
}
|
||||||
|
cb && cb(err)
|
||||||
|
})
|
||||||
|
let ws = fs.createWriteStream(tarPath)
|
||||||
|
ws.on('error', function (err) {
|
||||||
|
if (err) {
|
||||||
|
console.log('write error', tarPath)
|
||||||
|
}
|
||||||
|
cb && cb(err)
|
||||||
|
})
|
||||||
|
ws.on('close', function (ex) {
|
||||||
|
cb && cb(ex)
|
||||||
|
})
|
||||||
|
rs.pipe(ws)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复制文件夹所有
|
||||||
|
function copyDir(srcDir, tarDir, cb) {
|
||||||
|
if (fs.existsSync(tarDir)) {
|
||||||
|
fs.readdir(srcDir, function (err, files) {
|
||||||
|
let count = 0
|
||||||
|
let checkEnd = function () {
|
||||||
|
++count == files.length && cb && cb()
|
||||||
|
}
|
||||||
|
if (err) {
|
||||||
|
checkEnd()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
files.forEach(function (file) {
|
||||||
|
let srcPath = path.join(srcDir, file)
|
||||||
|
let tarPath = path.join(tarDir, file)
|
||||||
|
fs.stat(srcPath, function (err, stats) {
|
||||||
|
if (stats.isDirectory()) {
|
||||||
|
fs.mkdir(tarPath, function (err) {
|
||||||
|
if (err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
copyDir(srcPath, tarPath, checkEnd)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
copyFile(srcPath, tarPath, checkEnd)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//为空时直接回调
|
||||||
|
files.length === 0 && cb && cb()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
fs.mkdir(tarDir, function (err) {
|
||||||
|
if (err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
copyDir(srcDir, tarDir, cb)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ***************************************************************************************************/
|
||||||
|
/** ***************************************************************************************************/
|
||||||
|
/** ***************************************************************************************************/
|
||||||
|
|
||||||
|
const electronDir = path.resolve("electron/public");
|
||||||
|
if (fs.existsSync(electronDir)) {
|
||||||
|
deleteFile(electronDir);
|
||||||
|
}
|
||||||
|
fs.mkdirSync(electronDir);
|
||||||
|
|
||||||
|
[
|
||||||
|
'audio',
|
||||||
|
'css',
|
||||||
|
'images',
|
||||||
|
'js',
|
||||||
|
].forEach(function (item) {
|
||||||
|
copyDir(path.resolve("public/" + item), electronDir + "/" + item)
|
||||||
|
})
|
||||||
|
|
||||||
|
copyFile(path.resolve("electron/index.html"), electronDir + "/index.html")
|
||||||
|
|
||||||
|
fs.writeFileSync(electronDir + "/config.js", `window.systemInformation = {
|
||||||
|
version: "${package.version}",
|
||||||
|
origin: "./",
|
||||||
|
apiUrl: "http://127.0.0.1:2222/api/"
|
||||||
|
}`, 'utf8');
|
||||||
|
|
62
nativefier.js
vendored
62
nativefier.js
vendored
@ -1,62 +0,0 @@
|
|||||||
const nativefier = require('nativefier').default;
|
|
||||||
const inquirer = require('inquirer');
|
|
||||||
const config = require('./package.json');
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
name: config.name,
|
|
||||||
appVersion: config.version,
|
|
||||||
buildVersion: config.version,
|
|
||||||
out: './build',
|
|
||||||
icon: './resources/assets/statics/public/images/logo-app.png',
|
|
||||||
bounce: false,
|
|
||||||
counter: true,
|
|
||||||
clearCache: false,
|
|
||||||
disableDevTools: true,
|
|
||||||
disableContextMenu: true,
|
|
||||||
fileDownloadOptions: {
|
|
||||||
saveAs: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const questions = [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
name: 'targetUrl',
|
|
||||||
message: "请输入网站地址",
|
|
||||||
validate: function (value) {
|
|
||||||
return value !== ''
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
type: 'list',
|
|
||||||
name: 'platform',
|
|
||||||
message: "选择操作系统平台",
|
|
||||||
choices: [{
|
|
||||||
name: "MacOS Intel",
|
|
||||||
value: {
|
|
||||||
platform: 'mac',
|
|
||||||
arch: 'x64',
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
name: "MacOS Arm64",
|
|
||||||
value: {
|
|
||||||
platform: 'mac',
|
|
||||||
arch: 'arm64',
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
name: "Window x86_64",
|
|
||||||
value: {
|
|
||||||
platform: 'windows',
|
|
||||||
arch: 'x64',
|
|
||||||
icon: './resources/assets/statics/public/images/logo-app.ico',
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
inquirer.prompt(questions).then(answers => {
|
|
||||||
nativefier(Object.assign(options, answers.platform, {
|
|
||||||
targetUrl: answers.targetUrl
|
|
||||||
}), (error) => {
|
|
||||||
error && console.error(error)
|
|
||||||
});
|
|
||||||
});
|
|
@ -11,7 +11,7 @@
|
|||||||
"prod": "npm run production",
|
"prod": "npm run production",
|
||||||
"production": "mix --production",
|
"production": "mix --production",
|
||||||
"version": "node ./version.js",
|
"version": "node ./version.js",
|
||||||
"native": "node ./nativefier.js"
|
"native": "node ./native.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"axios": "^0.21",
|
"axios": "^0.21",
|
||||||
|
@ -52,12 +52,12 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
$A.loadScriptS([
|
$A.loadScriptS([
|
||||||
'js/luckysheet/plugins/css/pluginsCss.css',
|
'js/luckysheet/plugins/css/pluginsCss.css',
|
||||||
'js/js/luckysheet/plugins/plugins.css',
|
'js/luckysheet/plugins/plugins.css',
|
||||||
'js/js/luckysheet/css/luckysheet.css',
|
'js/luckysheet/css/luckysheet.css',
|
||||||
'js/js/luckysheet/assets/iconfont/iconfont.css',
|
'js/luckysheet/assets/iconfont/iconfont.css',
|
||||||
//
|
//
|
||||||
'js/js/luckysheet/plugins/js/plugin.js',
|
'js/luckysheet/plugins/js/plugin.js',
|
||||||
'js/js/luckysheet/luckysheet.umd.js',
|
'js/luckysheet/luckysheet.umd.js',
|
||||||
], () => {
|
], () => {
|
||||||
this.loadIng = false;
|
this.loadIng = false;
|
||||||
this.bakValue = JSON.stringify(this.value);
|
this.bakValue = JSON.stringify(this.value);
|
||||||
@ -99,7 +99,7 @@ export default {
|
|||||||
],
|
],
|
||||||
lang: lang,
|
lang: lang,
|
||||||
loading: {
|
loading: {
|
||||||
image: 'image://.js/luckysheet/css/loading.gif'
|
image: 'image://' + $A.originUrl('js/luckysheet/css/loading.gif')
|
||||||
},
|
},
|
||||||
data: value ? $A.cloneJSON(value) : [
|
data: value ? $A.cloneJSON(value) : [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user