8000 update code · supercoderhawk/emr-processor@e2ef9e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2e 8000 f9e8

Browse files
update code
1 parent e667b46 commit e2ef9e8

File tree

17 files changed

+129
-51
lines changed

17 files changed

+129
-51
lines changed

.babelrc

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,33 @@
22
"comments": false,
33
"env": {
44
"main": {
5-
"presets": ["es2015", "stage-0"]
5+
"presets": [
6+
"es2015",
7+
"stage-0"
8+
]
69
},
710
"renderer": {
811
"presets": [
9-
["es2015", { "modules": false }],
12+
[
13+
"es2015",
14+
{
15+
"modules": false
16+
}
17+
],
1018
"stage-0"
1119
]
1220
}
1321
},
14-
"plugins": ["transform-runtime"]
22+
"plugins": [
23+
"transform-runtime",
24+
[
25+
"component",
26+
[
27+
{
28+
"libraryName": "element-ui",
29+
"styleLibraryName": "theme-default"
30+
}
31+
]
32+
]
33+
]
1534
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# emr-processor
22

3-
> process emr data
3+
> 中文电子病历标注工具
44
55
## Build Setup
66

app/index.ejs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>电子病历处理工具</title>
5+
<title>电子病历标注工具-v0.0.1</title>
66
<% if (htmlWebpackPlugin.options.appModules) { %>
77
<script>
88
require('module').globalPaths.push('<%= htmlWebpackPlugin.options.appModules.replace(/\\/g, '\\\\') %>')
99
</script>
1010
<% } %>
1111

12-
<% for (key in htmlWebpackPlugin.files.css) { %>
13-
<link href="<%= htmlWebpackPlugin.files.css[key] %>" rel="stylesheet">
14-
<% } %>
12+
1513
</head>
1614
<body>
1715
<div id="app"></div>

app/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"description": "process emr data",
55
"main": "./dist/main.js",
66
"dependencies": {
7+
"element-ui": "^1.3.7",
8+
"iview": "^2.0.0",
79
"json-formatter-js": "^1.3.0",
8-
"quill": "^1.2.6",
10+
"quill": "^1.3.1",
911
"request": "^2.81.0",
1012
"request-promise-native": "^1.0.4",
11-
"vue": "^2.3.4",
12-
"vue-checkbox-radio": "^0.5.1",
1313
"vue-electron": "^1.0.6",
14+
"vue-js-toggle-button": "^1.1.2",
1415
"vue-resource": "^1.3.4",
1516
"vue-router": "^2.7.0",
1617
"vue-strap": "github:wffranco/vue-strap",

app/src/renderer/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
relation,
2525
tabs,
2626
tab
27-
}
27+
},
28+
name: 'App'
2829
}
2930
</script>
3031

app/src/renderer/components/Converter.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<script>
2828
import {input} from 'vue-strap'
29-
import panel from './Converter/Panel'
29+
import panel from './Converter/Panel.vue'
3030
import jsonFormatter from '../utils/formatter'
3131
3232
import Vue from 'vue'
@@ -56,7 +56,6 @@
5656
}
5757
}
5858
}
59-
6059
</script>
6160

6261
<style>

app/src/renderer/components/Entity.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<template>
22
<div class="entity">
3+
<toggle-button :value="true" :labels="{checked: 'Foo', unchecked: 'Bar'}" :width="85" :height="35"/>
34
<vue-editor v-model="content" ref="editor" @select="selectContent"></vue-editor>
45
<list></list>
56
<contextmenu ref="menu" :left="left" :top="top" :display="display" v-on:selectCompleted="selectCompleted"></contextmenu>
67
</div>
78
</template>
89

910
<script>
11+
import Vue from 'vue'
12+
import ToggleButton from 'vue-js-toggle-button'
1013
import list from './Entity/List'
1114
import contextmenu from './Entity/Contextmenu'
1215
import VueEditor from './VueEditor'
1316
import {isRangeValid, getOffset} from '../utils/utils'
1417
18+
Vue.use(ToggleButton)
19+
1520
export default{
1621
components: {
1722
list,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<div>
3+
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: 'entity-relation'
10+
}
11+
</script>
12+
13+
<style>
14+
15+
</style>

app/src/renderer/components/Relation.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<template>
2-
<p>hello</p>
2+
<relation-panel></relation-panel>
33
</template>
44

55
<script>
6-
export default {
7-
name: 'relation'
8-
}
6+
import RelationPanel from './Relation/RelationPanel'
7+
export default {
8+
components: {RelationPanel},
9+
name: 'relation'
10+
}
911
</script>
1012

1113
<style>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<template>
2+
<div>
3+
<el-tag color="#3df" class="tag-pointer">标签二</el-tag>
4+
<div>women<el-tag color="#3df" class="tag-pointer">标签二</el-tag>我们</div>
5+
<div v-html="htmlContent"></div>
6+
</div>
7+
</template>
8+
9+
<script>
10+
import {Tag} from 'element-ui'
11+
// import Tag from 'iview/src/components/tag'
12+
// import 'iview/dist/styles/iview.css'
13+
import 'element-ui/lib/theme-default/index.css'
14+
15+
export default {
16+
components: {
17+
'el-tag': Tag
18+
},
19+
data () {
20+
return {
21+
content: '这是一个电子病历啦啦啦啦啦',
22+
htmlContent: '<div>women<el-tag color="#3df" class="tag-pointer">标签二</el-tag>我们</div>'
23+
}
24+
},
25+
name: 'relation-panel'
26+
}
27+
</script>
28+
29+
<style>
30+
.tag-pointer{
31+
cursor: pointer;
32+
}
33+
</style>

app/src/renderer/components/VueEditor.vue

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="quillWrapper">
3-
<div ref="quillContainer" :id="id"></div>
3+
<div ref="quillContainer" :id="id" @mouseup.native="mouseup" @mousedown.native="mousedown($event)"></div>
44
</div>
55
</template>
66
<script>
@@ -32,7 +32,6 @@
3232
3333
mounted () {
3434
this.initializeVue2Editor()
35-
this.handleUpdatedEditor()
3635
},
3736
3837
watch: {
@@ -76,20 +75,25 @@
7675
} else {
7776
}
7877
})
78+
this.quill.on('onmouseup', function () {
79+
console.log('aaak')
80+
})
81+
this.quill.on('onmousedown', function () {
82+
console.log('bbbb')
83+
})
84+
},
85+
mouseup () {
86+
console.log('aaa')
87+
},
88+
mousedown (event) {
89+
event.preventDefault()
7990
},
80-
8191
setEditorElement () {
8292
this.editor = document.querySelector(`#${this.id} .ql-editor`)
8393
},
8494
8595
checkForInitialContent () {
8696
this.editor.innerHTML = this.value || ''
87-
},
88-
89-
handleUpdatedEditor () {
90-
this.quill.on('text-change', () => {
91-
this.$emit('input', this.editor.innerHTML)
92-
})
9397
}
9498
}
9599
}

app/src/renderer/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Vue.use(Electron)
88
Vue.use(Resource)
99
Vue.config.debug = true
1010

11-
/* eslint-disable no-new */
1211
new Vue({
13-
el: '#app',
1412
...App
15-
})
13+
}).$mount('#app')

app/src/renderer/store/mutation-types.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export const ADD_ITEM = 'ADD_ITEM'
2+
export const REMOVE_ITEM = 'REMOVE_ITEM'
3+
export const RESORT_ITEM = 'RESORT_ITEM'
24
export const REMOVE_ALL_RECORDS = 'REMOVE_ALL_RECORDS'
35
export const ADD_RECORD = 'ADD_RECORD'
46
export const ADD_AMOUNT = 'ADD_AMOUNT'

app/src/renderer/utils/constant.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ export const ITEM = {
1212

1313
export const LIST = {
1414
INIT: [
15-
{
16-
id: 1,
17-
value: '我',
18-
type: '11',
19-
start: 0,
20-
end: 1
21-
}, {
22-
id: 2,
23-
value: '你',
24-
type: '22',
25-
start: 3,
26-
end: 4
27-
}
2815
]
2916
}
3017

@@ -40,6 +27,6 @@ export const CONVERTER = {
4027
{val: 0, label: '分词'},
4128
{val: 1, label: 'JSON'}
4229
],
43-
KEY: '316WbbEsHIKpEXJN2eT8iQGoEVmQw2jL', // uk
30+
KEY: '316WbbEsHIKpEXJN2eT8iQGoEVmQw2jL', // uk
4431
SIGN: 'CtbwqqzoTHFzbBN7A1mjL1Wd77WHjgHI' // ut
4532
}

app/src/renderer/utils/utils.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ export function isRangeValid (start, end, items) {
1313

1414
return end < items[beforeLength].start
1515
}
16+
export function getOffset (element) {
17+
let top = 0
18+
let left = 0
19+
do {
20+
top += element.offsetTop || 0
21+
left += element.offsetLeft || 0
22+
element = element.offsetParent
23+
} while (element)
24+
25+
return {
26+
top: top,
27+
left: left
28+
}
29+
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"babel-core": "^6.25.0",
5757
"babel-eslint": "^7.2.3",
5858
"babel-loader": "^7.1.1",
59+
"babel-plugin-component": "^0.10.0",
5960
"babel-plugin-transform-runtime": "^6.8.0",
6061
"babel-preset-es2015": "^6.24.1",
6162
"babel-preset-stage-0": "^6.24.1",
@@ -66,18 +67,18 @@
6667
"css-loader": "^0.28.4",
6768
"del": "^3.0.0",
6869
"devtron": "^1.1.0",
69-
"electron": "^1.7.4",
70-
"electron-builder": "^19.11.1",
70+
"electron": "^1.7.5",
71+
"electron-builder": "^19.16.2",
7172
"electron-debug": "^1.2.0",
7273
"electron-devtools-installer": "^2.2.0",
7374
"electron-rebuild": "^1.5.11",
7475
"eslint": "^4.1.1",
75-
"eslint-plugin-import":"^2.6.1",
76-
"eslint-plugin-node":"^5.1.0",
7776
"eslint-config-standard": "^10.2.1",
7877
"eslint-friendly-formatter": "^3.0.0",
7978
"eslint-loader": "^1.8.0",
8079
"eslint-plugin-html": "^3.0.0",
80+
"eslint-plugin-import": "^2.6.1",
81+
"eslint-plugin-node": "^5.1.0",
8182
"eslint-plugin-promise": "^3.4.0",
8283
"eslint-plugin-standard": "^3.0.1",
8384
"extract-text-webpack-plugin": "^2.1.2",
@@ -90,12 +91,11 @@
9091 48DA
"style-loader": "^0.18.2",
9192
"tree-kill": "^1.1.0",
9293
"url-loader": "^0.5.9",
93-
"vue": "^2.3.4",
9494
"vue-hot-reload-api": "^2.0.7",
9595
"vue-html-loader": "^1.2.2",
9696
"vue-loader": "^13.0.0",
9797
"vue-style-loader": "^3.0.1",
98-
"vue-template-compiler": "^2.3.4",
98+
"vue-template-compiler": "^2.4.1",
9999
"webpack": "^2.6.1",
100100
"webpack-dev-server": "^2.5.0"
101101
},

webpack.renderer.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ let rendererConfig = {
117117
},
118118
resolve: {
119119
alias: {
120-
'vue$': path.join(__dirname, 'node_modules/vue/dist/vue.esm.js'),
120+
'vue$': path.join(__dirname, './app/node_modules/vue/dist/vue.esm.js'),
121121
'renderer': path.join(__dirname, 'app/src/renderer')
122122
},
123123
extensions: ['.js', '.vue', '.json', '.css', '.node'],

0 commit comments

Comments
 (0)
0