.
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.1.5 on 2021-02-15 16:16
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('longs', '0018_auto_20210215_1052'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='longseriesimage',
|
||||||
|
name='upload_filename',
|
||||||
|
field=models.CharField(blank=True, max_length=255),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -151,6 +151,7 @@ def test_image_validator(file):
|
|||||||
class LongSeriesImage(models.Model):
|
class LongSeriesImage(models.Model):
|
||||||
image = models.FileField(upload_to=image_directory_path)
|
image = models.FileField(upload_to=image_directory_path)
|
||||||
position = models.IntegerField(default=0)
|
position = models.IntegerField(default=0)
|
||||||
|
upload_filename = models.CharField(max_length=255, blank=True)
|
||||||
series = models.ForeignKey(
|
series = models.ForeignKey(
|
||||||
"LongSeries", related_name="images", on_delete=models.SET_NULL, null=True
|
"LongSeries", related_name="images", on_delete=models.SET_NULL, null=True
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -193,7 +193,6 @@
|
|||||||
$(`img[data-input-id='${input.id}'`).removeClass("image-ident-loading");
|
$(`img[data-input-id='${input.id}'`).removeClass("image-ident-loading");
|
||||||
console.log(l);
|
console.log(l);
|
||||||
if (l.includes("accesion") || l.includes("number") || l.search(/(ref|rk9|rh8|ra9|rbz)\d+/g) > -1) {
|
if (l.includes("accesion") || l.includes("number") || l.search(/(ref|rk9|rh8|ra9|rbz)\d+/g) > -1) {
|
||||||
console.log("SHIT", input);
|
|
||||||
$(input).addClass("image-ident-warning");
|
$(input).addClass("image-ident-warning");
|
||||||
$(`img[data-input-id='${input.id}'`).addClass("image-ident-warning");
|
$(`img[data-input-id='${input.id}'`).addClass("image-ident-warning");
|
||||||
} else {
|
} else {
|
||||||
@@ -218,13 +217,14 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const readFile = (file) => {
|
const readFile = (file, el) => {
|
||||||
reader(file).then(reader => {
|
reader(file).then(reader => {
|
||||||
var image = new Image();
|
var image = new Image();
|
||||||
image.height = 100;
|
image.height = 100;
|
||||||
image.title = file.name;
|
image.title = file.name;
|
||||||
image.src = reader.result;
|
image.src = reader.result;
|
||||||
$("#images").append(image);
|
console.log("read" ,el);
|
||||||
|
$(el).parent().parent().preppend(image);
|
||||||
//images.push(reader.result);
|
//images.push(reader.result);
|
||||||
loadViewer(images);
|
loadViewer(images);
|
||||||
});
|
});
|
||||||
@@ -239,7 +239,7 @@
|
|||||||
console.log(el);
|
console.log(el);
|
||||||
if (el.files.length > 0) {
|
if (el.files.length > 0) {
|
||||||
filename = el.files[0].name;
|
filename = el.files[0].name;
|
||||||
await readFile(el.files[0]);
|
await readFile(el.files[0], el);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
image_set = $("#images img");
|
image_set = $("#image_form_set img");
|
||||||
if (n == image_set.length) {
|
if (n == image_set.length) {
|
||||||
const event = new CustomEvent('loadDicomViewer', { "detail": images });
|
const event = new CustomEvent('loadDicomViewer', { "detail": images });
|
||||||
|
|
||||||
@@ -282,9 +282,13 @@
|
|||||||
console.log(ul)
|
console.log(ul)
|
||||||
|
|
||||||
file_element = $(ul).find("input[type=file]").get(0);
|
file_element = $(ul).find("input[type=file]").get(0);
|
||||||
console.log(file_element);
|
|
||||||
|
|
||||||
""
|
// If a (new) file is being uploaded we save it's name prior to it being hashed
|
||||||
|
if (file_element.files.length > 0) {
|
||||||
|
file_name = file_element.files[0].name
|
||||||
|
$(ul).find("input[type=text]").val(file_name);
|
||||||
|
}
|
||||||
|
|
||||||
if (file_element.files.length > 0 || $(ul).find(":contains('Currently:')")) {
|
if (file_element.files.length > 0 || $(ul).find(":contains('Currently:')")) {
|
||||||
n++;
|
n++;
|
||||||
$(ul).find("input[type=number]").val(n);
|
$(ul).find("input[type=number]").val(n);
|
||||||
|
|||||||
Reference in New Issue
Block a user