创建新仓库
30
.babelrc
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"comments": false,
|
||||
"env": {
|
||||
"main": {
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": { "node": 7 }
|
||||
}],
|
||||
"stage-0"
|
||||
]
|
||||
},
|
||||
"renderer": {
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false
|
||||
}],
|
||||
"stage-0"
|
||||
]
|
||||
},
|
||||
"web": {
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false
|
||||
}],
|
||||
"stage-0"
|
||||
]
|
||||
}
|
||||
},
|
||||
"plugins": ["transform-runtime"]
|
||||
}
|
22
.cursorignore
Normal file
@ -0,0 +1,22 @@
|
||||
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
|
||||
bin-debug/
|
||||
bin-release/
|
||||
[Oo]bj/
|
||||
[Bb]in/
|
||||
node_modules_w/
|
||||
node_modules_l/
|
||||
.settings/
|
||||
.history/
|
||||
build/linux-unpacked/
|
||||
build/win-unpacked/
|
||||
logs/
|
||||
# Executables
|
||||
*.swf
|
||||
*.air
|
||||
*.ipa
|
||||
*.apk
|
||||
*.deb
|
||||
*.exe
|
||||
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||
# should NOT be excluded as they contain compiler settings and other important
|
||||
# information for Eclipse / Flash Builder.
|
35
.cursorrules
Normal file
@ -0,0 +1,35 @@
|
||||
You are an expert in javaScript, Node.js, Vite, Vue.js, Vue Router, vuex, Element-ui,with a deep understanding of best practices and performance optimization techniques in these technologies.
|
||||
|
||||
Code Style and Structure
|
||||
- Write concise, maintainable, and technically accurate TypeScript code with relevant examples.
|
||||
- Use functional and declarative programming patterns; avoid classes.
|
||||
- Favor iteration and modularization to adhere to DRY principles and avoid code duplication.
|
||||
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
|
||||
- Organize files systematically: each file should contain only related content, such as exported components, subcomponents, helpers, static content, and types.
|
||||
|
||||
Naming Conventions
|
||||
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
|
||||
- Favor named exports for functions.
|
||||
|
||||
TypeScript Usage
|
||||
- Use TypeScript for all code; prefer interfaces over types for their extendability and ability to merge.
|
||||
- Avoid enums; use maps instead for better type safety and flexibility.
|
||||
- Use functional components with TypeScript interfaces.
|
||||
|
||||
Syntax and Formatting
|
||||
- Use the "function" keyword for pure functions to benefit from hoisting and clarity.
|
||||
- Always use the Vue Composition API script setup style.
|
||||
|
||||
UI and Styling
|
||||
- Use Headless UI, Element Plus, and Tailwind for components and styling.
|
||||
- Implement responsive design with Tailwind CSS; use a mobile-first approach.
|
||||
|
||||
Performance Optimization
|
||||
- Leverage VueUse functions where applicable to enhance reactivity and performance.
|
||||
- Wrap asynchronous components in Suspense with a fallback UI.
|
||||
- Use dynamic loading for non-critical components.
|
||||
- Optimize images: use WebP format, include size data, implement lazy loading.
|
||||
- Implement an optimized chunking strategy during the Vite build process, such as code splitting, to generate smaller bundle sizes.
|
||||
|
||||
Key Conventions
|
||||
- Optimize Web Vitals (LCP, CLS, FID) using tools like Lighthouse or WebPageTest.
|
82
.drone.yml
Normal file
@ -0,0 +1,82 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
workspace:
|
||||
path: /app
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: clone
|
||||
image: alpine/git
|
||||
network_mode: host
|
||||
commands:
|
||||
- git clone --branch ${DRONE_TAG} --depth 1 http://192.168.110.199:3000/fengsen/4.0.git .
|
||||
|
||||
- name: build-linux
|
||||
image: docker.1ms.run/node:18.20.5
|
||||
volumes:
|
||||
- name: node_modules-linux
|
||||
path: /app/node_modules
|
||||
|
||||
- name: electron-builder-cache-linux
|
||||
path: /root/.cache/
|
||||
|
||||
- name: bin
|
||||
path: /app/bin
|
||||
|
||||
commands:
|
||||
- npm config set registry https://registry.npmmirror.com/
|
||||
- npm install
|
||||
- umask 0000
|
||||
- npm run build:linux64
|
||||
- export DRONE_TAG=${DRONE_TAG:-$(cat /proc/sys/kernel/random/uuid)}
|
||||
- /app/bin/cpl "$(find build/ -name "*.deb")" ${DRONE_TAG}
|
||||
|
||||
- name: build-windows-wine
|
||||
image: docker.1ms.run/electronuserland/builder:wine
|
||||
volumes:
|
||||
- name: node_modules-windows
|
||||
path: /app/node_modulesw
|
||||
|
||||
- name: electron-builder-cache-windows
|
||||
path: /root/.cache/
|
||||
|
||||
- name: bin
|
||||
path: /app/bin
|
||||
|
||||
commands:
|
||||
- npm config set registry https://registry.npmmirror.com/
|
||||
- npm install
|
||||
- npm run build:win64
|
||||
- export DRONE_TAG=${DRONE_TAG:-$(cat /proc/sys/kernel/random/uuid)}
|
||||
- /app/bin/cpl "$(find build/ -maxdepth 1 -name "*.exe")" ${DRONE_TAG}
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
ref:
|
||||
- refs/tags/**
|
||||
|
||||
volumes:
|
||||
# linux
|
||||
- name: node_modules-linux
|
||||
host:
|
||||
path: /home/abc/drone/yj/ci-cache/linux/node_modules
|
||||
- name: electron-builder-cache-linux
|
||||
host:
|
||||
path: /home/abc/drone/yj/ci-cache/linux/cache
|
||||
|
||||
# windows
|
||||
- name: node_modules-windows
|
||||
host:
|
||||
path: /home/abc/drone/yj/ci-cache/windows/node_modules
|
||||
- name: electron-builder-cache-windows
|
||||
host:
|
||||
path: /home/abc/drone/yj/ci-cache/windows/cache
|
||||
|
||||
- name: bin
|
||||
host:
|
||||
path: /home/abc/drone/bin
|
141
.electron-vue/build.js
Normal file
@ -0,0 +1,141 @@
|
||||
"use strict";
|
||||
|
||||
process.env.NODE_ENV = "production";
|
||||
|
||||
const { say } = require("cfonts");
|
||||
const chalk = require("chalk");
|
||||
const del = require("del");
|
||||
const { spawn } = require("child_process");
|
||||
const webpack = require("webpack");
|
||||
const Multispinner = require("multispinner");
|
||||
const { mains } = require("./setVersion");
|
||||
mains();
|
||||
|
||||
const mainConfig = require("./webpack.main.config");
|
||||
const rendererConfig = require("./webpack.renderer.config");
|
||||
const webConfig = require("./webpack.web.config");
|
||||
|
||||
const doneLog = chalk.bgGreen.white(" DONE ") + " ";
|
||||
const errorLog = chalk.bgRed.white(" ERROR ") + " ";
|
||||
const okayLog = chalk.bgBlue.white(" OKAY ") + " ";
|
||||
const isCI = process.env.CI || false;
|
||||
|
||||
if (process.env.BUILD_TARGET === "clean") clean();
|
||||
else if (process.env.BUILD_TARGET === "web") web();
|
||||
else build();
|
||||
|
||||
function clean() {
|
||||
del.sync(["build/*", "!build/icons", "!build/icons/icon.*"]);
|
||||
console.log(`\n${doneLog}\n`);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
function build() {
|
||||
greeting();
|
||||
|
||||
del.sync(["dist/electron/*", "!.gitkeep"]);
|
||||
|
||||
const tasks = ["main", "renderer"];
|
||||
const m = new Multispinner(tasks, {
|
||||
preText: "building",
|
||||
postText: "process"
|
||||
});
|
||||
|
||||
let results = "";
|
||||
|
||||
m.on("success", () => {
|
||||
process.stdout.write("\x1B[2J\x1B[0f");
|
||||
console.log(`\n\n${results}`);
|
||||
console.log(
|
||||
`${okayLog}take it away ${chalk.yellow("`electron-builder`")}\n`
|
||||
);
|
||||
process.exit();
|
||||
});
|
||||
|
||||
pack(mainConfig)
|
||||
.then(result => {
|
||||
results += result + "\n\n";
|
||||
m.success("main");
|
||||
})
|
||||
.catch(err => {
|
||||
m.error("main");
|
||||
console.log(`\n ${errorLog}failed to build main process`);
|
||||
console.error(`\n${err}\n`);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
pack(rendererConfig)
|
||||
.then(result => {
|
||||
results += result + "\n\n";
|
||||
m.success("renderer");
|
||||
})
|
||||
.catch(err => {
|
||||
m.error("renderer");
|
||||
console.log(`\n ${errorLog}failed to build renderer process`);
|
||||
console.error(`\n${err}\n`);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
function pack(config) {
|
||||
return new Promise((resolve, reject) => {
|
||||
webpack(config, (err, stats) => {
|
||||
if (err) reject(err.stack || err);
|
||||
else if (stats.hasErrors()) {
|
||||
let err = "";
|
||||
|
||||
stats
|
||||
.toString({
|
||||
chunks: false,
|
||||
colors: true
|
||||
})
|
||||
.split(/\r?\n/)
|
||||
.forEach(line => {
|
||||
err += ` ${line}\n`;
|
||||
});
|
||||
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(
|
||||
stats.toString({
|
||||
chunks: false,
|
||||
colors: true
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function web() {
|
||||
del.sync(["dist/web/*", "!.gitkeep"]);
|
||||
webpack(webConfig, (err, stats) => {
|
||||
if (err || stats.hasErrors()) console.log(err);
|
||||
|
||||
console.log(
|
||||
stats.toString({
|
||||
chunks: false,
|
||||
colors: true
|
||||
})
|
||||
);
|
||||
|
||||
process.exit();
|
||||
});
|
||||
}
|
||||
|
||||
function greeting() {
|
||||
const cols = process.stdout.columns;
|
||||
let text = "";
|
||||
|
||||
if (cols > 85) text = "lets-build";
|
||||
else if (cols > 60) text = "lets-|build";
|
||||
else text = false;
|
||||
|
||||
if (text && !isCI) {
|
||||
say(text, {
|
||||
colors: ["yellow"],
|
||||
font: "simple3d",
|
||||
space: false
|
||||
});
|
||||
} else console.log(chalk.yellow.bold("\n lets-build"));
|
||||
}
|
41
.electron-vue/dev-client.js
Normal file
@ -0,0 +1,41 @@
|
||||
const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
|
||||
import 'polyfill-object.fromentries';
|
||||
|
||||
hotClient.subscribe(event => {
|
||||
/**
|
||||
* Reload browser when HTMLWebpackPlugin emits a new index.html
|
||||
*
|
||||
* Currently disabled until jantimon/html-webpack-plugin#680 is resolved.
|
||||
* https://github.com/SimulatedGREG/electron-vue/issues/437
|
||||
* https://github.com/jantimon/html-webpack-plugin/issues/680
|
||||
*/
|
||||
// if (event.action === 'reload') {
|
||||
// window.location.reload()
|
||||
// }
|
||||
|
||||
/**
|
||||
* Notify `mainWindow` when `main` process is compiling,
|
||||
* giving notice for an expected reload of the `electron` process
|
||||
*/
|
||||
if (event.action === 'compiling') {
|
||||
document.body.innerHTML += `
|
||||
<style>
|
||||
#dev-client {
|
||||
background: #4fc08d;
|
||||
border-radius: 4px;
|
||||
bottom: 20px;
|
||||
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
|
||||
color: #fff;
|
||||
font-family: 'Source Sans Pro', sans-serif;
|
||||
left: 20px;
|
||||
padding: 8px 12px;
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="dev-client">
|
||||
Compiling Main Process...
|
||||
</div>
|
||||
`
|
||||
}
|
||||
})
|
205
.electron-vue/dev-runner.js
Normal file
@ -0,0 +1,205 @@
|
||||
"use strict";
|
||||
|
||||
const chalk = require("chalk");
|
||||
const electron = require("electron");
|
||||
const path = require("path");
|
||||
const { say } = require("cfonts");
|
||||
const { spawn } = require("child_process");
|
||||
const webpack = require("webpack");
|
||||
const WebpackDevServer = require("webpack-dev-server");
|
||||
const webpackHotMiddleware = require("webpack-hot-middleware");
|
||||
|
||||
const mainConfig = require("./webpack.main.config");
|
||||
const rendererConfig = require("./webpack.renderer.config");
|
||||
const config = require("../config");
|
||||
const { setEnvior } = require("./setVersion");
|
||||
|
||||
let electronProcess = null;
|
||||
let manualRestart = false;
|
||||
let hotMiddleware;
|
||||
|
||||
function logStats(proc, data) {
|
||||
let log = "";
|
||||
|
||||
log += chalk.yellow.bold(
|
||||
`┏ ${proc} Process ${new Array(19 - proc.length + 1).join("-")}`
|
||||
);
|
||||
log += "\n\n";
|
||||
|
||||
if (typeof data === "object") {
|
||||
data
|
||||
.toString({
|
||||
colors: true,
|
||||
chunks: false
|
||||
})
|
||||
.split(/\r?\n/)
|
||||
.forEach(line => {
|
||||
log += " " + line + "\n";
|
||||
});
|
||||
} else {
|
||||
log += ` ${data}\n`;
|
||||
}
|
||||
|
||||
log += "\n" + chalk.yellow.bold(`┗ ${new Array(28 + 1).join("-")}`) + "\n";
|
||||
|
||||
console.log(log);
|
||||
}
|
||||
|
||||
function startRenderer() {
|
||||
return new Promise((resolve, reject) => {
|
||||
rendererConfig.entry.renderer = [path.join(__dirname, "dev-client")].concat(
|
||||
rendererConfig.entry.renderer
|
||||
);
|
||||
|
||||
const compiler = webpack(rendererConfig);
|
||||
hotMiddleware = webpackHotMiddleware(compiler, {
|
||||
log: false,
|
||||
heartbeat: 2500
|
||||
});
|
||||
|
||||
compiler.plugin("compilation", compilation => {
|
||||
compilation.plugin("html-webpack-plugin-after-emit", (data, cb) => {
|
||||
hotMiddleware.publish({ action: "reload" });
|
||||
cb();
|
||||
});
|
||||
});
|
||||
|
||||
compiler.plugin("done", stats => {
|
||||
logStats("Renderer", stats);
|
||||
});
|
||||
|
||||
const server = new WebpackDevServer(compiler, {
|
||||
contentBase: path.join(__dirname, "../"),
|
||||
quiet: true,
|
||||
before(app, ctx) {
|
||||
app.use(hotMiddleware);
|
||||
ctx.middleware.waitUntilValid(() => {
|
||||
resolve();
|
||||
});
|
||||
},
|
||||
proxy:{
|
||||
"/airApi": {
|
||||
//测试服务接口地址
|
||||
target: "http://120.46.149.189:9136",
|
||||
changeOrigin: true, // 允许跨域
|
||||
pathRewrite: {
|
||||
"^/airApi": "/"
|
||||
},
|
||||
headers: {referer: ''}
|
||||
}
|
||||
}
|
||||
});
|
||||
server.listen(config.AppConfig.PORT);
|
||||
});
|
||||
}
|
||||
|
||||
function startMain() {
|
||||
return new Promise((resolve, reject) => {
|
||||
mainConfig.entry.main = [
|
||||
path.join(__dirname, "../src/main/index.dev.js")
|
||||
].concat(mainConfig.entry.main);
|
||||
|
||||
const compiler = webpack(mainConfig);
|
||||
|
||||
compiler.plugin("watch-run", (compilation, done) => {
|
||||
logStats("Main", chalk.white.bold("compiling..."));
|
||||
hotMiddleware.publish({ action: "compiling" });
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
compiler.watch({}, (err, stats) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
|
||||
logStats("Main", stats);
|
||||
|
||||
if (electronProcess && electronProcess.kill) {
|
||||
manualRestart = true;
|
||||
process.kill(electronProcess.pid);
|
||||
electronProcess = null;
|
||||
startElectron();
|
||||
|
||||
setTimeout(() => {
|
||||
manualRestart = false;
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function startElectron() {
|
||||
|
||||
electronProcess = spawn(electron, [
|
||||
"--inspect=5858",
|
||||
path.join(__dirname, "../dist/electron/main.js")
|
||||
]);
|
||||
electronProcess.on('spawn', () => {
|
||||
console.log('子进程已启动');
|
||||
setEnvior()
|
||||
});
|
||||
// setEnvior();
|
||||
electronProcess.stdout.on("data", data => {
|
||||
electronLog(data, "blue");
|
||||
});
|
||||
electronProcess.stderr.on("data", data => {
|
||||
electronLog(data, "red");
|
||||
});
|
||||
|
||||
electronProcess.on("close", () => {
|
||||
if (!manualRestart) process.exit();
|
||||
});
|
||||
}
|
||||
|
||||
function electronLog(data, color) {
|
||||
let log = "";
|
||||
data = data.toString().split(/\r?\n/);
|
||||
data.forEach(line => {
|
||||
log += ` ${line}\n`;
|
||||
});
|
||||
if (/[0-9A-z]+/.test(log)) {
|
||||
console.log(
|
||||
chalk[color].bold("┏ Electron -------------------") +
|
||||
"\n\n" +
|
||||
log +
|
||||
chalk[color].bold("┗ ----------------------------") +
|
||||
"\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function greeting() {
|
||||
const cols = process.stdout.columns;
|
||||
let text = "";
|
||||
|
||||
if (cols > 104) text = "electron-vue";
|
||||
else if (cols > 76) text = "electron-|vue";
|
||||
else text = false;
|
||||
|
||||
if (text) {
|
||||
say(text, {
|
||||
colors: ["yellow"],
|
||||
font: "simple3d",
|
||||
space: false
|
||||
});
|
||||
} else console.log(chalk.yellow.bold("\n electron-vue"));
|
||||
console.log(chalk.blue(" getting ready...") + "\n");
|
||||
}
|
||||
|
||||
function init() {
|
||||
greeting();
|
||||
|
||||
Promise.all([startRenderer(), startMain()])
|
||||
.then(() => {
|
||||
startElectron();
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
65
.electron-vue/setVersion.js
Normal file
@ -0,0 +1,65 @@
|
||||
const fs = require("fs");
|
||||
const obj = require("../config/app_config");
|
||||
// 获取当前工作目录路径
|
||||
const currentDirPath = process.cwd();
|
||||
// 定义需要更改的 package.json 文件路径
|
||||
const packageJsonFilePath = `${currentDirPath}/package.json`;
|
||||
const installerFilePath = `${currentDirPath}/installer.nsh`;
|
||||
const installText = `${currentDirPath}/install.txt`;
|
||||
|
||||
/*function setEnvior() {}*/
|
||||
|
||||
let Factory = (function() {
|
||||
return {
|
||||
mains: function() {
|
||||
// 读取原始的 package.json 内容
|
||||
let packageData;
|
||||
let y;
|
||||
try {
|
||||
const str = String(fs.readFileSync(installText));
|
||||
y = str.replace(/installurl/g, obj.installUrl);
|
||||
const rawData = fs.readFileSync(packageJsonFilePath);
|
||||
packageData = JSON.parse(rawData);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.log(`无法读取 ${packageJsonFilePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据自定义逻辑修改 package.json 中的 name 字段(这里示意性地将其设置为 "new_app")
|
||||
for (const objKey in obj) {
|
||||
if (objKey.indexOf("_") > -1) {
|
||||
let keyArr = [];
|
||||
keyArr = objKey.split("_");
|
||||
//[win,icon]=>["win"]["icon"]
|
||||
let str = '["' + keyArr.join('"]["') + '"]';
|
||||
console.log(str);
|
||||
try {
|
||||
eval(`packageData${str} = obj[objKey]`);
|
||||
} catch (e) {}
|
||||
} else {
|
||||
if (packageData.hasOwnProperty(objKey)) {
|
||||
packageData[objKey] = obj[objKey];
|
||||
}
|
||||
if(objKey=="isSetDefaultLayer"){
|
||||
localStorage.setItem("isSetDefaultLayer",obj[objKey])
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
console.log(packageData);
|
||||
// 写入修改后的 package.json 数据
|
||||
fs.writeFileSync(packageJsonFilePath, JSON.stringify(packageData));
|
||||
fs.writeFileSync(installerFilePath, y);
|
||||
},
|
||||
setEnvior: function() {
|
||||
// console.log("*********************", obj.head);
|
||||
if(obj.hasOwnProperty('isSetDefaultLayer')){
|
||||
// localStorage.setItem("isSetDefaultLayer",obj[objKey])
|
||||
}
|
||||
// process.env.Head = obj.head;
|
||||
return obj.head;
|
||||
}
|
||||
};
|
||||
})();
|
||||
module.exports = Factory;
|
56
.electron-vue/setVersion1.js
Normal file
@ -0,0 +1,56 @@
|
||||
const fs = require("fs");
|
||||
const obj = require("../config/app_config");
|
||||
// 获取当前工作目录路径
|
||||
const currentDirPath = process.cwd();
|
||||
// 定义需要更改的 package.json 文件路径
|
||||
const packageJsonFilePath = `${currentDirPath}/package.json`;
|
||||
const installerFilePath = `${currentDirPath}/installer.nsh`;
|
||||
|
||||
/*function setEnvior() {}*/
|
||||
|
||||
let Factory = (function() {
|
||||
return {
|
||||
mains: function() {
|
||||
// 读取原始的 package.json 内容
|
||||
let packageData;
|
||||
let y;
|
||||
try {
|
||||
const str = String(fs.readFileSync(installerFilePath));
|
||||
y = str.replace(/urlHKLM/g, obj.installUrl);
|
||||
const rawData = fs.readFileSync(packageJsonFilePath);
|
||||
packageData = JSON.parse(rawData);
|
||||
} catch (error) {
|
||||
console.log(`无法读取 ${packageJsonFilePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据自定义逻辑修改 package.json 中的 name 字段(这里示意性地将其设置为 "new_app")
|
||||
for (const objKey in obj) {
|
||||
if (objKey.indexOf("_") > -1) {
|
||||
let keyArr = [];
|
||||
keyArr = objKey.split("_");
|
||||
//[win,icon]=>["win"]["icon"]
|
||||
let str = '["' + keyArr.join('"]["') + '"]';
|
||||
console.log(str);
|
||||
try {
|
||||
eval(`packageData${str} = obj[objKey]`);
|
||||
} catch (e) {}
|
||||
} else {
|
||||
if (packageData.hasOwnProperty(objKey)) {
|
||||
packageData[objKey] = obj[objKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(packageData);
|
||||
// 写入修改后的 package.json 数据
|
||||
fs.writeFileSync(packageJsonFilePath, JSON.stringify(packageData));
|
||||
fs.writeFileSync(installerFilePath, y);
|
||||
},
|
||||
setEnvior: function() {
|
||||
console.log("*********************", obj.head);
|
||||
// process.env.Head = obj.head;
|
||||
return obj.head;
|
||||
}
|
||||
};
|
||||
})();
|
||||
module.exports = Factory;
|
85
.electron-vue/webpack.main.config.js
Normal file
@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
|
||||
process.env.BABEL_ENV = "main";
|
||||
|
||||
const path = require("path");
|
||||
const { dependencies } = require("../package.json");
|
||||
const webpack = require("webpack");
|
||||
|
||||
const BabiliWebpackPlugin = require("babili-webpack-plugin");
|
||||
let whiteListedModules = ["fs", "path", "net", "electron", "child_process"];
|
||||
let mainConfig = {
|
||||
entry: {
|
||||
main: path.join(__dirname, "../src/main/index.js")
|
||||
},
|
||||
/*externals: [
|
||||
...Object.keys(dependencies || {}).filter(
|
||||
d => !whiteListedModules.includes(d)
|
||||
)
|
||||
],*/
|
||||
externals: [...Object.keys(dependencies || {})],
|
||||
module: {
|
||||
rules: [
|
||||
/* {
|
||||
test: /\.(js)$/,
|
||||
enforce: 'pre',
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'eslint-loader',
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter')
|
||||
}
|
||||
}
|
||||
},*/
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: "babel-loader",
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: "node-loader"
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
__dirname: process.env.NODE_ENV !== "production",
|
||||
__filename: process.env.NODE_ENV !== "production"
|
||||
},
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
libraryTarget: "commonjs2",
|
||||
path: path.join(__dirname, "../dist/electron")
|
||||
},
|
||||
plugins: [new webpack.NoEmitOnErrorsPlugin()],
|
||||
resolve: {
|
||||
extensions: [".js", ".json", ".node"]
|
||||
},
|
||||
target: "electron-main"
|
||||
};
|
||||
|
||||
/**
|
||||
* Adjust mainConfig for development settings
|
||||
*/
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
mainConfig.plugins.push(
|
||||
new webpack.DefinePlugin({
|
||||
__static: `"${path.join(__dirname, "../static").replace(/\\/g, "\\\\")}"`
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust mainConfig for production settings
|
||||
*/
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
mainConfig.plugins.push(
|
||||
new BabiliWebpackPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": '"production"'
|
||||
})
|
||||
);
|
||||
}
|
||||
// console.log(mainConfig);
|
||||
|
||||
module.exports = mainConfig;
|
211
.electron-vue/webpack.renderer.config.js
Normal file
@ -0,0 +1,211 @@
|
||||
"use strict";
|
||||
|
||||
process.env.BABEL_ENV = "renderer";
|
||||
|
||||
const path = require("path");
|
||||
const { dependencies } = require("../package.json");
|
||||
const webpack = require("webpack");
|
||||
const config = require("../config/index.js");
|
||||
const BabiliWebpackPlugin = require("babili-webpack-plugin");
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const { setEnvior } = require("./setVersion");
|
||||
/**
|
||||
* List of node_modules to include in webpack bundle
|
||||
*
|
||||
* Required for specific packages like Vue UI libraries
|
||||
* that provide pure *.vue files that need compiling
|
||||
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals
|
||||
*/
|
||||
let whiteListedModules = ["vue", "elementUI", "element-ui", "avue"];
|
||||
let objd =
|
||||
process.env.NODE_ENV === "production" ? config.build.env : config.dev.env;
|
||||
// let env = {
|
||||
// "process.env": { Head: `"${setEnvior()}"`, ...objd }
|
||||
// };
|
||||
let rendererConfig = {
|
||||
devtool: "#cheap-module-eval-source-map",
|
||||
|
||||
entry: {
|
||||
renderer: path.join(__dirname, "../src/renderer/main.js"),
|
||||
},
|
||||
externals: [
|
||||
...Object.keys(dependencies || {}).filter(
|
||||
(d) => !whiteListedModules.includes(d)
|
||||
),
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
/* {
|
||||
test: /\.(js|vue)$/,
|
||||
enforce: 'pre',
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'eslint-loader',
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter')
|
||||
}
|
||||
}
|
||||
},*/
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: "style-loader",
|
||||
use: "css-loader",
|
||||
}),
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: "vue-html-loader",
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: "babel-loader",
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: "node-loader",
|
||||
},
|
||||
{
|
||||
test: /\.vue$/,
|
||||
use: {
|
||||
loader: "vue-loader",
|
||||
options: {
|
||||
extractCSS: process.env.NODE_ENV === "production",
|
||||
loaders: {
|
||||
sass: "vue-style-loader!css-loader!sass-loader?indentedSyntax=1",
|
||||
scss:
|
||||
'vue-style-loader!css-loader!sass-loader?data=@import "./src/renderer/assets/styles/computed.scss";',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
loader: "svg-sprite-loader",
|
||||
include: [path.join(__dirname, "../src/renderer/icons")],
|
||||
options: {
|
||||
symbolId: "icon-[name]",
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
exclude: [path.join(__dirname, "../src/renderer/icons")],
|
||||
use: {
|
||||
loader: "url-loader",
|
||||
query: {
|
||||
limit: 10000,
|
||||
name: "imgs/[name]--[folder].[ext]",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: "media/[name]--[folder].[ext]",
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
use: {
|
||||
loader: "url-loader",
|
||||
query: {
|
||||
limit: 10000,
|
||||
name: "fonts/[name]--[folder].[ext]",
|
||||
},
|
||||
},
|
||||
},
|
||||
/*{
|
||||
use: {
|
||||
loader: 'svgo-loader',
|
||||
query: {
|
||||
limit: 10000,
|
||||
name: 'fonts/[name]--[folder].[ext]'
|
||||
}
|
||||
}
|
||||
}*/
|
||||
],
|
||||
},
|
||||
node: {
|
||||
__dirname: process.env.NODE_ENV !== "production",
|
||||
__filename: process.env.NODE_ENV !== "production",
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin("styles.css"),
|
||||
new webpack.DefinePlugin({
|
||||
"process.env":
|
||||
process.env.NODE_ENV === "production"
|
||||
? config.build.env
|
||||
: config.dev.env,
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: "index.html",
|
||||
template: path.resolve(__dirname, "../src/index.ejs"),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
nodeModules:
|
||||
process.env.NODE_ENV !== "production"
|
||||
? path.resolve(__dirname, "../node_modules")
|
||||
: false,
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
],
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
libraryTarget: "commonjs2",
|
||||
path: path.join(__dirname, "../dist/electron"),
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.join(__dirname, "../src/renderer"),
|
||||
vue$: "vue/dist/vue.esm.js",
|
||||
},
|
||||
extensions: [".js", ".vue", ".json", ".css", ".node"],
|
||||
},
|
||||
target: "electron-renderer",
|
||||
};
|
||||
|
||||
/**
|
||||
* Adjust rendererConfig for development settings
|
||||
*/
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
rendererConfig.plugins.push(
|
||||
new webpack.DefinePlugin({
|
||||
__static: `"${path.join(__dirname, "../static").replace(/\\/g, "\\\\")}"`,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust rendererConfig for production settings
|
||||
*/
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
rendererConfig.devtool = "";
|
||||
|
||||
rendererConfig.plugins.push(
|
||||
new BabiliWebpackPlugin(),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.join(__dirname, "../static"),
|
||||
to: path.join(__dirname, "../dist/electron/static"),
|
||||
ignore: [".*"],
|
||||
},
|
||||
]),
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": '"production"',
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
minimize: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = rendererConfig;
|
140
.electron-vue/webpack.web.config.js
Normal file
@ -0,0 +1,140 @@
|
||||
'use strict'
|
||||
|
||||
process.env.BABEL_ENV = 'web'
|
||||
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
|
||||
const BabiliWebpackPlugin = require('babili-webpack-plugin')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
|
||||
let webConfig = {
|
||||
devtool: '#cheap-module-eval-source-map',
|
||||
|
||||
entry: {
|
||||
web: path.join(__dirname, '../src/renderer/main.js')
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
/* {
|
||||
test: /\.(js|vue)$/,
|
||||
enforce: 'pre',
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'eslint-loader',
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter')
|
||||
}
|
||||
}
|
||||
},*/
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: 'css-loader'
|
||||
})
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: 'vue-html-loader'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: 'babel-loader',
|
||||
include: [path.resolve(__dirname, '../src/renderer')],
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /\.vue$/,
|
||||
use: {
|
||||
loader: 'vue-loader',
|
||||
options: {
|
||||
extractCSS: true,
|
||||
loaders: {
|
||||
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
|
||||
scss: 'vue-style-loader!css-loader!sass-loader'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
use: {
|
||||
loader: 'url-loader',
|
||||
query: {
|
||||
limit: 10000,
|
||||
name: 'imgs/[name].[ext]'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
use: {
|
||||
loader: 'url-loader',
|
||||
query: {
|
||||
limit: 10000,
|
||||
name: 'fonts/[name].[ext]'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin('styles.css'),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: path.resolve(__dirname, '../src/index.ejs'),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true
|
||||
},
|
||||
nodeModules: false,
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.IS_WEB': 'true'
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoEmitOnErrorsPlugin()
|
||||
],
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.join(__dirname, '../dist/web')
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.join(__dirname, '../src/renderer'),
|
||||
'vue$': 'vue/dist/vue.esm.js'
|
||||
},
|
||||
extensions: ['.js', '.vue', '.json', '.css']
|
||||
},
|
||||
target: 'web'
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust webConfig for production settings
|
||||
*/
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
webConfig.devtool = ''
|
||||
|
||||
webConfig.plugins.push(
|
||||
new BabiliWebpackPlugin(),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.join(__dirname, '../static'),
|
||||
to: path.join(__dirname, '../dist/web/static'),
|
||||
ignore: ['.*']
|
||||
}
|
||||
]),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': '"production"'
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
minimize: true
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = webConfig
|
4
.eslintignore
Normal file
@ -0,0 +1,4 @@
|
||||
build/*.js
|
||||
src/renderer/assets/**
|
||||
dist/**
|
||||
src/*
|
198
.eslintrc.js
Normal file
@ -0,0 +1,198 @@
|
||||
module.exports = {
|
||||
root: false,
|
||||
parser: 'babel-eslint',
|
||||
parserOptions: {
|
||||
sourceType: 'module'
|
||||
},
|
||||
env: {
|
||||
browser: false,
|
||||
node: false,
|
||||
es6: false,
|
||||
},
|
||||
extends: 'eslint:recommended',
|
||||
// required to lint *.vue files
|
||||
plugins: [
|
||||
'html'
|
||||
],
|
||||
// check if imports actually resolve
|
||||
'settings': {
|
||||
'import/resolver': {
|
||||
'webpack': {
|
||||
'config': 'build/webpack.base.conf.js'
|
||||
}
|
||||
}
|
||||
},
|
||||
// add your custom rules here
|
||||
//it is base on https://github.com/vuejs/eslint-config-vue
|
||||
rules: {
|
||||
'accessor-pairs': 2,
|
||||
'arrow-spacing': [2, {
|
||||
'before': true,
|
||||
'after': true
|
||||
}],
|
||||
'block-spacing': [2, 'always'],
|
||||
'brace-style': [2, '1tbs', {
|
||||
'allowSingleLine': true
|
||||
}],
|
||||
'camelcase': [0, {
|
||||
'properties': 'always'
|
||||
}],
|
||||
'comma-dangle': [2, 'never'],
|
||||
'comma-spacing': [2, {
|
||||
'before': false,
|
||||
'after': true
|
||||
}],
|
||||
'comma-style': [2, 'last'],
|
||||
'constructor-super': 2,
|
||||
'curly': [2, 'multi-line'],
|
||||
'dot-location': [2, 'property'],
|
||||
'eol-last': 2,
|
||||
'eqeqeq': [2, 'allow-null'],
|
||||
'generator-star-spacing': [2, {
|
||||
'before': true,
|
||||
'after': true
|
||||
}],
|
||||
'handle-callback-err': [2, '^(err|error)$'],
|
||||
'indent': [2, 2, {
|
||||
'SwitchCase': 1
|
||||
}],
|
||||
'jsx-quotes': [2, 'prefer-single'],
|
||||
'key-spacing': [2, {
|
||||
'beforeColon': false,
|
||||
'afterColon': true
|
||||
}],
|
||||
'keyword-spacing': [2, {
|
||||
'before': true,
|
||||
'after': true
|
||||
}],
|
||||
'new-cap': [2, {
|
||||
'newIsCap': true,
|
||||
'capIsNew': false
|
||||
}],
|
||||
'new-parens': 2,
|
||||
'no-array-constructor': 2,
|
||||
'no-caller': 2,
|
||||
'no-console': 'off',
|
||||
'no-class-assign': 2,
|
||||
'no-cond-assign': 2,
|
||||
'no-const-assign': 2,
|
||||
'no-control-regex': 2,
|
||||
'no-delete-var': 2,
|
||||
'no-dupe-args': 2,
|
||||
'no-dupe-class-members': 2,
|
||||
'no-dupe-keys': 2,
|
||||
'no-duplicate-case': 2,
|
||||
'no-empty-character-class': 2,
|
||||
'no-empty-pattern': 2,
|
||||
'no-eval': 2,
|
||||
'no-ex-assign': 2,
|
||||
'no-extend-native': 2,
|
||||
'no-extra-bind': 2,
|
||||
'no-extra-boolean-cast': 2,
|
||||
'no-extra-parens': [2, 'functions'],
|
||||
'no-fallthrough': 2,
|
||||
'no-floating-decimal': 2,
|
||||
'no-func-assign': 2,
|
||||
'no-implied-eval': 2,
|
||||
'no-inner-declarations': [2, 'functions'],
|
||||
'no-invalid-regexp': 2,
|
||||
'no-irregular-whitespace': 2,
|
||||
'no-iterator': 2,
|
||||
'no-label-var': 2,
|
||||
'no-labels': [2, {
|
||||
'allowLoop': false,
|
||||
'allowSwitch': false
|
||||
}],
|
||||
'no-lone-blocks': 2,
|
||||
'no-mixed-spaces-and-tabs': 2,
|
||||
'no-multi-spaces': 2,
|
||||
'no-multi-str': 2,
|
||||
'no-multiple-empty-lines': [2, {
|
||||
'max': 1
|
||||
}],
|
||||
'no-native-reassign': 2,
|
||||
'no-negated-in-lhs': 2,
|
||||
'no-new-object': 2,
|
||||
'no-new-require': 2,
|
||||
'no-new-symbol': 2,
|
||||
'no-new-wrappers': 2,
|
||||
'no-obj-calls': 2,
|
||||
'no-octal': 2,
|
||||
'no-octal-escape': 2,
|
||||
'no-path-concat': 2,
|
||||
'no-proto': 2,
|
||||
'no-redeclare': 2,
|
||||
'no-regex-spaces': 2,
|
||||
'no-return-assign': [2, 'except-parens'],
|
||||
'no-self-assign': 2,
|
||||
'no-self-compare': 2,
|
||||
'no-sequences': 2,
|
||||
'no-shadow-restricted-names': 2,
|
||||
'no-spaced-func': 2,
|
||||
'no-sparse-arrays': 2,
|
||||
'no-this-before-super': 2,
|
||||
'no-throw-literal': 2,
|
||||
'no-trailing-spaces': 2,
|
||||
'no-undef': 2,
|
||||
'no-undef-init': 2,
|
||||
'no-unexpected-multiline': 2,
|
||||
'no-unmodified-loop-condition': 2,
|
||||
'no-unneeded-ternary': [2, {
|
||||
'defaultAssignment': false
|
||||
}],
|
||||
'no-unreachable': 2,
|
||||
'no-unsafe-finally': 2,
|
||||
'no-unused-vars': [2, {
|
||||
'vars': 'all',
|
||||
'args': 'none'
|
||||
}],
|
||||
'no-useless-call': 2,
|
||||
'no-useless-computed-key': 2,
|
||||
'no-useless-constructor': 2,
|
||||
'no-useless-escape': 0,
|
||||
'no-whitespace-before-property': 2,
|
||||
'no-with': 2,
|
||||
'one-var': [2, {
|
||||
'initialized': 'never'
|
||||
}],
|
||||
'operator-linebreak': [2, 'after', {
|
||||
'overrides': {
|
||||
'?': 'before',
|
||||
':': 'before'
|
||||
}
|
||||
}],
|
||||
'padded-blocks': [2, 'never'],
|
||||
'quotes': [2, 'single', {
|
||||
'avoidEscape': true,
|
||||
'allowTemplateLiterals': true
|
||||
}],
|
||||
'semi': [2, 'never'],
|
||||
'semi-spacing': [2, {
|
||||
'before': false,
|
||||
'after': true
|
||||
}],
|
||||
'space-before-blocks': [2, 'always'],
|
||||
'space-before-function-paren': [2, 'never'],
|
||||
'space-in-parens': [2, 'never'],
|
||||
'space-infix-ops': 2,
|
||||
'space-unary-ops': [2, {
|
||||
'words': true,
|
||||
'nonwords': false
|
||||
}],
|
||||
'spaced-comment': [2, 'always', {
|
||||
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
||||
}],
|
||||
'template-curly-spacing': [2, 'never'],
|
||||
'use-isnan': 2,
|
||||
'valid-typeof': 2,
|
||||
'wrap-iife': [2, 'any'],
|
||||
'yield-star-spacing': [2, 'both'],
|
||||
'yoda': [2, 'never'],
|
||||
'prefer-const': 2,
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
||||
'object-curly-spacing': [2, 'always', {
|
||||
objectsInObjects: false
|
||||
}],
|
||||
'array-bracket-spacing': [2, 'never']
|
||||
}
|
||||
}
|
22
.gitignore
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# Build and Release Folders
|
||||
bin-debug/
|
||||
bin-release/
|
||||
[Oo]bj/
|
||||
[Bb]in/
|
||||
node_modules/
|
||||
node_modules_w/
|
||||
node_modules_l/
|
||||
.settings/
|
||||
.history/
|
||||
build/linux-unpacked/
|
||||
build/win-unpacked/
|
||||
# Executables
|
||||
*.swf
|
||||
*.air
|
||||
*.ipa
|
||||
*.apk
|
||||
*.deb
|
||||
*.exe
|
||||
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||
# should NOT be excluded as they contain compiler settings and other important
|
||||
# information for Eclipse / Flash Builder.
|
22
.hintrc
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"extends": [
|
||||
"development"
|
||||
],
|
||||
"hints": {
|
||||
"compat-api/css": [
|
||||
"default",
|
||||
{
|
||||
"ignore": [
|
||||
"user-select"
|
||||
]
|
||||
}
|
||||
],
|
||||
"meta-viewport": "off",
|
||||
"axe/text-alternatives": [
|
||||
"default",
|
||||
{
|
||||
"document-title": "off"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
12
.idea/4.0.iml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/4.0.iml" filepath="$PROJECT_DIR$/.idea/4.0.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
136
.idea/workspace.xml
generated
Normal file
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="84ab0b82-0020-4fff-b2b2-e16882dec538" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/build/builder-debug.yml" beforeDir="false" afterPath="$PROJECT_DIR$/build/builder-debug.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/build/builder-effective-config.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/build/builder-effective-config.yaml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/build/便携式应急指挥电子沙盘系统北斗定位+ Setup 4.0.0.exe.blockmap" beforeDir="false" afterPath="$PROJECT_DIR$/build/便携式应急指挥电子沙盘系统北斗定位+ Setup 4.0.0.exe.blockmap" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dist/electron/0.js" beforeDir="false" afterPath="$PROJECT_DIR$/dist/electron/0.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dist/electron/1.js" beforeDir="false" afterPath="$PROJECT_DIR$/dist/electron/1.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dist/electron/2.js" beforeDir="false" afterPath="$PROJECT_DIR$/dist/electron/2.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dist/electron/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/dist/electron/index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dist/electron/renderer.js" beforeDir="false" afterPath="$PROJECT_DIR$/dist/electron/renderer.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dist/electron/static/Vue/index.css" beforeDir="false" afterPath="$PROJECT_DIR$/dist/electron/static/Vue/index.css" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dist/electron/styles.css" beforeDir="false" afterPath="$PROJECT_DIR$/dist/electron/styles.css" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/renderer/api/gisAPI.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/api/gisAPI.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/renderer/assets/styles/global.css" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/assets/styles/global.css" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/renderer/components/situationEdit/cabin.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/components/situationEdit/cabin.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/renderer/components/situationEdit/element.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/components/situationEdit/element.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/renderer/components/situationEdit/rightMenu.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/components/situationEdit/rightMenu.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/renderer/components/treeNode.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/components/treeNode.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/renderer/views/dashboard/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/views/dashboard/index.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/yjearth4_0/static/db/database.ydb" beforeDir="false" afterPath="$PROJECT_DIR$/yjearth4_0/static/db/database.ydb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/yjearth4_0/static/log/2025-05-18.20250520000949487921.log.gz" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/yjearth4_0/static/log/2025-05-19.log" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/yjearth4_0/static/log/2025-05-20.log" beforeDir="false" afterPath="$PROJECT_DIR$/yjearth4_0/static/log/2025-05-20.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/yjearth4_0/yjearth4.exe" beforeDir="false" afterPath="$PROJECT_DIR$/yjearth4_0/yjearth4.exe" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"customColor": "",
|
||||
"associatedIndex": 4
|
||||
}</component>
|
||||
<component name="ProjectId" id="2phSiqEHBuQVa3iG8XBFKWgwiZW" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"dart.analysis.tool.window.visible": "false",
|
||||
"git-widget-placeholder": "master",
|
||||
"last_opened_file_path": "F:/workspace/code/zmgz",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"npm.dev.executor": "Run",
|
||||
"settings.editor.selected.configurable": "database.data.views.appearance",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="F:\workspace\fs-4.0\4.0\src\renderer\components\Events" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="npm.dev">
|
||||
<configuration name="build:win64" type="js.build_tools.npm" nameIsGenerated="true">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="run" />
|
||||
<scripts>
|
||||
<script value="build:win64" />
|
||||
</scripts>
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="dev" type="js.build_tools.npm" nameIsGenerated="true">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="run" />
|
||||
<scripts>
|
||||
<script value="dev" />
|
||||
</scripts>
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="npm.dev" />
|
||||
<item itemvalue="npm.build:win64" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-js-predefined-d6986cc7102b-e768b9ed790e-JavaScript-WS-243.21565.180" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="84ab0b82-0020-4fff-b2b2-e16882dec538" name="Changes" comment="" />
|
||||
<created>1733216946983</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1733216946983</updated>
|
||||
<workItem from="1733216949923" duration="17000" />
|
||||
<workItem from="1733216981171" duration="132000" />
|
||||
<workItem from="1733217128664" duration="175000" />
|
||||
<workItem from="1743403974699" duration="5174000" />
|
||||
<workItem from="1744606114651" duration="41000" />
|
||||
<workItem from="1745203773398" duration="246000" />
|
||||
<workItem from="1745204396343" duration="177000" />
|
||||
<workItem from="1746528365902" duration="29228000" />
|
||||
<workItem from="1747205309501" duration="8254000" />
|
||||
<workItem from="1747272323889" duration="42369000" />
|
||||
<workItem from="1747734020050" duration="21289000" />
|
||||
<workItem from="1747878633650" duration="320000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
</project>
|
36
.travis.yml
Normal file
@ -0,0 +1,36 @@
|
||||
osx_image: xcode8.3
|
||||
sudo: required
|
||||
dist: trusty
|
||||
language: c
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
- os: linux
|
||||
env: CC=clang CXX=clang++ npm_config_clang=1
|
||||
compiler: clang
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- "$HOME/.electron"
|
||||
- "$HOME/.cache"
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libgnome-keyring-dev
|
||||
- icnsutils
|
||||
before_install:
|
||||
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
|
||||
"$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
|
||||
| tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
|
||||
install:
|
||||
- nvm install 7
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
- source ~/.bashrc
|
||||
- npm install -g xvfb-maybe
|
||||
- yarn
|
||||
script:
|
||||
- yarn run build
|
||||
branches:
|
||||
only:
|
||||
- master
|
BIN
.vs/4.0/v17/.wsuo
Normal file
BIN
.vs/4.0/v17/Browse.VC.db
Normal file
37
.vs/4.0/v17/DocumentLayout.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "G:\\fs2\\yj\\4.0\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|G:\\fs2\\yj\\4.0\\src\\renderer\\views\\dashboard\\index.vue||{40D31677-CBC0-4297-A9EF-89D907823A98}",
|
||||
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\renderer\\views\\dashboard\\index.vue||{40D31677-CBC0-4297-A9EF-89D907823A98}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 0,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "index.vue",
|
||||
"DocumentMoniker": "G:\\fs2\\yj\\4.0\\src\\renderer\\views\\dashboard\\index.vue",
|
||||
"RelativeDocumentMoniker": "src\\renderer\\views\\dashboard\\index.vue",
|
||||
"ToolTip": "G:\\fs2\\yj\\4.0\\src\\renderer\\views\\dashboard\\index.vue",
|
||||
"RelativeToolTip": "src\\renderer\\views\\dashboard\\index.vue",
|
||||
"ViewState": "AQIAADwAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003491|",
|
||||
"WhenOpened": "2024-12-17T10:08:12.959Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
BIN
.vs/4.0/v17/workspaceFileList.bin
Normal file
3
.vs/ProjectSettings.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"CurrentProjectSetting": "\u65E0\u914D\u7F6E"
|
||||
}
|
12
.vs/VSWorkspaceState.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
"",
|
||||
"\\dist",
|
||||
"\\src",
|
||||
"\\src\\renderer",
|
||||
"\\src\\renderer\\views",
|
||||
"\\src\\renderer\\views\\dashboard"
|
||||
],
|
||||
"SelectedNode": "\\src\\renderer\\views\\dashboard\\index.vue",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
BIN
.vs/slnx.sqlite
Normal file
15
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
// 使用 IntelliSense 了解相关属性。
|
||||
// 悬停以查看现有属性的描述。
|
||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "针对 localhost 启动 Chrome",
|
||||
"url": "http://localhost:8080",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
33
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"editor.fontFamily": "Monaspace Argon, Consolas, 'Courier New', monospace",
|
||||
"files.autoSave": "afterDelay",
|
||||
"editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'calt', 'dlig'",
|
||||
"i18n-ally.localesPaths": [
|
||||
"node_modules-linux/cacache/locales",
|
||||
"node_modules-linux/dayjs/locale",
|
||||
"node_modules-linux/date-fns/locale",
|
||||
"node_modules-linux/eslint/messages",
|
||||
"node_modules-linux/moment/locale",
|
||||
"node_modules-linux/yargs/locales",
|
||||
"src/renderer/assets/i18n",
|
||||
"static/sdk/3rdparty/lang",
|
||||
"node_modules-linux/dayjs/esm/locale",
|
||||
"node_modules-linux/element-ui/lib/locale",
|
||||
"node_modules-linux/element-ui/src/locale",
|
||||
"node_modules-linux/highlight.js/lib/languages",
|
||||
"node_modules-linux/moment/src/locale",
|
||||
"src/renderer/assets/i18n/lang",
|
||||
"static/sdk/3rdparty/ueditor/lang",
|
||||
"node_modules-linux/@smallwei/avue/lib/locale",
|
||||
"node_modules-linux/element-ui/lib/locale/lang",
|
||||
"node_modules-linux/element-ui/lib/umd/locale",
|
||||
"node_modules-linux/element-ui/src/locale/lang",
|
||||
"node_modules-linux/moment/src/lib/locale",
|
||||
"node_modules-linux/@smallwei/avue/lib/locale/lang",
|
||||
"node_modules-linux/accessibility-developer-tools/lib/closure-library/closure/goog/i18n",
|
||||
"node_modules-linux/accessibility-developer-tools/lib/closure-library/closure/goog/locale",
|
||||
"node_modules-linux/accessibility-developer-tools/lib/closure-library/closure/goog/labs/i18n",
|
||||
"node_modules-linux/accessibility-developer-tools/lib/closure-library/closure/goog/testing/i18n"
|
||||
],
|
||||
"git.ignoreLimitWarning": true
|
||||
}
|
76
README.md
Normal file
@ -0,0 +1,76 @@
|
||||
# 20230911
|
||||
|
||||
1. nisi操作 用户自主选择安装路径,appId格式:dzsp_xinjiang_offline_Y_save
|
||||
|
||||
2. 修改地形右键菜单,添加地形的编辑页面
|
||||
|
||||
3. 增加readMe文件记录改动
|
||||
|
||||
4. 关闭系统设置框打开时的多个信息提示
|
||||
|
||||
5. 增加倾斜模型的重置坐标功能
|
||||
|
||||
6. 富文本文本编辑页面:点击取消时存在bug
|
||||
|
||||
# 20230912
|
||||
|
||||
1. 点标注高程更新测试
|
||||
2. 优化标注平移时,点击取消之后,平移相关UI仍存在并跟随鼠标箭头
|
||||
3. 完善点、线、面等基础标绘的删除操作
|
||||
4. 优化富文本的全屏按钮点击后显示不正常
|
||||
|
||||
# 20230913
|
||||
|
||||
1. 线标注平移之后,首尾相连和线段圆滑失效了,且状态按钮与状态不匹配
|
||||
2. 优化富文本编辑器
|
||||
3. 模型库的子菜单不匹配
|
||||
|
||||
# 20230914
|
||||
|
||||
1. 图层的层级操作
|
||||
2. 火焰编辑操作及UI界面
|
||||
3. 淹没分析定位;淹没分析暂停、继续模拟;淹没重置;
|
||||
4. 淹没分析重新打开,删掉上次模拟数据
|
||||
5. 设置淹没模拟的最低点
|
||||
6. 修复剖面分析保存为图片选项功能
|
||||
|
||||
# 20230915
|
||||
|
||||
1. 优化线段首尾相连和线段圆滑同时开启功能
|
||||
|
||||
2. 增加线段拟合长度
|
||||
|
||||
3. 优化测量结果在地球上的展示效果
|
||||
|
||||
4. 去掉工具中的淹没模拟
|
||||
|
||||
5. 增加授权码复制功能
|
||||
|
||||
6. 测试模型库创建,导入、加载
|
||||
|
||||
|
||||
|
||||
# 20230918
|
||||
|
||||
1. 增加富文本中表格的样式
|
||||
2. 创建富文本显示窗口
|
||||
3. 修改树形节点的选中方式
|
||||
4. 增加shift连选节点选中方式
|
||||
|
||||
# 20230919
|
||||
|
||||
1. 解决软件一打开时候的报错信息。
|
||||
2. 优化右键菜单,多选状态下的右键菜单
|
||||
3. 授权码复制成功的提示
|
||||
4. 线段切换平滑和首尾相连状态时更新线段长度
|
||||
5. 上传授权文件时限制文件类型
|
||||
|
||||
# 20230921
|
||||
|
||||
1. 添加竖体图标
|
||||
2. 优化点平移操作
|
||||
|
||||
# 20230922
|
||||
|
||||
1. 优化普通图标、竖体图标的选择、显示及存储
|
||||
2. 添加点标注闪烁事件
|
30
appveyor.yml
Normal file
@ -0,0 +1,30 @@
|
||||
version: 0.1.{build}
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
image: Visual Studio 2017
|
||||
platform:
|
||||
- x64
|
||||
|
||||
cache:
|
||||
- node_modules
|
||||
- '%APPDATA%\npm-cache'
|
||||
- '%USERPROFILE%\.electron'
|
||||
- '%USERPROFILE%\AppData\Local\Yarn\cache'
|
||||
|
||||
init:
|
||||
- git config --global core.autocrlf input
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 8 x64
|
||||
- choco install yarn --ignore-dependencies
|
||||
- git reset --hard HEAD
|
||||
- yarn
|
||||
- node --version
|
||||
|
||||
build_script:
|
||||
- yarn build
|
||||
|
||||
test: off
|
17
build/builder-debug.yml
Normal file
@ -0,0 +1,17 @@
|
||||
x64:
|
||||
firstOrDefaultFilePatterns:
|
||||
- '!**/node_modules'
|
||||
- '!build{,/**/*}'
|
||||
- '!build{,/**/*}'
|
||||
- dist/electron/**/*
|
||||
- package.json
|
||||
- '!**/*.{iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts,pdb}'
|
||||
- '!**/._*'
|
||||
- '!**/electron-builder.{yaml,yml,json,json5,toml}'
|
||||
- '!**/{.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore,.idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci,.yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log,appveyor.yml,.travis.yml,circle.yml,.nyc_output}'
|
||||
- '!.yarn{,/**/*}'
|
||||
- '!.editorconfig'
|
||||
- '!.yarnrc.yml'
|
||||
nodeModuleFilePatterns:
|
||||
- '**/*'
|
||||
- dist/electron/**/*
|
46
build/builder-effective-config.yaml
Normal file
@ -0,0 +1,46 @@
|
||||
directories:
|
||||
output: build
|
||||
buildResources: build
|
||||
extraFiles:
|
||||
- from: ./collada2gltf/
|
||||
to: ./collada2gltf
|
||||
- from: ./convert/
|
||||
to: ./convert
|
||||
- from: ./yjearth4_0/
|
||||
to: ./yjearth4_0
|
||||
- from: ./ffplay/
|
||||
to: ./ffplay
|
||||
- from: ./build/icons/
|
||||
to: ./icons
|
||||
productName: 便携式应急指挥电子沙盘系统北斗定位+
|
||||
appId: org.dzsp_yingjizhihuibeidou_offline_Y_save
|
||||
files:
|
||||
- filter:
|
||||
- dist/electron/**/*
|
||||
dmg:
|
||||
contents:
|
||||
- x: 410
|
||||
'y': 150
|
||||
type: link
|
||||
path: /Applications
|
||||
- x: 130
|
||||
'y': 150
|
||||
type: file
|
||||
mac:
|
||||
icon: build/icons/icon.icns
|
||||
win:
|
||||
icon: build/icons/81.ico
|
||||
linux:
|
||||
target: deb
|
||||
icon: build/icons/81.png
|
||||
desktop:
|
||||
Icon: /opt/便携式应急指挥电子沙盘系统北斗定位+/icons/81.png
|
||||
executableArgs:
|
||||
- '--no-sandbox'
|
||||
nsis:
|
||||
include: installer.nsh
|
||||
oneClick: false
|
||||
perMachine: true
|
||||
allowToChangeInstallationDirectory: true
|
||||
language: '2052'
|
||||
electronVersion: 13.6.9
|
BIN
build/icons/81.ico
Normal file
After Width: | Height: | Size: 73 KiB |
BIN
build/icons/81.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
build/icons/bianxie.ico
Normal file
After Width: | Height: | Size: 118 KiB |
BIN
build/icons/bianxie.png
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
build/icons/country.ico
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
build/icons/dazu.ico
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
build/icons/dazu.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
build/icons/earth.ico
Normal file
After Width: | Height: | Size: 184 KiB |
BIN
build/icons/earth.png
Normal file
After Width: | Height: | Size: 145 KiB |
BIN
build/icons/gongan.ico
Normal file
After Width: | Height: | Size: 264 KiB |
BIN
build/icons/gongan.png
Normal file
After Width: | Height: | Size: 648 KiB |
BIN
build/icons/jingwu.ico
Normal file
After Width: | Height: | Size: 100 KiB |
BIN
build/icons/jingwu.png
Normal file
After Width: | Height: | Size: 103 KiB |
BIN
build/icons/uav.ico
Normal file
After Width: | Height: | Size: 264 KiB |
BIN
build/icons/uav.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
collada2gltf/COLLADA2GLTF-bin.lib
Normal file
BIN
collada2gltf/COLLADA2GLTF-test.lib
Normal file
BIN
collada2gltf/COLLADA2GLTF.lib
Normal file
BIN
collada2gltf/COLLADABaseUtils.lib
Normal file
BIN
collada2gltf/COLLADAFramework.lib
Normal file
BIN
collada2gltf/COLLADASaxFrameworkLoader.lib
Normal file
BIN
collada2gltf/GLTF.lib
Normal file
BIN
collada2gltf/GeneratedSaxParser.lib
Normal file
BIN
collada2gltf/LibXML.lib
Normal file
BIN
collada2gltf/MathMLSolver.lib
Normal file
BIN
collada2gltf/ahoy.lib
Normal file
12
collada2gltf/converting
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"asset": {
|
||||
"generator": "COLLADA2GLTF",
|
||||
"version": "2.0"
|
||||
},
|
||||
"scenes": [
|
||||
{
|
||||
"nodes": []
|
||||
}
|
||||
],
|
||||
"scene": 0
|
||||
}
|
BIN
collada2gltf/draco.lib
Normal file
BIN
collada2gltf/draco_attributes.lib
Normal file
BIN
collada2gltf/draco_compression_attributes_dec.lib
Normal file
BIN
collada2gltf/draco_compression_attributes_enc.lib
Normal file
BIN
collada2gltf/draco_compression_attributes_pred_schemes_dec.lib
Normal file
BIN
collada2gltf/draco_compression_attributes_pred_schemes_enc.lib
Normal file
BIN
collada2gltf/draco_compression_decode.lib
Normal file
BIN
collada2gltf/draco_compression_encode.lib
Normal file
BIN
collada2gltf/draco_compression_mesh_dec.lib
Normal file
BIN
collada2gltf/draco_compression_mesh_enc.lib
Normal file
BIN
collada2gltf/draco_compression_point_cloud_dec.lib
Normal file
BIN
collada2gltf/draco_compression_point_cloud_enc.lib
Normal file
BIN
collada2gltf/draco_core.lib
Normal file
BIN
collada2gltf/draco_core_bit_coders.lib
Normal file
BIN
collada2gltf/draco_dec_config.lib
Normal file
BIN
collada2gltf/draco_enc_config.lib
Normal file
BIN
collada2gltf/draco_io.lib
Normal file
BIN
collada2gltf/draco_mesh.lib
Normal file
BIN
collada2gltf/draco_metadata.lib
Normal file
BIN
collada2gltf/draco_metadata_dec.lib
Normal file
BIN
collada2gltf/draco_metadata_enc.lib
Normal file
BIN
collada2gltf/draco_point_cloud.lib
Normal file
BIN
collada2gltf/draco_points_dec.lib
Normal file
BIN
collada2gltf/draco_points_enc.lib
Normal file
BIN
collada2gltf/draco_unity_plugin.lib
Normal file
BIN
collada2gltf/dracodec.lib
Normal file
BIN
collada2gltf/dracoenc.lib
Normal file
BIN
collada2gltf/expat.lib
Normal file
BIN
collada2gltf/gtest.lib
Normal file
BIN
collada2gltf/gtest.pdb
Normal file
BIN
collada2gltf/gtest_main.lib
Normal file
BIN
collada2gltf/gtest_main.pdb
Normal file
BIN
collada2gltf/pcre.lib
Normal file
46
config/app_config.js
Normal file
@ -0,0 +1,46 @@
|
||||
let name = 'dzsp_yingjizhihuibeidou_offline_Y_save'; //dzsp_yingjizhihuibeidou_offline_Y_save //dzsp_shijingjiangjin_offline_Y_save // dzsp_shijinghaidong_offline_Y_save //cc ,dzsp_yingjizhihuijunyong_offline_Y_save,dzsp_yingjizhihui_offline_Y_save,dzsp_shijing_offline_Y_save,dzsp_mudanyuan_offline_Y_save,'dzsp_wujingqinwu_offline_Y_save','dzsp_jilingongan_offline_Y_save'
|
||||
let productName = '便携式应急指挥电子沙盘系统北斗定位+'; //便携式应急指挥电子沙盘系统北斗定位+ //实景三维无人机智能巡检系统 // 海东市自然灾害风险普查可视化分析平台 //便携式应急指挥电子沙盘系统 //便携式应急指挥电子沙盘系统(军用版) //新版4.0//"实景三维电子沙盘系统";//"作战目标数字孪生仿真系统", "实景三维电子沙盘系统" ’牡丹园智慧景区管理系统‘,"武警勤务指挥电子沙盘系统”,"吉林省公安厅三维模型展示平台"
|
||||
let productName_tw = '便攜式應急指揮電子沙盤系統北斗定位+';
|
||||
let productName_en = 'Portable Emergency Command Electronic Sand Table System with Beidou Positioning+';
|
||||
let obj = {
|
||||
baseApi: "", // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
|
||||
PORT: 8099,
|
||||
head: "henan_head",
|
||||
name,
|
||||
version: "v4.0.0",
|
||||
productName,
|
||||
productName_tw,
|
||||
productName_en,
|
||||
build_productName: productName,
|
||||
build_win_icon: 'build/icons/81.ico',
|
||||
// 打包时,随安装包一起打包的路径earth
|
||||
build_extraFiles: [
|
||||
{
|
||||
from: "./collada2gltf/",
|
||||
to: "./collada2gltf",
|
||||
},
|
||||
{
|
||||
from: "./convert/",
|
||||
to: "./convert",
|
||||
},
|
||||
{
|
||||
from: "./yjearth4_0/",
|
||||
to: "./yjearth4_0",
|
||||
},
|
||||
{
|
||||
from: "./ffplay/",
|
||||
to: "./ffplay",
|
||||
},
|
||||
{
|
||||
from: "./build/icons/",
|
||||
to: "./icons",
|
||||
},
|
||||
],
|
||||
installUrl: "D:\\ProgramFiles\\" + name,
|
||||
build_appId: "org." + name,
|
||||
APPSECRET: "",
|
||||
appVersion: "earth",
|
||||
build_linux_desktop_Icon: "/opt/" + productName + "/icons/81.png",
|
||||
// isSetDefaultLayer:false,//软件初始是否加载默认数据
|
||||
};
|
||||
module.exports = obj;
|
16
config/dev.env.js
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
NODE_ENV: '"development"',
|
||||
BASE_API: '"http://127.0.0.1:8890/yjearth4.0"',
|
||||
HOST: '"http://127.0.0.1:8890"',
|
||||
// DOCKAIR: '"http://120.46.149.189:9136"',
|
||||
// DOCKSOCKETURL: '"ws://120.46.149.189:9136/websocket"',
|
||||
DOCKAIR: '"http://192.168.110.24:9136"',
|
||||
DOCKSOCKETURL: '"ws://192.168.110.24:9136/websocket"',
|
||||
REMOTEAIR: '"http://192.168.110.26:6789"',
|
||||
REMOTEAIR2: '"http://192.168.110.47:8000"',
|
||||
REMOTESOCKETURL: '"ws://192.168.110.26:6789/api/v1/ws"',
|
||||
// REMOTEAIR: '"http://121.37.119.107:6789"',
|
||||
// REMOTESOCKETURL: '"ws://121.37.119.107:6789/api/v1/ws"',
|
||||
// AI_URL: '"http://121.37.119.107:8000"',
|
||||
AI_URL: '"http://121.37.119.107:8000"',
|
||||
};
|
11
config/index.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
build: {
|
||||
env: require("./prod.env"),
|
||||
},
|
||||
dev: {
|
||||
removeElectronJunk: true,
|
||||
env: require("./dev.env"),
|
||||
},
|
||||
IsUseSysTitle: true,
|
||||
AppConfig: require("./app_config"),
|
||||
};
|