Commit f9d01393 authored by Reza Sahebgharan's avatar Reza Sahebgharan

feat(join devicemap and hislink): write join for devicemap and hislink

parent 4f9d6815
Pipeline #750 passed with stages
in 49 minutes and 3 seconds
...@@ -31,31 +31,21 @@ ...@@ -31,31 +31,21 @@
- open docker-compose.yml with an editor and paste following statements in the created docker compose file - open docker-compose.yml with an editor and paste following statements in the created docker compose file
``` ```
version: '3' version: "3"
services: services:
app: app:
container_name: karname-app container_name: karname-app
restart: always restart: always
image: repo.marcopacs.com/karname/karname-app image: "karname-app"
ports: ports:
- '80:3000' - "80:3000"
depends_on:
- mongo
links:
- mongo
environment: environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost} ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://mongo:27017/karname MONGO_URL: mongodb://mongo-windows:27017/karname
PORT: 3000 PORT: 3000
METEOR_SETTINGS: '{"worklistUrl":"http://karname-broker"}' METEOR_SETTINGS: '{"worklistUrl":"http://karname-broker","databusUrl":"http://databus"}'
mongo:
ports:
- '27017:27017'
image: repo.marcopacs.com/karname/mongo-windows
volumes:
- D:\data\db:C:\data\db
volumes:
data:
networks: networks:
default: default:
external: external:
......
...@@ -128,7 +128,6 @@ export default { ...@@ -128,7 +128,6 @@ export default {
CodeInPacs: "", CodeInPacs: "",
Modality: "", Modality: "",
HisLinkId: "", HisLinkId: "",
HisName: "",
MaxLen: "", MaxLen: "",
_id: "" _id: ""
}, },
...@@ -162,7 +161,17 @@ export default { ...@@ -162,7 +161,17 @@ export default {
this.loading = false; this.loading = false;
this.dialog = false; this.dialog = false;
if (this.devicemaps && this.devicemaps.length > 0) { if (this.devicemaps && this.devicemaps.length > 0) {
return this.devicemaps; let currentDevicemap = [];
for (let devicemap of this.devicemaps) {
let hislink = HisLink.find(
{ _id: devicemap.HisLinkId },
{ fields: { Name: 1 } }
).fetch();
if (hislink)
currentDevicemap.push({ ...devicemap, HisName: hislink[0].Name });
}
return currentDevicemap;
} }
return []; return [];
}, },
...@@ -192,7 +201,6 @@ export default { ...@@ -192,7 +201,6 @@ export default {
} }
}, },
openNewDialog() { openNewDialog() {
;
for (let prop in this.DevicemapForm) { for (let prop in this.DevicemapForm) {
this.$set(this.DevicemapForm, prop, ""); this.$set(this.DevicemapForm, prop, "");
} }
...@@ -217,7 +225,6 @@ export default { ...@@ -217,7 +225,6 @@ export default {
} }
} }
this.selectedClient = undefined; this.selectedClient = undefined;
this.selectedHisLink = undefined; this.selectedHisLink = undefined;
let me = this; let me = this;
...@@ -225,11 +232,9 @@ export default { ...@@ -225,11 +232,9 @@ export default {
return client.Caption == me.DevicemapForm.CodeInPacs; return client.Caption == me.DevicemapForm.CodeInPacs;
})[0]; })[0];
this.selectedHisLink = this.hislink.filter(hislink => { this.selectedHisLink = HisLink.find({
return hislink.Name == me.DevicemapForm.HisName; _id: me.DevicemapForm.HisLinkId
})[0]; }).fetch()[0];
this.$set(this.DevicemapForm, "_id", this.selectedItemInTable[0]["_id"]); this.$set(this.DevicemapForm, "_id", this.selectedItemInTable[0]["_id"]);
this.newOrEdit = "edit"; this.newOrEdit = "edit";
...@@ -239,27 +244,22 @@ export default { ...@@ -239,27 +244,22 @@ export default {
this.loading = true; this.loading = true;
let me = this; let me = this;
if (this.newOrEdit == "new") { if (this.newOrEdit == "new") {
if (this.selectedClient != undefined && this.selectedClient != null) if (this.selectedClient != undefined && this.selectedClient != null)
this.DevicemapForm.CodeInPacs = this.selectedClient.Caption; this.DevicemapForm.CodeInPacs = this.selectedClient.Caption;
if (this.selectedHisLink != undefined && this.selectedHisLink != null) { if (this.selectedHisLink != undefined && this.selectedHisLink != null) {
this.DevicemapForm.HisLinkId = this.selectedHisLink._id; this.DevicemapForm.HisLinkId = this.selectedHisLink._id;
this.DevicemapForm.HisName = this.selectedHisLink.Name;
} }
Meteor.call("createDevicemap", this.DevicemapForm, function() { Meteor.call("createDevicemap", this.DevicemapForm, function() {});
// me.dialog = false;
});
} }
if (this.newOrEdit == "edit") { if (this.newOrEdit == "edit") {
if (this.selectedClient != undefined && this.selectedClient != null) if (this.selectedClient != undefined && this.selectedClient != null)
this.DevicemapForm.CodeInPacs = this.selectedClient.Caption; this.DevicemapForm.CodeInPacs = this.selectedClient.Caption;
if (this.selectedHisLink != undefined && this.selectedHisLink != null) { if (this.selectedHisLink != undefined && this.selectedHisLink != null) {
this.DevicemapForm.HisLinkId = this.selectedHisLink._id; this.DevicemapForm.HisLinkId = this.selectedHisLink._id;
this.DevicemapForm.HisName = this.selectedHisLink.Name; this.DevicemapForm.Name = this.selectedHisLink.Name;
} }
Meteor.call("editDevicemap", this.DevicemapForm, function() { Meteor.call("editDevicemap", this.DevicemapForm, function() {
...@@ -302,6 +302,7 @@ export default { ...@@ -302,6 +302,7 @@ export default {
hislink() { hislink() {
return HisLink.find({}).fetch(); return HisLink.find({}).fetch();
}, },
clients() { clients() {
return Client.find({}).fetch(); return Client.find({}).fetch();
} }
......
...@@ -94,9 +94,9 @@ ...@@ -94,9 +94,9 @@
<v-content> <v-content>
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<keep-alive>
<router-view></router-view> <router-view></router-view>
</keep-alive>
</transition> </transition>
</v-content> </v-content>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment