Commit c540a96f authored by Reza Sahebgharan's avatar Reza Sahebgharan

feat(add register panel): add register panel to siderbar

parent 2332ff54
Pipeline #1035 passed with stage
in 35 minutes and 43 seconds
......@@ -16,3 +16,4 @@ accounts-password@1.5.2
ardatan:webpack
ardatan:webpack-dev-middleware
tmeasday:publish-counts
......@@ -62,6 +62,7 @@ sha@1.0.9
shell-server@0.4.0
socket-stream-client@0.2.2
srp@1.0.12
tmeasday:publish-counts@0.8.0
tracker@1.2.0
underscore@1.0.10
url@1.2.0
......
......@@ -25,7 +25,7 @@ afterEach(() => {
describe('AppFooter', () => {
test('is a Vue instance', () => {
debugger
expect(wrapper.isVueInstance).toBeTruthy();
});
......
......@@ -72,7 +72,7 @@
<v-text-field
v-model="search"
append-icon="search"
label="Search"
:label="$t('DataTableSearch')"
single-line
hide-details
style="width:400px"
......@@ -93,7 +93,7 @@
single-select
:sort-by.sync="sortByTable"
:sort-desc.sync="sortDescTable"
height="73vh"
height="62vh"
@click:row="clickRow"
:search="search"
></v-data-table>
......
......@@ -92,7 +92,7 @@
<v-text-field
v-model="search"
append-icon="search"
label="Search"
:label="$t('DataTableSearch')"
single-line
hide-details
style="width:400px"
......@@ -113,7 +113,7 @@
single-select
:sort-by.sync="sortByTable"
:sort-desc.sync="sortDescTable"
height="73vh"
height="62vh"
@click:row="clickRow"
:search="search"
></v-data-table>
......
......@@ -108,13 +108,28 @@
>
<strong>{{$t("HISLink.editBtn")}}</strong>
</v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="deleteSnackbar" :disabled="this.selectedItemInTable.length == 0">
<v-btn
color="rgb(94, 181, 177,.85)"
class="white--text"
@click="deleteSnackbar"
:disabled="this.selectedItemInTable.length == 0"
>
<strong>{{$t("HISLink.deleteBtn")}}</strong>
</v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="activeHislink" :disabled="this.selectedItemInTable.length == 0">
<v-btn
color="rgb(94, 181, 177,.85)"
class="white--text"
@click="activeHislink"
:disabled="this.selectedItemInTable.length == 0"
>
<strong>{{$t("HISLink.activeBtn")}}</strong>
</v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="deactiveHislink" :disabled="this.selectedItemInTable.length == 0">
<v-btn
color="rgb(94, 181, 177,.85)"
class="white--text"
@click="deactiveHislink"
:disabled="this.selectedItemInTable.length == 0"
>
<strong>{{$t("HISLink.deactiveBtn")}}</strong>
</v-btn>
<v-btn
......@@ -125,7 +140,12 @@
>
<strong>{{$t("HISLink.authenticateBtn")}}</strong>
</v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="getWorklist" :disabled="this.selectedItemInTable.length == 0">
<v-btn
color="rgb(94, 181, 177,.85)"
class="white--text"
@click="getWorklist"
:disabled="this.selectedItemInTable.length == 0"
>
<strong>{{$t("HISLink.getWorklistBtn")}}</strong>
</v-btn>
</v-col>
......@@ -142,7 +162,7 @@
<v-text-field
v-model="search"
append-icon="search"
label="Search"
:label="$t('DataTableSearch')"
single-line
hide-details
style="width:400px"
......@@ -163,29 +183,29 @@
single-select
:sort-by.sync="sortByTable"
:sort-desc.sync="sortDescTable"
height="73vh"
height="62vh"
@click:row="clickRow"
:search="search"
></v-data-table>
</v-card>
</v-col>
</v-row>
<his-worklist
<!-- <his-worklist
:HisWorklistDialogProp="HisWorklistDialog"
:closeDialog="closeHisWorklistMethod"
:selectedBrand="selectedBrand"
></his-worklist>
></his-worklist> -->
</v-container>
</template>
<script>
import HisLink from "../../imports/api/collections/hislink.js";
import Brands from "../../imports/api/collections/brands.js";
import { Meteor } from "meteor/meteor";
import HisWorklist from "./HisWorklist.vue";
// import HisWorklist from "./HisWorklist.vue";
export default {
components: {
HisWorklist
},
// components: {
// HisWorklist
// },
data() {
return {
sortByTable: undefined,
......@@ -212,7 +232,7 @@ export default {
alertSnackbar: false,
alertText: "",
loading: false,
HisWorklistDialog: false,
// HisWorklistDialog: false,
selectedBrand: null,
search: ""
};
......@@ -264,10 +284,10 @@ export default {
}
},
methods: {
closeHisWorklistMethod() {
this.HisWorklistDialog = false;
this.selectedBrand = null;
},
// closeHisWorklistMethod() {
// this.HisWorklistDialog = false;
// this.selectedBrand = null;
// },
clickRow(item) {
if (
this.selectedItemInTable.length > 0 &&
......@@ -418,7 +438,10 @@ export default {
let Brand = this.selectedItemInTable[0].Brand;
this.selectedBrand = Brand;
this.HisWorklistDialog = true;
this.$router.push({ name: "register", params: { selectedBrand: Brand } });
// this.HisWorklistDialog = true;
}
},
meteor: {
......
......@@ -22,6 +22,7 @@
</v-row>-->
<v-row dense>
<v-data-table
ref="patientsDatatable"
:headers="headerOfTable"
:items="itemsOfTable"
item-key="_id"
......@@ -30,6 +31,8 @@
fixed-header
disable-sort
height="600px"
disable-pagination
hide-default-footer
></v-data-table>
</v-row>
</v-card>
......@@ -46,9 +49,11 @@ export default {
props: ["HisWorklistDialogProp", "closeDialog", "selectedBrand"],
data: () => ({
HisWorklistLoading: false,
HisWorklistDialog: false
HisWorklistDialog: false,
limit: 15
// selectedBrand: null
}),
mounted() {},
computed: {
itemsOfBrands() {
if (this.brands && this.brands.length > 0) {
......@@ -92,6 +97,14 @@ export default {
watch: {
"$subReady.worklist4hislink"(ready) {
this.HisWorklistLoading = false;
if (this.$refs.patientsDatatable) {
this.$refs.patientsDatatable.$el
.querySelector(".v-data-table__wrapper")
.removeEventListener("scroll", this.onScroll);
this.$refs.patientsDatatable.$el
.querySelector(".v-data-table__wrapper")
.addEventListener("scroll", this.onScroll);
}
},
HisWorklistDialog(newvalue, oldvalue) {
if (newvalue == false) {
......@@ -107,13 +120,29 @@ export default {
methods: {
internalCloseDialog() {
this.HisWorklistDialog = false;
},
onScroll(e) {
this.offsetTop = e.target.scrollTop;
let element = this.$refs.patientsDatatable.$el.querySelector(
".v-data-table__wrapper"
);
var scrollHeight = element.scrollHeight;
var divHeight = element.clientHeight;
var scrollerEndPoint = scrollHeight - divHeight;
var divScrollerTop = e.target.scrollTop;
if (divScrollerTop === scrollerEndPoint) {
this.limit += 10;
}
}
},
meteor: {
$subscribe: {
// brands: [],
worklist4hislink: function() {
return [this.selectedBrand];
console.log(true);
this.HisWorklistLoading = true;
return [{ brand: this.selectedBrand, limit: this.limit }];
}
},
// brands() {
......
<template>
<v-container>
<!-- <v-snackbar color="primary" v-model="snackbar" top>
{{$t("Client.DeleteMessage")}}
<v-btn color="pink" @click="deleteClient">{{$t("Client.YesBtn")}}</v-btn>
<v-btn color="pink" @click="snackbar = false">{{$t("Client.NoBtn")}}</v-btn>
</v-snackbar>
<v-snackbar color="primary" v-model="alertSnackbar" :timeout="2000">{{alertText}}</v-snackbar>-->
<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" class="justify-center align-center flex-wrap">
<v-col cols="6">
<v-autocomplete
:items="itemsOfHISLinks"
:label="$t('RegisterRoute.HISLinkCombo')"
v-model="selectedBrand"
item-text="Name"
item-value="Brand"
></v-autocomplete>
</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-card class="justify-center">
<v-progress-linear
:active="HisWorklistLoading"
:indeterminate="HisWorklistLoading"
absolute
top
color="cyan lighten-2"
></v-progress-linear>
<v-card-title>
<strong>{{worklist4hislink.length}}/{{count}}</strong>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
append-icon="search"
:label="$t('DataTableSearch')"
single-line
hide-details
style="width:400px"
class="flex-grow-0"
></v-text-field>
</v-card-title>
<v-data-table
ref="patientsDatatable"
:headers="headerOfTable"
:items="itemsOfTable"
item-key="_id"
class="elevation-1"
style="width:100%"
fixed-header
disable-sort
:height="tableHeight"
disable-pagination
hide-default-footer
:search="search"
></v-data-table>
<v-btn v-if="showMore" class="primary" tile block @click="loadMoreFn">{{$t("RegisterRoute.ShowMoreBtn")}}</v-btn>
</v-card>
</v-col>
</v-row>
</v-container>
</template>
<script>
import HisLink from "../../imports/api/collections/hislink.js";
import { Meteor } from "meteor/meteor";
import BrandCollections from "../../imports/api/collections/worklist4hislink.js";
import { Mongo } from "meteor/mongo";
import { Counts } from "meteor/tmeasday:publish-counts";
export default {
data() {
return {
search: "",
selectedBrand: null,
HisWorklistLoading: false,
limit: 5,
prevLeft: 0,
showMore: false,
tableHeight: "62vh",
count: 0
};
},
computed: {
itemsOfHISLinks() {
if (this.hislink && this.hislink.length > 0) {
return this.hislink;
}
return [];
},
itemsOfTable() {
if (this.worklist4hislink && this.worklist4hislink.length > 0) {
let worklistArray = [];
for (let worklist of this.worklist4hislink) {
let tempWorklist = {};
for (let prop in worklist) {
tempWorklist[prop] = JSON.stringify(worklist[prop]);
}
worklistArray.push(tempWorklist);
}
return worklistArray;
}
return [];
},
headerOfTable() {
if (this.worklist4hislink && this.worklist4hislink.length > 0) {
let headerNames = [];
let worklist = this.worklist4hislink[0];
for (let prop in worklist) {
headerNames.push({
text: prop,
value: prop,
class: "text-center",
width: 180
});
}
return headerNames;
}
return [];
}
},
created() {
if (this.$route.params.selectedBrand)
this.selectedBrand = this.$route.params.selectedBrand;
},
methods: {
onScroll(e) {
let currentLeft = e.target.scrollLeft;
if (this.prevLeft != currentLeft) {
this.prevLeft = currentLeft;
return;
}
let element = this.$refs.patientsDatatable.$el.querySelector(
".v-data-table__wrapper"
);
let scrollHeight = element.scrollHeight;
let divHeight = element.clientHeight;
let scrollerEndPoint = scrollHeight - divHeight;
let divScrollerTop = e.target.scrollTop;
if (divScrollerTop === scrollerEndPoint) {
this.count = Counts.get("brandCount");
if (this.worklist4hislink.length < this.count) {
this.limit += 5;
}
}
},
loadMoreFn() {
this.count = Counts.get("brandCount");
this.worklist4hislink.length < this.count ? (this.limit += 5) : "";
},
checkScrollExistiance() {
if (this.worklist4hislink && this.worklist4hislink.length > 0) {
let me = this;
setTimeout(function() {
let element = me.$refs.patientsDatatable.$el.querySelector(
".v-data-table__wrapper"
);
let scrollHeight = element.scrollHeight;
let divHeight = element.clientHeight;
if (divHeight >= scrollHeight) {
me.tableHeight = "59vh";
me.showMore = true;
} else {
me.tableHeight = "62vh";
me.showMore = false;
}
}, 500);
}
}
},
watch: {
"$subReady.worklist4hislink"(ready) {
this.HisWorklistLoading = false;
if (this.$refs.patientsDatatable) {
this.$refs.patientsDatatable.$el
.querySelector(".v-data-table__wrapper")
.removeEventListener("scroll", this.onScroll);
this.$refs.patientsDatatable.$el
.querySelector(".v-data-table__wrapper")
.addEventListener("scroll", this.onScroll);
this.checkScrollExistiance();
}
}
},
meteor: {
$subscribe: {
hislink: [],
worklist4hislink: function() {
this.HisWorklistLoading = true;
return [{ brand: this.selectedBrand, limit: this.limit }];
}
},
hislink() {
return HisLink.find({}).fetch();
},
worklist4hislink() {
if (this.selectedBrand == null) return [];
this.count = Counts.get("brandCount");
if (BrandCollections[this.selectedBrand])
return BrandCollections[this.selectedBrand].find({}).fetch();
else {
BrandCollections[this.selectedBrand] = new Mongo.Collection(
this.selectedBrand
);
return BrandCollections[this.selectedBrand].find({}).fetch();
}
}
}
};
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -91,7 +91,7 @@ export default {
this.alertSnackbar = true;
},
saveUserProfile() {
debugger;
;
this.loading = true;
if (this.newSelectedLang == null || this.newSelectedLang == undefined) {
this.alertSnackbarMethod(this.$t("UserSetting.chooseLanguage"));
......@@ -163,7 +163,7 @@ export default {
},
selectedLang: {
get() {
debugger;
;
if (this.users && this.users.length > 0) {
this.newSelectedLang = this.users[0].profile.language;
return this.users[0].profile.language;
......
......@@ -117,7 +117,7 @@
<v-text-field
v-model="search"
append-icon="search"
label="Search"
:label="$t('DataTableSearch')"
single-line
hide-details
style="width:400px"
......@@ -138,7 +138,7 @@
single-select
:sort-by.sync="sortByTable"
:sort-desc.sync="sortDescTable"
height="73vh"
height="62vh"
@click:row="clickRow"
:search="search"
></v-data-table>
......@@ -277,7 +277,7 @@ export default {
createOrEditUser() {
this.loading = true;
let me = this;
debugger;
if (this.newOrEdit == "new") {
const username = this.UserForm.username;
const password = this.UserForm.password;
......@@ -390,7 +390,7 @@ export default {
}
},
deleteUser() {
debugger;
let me = this;
this.snackbar = false;
if (this.selectedItemInTable.length == 0) {
......
......@@ -88,7 +88,7 @@
<v-text-field
v-model="search"
append-icon="search"
label="Search"
:label="$t('DataTableSearch')"
single-line
hide-details
style="width:400px"
......@@ -523,7 +523,7 @@
import Worklist from "../../imports/api/collections/worklist.js";
import Clients from "../../imports/api/collections/clients.js";
import HisWorklist from "./HisWorklist.vue";
// import HisWorklist from "./HisWorklist.vue";
export default {
methods: {
......@@ -557,7 +557,7 @@ export default {
// this.$set(item, "selected", true);
},
searchPatients() {
debugger;
if (
this.selectedDevice &&
this.devicemap != this.selectedDevice.Caption
......@@ -660,7 +660,7 @@ export default {
this.activerow(this.sortedItems[index - 1]);
},
savePatient() {
debugger;
this.selectedItem.EnglishFirstNameParts = [
this.editedItemParts.EnglishFirstNameParts0,
this.editedItemParts.EnglishFirstNameParts1,
......@@ -694,7 +694,7 @@ export default {
});
let { selected, ...selectedItemClone } = this.selectedItem;
debugger;
this.editLoading = true;
let self = this;
Meteor.call("EditworklistItem", selectedItemClone, function(
......@@ -736,7 +736,8 @@ export default {
},
selectedItem: undefined,
sortedItems: undefined,
search: ""
search: "",
offsetTop: 0
}),
computed: {
clientsItems() {
......@@ -817,7 +818,6 @@ export default {
this.fetchWorklistLoading = true;
Meteor.call("Fetchworklist", this.selectedDevice.Caption, function() {
self.devicemap = self.selectedDevice.Caption;
console.log(self.devicemap);
self.fetchWorklistLoading = false;
});
}
......
......@@ -160,15 +160,15 @@ const messages = {
Client: "Client",
Users: "Users",
Setting: "Setting",
Signout: "Signout",
Register: "Register"
},
RegisterRoute: {
HISLinkCombo: "HISLink",
ShowMoreBtn: "show more..."
},
DataTableSearch: "search"
Signout: "Signout"
}
// NavigationBar: {
// Worklist: "لیست کاری",
// HISLink: "درگاه HIS",
// DeviceMap: "نگاشت",
// Client: "دستگاه"
// }
},
'fa': {
Login: {
......@@ -259,7 +259,7 @@ const messages = {
activeBtn: "فعال",
deactiveBtn: "غیرفعال",
authenticateBtn: "تصدیق کردن",
getWorklistBtn: "لیست بیماران",
getWorklistBtn: "فهرست",
hislinkSelectStatement: "لطفا یکی از hislink ها را انتخاب نمایید",
hislinkDeleteStatement: "HISLink حذف گردید",
hislinkActiveStatement: "HISLink فعال شد",
......@@ -310,7 +310,7 @@ const messages = {
minimum5Character: "رمز باید حداقل دارای 5 کاراکتر باشد"
},
HisWorklist: {
title: "لیست بیماران"
title: "فهرست"
},
UserSetting: {
language: "زبان",
......@@ -327,9 +327,14 @@ const messages = {
Client: "دستگاه",
Users: "کاربران",
Setting: "تنظیمات",
Signout: "خروج"
}
Signout: "خروج",
Register: "فهرست"
},
RegisterRoute: {
HISLinkCombo: "درگاه HIS",
ShowMoreBtn: "بیشتر..."
},
DataTableSearch: "جستجو"
}
};
......
// const Login = () =>
// import ('../views/Login.vue')
// const Home = () =>
// import ('../views/Home.vue')
// const Register = () =>
// import ('../views/Register.vue')
// const ChangePassword = () =>
// import ('../views/ChangePassword.vue')
// const Main = () =>
// import ('../views/Main.vue')
// const EditWorkList = () =>
// import ('../components/EditWorkList.vue')
// const WorkList = () =>
// import ('../components/Worklist.vue')
// import Login from '../views/Login.vue';
// import Home from '../views/Home.vue';
// import Register from '../views/Register.vue';
// import ChangePassword from '../views/ChangePassword.vue';
// import Main from '../views/Main.vue';
// import EditWorkList from '../components/EditWorkList.vue';
// import WorkList from '../components/Worklist.vue';
// import AppVersion from '../views/AppVersion.vue';
// const routes = [{
// path: '/',
// component: () =>
// import ('../views/Home.vue'),
// name: 'Home'
// },
// {
// path: '/appversion',
// component: AppVersion,
// name: 'AppVersion'
// },
// {
// path: '/signin',
// component: () =>
// import ('../views/Login.vue'),
// name: 'signin'
// },
// {
// path: '/signup',
// component: () =>
// import ('../views/Register.vue'),
// name: 'signup'
// },
// {
// path: '/changePassword',
// component: () =>
// import ('../views/ChangePassword.vue'),
// name: 'changePassword'
// }, {
// path: '/main',
// component: () =>
// import ('../views/Main.vue'),
// name: 'main',
// children: [{
// path: "worklist",
// name: "worklist",
// components: {
// default: () =>
// import ('../components/Worklist.vue'),
// edit_worklist: () =>
// import ('../components/EditWorkList.vue')
// }
// }]
// }
// ];
// export default routes;
import Login from '../views/Login.vue';
import Home from '../views/Home.vue';
// import Register from '../views/Register.vue';
......@@ -101,12 +7,13 @@ import Main from '../views/Main.vue';
import EditWorkList from '../components/EditWorkList.vue';
import RegisterPatient from '../components/RegisterPatient.vue';
// import WorkList from '../components/Worklist.vue';
// import HisLink from '../components/HisLink.vue';
import HisLink from '../components/HisLink.vue';
import DeviceMap from '../components/DeviceMap.vue';
import Client from '../components/Client.vue';
import Users from '../components/Users.vue';
import UserSetting from '../components/UserSetting.vue';
import RegisterRoute from '../components/RegisterRoute.vue';
import AppVersion from '../views/AppVersion.vue';
......@@ -151,9 +58,9 @@ const routes = [{
}, {
path: "hislink",
name: "hislink",
// component: HisLink
component: () =>
import ('../components/HisLink.vue')
component: HisLink
// component: () =>
// import ('../components/HisLink.vue')
}, {
path: "devicemap",
name: "devicemap",
......@@ -170,6 +77,13 @@ const routes = [{
path: "usersetting",
name: "usersetting",
component: UserSetting
}, {
path: "register",
name: "register",
component: RegisterRoute
// component: () =>
// import ('../components/RegisterRoute.vue')
}]
}
];
......
......@@ -152,7 +152,7 @@ import RegisterPatient from "../components/RegisterPatient.vue";
import { mapActions } from "vuex";
export default {
mounted() {
debugger;
this.items.push({
text: this.$t("NavigationBar.Worklist"),
url: "/main/worklist"
......@@ -169,6 +169,10 @@ export default {
text: this.$t("NavigationBar.Client"),
url: "/main/client"
});
this.items.push({
text: this.$t("NavigationBar.Register"),
url: "/main/register"
});
},
components: {
"app-footer": AppFooter,
......@@ -188,7 +192,7 @@ export default {
},
computed: {
// getCurrentRoute(){
// debugger
// return this.$router.currentRoute.name == "worklist"
// },
......@@ -244,7 +248,7 @@ export default {
},
selectedLang: {
get() {
debugger;
if (this.users && this.users.length > 0) {
return this.users[0].profile.language;
} else {
......@@ -293,6 +297,10 @@ export default {
text: this.$t("NavigationBar.Client"),
url: "/main/client"
});
this.items.push({
text: this.$t("NavigationBar.Register"),
url: "/main/register"
});
}
},
meteor: {
......
......@@ -5,7 +5,7 @@ import internalWorklist from '../collections/internalworklist';
let collections = {};
if (Meteor.isServer) {
debugger
const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/GetHISBrandsRest`);
let brandsHttpResult = JSON.parse(result.content);
......@@ -26,20 +26,18 @@ if (Meteor.isServer) {
}
if (Meteor.isClient || Meteor.isCordova) {
Meteor.call("getBrandsName", function(err, result) {
let collectionNames = result;
// let collectionNames = ["TestWLS"];
for (let collName of collectionNames) {
if (collName != "InternalHis")
collections[collName] = new Mongo.Collection(collName);
else
collections[collName] = internalWorklist;
}
});
// Meteor.call("getBrandsName", function(err, result) {
// let collectionNames = result;
// // let collectionNames = ["TestWLS"];
// for (let collName of collectionNames) {
// if (collName != "InternalHis")
// collections[collName] = new Mongo.Collection(collName);
// else
// collections[collName] = internalWorklist;
// }
// });
collections["InternalHis"] = internalWorklist;
}
export default collections;
\ No newline at end of file
......@@ -7,7 +7,7 @@ import { check } from 'meteor/check';
Meteor.methods({
'changePass' (username, oldPassword, newPassword) {
debugger;
this.unblock();
check(username, String);
check(oldPassword, String);
......
......@@ -10,7 +10,7 @@ Meteor.methods({
this.unblock();
if (this.userId) {
try {
debugger;
let userExists = Meteor.users.findOne({ username: item.username });
if (userExists == undefined || userExists == null)
Accounts.createUser({
......@@ -34,7 +34,7 @@ Meteor.methods({
this.unblock();
if (this.userId) {
try {
debugger;
Meteor.users.update({ _id: item._id }, { $set: { "profile.fullName": item.fullName } }, { upsert: true })
// Accounts.setPassword(item._id, item.password, { logout: true })
return true
......@@ -49,7 +49,7 @@ Meteor.methods({
this.unblock();
if (this.userId) {
try {
debugger;
Accounts.setPassword(item._id, item.password, { logout: true })
return true
} catch (e) {
......@@ -60,11 +60,11 @@ Meteor.methods({
}
},
"deleteUser1" (item) {
debugger
this.unblock();
if (this.userId) {
try {
debugger;
Meteor.users.remove({ _id: item._id });
return true
} catch (e) {
......@@ -75,11 +75,11 @@ Meteor.methods({
}
},
"editUserProfile" (item) {
debugger;
this.unblock();
if (this.userId) {
try {
debugger;
// db.collection.update( { _id:...} , { $set: { some_key.param2 : new_info } }
Meteor.users.update({ _id: this.userId }, { $set: {...item } }, { upsert: true })
return true
......
......@@ -6,7 +6,7 @@ import { HTTP } from 'meteor/http';
let uuidv4 = require("uuid/v4");
// Accounts.onLogin(function(user) {
// debugger;
//
// console.log(",", user.user._id)
// });
......@@ -47,7 +47,7 @@ Meteor.methods({
}
},
"EditworklistItem" (item) {
// debugger;
// const item = {
// "Accession": "",
// "AdmissionID": "1501",
......
......@@ -2,7 +2,7 @@ import Clients from '../../collections/clients.js';
import { check } from 'meteor/check';
Meteor.publish("clients", function() {
debugger;
// if (!this.userId) {
// return this.ready();
// }
......
......@@ -2,7 +2,7 @@ import DeviceMap from '../../collections/devicemap';
import { check } from 'meteor/check';
Meteor.publish("devicemaps", function() {
debugger;
if (!this.userId) {
return this.ready();
}
......
import { check } from 'meteor/check';
import { Mongo } from 'meteor/mongo'
import Collections from '../../collections/worklist4hislink.js';
import { Counts } from 'meteor/tmeasday:publish-counts';
Meteor.publish("worklist4hislink", function({ brand, limit }) {
Meteor.publish("worklist4hislink", function(brand) {
debugger
if (brand == null) {
return [];
}
......@@ -12,12 +13,15 @@ Meteor.publish("worklist4hislink", function(brand) {
}
const userid = this.userId;
check(brand, String);
check(limit, Number);
Counts.publish(this, 'brandCount', Collections[brand].find(), { noReady: true });
// let Worklist = new Mongo.Collection(brand);
// console.log(Worklist.find({ _userid: userid, _devicemap: devicemap }).fetch())
return Collections[brand].find({}, {
disableOplog: true,
// pollingThrottleMs: 1000,
pollingIntervalMs: 1000
pollingIntervalMs: 1000,
limit: limit
});
});
\ No newline at end of file
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