Skip to content

Commit

Permalink
Merge pull request #80 from rikyperdana/local
Browse files Browse the repository at this point in the history
antrian update
  • Loading branch information
rikyperdana committed Sep 2, 2020
2 parents 32ef44f + 4998467 commit 9b8731a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion development/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ io().on('connect', socket => [
m('.content', m('a.help', {
href: 'https://github.com/rikyperdana/simrs',
target: '_blank'
}, 'Versi 1.9.3'))
}, 'Versi 2.0.6'))
)
)}),
// setiap kali data berubah, beritahu server untuk update seluruh klien yg sedang terkoneksi
Expand Down
2 changes: 1 addition & 1 deletion development/doms.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ makeReport = (name, action, selections) => m('.box',
)
),

defaultStyle = objDB => 11001001001 ? // dbConnector?
defaultStyle = objDB => 1001100111110111110101101 ? // dbConnector?
((+localStorage[false || 'license'] || 0) > _.now()) ? objDB : withThis(
{decoration: _.camelCase(_.initial(['line', 'through', 'database']).join(' '))},
({decoration}) => _.merge({defaultStyle: {decoration}}, objDB)
Expand Down
3 changes: 1 addition & 2 deletions development/pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ makePdf = {
]}}
]
].filter(Boolean) : ''
].filter(Boolean)}))
.download('soap_'+identitas.no_mr),
]})).download('soap_'+identitas.no_mr),

resep: (drugs, no_mr) =>
pdfMake.createPdf(defaultStyle({content: [
Expand Down
3 changes: 2 additions & 1 deletion development/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ _.assign(comp, {
{onclick: () => [
state.modalLicense = m('.box',
m('h3', 'Unlock Lisensi Enterprise'),
m('p.help', 'Untuk menghilangkan semua garis batas pada pdf'),
m(autoForm({
id: 'updateLicense',
schema: {key: {type: String, autoform: {
help: 'Dapatkan dari developer'
placeholder: 'Dapatkan dari developer'
}}},
action: ({key}) => key.length === 15 && [
withThis(['license', key.split(' ').reverse().join(''), localStorage],
Expand Down
33 changes: 26 additions & 7 deletions development/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@
_.assign(comp, {
queue: () => m('.content',
m('table.is-fullwidth', m('tr',
{oncreate: () => db.queue.toArray(
array => localStorage.setItem('regQueue', array.filter(
i => i.timestamp > startOfTheDay(+moment())
).length)
)},
{onupdate: () => [
db.queue.toArray(
array => localStorage.setItem('regQueue', array.filter(
i => i.timestamp > startOfTheDay(+moment())
).length)
),
db.patients.toArray(array => localStorage.setItem(
'clinicQueue', JSON.stringify(
array.flatMap(i => (i.rawatJalan || []).map(j =>
(startOfTheDay(j.tanggal) === startOfTheDay(_.now())) &&
[j.klinik, Boolean(j.soapDokter)]
).filter(Boolean))
.filter(i => i.length)
)
))
]},
m('th', m('h1', 'Antrian Pendaftaran')),
m('th', m('h1', 'R'+(localStorage.regQueue || 0)))
)),
Expand All @@ -28,10 +39,18 @@ _.assign(comp, {
),
Array(3).map(i => m('br')),
// TODO: antrian poliklinik belum ada angkanya
m('h1', 'Antrian Poliklinik'),
m('table.is-fullwidth.is-striped',
m('thead', m('tr'), [
'Antrian Poliklinik', 'Urutan', 'Panjang'
].map(i => m('td', m('h1', i)))),
selects('klinik')().map(i => m('tr',
m('td', m('h2', i.label))
[
i.label,
JSON.parse(localStorage.clinicQueue || '[]')
.filter(j => ands([j[0] === i.value, j[1]])).length,
JSON.parse(localStorage.clinicQueue || '[]')
.filter(j => j[0] === i.value).length
].map(i => m('td', m('h1', i)))
))
)
)
Expand Down
2 changes: 1 addition & 1 deletion production/bundled.min.js

Large diffs are not rendered by default.

0 comments on commit 9b8731a

Please sign in to comment.