Commit ec45d803 authored by Reza Sahebgharan's avatar Reza Sahebgharan

feat(search register): add search register and register panel to karname

parent dad06bb4
Pipeline #1056 passed with stage
in 91 minutes and 3 seconds
...@@ -49,13 +49,13 @@ ...@@ -49,13 +49,13 @@
<v-card-actions> <v-card-actions>
<v-row style="margin:auto"> <v-row style="margin:auto">
<v-col cols="12" class="d-flex justify-center align-center flex-wrap"> <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"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openNewDialog">
<strong>{{$t("HISLink.newBtn")}}</strong> <strong>{{$t("HISLink.newBtn")}}</strong>
</v-btn> </v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="openEditDialog" :disabled="this.selectedItemInTable.length == 0"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openEditDialog" :disabled="this.selectedItemInTable.length == 0">
<strong>{{$t("HISLink.editBtn")}}</strong> <strong>{{$t("HISLink.editBtn")}}</strong>
</v-btn> </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 ma-1" @click="deleteSnackbar" :disabled="this.selectedItemInTable.length == 0">
<strong>{{$t("HISLink.deleteBtn")}}</strong> <strong>{{$t("HISLink.deleteBtn")}}</strong>
</v-btn> </v-btn>
</v-col> </v-col>
......
...@@ -69,13 +69,13 @@ ...@@ -69,13 +69,13 @@
<v-card-actions> <v-card-actions>
<v-row style="margin:auto"> <v-row style="margin:auto">
<v-col cols="12" class="d-flex justify-center align-center flex-wrap"> <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"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openNewDialog">
<strong>{{$t("HISLink.newBtn")}}</strong> <strong>{{$t("HISLink.newBtn")}}</strong>
</v-btn> </v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="openEditDialog" :disabled="this.selectedItemInTable.length == 0"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openEditDialog" :disabled="this.selectedItemInTable.length == 0">
<strong>{{$t("HISLink.editBtn")}}</strong> <strong>{{$t("HISLink.editBtn")}}</strong>
</v-btn> </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 ma-1" @click="deleteSnackbar" :disabled="this.selectedItemInTable.length == 0">
<strong>{{$t("HISLink.deleteBtn")}}</strong> <strong>{{$t("HISLink.deleteBtn")}}</strong>
</v-btn> </v-btn>
</v-col> </v-col>
......
...@@ -97,12 +97,12 @@ ...@@ -97,12 +97,12 @@
<v-card-actions> <v-card-actions>
<v-row style="margin:auto"> <v-row style="margin:auto">
<v-col cols="12" class="d-flex justify-center align-center flex-wrap"> <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"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openNewDialog">
<strong>{{$t("HISLink.newBtn")}}</strong> <strong>{{$t("HISLink.newBtn")}}</strong>
</v-btn> </v-btn>
<v-btn <v-btn
color="rgb(94, 181, 177,.85)" color="rgb(94, 181, 177,.85)"
class="white--text" class="white--text ma-1"
@click="openEditDialog" @click="openEditDialog"
:disabled="this.selectedItemInTable.length == 0" :disabled="this.selectedItemInTable.length == 0"
> >
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</v-btn> </v-btn>
<v-btn <v-btn
color="rgb(94, 181, 177,.85)" color="rgb(94, 181, 177,.85)"
class="white--text" class="white--text ma-1"
@click="deleteSnackbar" @click="deleteSnackbar"
:disabled="this.selectedItemInTable.length == 0" :disabled="this.selectedItemInTable.length == 0"
> >
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
</v-btn> </v-btn>
<v-btn <v-btn
color="rgb(94, 181, 177,.85)" color="rgb(94, 181, 177,.85)"
class="white--text" class="white--text ma-1"
@click="activeHislink" @click="activeHislink"
:disabled="this.selectedItemInTable.length == 0" :disabled="this.selectedItemInTable.length == 0"
> >
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
</v-btn> </v-btn>
<v-btn <v-btn
color="rgb(94, 181, 177,.85)" color="rgb(94, 181, 177,.85)"
class="white--text" class="white--text ma-1"
@click="deactiveHislink" @click="deactiveHislink"
:disabled="this.selectedItemInTable.length == 0" :disabled="this.selectedItemInTable.length == 0"
> >
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
</v-btn> </v-btn>
<v-btn <v-btn
color="rgb(94, 181, 177,.85)" color="rgb(94, 181, 177,.85)"
class="white--text" class="white--text ma-1"
@click="authenticateHislink" @click="authenticateHislink"
:disabled="this.selectedItemInTable.length == 0" :disabled="this.selectedItemInTable.length == 0"
> >
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
</v-btn> </v-btn>
<v-btn <v-btn
color="rgb(94, 181, 177,.85)" color="rgb(94, 181, 177,.85)"
class="white--text" class="white--text ma-1"
@click="getWorklist" @click="getWorklist"
:disabled="this.selectedItemInTable.length == 0" :disabled="this.selectedItemInTable.length == 0"
> >
......
...@@ -5,29 +5,256 @@ ...@@ -5,29 +5,256 @@
<v-btn color="pink" @click="deleteClient">{{$t("Client.YesBtn")}}</v-btn> <v-btn color="pink" @click="deleteClient">{{$t("Client.YesBtn")}}</v-btn>
<v-btn color="pink" @click="snackbar = false">{{$t("Client.NoBtn")}}</v-btn> <v-btn color="pink" @click="snackbar = false">{{$t("Client.NoBtn")}}</v-btn>
</v-snackbar> </v-snackbar>
<v-snackbar color="primary" v-model="alertSnackbar" :timeout="2000">{{alertText}}</v-snackbar>--> -->
<v-snackbar color="error" v-model="alertSnackbar" :timeout="2000">{{alertText}}</v-snackbar>
<v-row justify="center" dense class="flex-wrap mb-6"> <v-row justify="center" align="center" dense class="flex-wrap mb-6">
<v-col md="7" lg="6" cols="12"> <v-col md="5" lg="5" style="height:100%">
<v-card tile> <v-card tile height="100%">
<v-card-actions> <v-card-actions>
<v-row style="margin:auto" class="justify-center align-center flex-wrap"> <v-row style="margin:auto" class="justify-center align-center flex-wrap">
<v-col cols="6"> <v-col>
<v-autocomplete <v-autocomplete
:items="itemsOfHISLinks" :items="itemsOfHISLinks"
:label="$t('RegisterRoute.HISLinkCombo')" :label="$t('RegisterRoute.HISLinkCombo')"
v-model="selectedBrand" v-model="selectedBrand"
item-text="Name" item-text="Name"
item-value="Brand" item-value="Brand"
clearable
></v-autocomplete> ></v-autocomplete>
</v-col> </v-col>
<!-- <v-col cols="6">
<v-bottom-sheet v-model="sheet" hide-overlay inset>
<template v-slot:activator="{ on }">
<v-btn color="green" dark v-on="on">Open Persistent</v-btn>
</template>
<v-sheet height="400px" color="grey lighten-3">
<v-container fill-height>
<v-row align="center">
<v-col xl="3" md="3" sm="12">
<v-card class="mx-auto" height="330" tile>
<v-content class="pa-4">
<strong>Worklist date / time</strong>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="Show only worklist items from"
type="checkbox"
required
></v-checkbox>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="Show only worklist items to"
type="checkbox"
required
></v-checkbox>
<v-dialog
ref="dateDialog"
v-model="modal"
:return-value.sync="date"
persistent
width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="date"
label="Picker in dialog"
prepend-icon="event"
readonly
v-on="on"
></v-text-field>
</template>
<v-date-picker v-model="date" scrollable>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="modal = false">Cancel</v-btn>
<v-btn
text
color="primary"
@click="$refs.dateDialog.save(date)"
>OK</v-btn>
</v-date-picker>
</v-dialog>
<v-dialog
ref="timeDialog"
v-model="timeModal"
:return-value.sync="time"
persistent
width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="time"
label="Picker in dialog"
prepend-icon="access_time"
readonly
v-on="on"
></v-text-field>
</template>
<v-time-picker v-if="timeModal" v-model="time" full-width>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="timeModal = false">Cancel</v-btn>
<v-btn
text
color="primary"
@click="$refs.timeDialog.save(time)"
>OK</v-btn>
</v-time-picker>
</v-dialog>
</v-content>
</v-card>
</v-col>
<v-col xl="3" md="3" sm="12">
<v-card class="mx-auto" style="overflow-y:auto" height="330" tile>
<v-list-item-content class="pa-4">
<strong>Modality</strong>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="Show only worklist for modality"
type="checkbox"
required
></v-checkbox>
<v-list
subheader
two-line
flat
max-height="207"
style="overflow-y:auto"
>
<v-list-item-group v-model="settings" multiple>
<v-list-item>
<template v-slot:default="{ active, toggle }">
<v-list-item-action>
<v-checkbox :value="active" color="primary" @click="toggle"></v-checkbox>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>Notifications</v-list-item-title>
</v-list-item-content>
</template>
</v-list-item>
<v-list-item>
<template v-slot:default="{ active, toggle }">
<v-list-item-action>
<v-checkbox color="primary" @click="toggle" :value="active"></v-checkbox>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>Invites</v-list-item-title>
</v-list-item-content>
</template>
</v-list-item>
<v-list-item>
<template v-slot:default="{ active, toggle }">
<v-list-item-action>
<v-checkbox :value="active" color="primary" @click="toggle"></v-checkbox>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>Sound</v-list-item-title>
</v-list-item-content>
</template>
</v-list-item>
</v-list-item-group>
</v-list>
</v-list-item-content>
</v-card>
</v-col>
<v-col xl="3" md="3" sm="12">
<v-card class="mx-auto" style="overflow-y:auto" height="330" tile>
<v-list-item-content class="pa-4">
<strong>AETitle</strong>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="Show only worklist for AETitle"
type="checkbox"
required
></v-checkbox>
<v-text-field label="AETitle"></v-text-field>
</v-list-item-content>
</v-card>
</v-col>
<v-col xl="3" md="3" sm="12">
<v-card class="mx-auto" style="overflow-y:auto" height="330" tile>
<v-list-item-content class="pa-4">
<strong>Patient</strong>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="Show only Patients with Name"
type="checkbox"
required
></v-checkbox>
<v-text-field label="Patient Name"></v-text-field>
</v-list-item-content>
<v-list-item-content class="pa-4">
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="Show only patient of Sex"
type="checkbox"
required
></v-checkbox>
<v-spacer></v-spacer>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="M"
type="checkbox"
required
></v-checkbox>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="F"
type="checkbox"
required
></v-checkbox>
<v-checkbox
v-model="fromCheckbox"
value="fromDate"
label="O"
type="checkbox"
required
></v-checkbox>
</v-list-item-content>
</v-card>
</v-col>
</v-row> </v-row>
</v-container>
</v-sheet>
</v-bottom-sheet>
</v-col>-->
</v-row>
</v-card-actions>
</v-card>
</v-col>
<v-col md="5" lg="5">
<v-card>
<v-card-actions>
<v-col cols="9">
<v-text-field :label="$t('RegisterRoute.advancedSearchLabel')" v-model="queryText" style="direction:ltr"></v-text-field>
</v-col>
<v-col cols="3" class="d-flex align-center justify-center">
<v-btn class="primary" @click="searchServerSide">{{$t("RegisterRoute.searchBtn")}}</v-btn>
<v-btn
icon
href="https://kb.marcopacs.com/pages/viewpage.action?pageId=69796098"
target="_blank"
>
<v-icon color="success">live_help</v-icon>
</v-btn>
</v-col>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
<v-row justify="center" dense class="flex-wrap mt-6"> <v-row justify="center" dense class="flex-wrap mt-6">
<v-col md="9" cols="12"> <v-col md="10" cols="12">
<v-card class="justify-center"> <v-card class="justify-center">
<v-progress-linear <v-progress-linear
:active="HisWorklistLoading" :active="HisWorklistLoading"
...@@ -37,7 +264,7 @@ ...@@ -37,7 +264,7 @@
color="cyan lighten-2" color="cyan lighten-2"
></v-progress-linear> ></v-progress-linear>
<v-card-title> <v-card-title>
<strong>{{worklist4hislink.length}}/{{count}}</strong> <strong>{{worklist4hislink!=undefined?worklist4hislink.length:0}}/{{count}}</strong>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-text-field <v-text-field
v-model="search" v-model="search"
...@@ -63,7 +290,6 @@ ...@@ -63,7 +290,6 @@
hide-default-footer hide-default-footer
:search="search" :search="search"
></v-data-table> ></v-data-table>
<!-- <v-btn v-if="showMore" class="primary" tile block @click="loadMoreFn">{{$t("RegisterRoute.ShowMoreBtn")}}</v-btn> -->
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
...@@ -83,9 +309,19 @@ export default { ...@@ -83,9 +309,19 @@ export default {
HisWorklistLoading: false, HisWorklistLoading: false,
limit: 40, limit: 40,
prevLeft: 0, prevLeft: 0,
showMore: false,
tableHeight: "62vh", tableHeight: "62vh",
count: 0 count: 0,
alertSnackbar: false,
alertText: "",
// sheet: false,
// date: new Date().toISOString().substr(0, 10),
// modal: false,
// fromCheckbox: false,
// timeModal: false,
// time: null,
// settings: [],
query: null,
queryText: ""
}; };
}, },
computed: { computed: {
...@@ -152,10 +388,6 @@ export default { ...@@ -152,10 +388,6 @@ export default {
} }
} }
}, },
loadMoreFn() {
this.count = Counts.get("brandCount");
this.worklist4hislink.length < this.count ? (this.limit += 5) : "";
},
checkScrollExistiance() { checkScrollExistiance() {
if (this.worklist4hislink && this.worklist4hislink.length > 0) { if (this.worklist4hislink && this.worklist4hislink.length > 0) {
let me = this; let me = this;
...@@ -175,6 +407,18 @@ export default { ...@@ -175,6 +407,18 @@ export default {
} }
}, 500); }, 500);
} }
},
searchServerSide() {
try {
this.query = JSON.parse(this.queryText);
this.limit = 40;
} catch (e) {
this.alertText = this.$t("RegisterRoute.jsonParseError");
this.alertSnackbar = true;
this.query = null;
this.limit = 40;
}
} }
}, },
watch: { watch: {
...@@ -194,25 +438,68 @@ export default { ...@@ -194,25 +438,68 @@ export default {
meteor: { meteor: {
$subscribe: { $subscribe: {
hislink: [], hislink: [],
brandCount: function() {
return [{ brand: this.selectedBrand, query: this.query }];
},
worklist4hislink: function() { worklist4hislink: function() {
this.HisWorklistLoading = true; this.HisWorklistLoading = true;
return [{ brand: this.selectedBrand, limit: this.limit }];
return [
{ brand: this.selectedBrand, limit: this.limit, query: this.query },
{
onStop: error => {
if (error != undefined) {
this.alertText = this.$t("RegisterRoute.dbError");
this.alertSnackbar = true;
this.query = null;
this.limit = 40;
}
}
}
];
} }
}, },
hislink() { hislink() {
return HisLink.find({}).fetch(); 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();
// }
// },
worklist4hislink() { worklist4hislink() {
try {
if (this.selectedBrand == null) return []; if (this.selectedBrand == null) return [];
this.count = Counts.get("brandCount"); this.count = Counts.get("brandCount");
if (BrandCollections[this.selectedBrand]) if (BrandCollections[this.selectedBrand])
return BrandCollections[this.selectedBrand].find({}).fetch(); if (this.query != null)
return BrandCollections[this.selectedBrand]
.find(this.query)
.fetch();
else return BrandCollections[this.selectedBrand].find().fetch();
else { else {
BrandCollections[this.selectedBrand] = new Mongo.Collection( BrandCollections[this.selectedBrand] = new Mongo.Collection(
this.selectedBrand this.selectedBrand
); );
return BrandCollections[this.selectedBrand].find({}).fetch(); if (this.query == null)
return BrandCollections[this.selectedBrand].find().fetch();
else
return BrandCollections[this.selectedBrand]
.find(this.query)
.fetch();
}
} catch (e) {
this.alertText = this.$t("RegisterRoute.dbError");
this.alertSnackbar = true;
this.limit = 40;
return [];
} }
} }
} }
......
...@@ -91,16 +91,16 @@ ...@@ -91,16 +91,16 @@
<v-card-actions> <v-card-actions>
<v-row style="margin:auto"> <v-row style="margin:auto">
<v-col cols="12" class="d-flex justify-center align-center flex-wrap"> <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"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openNewDialog">
<strong>{{$t("HISLink.newBtn")}}</strong> <strong>{{$t("HISLink.newBtn")}}</strong>
</v-btn> </v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="openEditDialog" :disabled="this.selectedItemInTable.length == 0"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openEditDialog" :disabled="this.selectedItemInTable.length == 0">
<strong>{{$t("HISLink.editBtn")}}</strong> <strong>{{$t("HISLink.editBtn")}}</strong>
</v-btn> </v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="openResetDialog" :disabled="this.selectedItemInTable.length == 0"> <v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openResetDialog" :disabled="this.selectedItemInTable.length == 0">
<strong>{{$t("Users.ResetPasswordBtn")}}</strong> <strong>{{$t("Users.ResetPasswordBtn")}}</strong>
</v-btn> </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 ma-1" @click="deleteSnackbar" :disabled="this.selectedItemInTable.length == 0">
<strong>{{$t("HISLink.deleteBtn")}}</strong> <strong>{{$t("HISLink.deleteBtn")}}</strong>
</v-btn> </v-btn>
</v-col> </v-col>
......
...@@ -11,6 +11,10 @@ Vue.use(VueRouter); ...@@ -11,6 +11,10 @@ Vue.use(VueRouter);
import { Plugin } from 'vue-fragment' import { Plugin } from 'vue-fragment'
Vue.use(Plugin); Vue.use(Plugin);
import AsyncComputed from 'vue-async-computed';
Vue.use(AsyncComputed);
import routes from './plugins/routes'; import routes from './plugins/routes';
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
......
...@@ -165,7 +165,10 @@ const messages = { ...@@ -165,7 +165,10 @@ const messages = {
}, },
RegisterRoute: { RegisterRoute: {
HISLinkCombo: "HISLink", HISLinkCombo: "HISLink",
ShowMoreBtn: "show more..." searchBtn: "Search",
advancedSearchLabel: "Advanced search",
jsonParseError: "error in parse of given json",
dbError: "error in query, please edit query"
}, },
DataTableSearch: "search" DataTableSearch: "search"
...@@ -332,7 +335,10 @@ const messages = { ...@@ -332,7 +335,10 @@ const messages = {
}, },
RegisterRoute: { RegisterRoute: {
HISLinkCombo: "درگاه HIS", HISLinkCombo: "درگاه HIS",
ShowMoreBtn: "بیشتر..." searchBtn: "جستجو",
advancedSearchLabel: "جستجوی پیشرفته",
jsonParseError: "خطا در Parse عبارت وارد شده",
dbError: "خطا در query، لطفا query را اصلاح نمایید"
}, },
DataTableSearch: "جستجو" DataTableSearch: "جستجو"
......
...@@ -5,7 +5,6 @@ import internalWorklist from '../collections/internalworklist'; ...@@ -5,7 +5,6 @@ import internalWorklist from '../collections/internalworklist';
let collections = {}; let collections = {};
if (Meteor.isServer) { if (Meteor.isServer) {
const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/GetHISBrandsRest`); const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/GetHISBrandsRest`);
let brandsHttpResult = JSON.parse(result.content); let brandsHttpResult = JSON.parse(result.content);
......
...@@ -3,25 +3,62 @@ import { Mongo } from 'meteor/mongo' ...@@ -3,25 +3,62 @@ import { Mongo } from 'meteor/mongo'
import Collections from '../../collections/worklist4hislink.js'; import Collections from '../../collections/worklist4hislink.js';
import { Counts } from 'meteor/tmeasday:publish-counts'; import { Counts } from 'meteor/tmeasday:publish-counts';
Meteor.publish("worklist4hislink", function({ brand, limit }) { Meteor.publish("worklist4hislink", function({ brand, limit, query }) {
if (brand == null) { if (brand == null) {
return []; return [];
} }
if (!this.userId) { if (!this.userId) {
return this.ready(); return this.ready();
} }
const userid = this.userId; const userid = this.userId;
check(brand, String); check(brand, String);
check(limit, Number); check(limit, Number);
Counts.publish(this, 'brandCount', Collections[brand].find(), { noReady: true }); if (query == null)
query = {};
try {
// Counts.publish(this, 'brandCount', Collections[brand].find(query), { noReady: true, fastCount: true });
// else
// Counts.publish(this, 'brandCount', Collections[brand].find(), { noReady: true, fastCount: true });
// let Worklist = new Mongo.Collection(brand); // let Worklist = new Mongo.Collection(brand);
// console.log(Worklist.find({ _userid: userid, _devicemap: devicemap }).fetch()) // console.log(Worklist.find({ _userid: userid, _devicemap: devicemap }).fetch())
return Collections[brand].find({}, { // if (query == null)
// return Collections[brand].find({}, {
// disableOplog: true,
// // pollingThrottleMs: 1000,
// pollingIntervalMs: 1000,
// limit: limit
// });
// else
return Collections[brand].find(query, {
disableOplog: true, disableOplog: true,
// pollingThrottleMs: 1000, // pollingThrottleMs: 1000,
pollingIntervalMs: 1000, pollingIntervalMs: 1000,
limit: limit limit: limit
}); });
} catch (e) {
// Counts.publish(this, 'brandCount', Collections[brand].find({}), { noReady: false });
this.error(new Meteor.Error(e, 'error'));
return [];
}
}); });
Meteor.publish("brandCount", function({ brand, query }) {
if (query == null)
query = {}
if (brand == null) {
return [];
}
try {
Counts.publish(this, 'brandCount', Collections[brand].find(query), { fastCount: true });
} catch {
Counts.publish(this, 'brandCount', Collections[brand].find({}), { fastCount: true });
}
})
\ No newline at end of file
...@@ -13524,6 +13524,11 @@ ...@@ -13524,6 +13524,11 @@
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz",
"integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ=="
}, },
"vue-async-computed": {
"version": "3.8.2",
"resolved": "https://registry.npmjs.org/vue-async-computed/-/vue-async-computed-3.8.2.tgz",
"integrity": "sha512-If5roOhp/x0WWd0TWRD77YsuFoiIw3MbkcRlIB/FE3TqQCPje52eQp5CV5NN/7B0VAyPuGX5JQa+rc9AOcGAYw=="
},
"vue-fragment": { "vue-fragment": {
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/vue-fragment/-/vue-fragment-1.5.1.tgz", "resolved": "https://registry.npmjs.org/vue-fragment/-/vue-fragment-1.5.1.tgz",
...@@ -13618,9 +13623,9 @@ ...@@ -13618,9 +13623,9 @@
"dev": true "dev": true
}, },
"vuetify": { "vuetify": {
"version": "2.1.15", "version": "2.2.12",
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.1.15.tgz", "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.2.12.tgz",
"integrity": "sha512-M35NJvlzkbCpFfsK08xraNvCpiNCIbYUXI/hkzjWHQV1MFIZnjrDTVtYoiudCyJ52zlrhWezAr4pzFOCLAr6RA==" "integrity": "sha512-rtNug+2I45p/ahEeY54nWM/8UyJ1LouS5CpwWjb6JaaMusE3GHD3FBwvb/FMyR+vWZkCxJpLIRfRT0cRpr/QJA=="
}, },
"vuetify-loader": { "vuetify-loader": {
"version": "1.3.0", "version": "1.3.0",
......
...@@ -25,13 +25,14 @@ ...@@ -25,13 +25,14 @@
"uuid": "^3.3.3", "uuid": "^3.3.3",
"valid-url": "^1.0.9", "valid-url": "^1.0.9",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-async-computed": "^3.8.2",
"vue-fragment": "^1.5.1", "vue-fragment": "^1.5.1",
"vue-i18n": "^8.14.0", "vue-i18n": "^8.14.0",
"vue-meta": "^2.2.1", "vue-meta": "^2.2.1",
"vue-meteor-tracker": "^2.0.0-beta.5", "vue-meteor-tracker": "^2.0.0-beta.5",
"vue-router": "^3.1.2", "vue-router": "^3.1.2",
"vue-template-compiler": "^2.6.10", "vue-template-compiler": "^2.6.10",
"vuetify": "^2.1.15", "vuetify": "^2.2.12",
"vuex": "^3.1.1" "vuex": "^3.1.1"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -19,6 +19,7 @@ import '../imports/api/server/publications/devicemap.js'; ...@@ -19,6 +19,7 @@ import '../imports/api/server/publications/devicemap.js';
import '../imports/api/server/publications/users.js'; import '../imports/api/server/publications/users.js';
import '../imports/api/server/publications/worklist4hislink.js' import '../imports/api/server/publications/worklist4hislink.js'
import { Accounts } from "meteor/accounts-base"; import { Accounts } from "meteor/accounts-base";
Meteor.startup(() => { Meteor.startup(() => {
......
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