fixed warnings
This commit is contained in:
parent
10a413e9c1
commit
d47e866492
@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import Header from './components/Header.vue';
|
||||
import Header from './components/Header.vue';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
components: {
|
||||
Header
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import CatalogMixins from '../mixins/CatalogMixins.js';
|
||||
import Cabinet from "../models/Cabinet";
|
||||
import Computer from '../models/Computer';
|
||||
import Monitor from '../models/Monitor';
|
||||
import DataService from '../services/DataService';
|
||||
import axios from 'axios';
|
||||
import CatalogMixins from '../mixins/CatalogMixins.js';
|
||||
import Cabinet from "../models/Cabinet";
|
||||
import Computer from '../models/Computer';
|
||||
import Monitor from '../models/Monitor';
|
||||
import DataService from '../services/DataService';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
mixins: [
|
||||
CatalogMixins
|
||||
],
|
||||
@ -49,7 +49,7 @@
|
||||
methods: {
|
||||
filter() {
|
||||
let urlParams = ""
|
||||
if (document.getElementById('numberFilterInput').value != "") {
|
||||
if (document.getElementById('numberFilterInput').value !== "") {
|
||||
urlParams += "number=" + this.number;
|
||||
}
|
||||
DataService.readAll(this.dataFilterUrl + urlParams, (data) => new Cabinet(data))
|
||||
|
@ -1,12 +1,11 @@
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import CatalogMixins from '../mixins/CatalogMixins.js';
|
||||
import Cabinet from "../models/Cabinet";
|
||||
import Computer from '../models/Computer';
|
||||
import Monitor from '../models/Monitor';
|
||||
import DataService from '../services/DataService';
|
||||
import CatalogMixins from '../mixins/CatalogMixins.js';
|
||||
import Cabinet from "../models/Cabinet";
|
||||
import Computer from '../models/Computer';
|
||||
import Monitor from '../models/Monitor';
|
||||
import DataService from '../services/DataService';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
mixins: [
|
||||
CatalogMixins
|
||||
],
|
||||
@ -46,26 +45,26 @@
|
||||
methods: {
|
||||
filter() {
|
||||
let urlParams = ""
|
||||
if (document.getElementById('modelNameFilterInput').value != "") {
|
||||
if (urlParams != "") {
|
||||
if (document.getElementById('modelNameFilterInput').value !== "") {
|
||||
if (urlParams !== "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "modelName=" + this.modelName;
|
||||
}
|
||||
if (document.getElementById('serialNumberFilterInput').value != "") {
|
||||
if (urlParams != "") {
|
||||
if (document.getElementById('serialNumberFilterInput').value !== "") {
|
||||
if (urlParams !== "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "serialNum=" + this.serialNumber;
|
||||
}
|
||||
if (document.getElementById('monitorFilterSelect').value != "") {
|
||||
if (urlParams != "") {
|
||||
if (document.getElementById('monitorFilterSelect').value !== "") {
|
||||
if (urlParams !== "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "monitorId=" + this.monitorId;
|
||||
}
|
||||
if (document.getElementById('cabinetFilterSelect').value != "") {
|
||||
if (urlParams != "") {
|
||||
if (document.getElementById('cabinetFilterSelect').value !== "") {
|
||||
if (urlParams !== "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "cabinetId=" + this.cabinetId;
|
||||
@ -83,10 +82,6 @@
|
||||
this.monitorId = null;
|
||||
this.cabinetId = null;
|
||||
},
|
||||
addCabinetToComputer(computerId) {
|
||||
let cabinetId = document.getElementById('cabinets').value;
|
||||
let response = axios.post(`http://localhost:8080/api/computer/${computerId}/cabinet?cabinetId=${cabinetId}`);
|
||||
},
|
||||
itemsComps(computers) {
|
||||
if (typeof computers === 'undefined') {
|
||||
return;
|
||||
@ -167,16 +162,5 @@
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- <div class="mb-3">
|
||||
<label for="cabinet" class="form-label">Номер кабинета</label>
|
||||
<select class="form-select" id="cabinet" v-model="data.cabinetId">
|
||||
<option disabled value="">Выберите номер кабинета</option>
|
||||
<option v-for="cabinet in this.cabinets"
|
||||
:value="cabinet.id"
|
||||
:selected="data.cabinetId && cabinet.id === data.cabinetId">
|
||||
{{ cabinet.number }}
|
||||
</option>
|
||||
</select>
|
||||
</div> -->
|
||||
</Modal>
|
||||
</template>
|
@ -1,10 +1,9 @@
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import CatalogMixins from '../mixins/CatalogMixins.js';
|
||||
import Monitor from '../models/Monitor';
|
||||
import DataService from '../services/DataService';
|
||||
import CatalogMixins from '../mixins/CatalogMixins.js';
|
||||
import Monitor from '../models/Monitor';
|
||||
import DataService from '../services/DataService';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
mixins: [
|
||||
CatalogMixins
|
||||
],
|
||||
@ -22,7 +21,7 @@
|
||||
methods: {
|
||||
filter() {
|
||||
let urlParams = ""
|
||||
if (document.getElementById('modelNameFilterInput').value != "") {
|
||||
if (document.getElementById('modelNameFilterInput').value !== "") {
|
||||
urlParams += "modelName=" + this.modelName;
|
||||
}
|
||||
DataService.readAll(this.dataFilterUrl + urlParams, (data) => new Monitor(data))
|
||||
|
@ -1,247 +0,0 @@
|
||||
<script>
|
||||
import CatalogMixins from '../mixins/CatalogMixins.js';
|
||||
import Order from "../models/Order";
|
||||
import Car from '../models/Car';
|
||||
import Client from '../models/Client';
|
||||
import PickUpPoint from '../models/PickUpPoint';
|
||||
import DataService from '../services/DataService';
|
||||
|
||||
export default {
|
||||
mixins: [
|
||||
CatalogMixins
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
getAllUrl: 'order',
|
||||
dataUrl: 'order',
|
||||
transformer: (data) => new Order(data),
|
||||
headers: [
|
||||
{ name: 'value', label: 'Оценочная стоимость' },
|
||||
{ name: 'status', label: 'Статус' },
|
||||
{ name: 'date', label: 'Дата' },
|
||||
{ name: 'clientName', label: 'Клиент' },
|
||||
{ name: 'sourcePickUpPointAddress', label: 'Пункт отправления' },
|
||||
{ name: 'destPickUpPointAddress', label: 'Пункт выдачи' },
|
||||
{ name: 'carNumber', label: 'Автомобиль' }
|
||||
],
|
||||
dataFilterUrl: 'order/filter?',
|
||||
carUrl: 'car',
|
||||
cars: [],
|
||||
pickUpPointUrl: 'pickUpPoint',
|
||||
pickUpPoints: [],
|
||||
clientUrl: 'client',
|
||||
clients: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
DataService.readAll(this.carUrl, (data) => new Car(data))
|
||||
.then(data => {
|
||||
this.cars = data;
|
||||
});
|
||||
DataService.readAll(this.pickUpPointUrl, (data) => new PickUpPoint(data))
|
||||
.then(data => {
|
||||
this.pickUpPoints = data;
|
||||
});
|
||||
DataService.readAll(this.clientUrl, (data) => new Client(data))
|
||||
.then(data => {
|
||||
this.clients = data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
filter() {
|
||||
let urlParams = ""
|
||||
if (document.getElementById('idFilterInput').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "id=" + this.id;
|
||||
}
|
||||
if (document.getElementById('valueFilterInput').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "value=" + this.value;
|
||||
}
|
||||
if (document.getElementById('statusFilterSelect').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "status=" + this.status;
|
||||
}
|
||||
if (document.getElementById('dateFilterInput').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "date=" + this.date;
|
||||
}
|
||||
if (document.getElementById('clientFilterSelect').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "clientId=" + this.clientId;
|
||||
}
|
||||
if (document.getElementById('sourcePickUpPointFilterSelect').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "sourcePickUpPointId=" + this.sourcePickUpPointId;
|
||||
}
|
||||
if (document.getElementById('destPickUpPointFilterSelect').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "destPickUpPointId=" + this.destPickUpPointId;
|
||||
}
|
||||
if (document.getElementById('carFilterSelect').value != "") {
|
||||
if (urlParams != "") {
|
||||
urlParams += "&";
|
||||
}
|
||||
urlParams += "carId=" + this.carId;
|
||||
}
|
||||
DataService.readAll(this.dataFilterUrl + urlParams, (data) => new Order(data))
|
||||
.then(data => {
|
||||
this.items = data;
|
||||
});
|
||||
},
|
||||
clearFilters() {
|
||||
this.loadItems();
|
||||
this.id = null;
|
||||
this.value = null;
|
||||
this.status = null;
|
||||
this.date = null;
|
||||
this.clientId = null;
|
||||
this.sourcePickUpPointId = null;
|
||||
this.destPickUpPointId = null;
|
||||
this.destPickUpPointId = null;
|
||||
this.carId = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" id="idFilterInput" placeholder="Номер заказа" required v-model="id">
|
||||
|
||||
<input type="text" class="form-control" id="valueFilterInput" placeholder="Оценочная стоимость" required v-model="value">
|
||||
|
||||
<select class="form-select" id="statusFilterSelect" v-model="status">
|
||||
<option disabled value="" selected>Выберите статус</option>
|
||||
<option value="accepted">Принят</option>
|
||||
<option value="inDelivery">В пути</option>
|
||||
<option value="delivered">Доставлен</option>
|
||||
<option value="issued">Выдан</option>
|
||||
</select>
|
||||
|
||||
<input type="date" class="form-control" id="dateFilterInput" placeholder="Дата" required v-model="date">
|
||||
|
||||
<select class="form-select" id="clientFilterSelect" v-model="clientId">
|
||||
<option disabled value="" selected>Выберите клиента</option>
|
||||
<option v-for="client in clients" :value="client.id">{{ client.name }}</option>
|
||||
</select>
|
||||
|
||||
<select class="form-select" id="sourcePickUpPointFilterSelect" v-model="sourcePickUpPointId">
|
||||
<option disabled value="" selected>Выберите пункт отправления</option>
|
||||
<option v-for="sourcePickUpPoint in pickUpPoints" :value="sourcePickUpPoint.id">{{ sourcePickUpPoint.address }}</option>
|
||||
</select>
|
||||
|
||||
<select class="form-select" id="destPickUpPointFilterSelect" v-model="destPickUpPointId">
|
||||
<option disabled value="" selected>Выберите пункт получения</option>
|
||||
<option v-for="destPickUpPoint in pickUpPoints" :value="destPickUpPoint.id">{{ destPickUpPoint.address }}</option>
|
||||
</select>
|
||||
|
||||
<select class="form-select" id="carFilterSelect" v-model="carId">
|
||||
<option disabled value="" selected>Выберите автомобиль</option>
|
||||
<option v-for="car in cars" :value="car.id">{{ car.gosNumber }}</option>
|
||||
</select>
|
||||
|
||||
<button class="btn btn-primary" type="button" id="report-button"
|
||||
@click.prevent="filter">Сформировать</button>
|
||||
<button class="btn btn-outline-secondary" type="button" id="report-button"
|
||||
@click.prevent="clearFilters">Очистить</button>
|
||||
</div>
|
||||
<ToolBar
|
||||
@add="showAddModal"
|
||||
@edit="showEditModal"
|
||||
@remove="removeSelectedItems">
|
||||
</ToolBar>
|
||||
<DataTable
|
||||
:headers="this.headers"
|
||||
:items="this.items"
|
||||
:selectedItems="this.selectedItems"
|
||||
@dblclick="showEditModalDblClick">
|
||||
</DataTable>
|
||||
<Modal
|
||||
:header="this.modal.header"
|
||||
:confirm="this.modal.confirm"
|
||||
v-model:visible="this.modalShow"
|
||||
@done="saveItem">
|
||||
<div class="mb-3">
|
||||
<label for="value" class="form-label">Оценочная стоимость</label>
|
||||
<input type="text" class="form-control" id="value" required v-model="data.value">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="status" class="form-label">Статус</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="status" id="statusAccepted" v-model="data.status" value="accepted" checked>
|
||||
<label class="form-check-label" for="statusAccepted">
|
||||
Принят
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="status" id="statusIssued" v-model="data.status" value="issued">
|
||||
<label class="form-check-label" for="statusIssued">
|
||||
Выдан
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="date" class="form-label">Дата</label>
|
||||
<input type="date" class="form-control" id="date" required v-model="data.date">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="clients" class="form-label">Клиент</label>
|
||||
<select class="form-select" id="client" required v-model="data.clientId">
|
||||
<option disabled value="">Выберите клиента</option>
|
||||
<option v-for="client in this.clients"
|
||||
:value="client.id"
|
||||
:selected="data.clientId && client.id === data.clientId">
|
||||
{{ client.name }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="pickUpPoints" class="form-label">Пункт отправления</label>
|
||||
<select class="form-select" id="sourcePickUpPoint" required v-model="data.sourcePickUpPointId">
|
||||
<option disabled value="">Выберите пункт отправления</option>
|
||||
<option v-for="sourcePickUpPoint in this.pickUpPoints"
|
||||
:value="sourcePickUpPoint.id"
|
||||
:selected="data.sourcePickUpPointId && sourcePickUpPoint.id === data.sourcePickUpPointId">
|
||||
{{ sourcePickUpPoint.address }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="pickUpPoints" class="form-label">Пункт выдачи</label>
|
||||
<select class="form-select" id="destPickUpPoint" v-model="data.destPickUpPointId">
|
||||
<option disabled value="">Выберите пункт выдачи</option>
|
||||
<option v-for="destPickUpPoint in this.pickUpPoints"
|
||||
:value="destPickUpPoint.id"
|
||||
:selected="data.destPickUpPointId && destPickUpPoint.id === data.destPickUpPointId">
|
||||
{{ destPickUpPoint.address }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="cars" class="form-label">Автомобиль</label>
|
||||
<select class="form-select" id="car" required v-model="data.carId">
|
||||
<option disabled value="">Выберите автомобиль</option>
|
||||
<option v-for="car in this.cars"
|
||||
:value="car.id"
|
||||
:selected="data.carId && car.id === data.carId">
|
||||
{{ car.vin }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</Modal>
|
||||
</template>
|
@ -1,5 +1,5 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import {createApp} from 'vue'
|
||||
import {createRouter, createWebHistory} from 'vue-router'
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
import Cabinets from './components/Cabinets.vue'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import {fileURLToPath, URL} from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import {defineConfig} from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
|
||||
|
@ -70,17 +70,17 @@ public class CabinetService {
|
||||
}
|
||||
@Transactional
|
||||
public List<Computer> listComputersFromCabinet(Long id) {
|
||||
if ((Object)id == null) {
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("Cabinet id is null or empty");
|
||||
}
|
||||
return findCabinet(id).getComputers();
|
||||
}
|
||||
@Transactional
|
||||
public void addComputerToCabinet(Long computerId, Long cabinetId) {
|
||||
if ((Object)computerId == null) {
|
||||
if (computerId == null) {
|
||||
throw new IllegalArgumentException("Computer id is null or empty");
|
||||
}
|
||||
if ((Object)cabinetId == null) {
|
||||
if (cabinetId == null) {
|
||||
throw new IllegalArgumentException("Cabinet id is null or empty");
|
||||
}
|
||||
final Computer computer = computerService.findComputer(computerId);
|
||||
@ -89,10 +89,10 @@ public class CabinetService {
|
||||
}
|
||||
@Transactional
|
||||
public void deleteComputerFromCabinet(Long computerId, Long cabinetId) {
|
||||
if ((Object) computerId == null) {
|
||||
if (computerId == null) {
|
||||
throw new IllegalArgumentException("Computer id is null or empty");
|
||||
}
|
||||
if ((Object) cabinetId == null) {
|
||||
if (cabinetId == null) {
|
||||
throw new IllegalArgumentException("Cabinet id is null or empty");
|
||||
}
|
||||
final Computer computer = computerService.findComputer(computerId);
|
||||
|
@ -94,10 +94,10 @@ public class ComputerService {
|
||||
}
|
||||
@Transactional
|
||||
public Monitor setMonitor(Long monitorId, Long computerId) {
|
||||
if ((Object)computerId == null) {
|
||||
if (computerId == null) {
|
||||
throw new IllegalArgumentException("Computer id is null or empty");
|
||||
}
|
||||
if ((Object)monitorId == null) {
|
||||
if (monitorId == null) {
|
||||
throw new IllegalArgumentException("Monitor id is null or empty");
|
||||
}
|
||||
final Computer computer = findComputer(computerId);
|
||||
|
Loading…
Reference in New Issue
Block a user