forms
This commit is contained in:
parent
15292f4f1b
commit
d05a980adb
@ -43,7 +43,7 @@ import '@vuepic/vue-datepicker/dist/main.css';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {VueDatePicker},
|
components: {VueDatePicker},
|
||||||
name: 'CalibrationDeviceForm',
|
name: 'NewCalibrationDeviceForm',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
calibration_model: "",
|
calibration_model: "",
|
@ -56,7 +56,7 @@ import '@vuepic/vue-datepicker/dist/main.css';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {VueDatePicker},
|
components: {VueDatePicker},
|
||||||
name: 'InstrumentForm',
|
name: 'NewInstrumentForm',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
channel: "",
|
channel: "",
|
@ -1,18 +1,10 @@
|
|||||||
<script setup>
|
|
||||||
import CustomerForm from "./CustomerForm.vue";
|
|
||||||
import InstrumentForm from "./InstrumentForm.vue";
|
|
||||||
import CalibrationDeviceForm from "./CalibrationDeviceForm.vue";
|
|
||||||
import EnvironmentForm from "./EnvironmentForm.vue";
|
|
||||||
import UploadForm from "./UploadForm.vue";
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="item card">
|
<div class="item card">
|
||||||
<UploadForm />
|
<UploadForm />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="item card">
|
<div class="item card">
|
||||||
<CustomerForm />
|
<CustomerForm />
|
||||||
@ -22,10 +14,18 @@ import UploadForm from "./UploadForm.vue";
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item card">
|
<div class="item card">
|
||||||
<InstrumentForm/>
|
<NewInstrumentForm />
|
||||||
</div>
|
</div>
|
||||||
<div class="item card">
|
<div class="item card">
|
||||||
<CalibrationDeviceForm/>
|
<NewCalibrationDeviceForm />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import CustomerForm from "./CustomerForm.vue";
|
||||||
|
import NewInstrumentForm from "./Instrument/NewInstrumentForm.vue";
|
||||||
|
import NewCalibrationDeviceForm from "./CalibrationDevice/NewCalibrationDeviceForm.vue";
|
||||||
|
import EnvironmentForm from "./EnvironmentForm.vue";
|
||||||
|
import UploadForm from "./UploadForm.vue";
|
||||||
|
</script>
|
@ -16,8 +16,17 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan=2>
|
<td colspan=2>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="file in files">
|
<li v-for="file in files" :key="file.id">
|
||||||
{{ file.name }}
|
{{ file.name }}
|
||||||
|
<label>
|
||||||
|
<input type="radio" name="alignment" value="both" @change="kindChange('both', file)"> Both
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<input type="radio" name="alignment" value="left" @change="kindChange('left', file)"> As Left
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<input type="radio" name="alignment" value="found" @change="kindChange('found', file)"> As Found
|
||||||
|
</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<file-upload
|
<file-upload
|
||||||
@ -79,7 +88,7 @@ export default {
|
|||||||
* @param Object|undefined oldFile Read only
|
* @param Object|undefined oldFile Read only
|
||||||
* @return undefined
|
* @return undefined
|
||||||
*/
|
*/
|
||||||
inputFile: function (newFile, oldFile) {
|
inputFile(newFile, oldFile) {
|
||||||
if (newFile && oldFile && !newFile.active && oldFile.active) {
|
if (newFile && oldFile && !newFile.active && oldFile.active) {
|
||||||
// Get response data
|
// Get response data
|
||||||
console.log('response', newFile.response)
|
console.log('response', newFile.response)
|
||||||
@ -96,7 +105,7 @@ export default {
|
|||||||
* @param Function prevent Prevent changing
|
* @param Function prevent Prevent changing
|
||||||
* @return undefined
|
* @return undefined
|
||||||
*/
|
*/
|
||||||
inputFilter: function (newFile, oldFile, prevent) {
|
inputFilter(newFile, oldFile, prevent) {
|
||||||
if (newFile && !oldFile) {
|
if (newFile && !oldFile) {
|
||||||
// Filter non-image file
|
// Filter non-image file
|
||||||
if (!/\.(txt)$/i.test(newFile.name)) {
|
if (!/\.(txt)$/i.test(newFile.name)) {
|
||||||
@ -110,6 +119,12 @@ export default {
|
|||||||
if (URL && URL.createObjectURL) {
|
if (URL && URL.createObjectURL) {
|
||||||
newFile.blob = URL.createObjectURL(newFile.file)
|
newFile.blob = URL.createObjectURL(newFile.file)
|
||||||
}
|
}
|
||||||
|
console.log(URL)
|
||||||
|
},
|
||||||
|
kindChange(opt, file) {
|
||||||
|
// Change the file kind metadata, (both, as found, as left) for the uploaded file
|
||||||
|
file.kind = opt
|
||||||
|
console.log(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user