Refactor
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<tbody>
|
||||
<tr v-for="row in patients_lost" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
|
||||
<td v-if="production"><router-link :to="'/patient/$' + row.key">{{row.Name}} ${{row.key}}</router-link></td>
|
||||
<td v-else><router-link :title="unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} ${{row.key}}</router-link></td>
|
||||
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} ${{row.key}}</router-link></td>
|
||||
<td>{{datefmt(row.TimeLast)}} {{dow[row.TimeLast.getDay()]}}</td>
|
||||
<td>{{row.Clinic}}</td>
|
||||
<td>{{Math.round(row.TimeLastDiff/86400000)}}</td>
|
||||
@@ -32,7 +32,7 @@
|
||||
<tbody>
|
||||
<tr v-for="row in patients_outstanding" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
|
||||
<td v-if="production"><router-link :to="'/patient/$' + row.key">{{row.Name}} ${{row.key}}</router-link></td>
|
||||
<td v-else><router-link :title="unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} ${{row.key}}</router-link></td>
|
||||
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} ${{row.key}}</router-link></td>
|
||||
<td>{{datefmt(row.TimeNext)}} {{dow[row.TimeNext.getDay()]}}</td>
|
||||
<td>{{row.Clinic}}</td>
|
||||
<td>{{Math.round(row.TimeNextDiff/86400000)}}</td>
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<script>
|
||||
import cookie from './cookie.mjs';
|
||||
import { groupByArray, strHashHSL, strftime_vista, debounce } from './util.mjs';
|
||||
import { groupByArray, strtr_unscramble, strHashHSL, strftime_vista, debounce } from './util.mjs';
|
||||
|
||||
import ViewResourceLookup from './ViewResourceLookup.vue';
|
||||
|
||||
@@ -54,15 +54,6 @@
|
||||
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
}
|
||||
|
||||
function strtr(s, a, b) {
|
||||
var res = '';
|
||||
for(var i = 0; i < s.length; ++i) {
|
||||
var j = a.indexOf(s.charAt(i));
|
||||
res += j >= 0 ? b.charAt(j) : s.charAt(i);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ViewResourceLookup
|
||||
@@ -97,9 +88,7 @@
|
||||
},
|
||||
methods: {
|
||||
strHashHSL,
|
||||
unscramble(name) {
|
||||
return name.length > 0 ? (name.charAt(0) + strtr(name.substring(1), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'LKJIHGFEDCBAZYXWVUTSRQPONM')) : name;
|
||||
},
|
||||
strtr_unscramble,
|
||||
datefmt(date) {
|
||||
return date ? date.toLocaleDateString('en-CA') : '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user