Skip to content

Commit 7819d46

Browse files
committed
initial commit
1 parent 45b19fb commit 7819d46

12 files changed

+273
-0
lines changed

.browserslistrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not ie <= 8

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[*]
2+
charset = utf-8
3+
indent_style = space
4+
5+
[*.{js,jsx,ts,tsx,vue}]
6+
indent_style = space
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VUE_APP_HOST=
2+
VUE_APP_MN_CONFIG_PREFIX=/api/rest_j/v1/
3+
VUE_APP_MN_CONFIG_SOCKET=/ws/api/entrance/connect

.eslintrc.js

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
'extends': [
7+
'plugin:vue/essential',
8+
'@vue/standard'
9+
],
10+
rules: {
11+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13+
'key-spacing': ['error'],
14+
'keyword-spacing': ['error'],
15+
'standard/no-callback-literal': 0,
16+
'handle-callback-err': 0,
17+
'no-return-assign': 0,
18+
'eqeqeq': 0,
19+
'comma-dangle': 0,
20+
'semi': 0,
21+
'space-before-function-paren': 0,
22+
'keyword-spacing': 0,
23+
'no-useless-escape': 0,
24+
'no-invalid-this': 0,
25+
'operator-linebreak': 0,
26+
'indent': [
27+
'error',
28+
4,
29+
{
30+
'SwitchCase': 1
31+
}
32+
],
33+
'no-const-assign': 'warn',
34+
'no-this-before-super': 'warn',
35+
'no-undef': 2,
36+
'no-unreachable': 'warn',
37+
'no-unused-vars': 'warn',
38+
'constructor-super': 'warn',
39+
'valid-typeof': 'warn',
40+
'one-var': 'warn',
41+
'max-len': 'off',
42+
'no-trailing-spaces': 'off',
43+
'require-jsdoc': 'warn',
44+
'camelcase': 'warn',
45+
'no-invalid-this': 'warn',
46+
'linebreak-style': 0,
47+
'vue/no-parsing-error': [2, {
48+
'x-invalid-end-tag': false,
49+
'invalid-first-character-of-tag-name': false
50+
}],
51+
'no-tabs': 0,
52+
'vue/html-indent': [2, 2, {
53+
'attribute': 1,
54+
'closeBracket': 0,
55+
'alignAttributesVertically': false
56+
}],
57+
'vue/require-default-prop': 0,
58+
'vue/component-name-in-template-casing': 0,
59+
'vue/html-closing-bracket-spacing': 0,
60+
'vue/html-closing-bracket-newline': 0,
61+
'vue/singleline-html-element-content-newline': 0,
62+
'vue/multiline-html-element-content-newline': 0,
63+
'vue/attributes-order': 0,
64+
'vue/html-self-closing': 0
65+
},
66+
parserOptions: {
67+
parser: 'babel-eslint'
68+
}
69+
}

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto
2+
* text eol=lf
3+
*.png binary
4+
*.gif binary

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
.vscode
3+
.cache
4+
.idea/
5+
6+
node_modules/
7+
dist/
8+
9+
.package-lock.json
10+
.env.development

babel.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/app'
4+
]
5+
}

mock.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module.exports = function (app, Mock) {
2+
}

package.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "dws",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint",
9+
"fix": "eslint --ext .js,.vue src --fix"
10+
},
11+
"dependencies": {
12+
"axios": "^0.16.2",
13+
"babel-polyfill": "^6.26.0",
14+
"core-js": "^2.6.5",
15+
"dexie": "^2.0.4",
16+
"dt-sql-parser": "^1.1.10",
17+
"highlight.js": "^9.12.0",
18+
"iview": "^3.4.1",
19+
"lodash": "^4.17.10",
20+
"md5": "^2.2.1",
21+
"mitt": "^1.1.3",
22+
"moment": "^2.22.2",
23+
"monaco-editor": "^0.15.1",
24+
"reconnecting-websocket": "^4.1.10",
25+
"sql-formatter": "^2.1.0",
26+
"vue": "^2.6.6",
27+
"vue-router": "^3.0.1",
28+
"vuescroll": "^4.10.5"
29+
},
30+
"devDependencies": {
31+
"@vue/cli-plugin-babel": "^3.8.0",
32+
"@vue/cli-plugin-eslint": "^3.8.0",
33+
"@vue/cli-service": "^3.8.0",
34+
"@vue/eslint-config-standard": "^4.0.0",
35+
"babel-eslint": "^10.0.1",
36+
"copy-webpack-plugin": "^4.5.2",
37+
"eslint": "^5.16.0",
38+
"eslint-config-google": "^0.13.0",
39+
"eslint-plugin-prettier": "^3.1.0",
40+
"eslint-plugin-vue": "^5.0.0",
41+
"monaco-editor-webpack-plugin": "^1.7.0",
42+
"node-sass": "^4.9.0",
43+
"sass-loader": "^7.1.0",
44+
"vue-cli-plugin-mockjs": "^0.1.3",
45+
"vue-template-compiler": "^2.6.10"
46+
}
47+
}

postcss.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: {
3+
autoprefixer: {}
4+
}
5+
}

vue.config.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// vue.config.js
2+
let CopyWebpackPlugin = require('copy-webpack-plugin')
3+
let path = require('path')
4+
module.exports = {
5+
configureWebpack: {
6+
resolve: {
7+
alias: {
8+
'vue$': 'vue/dist/vue.esm.js',
9+
'@': path.resolve(__dirname, './src'),
10+
'@js': path.resolve(__dirname, './src/js'),
11+
'@assets': path.resolve(__dirname, './src/assets')
12+
}
13+
},
14+
plugins: [
15+
// 忽略moment的locale文件夹,然后再main.js中手动加载 ‘moment/locale/zh-cn'
16+
// new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
17+
new CopyWebpackPlugin([{
18+
from: 'node_modules/monaco-editor/dev/vs',
19+
to: 'static/vs',
20+
}]),
21+
]
22+
},
23+
// 选项...
24+
pluginOptions: {
25+
mock: {
26+
entry: 'mock.js',
27+
power: false
28+
}
29+
}
30+
}

编译文档中文版.md

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# 编译文档中文版
2+
3+
## 启动流程
4+
5+
### 一、安装Node.js
6+
将Node.js下载到电脑本地,安装即可。下载地址:[http://nodejs.cn/download/](http://nodejs.cn/download/) (建议使用最新的稳定版本)
7+
**该步骤仅第一次使用时需要执行。**
8+
9+
### 二、安装项目
10+
在终端命令行中执行以下指令:
11+
12+
```
13+
git clone ${ipAddress}
14+
cd wds-ide
15+
npm install
16+
```
17+
18+
指令简介:
19+
1. 将项目包从远程仓库拉取到电脑本地:git clone ${ipAddress}
20+
2. 进入项目包根目录:cd wds-ide
21+
3. 安装项目所需依赖:npm install
22+
23+
**该步骤仅第一次使用时需要执行。**
24+
25+
### 三、配置
26+
您需要在代码中进行一些配置,如后端接口地址,后端socket地址等,如根目录下的.env.development文件:
27+
28+
```
29+
// 后端接口地址
30+
VUE_APP_MN_CONFIG_PREFIX=http://yourIp:yourPort/yourPath
31+
// 后端socket地址
32+
VUE_APP_MN_CONFIG_SOCKET=/yourSocketPath
33+
```
34+
35+
配置的具体解释可参考vue-cli官方文档:[环境变量和模式](https://cli.vuejs.org/zh/guide/mode-and-env.html#%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%92%8C%E6%A8%A1%E5%BC%8F)
36+
37+
### 打包项目
38+
您可以通过在终端命令行执行以下指令对项目进行打包,生成压缩后的代码:
39+
40+
```
41+
npm run build
42+
```
43+
44+
该指令成功执行后,项目根目录下会出现一个名叫 “dist” 的文件夹,该文件夹即为打包好的代码。您可以直接将该文件夹放进您的静态服务器中。
45+
46+
### 运行项目
47+
如果您想在本地浏览器上运行该项目并且改动代码查看效果,需要在终端命令行中执行以下指令:
48+
49+
```
50+
npm run serve
51+
```
52+
53+
在浏览器中(建议Chrome浏览器)通过链接访问应用:[http://localhost:8080/](http://localhost:8080/) .
54+
当您使用该方式运行项目时,您对代码的改动产生的效果,会动态体现在浏览器上。
55+
56+
**注意:因为项目采用前后端分离开发,所以在本地浏览器上运行时,需要对浏览器进行设置跨域才能访问后端接口:**
57+
58+
比如chrome浏览器:
59+
windows系统下的配置方式:
60+
1. 关闭所有的chrome浏览器。
61+
2. 新建一个chrome快捷方式,右键“属性”,“快捷方式”选项卡里选择“目标”,添加  --args --disable-web-security --user-data-dir=C:\MyChromeDevUserData
62+
3. 通过快捷方式打开chrome浏览器
63+
mac系统下的配置方式:
64+
在终端命令行执行以下命令(需要替换路径中的yourname,若还不生效请检查您机器上MyChromeDevUserData文件夹的位置并将路径复制到下面指令的“--user-data-dir=”后面)
65+
66+
```
67+
open -n /Applications/Google\ Chrome.app/ --args --disable-web-security --user-data-dir=/Users/yourname/MyChromeDevUserData/
68+
```
69+
70+
71+
### 常见问题
72+
73+
#### npm install无法成功
74+
如果遇到该情况,可以使用国内的淘宝npm镜像:
75+
76+
```
77+
npm install -g cnpm --registry=https://registry.npm.taobao.org
78+
```
79+
80+
接着,通过执行以下指令代替npm install指令
81+
82+
```
83+
cnpm install
84+
```
85+
86+
注意,项目启动和打包时,仍然可以使用npm run build和npm run serve指令

0 commit comments

Comments
 (0)