hayun-vite 0.0.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/Daco_1154502.png +0 -0
- package/assets/ear-logo-1.png +0 -0
- package/assets/fonts/Vazirmatn-Regular.woff2 +0 -0
- package/assets/hearing-aid-computer-icons-sound-ears-.png +0 -0
- package/assets/logo.svg +1 -0
- package/assets/logo192.png +0 -0
- package/assets/rasa.png +0 -0
- package/assets/styles-test.css +90 -0
- package/assets/styles.css +90 -0
- package/data/formData1.js +42 -0
- package/data/officesObjStore.js +57 -0
- package/data/patientsObjStore.js +74 -0
- package/data/sampleData.js +95 -0
- package/index.js +9 -3
- package/package.json +1 -1
- package/src/{Audiogram.js → Audiogram/Audiogram.js} +6 -4
- package/src/Form/Form.js +277 -0
- package/src/Form/Form_N.js +159 -0
- package/src/Form/Forms-Test.html +125 -0
- package/src/Form/Forms.js +135 -0
- package/src/Form/Header.js +92 -0
- package/src/Form/Reflex.js +142 -0
- package/src/Form/Sections.js +72 -0
- package/src/Form/Speech.js +133 -0
- package/src/Form/TextBox.js +81 -0
- package/src/Form/Tympanogram.js +356 -0
- package/src/Form/formStyles.css +122 -0
- package/src/Form/globalinfo.js +68 -0
- package/src/Form/grid/drawGrid.js +84 -0
- package/src/Form/grid/hideGrid.js +9 -0
- package/src/Form/printForm.js +76 -0
- package/src/Form/rasa-audio-208-293.png +0 -0
- package/src/Form/templates/combo.js +248 -0
- package/src/Form/templates/dims.js +204 -0
- package/src/Form/templates/rasaAud.js +287 -0
- package/src/Form/templates/rasaAud.png +0 -0
- package/src/Form/templates/rasaTymp.jpg +0 -0
- package/src/fonts/Vazirmatn-Regular.woff2 +0 -0
- package/src/main.js +87 -74
- package/src/note.html +1 -0
- package/src/style.css +157 -96
- package/src/AudiogramChart-Test.html +0 -56
- /package/src/{dims.js → Audiogram/dims.js} +0 -0
@@ -0,0 +1,287 @@
|
|
1
|
+
import audDims from "../../Audiogram/dims.js";
|
2
|
+
|
3
|
+
|
4
|
+
const templateRasaAud = {
|
5
|
+
name: 'rasa',
|
6
|
+
label: 'RasaAud',
|
7
|
+
backgroundImage: 'backgroundImage',
|
8
|
+
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
9
|
+
paper: { type: 'A4', case: 'portrait', width: 210, height: 296 },
|
10
|
+
|
11
|
+
// Printable Dimention
|
12
|
+
calc1: function () {
|
13
|
+
this.width = this.paper.width - (this.margin.left + this.margin.right);
|
14
|
+
this.height = this.paper.height - (this.margin.top + this.margin.bottom);
|
15
|
+
let width = this.width;
|
16
|
+
// ابعاد و پدینگ المنت ها
|
17
|
+
// فضای خالی
|
18
|
+
this.blank = {
|
19
|
+
name: 'blank',
|
20
|
+
w: width, h: 21,
|
21
|
+
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
22
|
+
display: 'block',
|
23
|
+
}
|
24
|
+
this.blank1 = {
|
25
|
+
name: 'blank',
|
26
|
+
w: width, h: 99,
|
27
|
+
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
28
|
+
display: 'block',
|
29
|
+
}
|
30
|
+
this.header = {
|
31
|
+
// hideContext: true,
|
32
|
+
name: 'header',
|
33
|
+
w: width, h: 20,
|
34
|
+
margin: { left: 1, top: 1, right: 1, bottom: 1 },
|
35
|
+
display: 'block',
|
36
|
+
}
|
37
|
+
this.patient = {
|
38
|
+
hideContext: true, // برچسب ها را ایجاد نمیکند
|
39
|
+
forceInsert: true, // مقادیر مختصات ورودی ها را از آبجکت جداگانه ای میگیرد
|
40
|
+
name: 'patient',
|
41
|
+
w: width, h: 22,
|
42
|
+
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
43
|
+
display: 'block',
|
44
|
+
}
|
45
|
+
this.history = {
|
46
|
+
// hideContext: true,
|
47
|
+
name: 'history',
|
48
|
+
w: width, h: 10,
|
49
|
+
margin: { left: 1, top: 1, right: 1, bottom: 1 },
|
50
|
+
display: 'block',
|
51
|
+
}
|
52
|
+
|
53
|
+
this.RAudiogram = {}
|
54
|
+
Object.assign(this.RAudiogram,
|
55
|
+
audDims[this.name],
|
56
|
+
{
|
57
|
+
name: 'RAudiogram',
|
58
|
+
w: width / 2, h: 100,
|
59
|
+
margin: { left: 17, top: 18.5, right: 17.2, bottom: 11.5 },
|
60
|
+
display: 'inline',
|
61
|
+
});
|
62
|
+
|
63
|
+
this.LAudiogram = {}
|
64
|
+
Object.assign(this.LAudiogram,
|
65
|
+
audDims[this.name],
|
66
|
+
{
|
67
|
+
name: 'LAudiogram',
|
68
|
+
w: width / 2, h: 100, // پهنای سکشن هست
|
69
|
+
margin: { left: 17.7, top: 18.5, right: 16.8, bottom: 11.5 },
|
70
|
+
display: 'block',
|
71
|
+
});
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
this.RSpeech = {
|
76
|
+
name: 'RSpeech',
|
77
|
+
w: width / 2, h: 38.2,
|
78
|
+
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
79
|
+
display: 'inline',
|
80
|
+
hideContext: true,
|
81
|
+
forceInsert: true,
|
82
|
+
}
|
83
|
+
this.LSpeech = {
|
84
|
+
name: 'LSpeech',
|
85
|
+
w: width / 2, h: 38.2,
|
86
|
+
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
87
|
+
display: 'block',
|
88
|
+
hideContext: true,
|
89
|
+
forceInsert: true,
|
90
|
+
}
|
91
|
+
this.RTympanogram = {
|
92
|
+
name: 'RTympanogram',
|
93
|
+
w: width / 2, h: 60,
|
94
|
+
margin: { left: 2, top: 2, right: 2, bottom: 2 },
|
95
|
+
display: 'inline',
|
96
|
+
}
|
97
|
+
this.LTympanogram = {
|
98
|
+
name: 'LTympanogram',
|
99
|
+
w: width / 2, h: 60,
|
100
|
+
margin: { left: 2, top: 2, right: 2, bottom: 2 },
|
101
|
+
display: 'block',
|
102
|
+
}
|
103
|
+
this.RReflex = {
|
104
|
+
name: 'RReflex',
|
105
|
+
w: width / 2, h: 30,
|
106
|
+
margin: { left: 2, top: 2, right: 2, bottom: 2 },
|
107
|
+
display: 'inline'
|
108
|
+
}
|
109
|
+
this.LReflex = {
|
110
|
+
name: 'LReflex',
|
111
|
+
w: width / 2, h: 30,
|
112
|
+
margin: { left: 2, top: 2, right: 2, bottom: 2 },
|
113
|
+
display: 'block'
|
114
|
+
}
|
115
|
+
this.report = {
|
116
|
+
name: 'report',
|
117
|
+
w: width, h: 37.4,
|
118
|
+
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
119
|
+
display: 'block',
|
120
|
+
hideContext: true,
|
121
|
+
forceInsert: true
|
122
|
+
}
|
123
|
+
this.footer = {
|
124
|
+
name: 'footer',
|
125
|
+
w: width, h: 10,
|
126
|
+
margin: { left: 1, top: 1, right: 1, bottom: 1 },
|
127
|
+
display: 'block'
|
128
|
+
}
|
129
|
+
},
|
130
|
+
|
131
|
+
calc2: function () {
|
132
|
+
// let dims = this.dims;
|
133
|
+
let width, height;
|
134
|
+
//آیتم های روی این تمپلت
|
135
|
+
// روش جدید محاسبه ابعاد منطقی تر و تمیز تر
|
136
|
+
// Object.assign(this.header, {
|
137
|
+
// width: this.getWidth(this.header),
|
138
|
+
// height: this.getHeight(this.header),
|
139
|
+
// })
|
140
|
+
// New
|
141
|
+
width = this.header.width = this.getWidth(this.header)
|
142
|
+
height = this.header.height = this.getHeight(this.header)
|
143
|
+
|
144
|
+
this.header.elements = [
|
145
|
+
{ type: 'line', x1: 0, y1: height, x2: width, y2: height },
|
146
|
+
{ type: 'text', x: 30, y: 5, value: 'تاریخ :' },
|
147
|
+
]
|
148
|
+
this.header.inputs = [
|
149
|
+
{ name: 'officeName', x: width - 20, y: height - 10 },
|
150
|
+
{ name: 'date', x: 20, y: 5 },
|
151
|
+
]
|
152
|
+
|
153
|
+
width = this.patient.width = this.getWidth(this.patient)
|
154
|
+
this.patient.height = this.getHeight(this.patient)
|
155
|
+
this.patient.elements = [
|
156
|
+
{ type: 'line', x1: 0, y1: 20, x2: width, y2: 20 },
|
157
|
+
{ type: 'text', x: width, y: 5, value: 'نام:' },
|
158
|
+
{ type: 'text', x: width - 30, y: 5, value: 'نام خانوادگی:' },
|
159
|
+
{ type: 'text', x: width - 90, y: 5, value: 'سن:' },
|
160
|
+
{ type: 'text', x: width - 130, y: 5, value: 'ارجاع از:' }
|
161
|
+
]
|
162
|
+
this.patient.inputs = [
|
163
|
+
{ name: 'name', x: width - 5, y: 5 },
|
164
|
+
{ name: 'lastName', x: width - 47, y: 5 },
|
165
|
+
{ name: 'age', x: width - 97, y: 5 },
|
166
|
+
{ name: 'referrer', x: width - 142, y: 5 }
|
167
|
+
]
|
168
|
+
this.patient.forceInputs = [
|
169
|
+
{ name: 'name', x: width - 45, y: 12 },
|
170
|
+
{ name: 'lastName', x: width - 75, y: 12 },
|
171
|
+
{ name: 'age', x: width - 105, y: 12 },
|
172
|
+
{ name: 'referrer', x: width - 150, y: 12 }
|
173
|
+
]
|
174
|
+
|
175
|
+
width = this.history.width = this.getWidth(this.history)
|
176
|
+
this.history.height = this.getHeight(this.history)
|
177
|
+
this.history.elements = [
|
178
|
+
{ type: 'line', x1: 0, y1: 20, x2: width, y2: 20 },
|
179
|
+
{ type: 'text', x: width, y: 5, value: 'شرح حال:' },
|
180
|
+
]
|
181
|
+
this.history.inputs = [
|
182
|
+
{ name: 'description', x: width - 13, y: 5 },
|
183
|
+
]
|
184
|
+
|
185
|
+
width = this.RAudiogram.width = this.getWidth(this.RAudiogram)
|
186
|
+
this.RAudiogram.height = this.getHeight(this.RAudiogram)
|
187
|
+
|
188
|
+
width = this.LAudiogram.width = this.getWidth(this.LAudiogram)
|
189
|
+
this.LAudiogram.height = this.getHeight(this.LAudiogram)
|
190
|
+
|
191
|
+
width = this.RSpeech.width = this.getWidth(this.RSpeech)
|
192
|
+
this.RSpeech.height = this.getHeight(this.RSpeech)
|
193
|
+
this.RSpeech.labels = ["SRT", "MCL", "SDS", 'UCL']
|
194
|
+
this.RSpeech.forceInputs = [
|
195
|
+
{ name: 'SRT', x: 23, y: 26 },
|
196
|
+
{ name: 'MCL', x: 35, y: 26 },
|
197
|
+
{ name: 'SDS', x: 47, y: 26 },
|
198
|
+
{ name: 'UCL', x: 59, y: 26 },
|
199
|
+
]
|
200
|
+
|
201
|
+
width = this.LSpeech.width = this.getWidth(this.LSpeech)
|
202
|
+
this.LSpeech.height = this.getHeight(this.LSpeech)
|
203
|
+
this.LSpeech.labels = ["SRT", "MCL", "SDS", 'UCL']
|
204
|
+
this.LSpeech.forceInputs = [
|
205
|
+
{ name: 'SRT', x: 33, y: 26 },
|
206
|
+
{ name: 'MCL', x: 45, y: 26 },
|
207
|
+
{ name: 'SDS', x: 57, y: 26 },
|
208
|
+
{ name: 'UCL', x: 69, y: 26 },
|
209
|
+
]
|
210
|
+
|
211
|
+
width = this.RTympanogram.width = this.getWidth(this.RTympanogram)
|
212
|
+
this.RTympanogram.height = this.getHeight(this.RTympanogram)
|
213
|
+
width = this.LTympanogram.width = this.getWidth(this.LTympanogram)
|
214
|
+
this.LTympanogram.height = this.getHeight(this.LTympanogram)
|
215
|
+
|
216
|
+
width = this.RReflex.width = this.getWidth(this.RReflex)
|
217
|
+
this.RReflex.height = this.getHeight(this.RReflex)
|
218
|
+
width = this.LReflex.width = this.getWidth(this.LReflex)
|
219
|
+
this.LReflex.height = this.getHeight(this.LReflex)
|
220
|
+
|
221
|
+
width = this.report.width = this.getWidth(this.report)
|
222
|
+
this.report.height = this.getHeight(this.report)
|
223
|
+
this.report.elements = [
|
224
|
+
{ type: 'text', x: width, y: 5, value: 'گزارش:' },
|
225
|
+
]
|
226
|
+
this.report.inputs = [
|
227
|
+
{ name: 'description', x: width - 10, y: 5 },
|
228
|
+
]
|
229
|
+
this.report.forceInputs = [
|
230
|
+
{ name: 'description', x: width - 20, y: 14 },
|
231
|
+
|
232
|
+
]
|
233
|
+
|
234
|
+
|
235
|
+
width = this.footer.width = this.getWidth(this.footer)
|
236
|
+
this.footer.height = this.getHeight(this.footer)
|
237
|
+
this.footer.elements = [
|
238
|
+
{ type: 'line', x1: 0, y1: 0, x2: width, y2: 0 },
|
239
|
+
{ type: 'text', x: width, y: 5, value: 'آدرس:' },
|
240
|
+
{ type: 'text', x: width - 120, y: 5, value: 'تلفن:' },
|
241
|
+
]
|
242
|
+
this.footer.inputs = [
|
243
|
+
{ name: 'address', x: width - 10, y: 5 },
|
244
|
+
{ name: 'tel', x: width - 128, y: 5 },
|
245
|
+
]
|
246
|
+
},
|
247
|
+
|
248
|
+
|
249
|
+
getWidth: function (element) {
|
250
|
+
return (element.w - (element.margin.left + element.margin.right))
|
251
|
+
},
|
252
|
+
getHeight: function (element) {
|
253
|
+
return (element.h - (element.margin.top + element.margin.bottom))
|
254
|
+
},
|
255
|
+
|
256
|
+
calcSectionsArray: function () {
|
257
|
+
// این آرایه دقیقا ترتیب قرارگیری سکشن ها را بدون اون اوردر قبلی تعیین میکند
|
258
|
+
this.sections = [
|
259
|
+
|
260
|
+
// this.blank,
|
261
|
+
this.blank,
|
262
|
+
this.patient,
|
263
|
+
// this.blank1,
|
264
|
+
|
265
|
+
// this.history,
|
266
|
+
this.RAudiogram,
|
267
|
+
this.LAudiogram,
|
268
|
+
this.RSpeech, this.LSpeech,
|
269
|
+
// this.RTympanogram, this.LTympanogram,
|
270
|
+
// this.RReflex, this.LReflex,
|
271
|
+
this.report,
|
272
|
+
// this.footer
|
273
|
+
|
274
|
+
]
|
275
|
+
},
|
276
|
+
|
277
|
+
|
278
|
+
}
|
279
|
+
|
280
|
+
templateRasaAud.calc1()
|
281
|
+
templateRasaAud.calc2()
|
282
|
+
templateRasaAud.calcSectionsArray()
|
283
|
+
|
284
|
+
// پهنا و ارتفاع قابل استفاده منهای پد ها میشه پهنا و ارتفاع اصلی
|
285
|
+
|
286
|
+
export default templateRasaAud;
|
287
|
+
|
Binary file
|
Binary file
|
Binary file
|
package/src/main.js
CHANGED
@@ -1,74 +1,87 @@
|
|
1
|
-
import './style.css'
|
2
|
-
|
3
|
-
import AudiogramChart from "./Audiogram"
|
4
|
-
import dims from './dims.js'
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
// import
|
10
|
-
|
11
|
-
//
|
12
|
-
|
13
|
-
//
|
14
|
-
//
|
15
|
-
//
|
16
|
-
//
|
17
|
-
//
|
18
|
-
//
|
19
|
-
//
|
20
|
-
//
|
21
|
-
//
|
22
|
-
//
|
23
|
-
//
|
24
|
-
//
|
25
|
-
//
|
26
|
-
//
|
27
|
-
//
|
28
|
-
|
29
|
-
//
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
<
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
})
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
1
|
+
// import './style.css'
|
2
|
+
|
3
|
+
import AudiogramChart from "./Audiogram/Audiogram.js"
|
4
|
+
import dims from './Audiogram/dims.js'
|
5
|
+
import Forms from "./Form/Forms.js";
|
6
|
+
import { officeData, patientData } from "../data/sampleData.js"
|
7
|
+
|
8
|
+
|
9
|
+
// import javascriptLogo from './javascript.svg'
|
10
|
+
// import viteLogo from '/vite.svg'
|
11
|
+
// import { setupCounter } from './counter.js'
|
12
|
+
|
13
|
+
// document.querySelector('#app').innerHTML = `
|
14
|
+
// <div>
|
15
|
+
// <a href="https://vite.dev" target="_blank">
|
16
|
+
// <img src="${viteLogo}" class="logo" alt="Vite logo" />
|
17
|
+
// </a>
|
18
|
+
// <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
|
19
|
+
// <img src="${javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
|
20
|
+
// </a>
|
21
|
+
// <h1>Hello Vite!</h1>
|
22
|
+
// <div class="card">
|
23
|
+
// <button id="counter" type="button"></button>
|
24
|
+
// </div>
|
25
|
+
// <p class="read-the-docs">
|
26
|
+
// Click on the Vite logo to learn more
|
27
|
+
// </p>
|
28
|
+
// </div>
|
29
|
+
// `
|
30
|
+
|
31
|
+
// setupCounter(document.querySelector('#counter'))
|
32
|
+
|
33
|
+
|
34
|
+
document.querySelector('#app').innerHTML = `
|
35
|
+
<button>Ok</button>
|
36
|
+
<button>Tok</button>
|
37
|
+
<p>Mahdi</p>
|
38
|
+
<h1>مهدی جاویدی پرنده پرکلاغی</h1>
|
39
|
+
<div id="forms-div"></div>
|
40
|
+
<div id="audiogram-div"></div>
|
41
|
+
`
|
42
|
+
|
43
|
+
const forms = new Forms({ container: document.getElementById('forms-div'), name: 'form1' });
|
44
|
+
forms.update({ officeData, patientData, sessionIndex: 0 })
|
45
|
+
|
46
|
+
|
47
|
+
const RAudiogram = new AudiogramChart({
|
48
|
+
container: document.getElementById('audiogram-div'),
|
49
|
+
dims: dims.display,
|
50
|
+
side: 'R', x: 0, y: 0,
|
51
|
+
width: 700, height: 800, events: true
|
52
|
+
})
|
53
|
+
|
54
|
+
const LAudiogram = new AudiogramChart({
|
55
|
+
container: document.getElementById('audiogram-div'),
|
56
|
+
dims: dims.display,
|
57
|
+
side: 'L', x: 0, y: 0,
|
58
|
+
width: 700, height: 800, events: true
|
59
|
+
})
|
60
|
+
|
61
|
+
RAudiogram.update({
|
62
|
+
data: {
|
63
|
+
// R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
|
64
|
+
R_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
|
65
|
+
R_AC_NR: { 1500: 85 },
|
66
|
+
R_BC_M: { 2000: 25, 6000: 25 },
|
67
|
+
R_BC_M_NR: { 3000: 85 },
|
68
|
+
R_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
|
69
|
+
},
|
70
|
+
side: 'R',
|
71
|
+
})
|
72
|
+
|
73
|
+
LAudiogram.update({
|
74
|
+
data: {
|
75
|
+
// R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
|
76
|
+
L_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
|
77
|
+
L_AC_NR: { 1500: 85 },
|
78
|
+
L_BC_M: { 2000: 25, 6000: 25 },
|
79
|
+
L_BC_M_NR: { 3000: 85 },
|
80
|
+
L_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
|
81
|
+
},
|
82
|
+
side: 'L',
|
83
|
+
})
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
package/src/note.html
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
<div id="forms"></div>
|