Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
karname-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Reza Sahebgharan
karname-ui
Commits
c6e11e77
Commit
c6e11e77
authored
Dec 23, 2019
by
Reza Sahebgharan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(devicemap ui and back): write devicemap ui and back services
parent
3d2520d4
Pipeline
#740
passed with stages
in 45 minutes and 33 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
389 additions
and
14 deletions
+389
-14
DeviceMap.vue
client/components/DeviceMap.vue
+290
-7
devicemap.js
imports/api/collections/devicemap.js
+14
-0
brands.js
imports/api/methods/brands.js
+0
-1
devicemap.js
imports/api/methods/devicemap.js
+67
-0
hisLink.js
imports/api/methods/hisLink.js
+6
-6
devicemap.js
imports/api/server/publications/devicemap.js
+10
-0
main.js
server/main.js
+2
-0
No files found.
client/components/DeviceMap.vue
View file @
c6e11e77
<
template
>
<
template
>
<div>
<v-container>
DeviceMap
<v-snackbar
color=
"primary"
v-model=
"snackbar"
top
>
</div>
Are You Sure?
<v-btn
color=
"pink"
@
click=
"deleteDevicemap"
>
yes
</v-btn>
<v-btn
color=
"pink"
@
click=
"snackbar = false"
>
no
</v-btn>
</v-snackbar>
<v-snackbar
color=
"primary"
v-model=
"alertSnackbar"
:timeout=
"2000"
>
{{
alertText
}}
</v-snackbar>
<v-dialog
v-model=
"dialog"
max-width=
"600px"
>
<v-card>
<v-card-title>
<span
class=
"headline"
>
{{
newOrEdit
==
"new"
?
"New"
:
"Edit"
}}
DeviceMap
</span>
</v-card-title>
<v-card-text>
<v-container>
<div>
<v-progress-linear
:active=
"loading"
:indeterminate=
"loading"
color=
"cyan lighten-2"
></v-progress-linear>
</div>
<v-row
dense
>
<v-col
cols=
"12"
md=
"6"
>
<v-text-field
label=
"Group Name"
v-model=
"DevicemapForm.GroupName"
></v-text-field>
</v-col>
<v-col
cols=
"12"
md=
"6"
>
<v-text-field
label=
"Code in HIS"
v-model=
"DevicemapForm.CodeInHIS"
></v-text-field>
</v-col>
<v-col
cols=
"12"
md=
"6"
>
<v-autocomplete
:items=
"itemsOfClients"
label=
"Code in Pacs"
v-model=
"selectedClient"
item-text=
"Caption"
item-value=
"Caption"
return-object
></v-autocomplete>
</v-col>
<v-col
cols=
"12"
md=
"6"
>
<v-autocomplete
:items=
"itemsOfHisLink"
label=
"HIS Name"
v-model=
"selectedHisLink"
item-text=
"Name"
item-value=
"Name"
return-object
></v-autocomplete>
</v-col>
<v-col
cols=
"12"
md=
"6"
>
<v-text-field
label=
"Modality"
type=
"text"
v-model=
"DevicemapForm.Modality"
></v-text-field>
</v-col>
<v-col
cols=
"12"
md=
"6"
>
<v-text-field
label=
"Max Length"
type=
"number"
v-model=
"DevicemapForm.MaxLen"
></v-text-field>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color=
"blue darken-1"
text
@
click=
"createOrEditDevicemap"
>
{{
newOrEdit
==
"new"
?
"Create"
:
"Edit"
}}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-row
justify=
"center"
dense
class=
"flex-wrap mb-6"
>
<v-col
md=
"7"
lg=
"6"
cols=
"12"
>
<v-card
tile
>
<v-card-actions>
<v-row
style=
"margin:auto"
>
<v-col
cols=
"12"
class=
"d-flex justify-center align-center flex-wrap"
>
<v-btn
color=
"rgb(94, 181, 177,.85)"
class=
"white--text"
@
click=
"openNewDialog"
>
<strong>
{{
$t
(
"HISLink.newBtn"
)
}}
</strong>
</v-btn>
<v-btn
color=
"rgb(94, 181, 177,.85)"
class=
"white--text"
@
click=
"openEditDialog"
>
<strong>
{{
$t
(
"HISLink.editBtn"
)
}}
</strong>
</v-btn>
<v-btn
color=
"rgb(94, 181, 177,.85)"
class=
"white--text"
@
click=
"deleteSnackbar"
>
<strong>
{{
$t
(
"HISLink.deleteBtn"
)
}}
</strong>
</v-btn>
</v-col>
</v-row>
</v-card-actions>
</v-card>
</v-col>
</v-row>
<v-row
justify=
"center"
dense
class=
"flex-wrap mt-6"
>
<v-col
md=
"9"
cols=
"12"
>
<v-data-table
v-model=
"selectedItemInTable"
:headers=
"headerOfTable"
:items=
"itemsOfTable"
item-key=
"_id"
class=
"elevation-1"
style=
"width:100%"
fixed-header
hide-default-footer
disable-pagination
show-select
single-select
:sort-by
.
sync=
"sortByTable"
:sort-desc
.
sync=
"sortDescTable"
height=
"73vh"
@
click:row=
"clickRow"
></v-data-table>
</v-col>
</v-row>
</v-container>
</
template
>
</
template
>
<
script
>
<
script
>
import
Devicemap
from
"../../imports/api/collections/devicemap.js"
;
import
HisLink
from
"../../imports/api/collections/hislink.js"
;
import
Client
from
"../../imports/api/collections/clients.js"
;
import
{
Meteor
}
from
"meteor/meteor"
;
export
default
{
export
default
{
data
()
{
}
return
{
</
script
>
sortByTable
:
undefined
,
<
style
scoped
>
sortDescTable
:
undefined
,
selectedItemInTable
:
[],
dialog
:
false
,
newOrEdit
:
""
,
selectedClient
:
undefined
,
selectedHisLink
:
undefined
,
DevicemapForm
:
{
GroupName
:
""
,
CodeInHIS
:
""
,
CodeInPacs
:
""
,
Modality
:
""
,
HisLinkId
:
""
,
HisName
:
""
,
MaxLen
:
""
,
_id
:
""
},
snackbar
:
false
,
alertSnackbar
:
false
,
alertText
:
""
,
loading
:
false
};
},
computed
:
{
headerOfTable
()
{
let
headers
=
[
"GroupName"
,
"CodeInHIS"
,
"CodeInPacs"
,
"Modality"
,
"HisName"
];
let
headerObjs
=
[];
for
(
let
header
of
headers
)
{
headerObjs
.
push
({
text
:
header
,
value
:
header
,
class
:
"text-center"
,
width
:
180
});
}
return
headerObjs
;
},
itemsOfTable
()
{
this
.
loading
=
false
;
this
.
dialog
=
false
;
if
(
this
.
devicemaps
&&
this
.
devicemaps
.
length
>
0
)
{
return
this
.
devicemaps
;
}
return
[];
},
itemsOfClients
()
{
if
(
this
.
clients
&&
this
.
clients
.
length
>
0
)
{
return
this
.
clients
;
}
return
[];
},
itemsOfHisLink
()
{
if
(
this
.
hislink
&&
this
.
hislink
.
length
>
0
)
{
return
this
.
hislink
;
}
return
[];
}
},
methods
:
{
clickRow
(
item
)
{
if
(
this
.
selectedItemInTable
.
length
>
0
&&
this
.
selectedItemInTable
[
0
].
_id
==
item
.
_id
)
{
this
.
selectedItemInTable
=
[];
}
else
{
this
.
selectedItemInTable
=
[];
this
.
selectedItemInTable
=
[
item
];
}
},
openNewDialog
()
{
debugger
;
for
(
let
prop
in
this
.
DevicemapForm
)
{
this
.
$set
(
this
.
DevicemapForm
,
prop
,
""
);
}
this
.
$set
(
this
.
DevicemapForm
,
"_id"
,
""
);
this
.
newOrEdit
=
"new"
;
this
.
dialog
=
true
;
},
openEditDialog
()
{
if
(
this
.
selectedItemInTable
.
length
==
0
)
{
this
.
alertSnackbarMethod
(
"please select one of devicemaps"
);
return
;
}
for
(
let
prop
in
this
.
DevicemapForm
)
{
if
(
this
.
selectedItemInTable
[
0
][
prop
]
!=
undefined
)
{
this
.
$set
(
this
.
DevicemapForm
,
prop
,
this
.
selectedItemInTable
[
0
][
prop
]
);
}
}
this
.
$set
(
this
.
DevicemapForm
,
"_id"
,
this
.
selectedItemInTable
[
0
][
"_id"
]);
this
.
newOrEdit
=
"edit"
;
this
.
dialog
=
true
;
},
createOrEditDevicemap
()
{
this
.
loading
=
true
;
let
me
=
this
;
if
(
this
.
newOrEdit
==
"new"
)
{
debugger
if
(
this
.
selectedClient
!=
undefined
&&
this
.
selectedClient
!=
null
)
this
.
DevicemapForm
.
CodeInPacs
=
this
.
selectedClient
.
Caption
;
if
(
this
.
selectedHisLink
!=
undefined
&&
this
.
selectedHisLink
!=
null
)
{
this
.
DevicemapForm
.
HisLinkId
=
this
.
selectedHisLink
.
_id
;
this
.
DevicemapForm
.
HisName
=
this
.
selectedHisLink
.
Name
;
}
Meteor
.
call
(
"createDevicemap"
,
this
.
DevicemapForm
,
function
()
{
// me.dialog = false;
});
}
if
(
this
.
newOrEdit
==
"edit"
)
{
debugger
if
(
this
.
selectedClient
!=
undefined
&&
this
.
selectedClient
!=
null
)
this
.
DevicemapForm
.
CodeInPacs
=
this
.
selectedClient
.
Caption
;
if
(
this
.
selectedHisLink
!=
undefined
&&
this
.
selectedHisLink
!=
null
)
{
this
.
DevicemapForm
.
HisLinkId
=
this
.
selectedHisLink
.
_id
;
this
.
DevicemapForm
.
HisName
=
this
.
selectedHisLink
.
Name
;
}
Meteor
.
call
(
"editDevicemap"
,
this
.
DevicemapForm
,
function
()
{
// me.dialog = false;
me
.
selectedItemInTable
=
[];
});
}
},
deleteDevicemap
()
{
let
me
=
this
;
this
.
snackbar
=
false
;
if
(
this
.
selectedItemInTable
.
length
==
0
)
{
me
.
alertSnackbarMethod
(
"please select one of devicemaps"
);
return
;
}
let
deleteHislink
=
{};
deleteHislink
.
_id
=
this
.
selectedItemInTable
[
0
][
"_id"
];
Meteor
.
call
(
"deleteDevicemap"
,
deleteHislink
,
function
()
{
me
.
alertSnackbarMethod
(
"Devicemap has been deleted"
);
});
},
deleteSnackbar
()
{
this
.
snackbar
=
true
;
},
alertSnackbarMethod
(
text
)
{
this
.
alertText
=
text
;
this
.
alertSnackbar
=
true
;
}
},
meteor
:
{
$subscribe
:
{
devicemaps
:
[],
hislink
:
[],
clients
:
[]
},
devicemaps
()
{
return
Devicemap
.
find
({}).
fetch
();
},
hislink
()
{
return
HisLink
.
find
({}).
fetch
();
},
clients
()
{
return
Client
.
find
({}).
fetch
();
}
}
};
</
script
>
<
style
>
</
style
>
</
style
>
\ No newline at end of file
imports/api/collections/devicemap.js
0 → 100644
View file @
c6e11e77
import
{
Mongo
}
from
'meteor/mongo'
;
import
{
Meteor
}
from
'meteor/meteor'
;
let
DeviceMap
;
if
(
Meteor
.
isClient
||
Meteor
.
isCordova
)
{
DeviceMap
=
new
Mongo
.
Collection
(
'DeviceMap'
)
}
if
(
Meteor
.
isServer
)
{
DeviceMap
=
new
Mongo
.
Collection
(
'DeviceMap'
)
}
export
default
DeviceMap
;
\ No newline at end of file
imports/api/methods/brands.js
View file @
c6e11e77
...
@@ -9,7 +9,6 @@ Meteor.methods({
...
@@ -9,7 +9,6 @@ Meteor.methods({
if
(
this
.
userId
)
{
if
(
this
.
userId
)
{
try
{
try
{
const
result
=
HTTP
.
call
(
'GET'
,
`
${
Meteor
.
settings
.
worklistUrl
}
/HISIntegration.svc/rest/GetHISBrandsRest`
);
const
result
=
HTTP
.
call
(
'GET'
,
`
${
Meteor
.
settings
.
worklistUrl
}
/HISIntegration.svc/rest/GetHISBrandsRest`
);
// const result = HTTP.call("GET", "http://192.168.2.105/Broker/HISIntegration.svc/rest/GetHISBrandsRest");
let
brandsHttpResult
=
JSON
.
parse
(
result
.
content
);
let
brandsHttpResult
=
JSON
.
parse
(
result
.
content
);
Brands
.
remove
({});
Brands
.
remove
({});
brandsHttpResult
.
Items
.
forEach
((
brand
)
=>
{
brandsHttpResult
.
Items
.
forEach
((
brand
)
=>
{
...
...
imports/api/methods/devicemap.js
0 → 100644
View file @
c6e11e77
import
{
Meteor
}
from
'meteor/meteor'
;
import
{
check
}
from
'meteor/check'
;
import
{
HTTP
}
from
'meteor/http'
;
Meteor
.
methods
({
'createDevicemap'
(
item
)
{
this
.
unblock
();
if
(
this
.
userId
)
{
try
{
let
options
=
{
data
:
item
,
headers
:
{
'content-type'
:
'application/json'
,
'Accept'
:
'application/json'
}
}
const
result
=
HTTP
.
call
(
"POST"
,
`
${
Meteor
.
settings
.
databusUrl
}
/devicemap/create`
,
options
);
return
true
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
);
return
false
;
}
}
},
"editDevicemap"
(
item
)
{
this
.
unblock
();
if
(
this
.
userId
)
{
try
{
let
options
=
{
data
:
item
,
headers
:
{
'content-type'
:
'application/json'
,
'Accept'
:
'application/json'
}
}
const
result
=
HTTP
.
call
(
"POST"
,
`
${
Meteor
.
settings
.
databusUrl
}
/devicemap/update`
,
options
);
return
true
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
);
return
false
;
}
}
},
"deleteDevicemap"
(
item
)
{
this
.
unblock
();
if
(
this
.
userId
)
{
try
{
let
options
=
{
data
:
item
,
headers
:
{
'content-type'
:
'application/json'
,
'Accept'
:
'application/json'
}
}
const
result
=
HTTP
.
call
(
"POST"
,
`
${
Meteor
.
settings
.
databusUrl
}
/devicemap/delete`
,
options
);
return
true
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
);
return
false
;
}
}
},
});
\ No newline at end of file
imports/api/methods/hisLink.js
View file @
c6e11e77
...
@@ -22,7 +22,7 @@ Meteor.methods({
...
@@ -22,7 +22,7 @@ Meteor.methods({
return
true
return
true
}
catch
(
e
)
{
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
)
console
.
log
(
e
)
;
return
false
;
return
false
;
}
}
}
}
...
@@ -45,7 +45,7 @@ Meteor.methods({
...
@@ -45,7 +45,7 @@ Meteor.methods({
return
true
return
true
}
catch
(
e
)
{
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
)
console
.
log
(
e
)
;
return
false
;
return
false
;
}
}
}
}
...
@@ -67,7 +67,7 @@ Meteor.methods({
...
@@ -67,7 +67,7 @@ Meteor.methods({
return
true
return
true
}
catch
(
e
)
{
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
)
console
.
log
(
e
)
;
return
false
;
return
false
;
}
}
}
}
...
@@ -89,7 +89,7 @@ Meteor.methods({
...
@@ -89,7 +89,7 @@ Meteor.methods({
return
true
return
true
}
catch
(
e
)
{
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
)
console
.
log
(
e
)
;
return
false
;
return
false
;
}
}
}
}
...
@@ -111,7 +111,7 @@ Meteor.methods({
...
@@ -111,7 +111,7 @@ Meteor.methods({
return
true
return
true
}
catch
(
e
)
{
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
)
console
.
log
(
e
)
;
return
false
;
return
false
;
}
}
}
}
...
@@ -133,7 +133,7 @@ Meteor.methods({
...
@@ -133,7 +133,7 @@ Meteor.methods({
return
result
;
return
result
;
}
catch
(
e
)
{
}
catch
(
e
)
{
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
console
.
log
(
e
)
console
.
log
(
e
)
;
throw
new
Meteor
.
Error
(
500
,
"error"
);
throw
new
Meteor
.
Error
(
500
,
"error"
);
}
}
}
}
...
...
imports/api/server/publications/devicemap.js
0 → 100644
View file @
c6e11e77
import
DeviceMap
from
'../../collections/devicemap'
;
import
{
check
}
from
'meteor/check'
;
Meteor
.
publish
(
"devicemaps"
,
function
()
{
if
(
!
this
.
userId
)
{
return
this
.
ready
();
}
return
DeviceMap
.
find
({});
});
\ No newline at end of file
server/main.js
View file @
c6e11e77
...
@@ -6,12 +6,14 @@ import '../imports/api/methods/devicecode.js';
...
@@ -6,12 +6,14 @@ import '../imports/api/methods/devicecode.js';
import
'../imports/api/methods/brands.js'
;
import
'../imports/api/methods/brands.js'
;
import
'../imports/api/methods/hisLink.js'
;
import
'../imports/api/methods/hisLink.js'
;
import
'../imports/api/methods/clients.js'
;
import
'../imports/api/methods/clients.js'
;
import
'../imports/api/methods/devicemap.js'
;
import
'../imports/api/server/publications/worklist.js'
;
import
'../imports/api/server/publications/worklist.js'
;
import
'../imports/api/server/publications/devicecode.js'
;
import
'../imports/api/server/publications/devicecode.js'
;
import
'../imports/api/server/publications/hislink.js'
;
import
'../imports/api/server/publications/hislink.js'
;
import
'../imports/api/server/publications/brands.js'
;
import
'../imports/api/server/publications/brands.js'
;
import
'../imports/api/server/publications/clients.js'
;
import
'../imports/api/server/publications/clients.js'
;
import
'../imports/api/server/publications/devicemap.js'
;
Meteor
.
startup
(()
=>
{
Meteor
.
startup
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment