Skip to content

Commit ee039c4

Browse files
author
jxw
committed
update reademe
1 parent 453f37a commit ee039c4

File tree

3 files changed

+69
-67
lines changed

3 files changed

+69
-67
lines changed

README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
1-
# vue-jdlstudio
1+
# vue-jdlstudio - jdlstudio for Vue , JDL Studio is an online JHipster Domain Language visual editor
2+
3+
[JDL-Studio](https://github.com/jhipster/jdl-studio)
4+
5+
Hello, this is JDL-Studio with Vue, an online tool for drawing UML diagrams for JHipster based on the JDL syntax. It tries to keep its syntax visually as close as possible to the generated UML diagram without resorting to ASCII drawings.
6+
7+
- [Vue](https://github.com/vuejs/vue)
8+
- [ElementUI](https://github.com/ElementUI)
9+
- [nomnoml](https://github.com/skanaar/nomnoml)
10+
- [dagre](https://github.com/cpettitt/dagre)
11+
- [lodash](http://lodash.com)
12+
- [Jquery](https://jquery.com/)
13+
- [codemirror](https://codemirror.net/)
14+
- [solarized](http://ethanschoonover.com/solarized)
15+
- [Linearicons](https://linearicons.com/free)
16+
17+
# Features
18+
19+
- 官方版基本功能移植到 vue-jdlstudio 组件
20+
- 增加 JDLObject 表单编辑器组件
21+
- 移植 jhipster-Online 前端功能到执行器组件
22+
- 移植 Jhipster-Online 后端服务到 node.js
23+
24+
# Build
225

326
```
427
npm run build-bundle

src/components/JdIImportor/JdIImportor.vue

-61
This file was deleted.

src/components/JdlStudio.vue

+45-5
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@
1414
v-bind:style="{width:pannerStyle.w}"
1515
></div>
1616
<div class="tools">
17-
<JdIImportor />
18-
<JdlFormEditor />
19-
<JdlExeutor />
17+
<a href="#" class="upload-input">
18+
<i class="el-icon-upload"></i>
19+
<input type="file" @change="importHandle" />
20+
</a>
2021
<a href="javascript:void(0);" @click="downHandle">
2122
<i class="el-icon-download"></i>
2223
</a>
2324
<a href="javascript:void(0);" @click="delHandle">
2425
<i class="el-icon-delete"></i>
2526
</a>
27+
<JdlFormEditor />
28+
<JdlExeutor />
2629
</div>
2730
</div>
2831
</template>
@@ -49,13 +52,11 @@ import "codemirror/addon/edit/matchbrackets";
4952
import "codemirror/addon/hint/show-hint";
5053
import "codemirror/addon/scroll/simplescrollbars";
5154
52-
import JdIImportor from "./JdIImportor/JdIImportor.vue";
5355
import JdlFormEditor from "./JdlFormEditor/JdlFormEditor.vue";
5456
import JdlExeutor from "./JdlExeutor/JdlExeutor.vue";
5557
export default {
5658
name: "jdlstudio",
5759
components: {
58-
JdIImportor,
5960
JdlFormEditor,
6061
JdlExeutor
6162
},
@@ -213,6 +214,25 @@ export default {
213214
},
214215
handleClose() {
215216
this.settingdialogVisiable = false;
217+
},
218+
importHandle(event) {
219+
let file = event.target.files[0];
220+
var reader = new FileReader();
221+
reader.readAsText(file, "UTF-8");
222+
reader.onload = e => {
223+
let data = e.currentTarget.result;
224+
this.$store.commit("setFilename", file.name);
225+
if (_.endsWith(file.name, ".json")) {
226+
console.log(data);
227+
}
228+
if (_.endsWith(file.name, ".jdl")) {
229+
this.$store.commit("setEditorValue", data);
230+
//data->jdlobject
231+
data = data.replace(/\/\/[^\n\r]*/gm, "");
232+
let jdlObject = parser.parse(data);
233+
this.$store.commit("setJdlObject", jdlObject);
234+
}
235+
};
216236
}
217237
}
218238
};
@@ -377,4 +397,24 @@ export default {
377397
font-size: 25px;
378398
margin: 0 10px;
379399
}
400+
.el-upload-list {
401+
display: none;
402+
}
403+
.upload-input {
404+
position: relative;
405+
padding: 2px 2px;
406+
overflow: hidden;
407+
text-decoration: none;
408+
text-indent: 0;
409+
line-height: 20px;
410+
}
411+
.upload-input input {
412+
position: absolute;
413+
font-size: 100px;
414+
left: 0;
415+
top: 0;
416+
width: 20px;
417+
height: 20px;
418+
opacity: 0;
419+
}
380420
</style>

0 commit comments

Comments
 (0)