implemented userTable
This commit is contained in:
@ -10,6 +10,7 @@ import {
|
||||
getUserById,
|
||||
updateUserById,
|
||||
deleteUserById,
|
||||
getSelectedUsersByUser,
|
||||
} from "../models/usersModel.js";
|
||||
|
||||
//insert user to databased
|
||||
@ -40,7 +41,7 @@ export const signUp = async (req, res, next) => {
|
||||
minute: '2-digit'
|
||||
};
|
||||
const dateTimeString = currentTime.toLocaleString('de-DE', options);
|
||||
const results = ownConn.query(`INSERT INTO users(id, username, password, registered, fullName, email, phonenumber, address, city, postcode, adminBool, technician1Bool, technician2Bool, technicianMonitoringBool, merchantBool, internBool) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
const results = ownConn.query(`INSERT INTO users(id, username, password, registered, fullName, email, phonenumber, address, city, postcode, adminBool, technicianBool, readerBool) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
[
|
||||
uuidv4(),
|
||||
req.body.username,
|
||||
@ -53,11 +54,8 @@ export const signUp = async (req, res, next) => {
|
||||
req.body.city,
|
||||
req.body.postcode,
|
||||
req.body.adminBool,
|
||||
req.body.technician1Bool,
|
||||
req.body.technician2Bool,
|
||||
req.body.technicianMonitoringBool,
|
||||
req.body.merchantBool,
|
||||
req.body.internBool,
|
||||
req.body.technicianBool,
|
||||
req.body.readerBool,
|
||||
]);
|
||||
return res.status(201).send({
|
||||
message: "Registered!",
|
||||
@ -161,6 +159,18 @@ export const showUserById = (req, res) => {
|
||||
});
|
||||
};
|
||||
|
||||
//get all selected users by user
|
||||
export const showSelectedUsersByUser = (req, res) => {
|
||||
getSelectedUsersByUser(req.params.id, (err, results) => {
|
||||
if (err) {
|
||||
res.send(err);
|
||||
} else {
|
||||
res.json(results);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// Update user
|
||||
export const updateUser = (req, res) => {
|
||||
const data = req.body;
|
||||
|
||||
@ -28,12 +28,26 @@ export const getUserById = async (id, result) => {
|
||||
}
|
||||
};
|
||||
|
||||
//get all selected users by full name
|
||||
export const getSelectedUsersByUser = async (selected, result) => {
|
||||
try {
|
||||
let sql = `SELECT * FROM users WHERE LOWER(fullName) LIKE '%${selected.toLowerCase()}%' ORDER BY fullName ASC`;
|
||||
const results = await ownConn.execute(sql)
|
||||
result(null, results);
|
||||
}
|
||||
catch (err) {
|
||||
// Manage Errors
|
||||
console.log("SQL error : ", err);
|
||||
result(err, null);
|
||||
}
|
||||
};
|
||||
|
||||
// Update user to Database
|
||||
export const updateUserById = async (data, result) => {
|
||||
try {
|
||||
const id = data.id;
|
||||
let sql = `UPDATE users SET username = ?, password = ?, fullName = ?, email = ?, phonenumber = ?, address = ?, city = ?, postcode = ?, adminBool = ?, technician1Bool = ?, technician2Bool = ?, technicianMonitoringBool = ?, merchantBool = ?, internBool = ? WHERE id = ?`;
|
||||
const results = await ownConn.query(sql, [data.username, data.password, data.fullName, data.email, data.phonenumber, data.address, data.city, data.postcode, data.adminBool, data.technician1Bool, data.technician2Bool, data.technicianMonitoringBool, data.merchantBool, data.internBool, id]);
|
||||
let sql = `UPDATE users SET username = ?, password = ?, fullName = ?, email = ?, phonenumber = ?, address = ?, city = ?, postcode = ?, adminBool = ?, technicianBool = ?, readerBool = ? WHERE id = ?`;
|
||||
const results = await ownConn.query(sql, [data.username, data.password, data.fullName, data.email, data.phonenumber, data.address, data.city, data.postcode, data.adminBool, data.technicianBool,, data.readerBool, id]);
|
||||
result(null, results);
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
@ -113,6 +113,7 @@ import {
|
||||
showUserById,
|
||||
updateUser,
|
||||
deleteUser,
|
||||
showSelectedUsersByUser,
|
||||
} from "../controller/users.js";
|
||||
|
||||
import * as userMiddleware from "../middleware/users.js";
|
||||
@ -608,6 +609,9 @@ router.post('/login', login);
|
||||
// get all users
|
||||
router.get("/users", showUsers);
|
||||
|
||||
// get all users by user
|
||||
router.get("/selectedUsersByUser/:id", showSelectedUsersByUser)
|
||||
|
||||
//get user by id
|
||||
router.get("/user/:id", showUserById);
|
||||
|
||||
|
||||
129
components/EmployeeSearch.vue
Normal file
129
components/EmployeeSearch.vue
Normal file
@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<section :class="['employee-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Employee</div>
|
||||
<pre v-if="!filtered"
|
||||
:class="['data', 'pre-customer', darkMode ? 'pre-darkmode' : 'pre-lightmode']">{{ employeeFilter }}</pre>
|
||||
<input v-if="filtered" v-model="employeeFilter" @change="filterList()"
|
||||
:class="['data', 'input-customer', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { useStore } from 'vuex';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const store = useStore();
|
||||
const filtered = computed(() => store.state.filtered);
|
||||
const filteredTerm = computed(() => store.state.filteredByCustomer);
|
||||
const employeeFilter = ref(store.state.filteredByCustomer);
|
||||
|
||||
const darkMode = ref(true)
|
||||
|
||||
// update filtered term
|
||||
const updateFilterTerm = () => {
|
||||
employeeFilter.value = filteredTerm.value
|
||||
}
|
||||
|
||||
const checkFiltered = () => {
|
||||
if (!filtered.value) {
|
||||
employeeFilter.value = ''
|
||||
filterList();
|
||||
}
|
||||
}
|
||||
|
||||
// update the filtered term in the store
|
||||
const filterList = () => {
|
||||
store.commit('updateFilterbyCustomer', employeeFilter.value);
|
||||
}
|
||||
|
||||
watch(filteredTerm, updateFilterTerm)
|
||||
watch(filtered, checkFiltered)
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "EmployeeSearch",
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.employee-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.625em 1.875em;
|
||||
gap: 1.25em;
|
||||
width: 30.125em;
|
||||
height: 3.125em;
|
||||
box-shadow: 0.25em 0.25em 0.25em rgba(0, 0, 0, 0.25);
|
||||
border-radius: 0.625em;
|
||||
}
|
||||
|
||||
.section-darkmode {
|
||||
background-color: #2c2c2c;
|
||||
}
|
||||
|
||||
.section-lightmode {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.label {
|
||||
width: 2.5625em;
|
||||
height: 1.875em;
|
||||
font-family: "Overpass";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-size: 0.875em;
|
||||
line-height: 1.875;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.label-darkmode {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.label-lightmode {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.data {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
padding: 0 0.625rem;
|
||||
border-radius: 0.3125rem;
|
||||
box-shadow: 0.0625rem 0.0625rem 0.25rem 0rem rgba(0, 0, 0, 0.25) inset;
|
||||
letter-spacing: 5%;
|
||||
font: 400 0.75rem/250% Overpass, sans-serif;
|
||||
}
|
||||
|
||||
.pre-darkmode {
|
||||
background-color: #212121;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.pre-lightmode {
|
||||
background-color: #EBEBEB;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.input-customer {
|
||||
border: none;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.pre-customer {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.data-darkmode {
|
||||
background-color: #212121;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.data-lightmode {
|
||||
background-color: #EBEBEB;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
|
||||
228
components/server/EmployeeTable.vue
Normal file
228
components/server/EmployeeTable.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||
<table class="data-table" id="employeetable">
|
||||
<tbody>
|
||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||
<th
|
||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||
Name</th>
|
||||
<th
|
||||
:class="['Username', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Username-darkmode' : 'Username-lightmode']">
|
||||
Username</th>
|
||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode']">ID</th>
|
||||
</tr>
|
||||
<tr v-for="u in userList" :key="u.id"
|
||||
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']">
|
||||
<td
|
||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||
<nuxt-link to="/assets" id="nuxt-link" class="button"
|
||||
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
||||
@click="goToChosenAsset(u.id)">
|
||||
{{ u.fullName }}
|
||||
</nuxt-link>
|
||||
</td>
|
||||
<td
|
||||
:class="['Username', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Username-darkmode' : 'Username-lightmode']">
|
||||
<nuxt-link to="/assets" id="nuxt-link" class="button"
|
||||
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
||||
@click="goToChosenAsset(u.id)">
|
||||
{{ u.username }}
|
||||
</nuxt-link>
|
||||
</td>
|
||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode']"> {{ u.id }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import Axios from '../axios.config.js';
|
||||
import clientsideConfig from '../../clientsideConfig.js';
|
||||
import { useStore } from 'vuex';
|
||||
import { computed } from 'vue';
|
||||
|
||||
// get accesss to the store
|
||||
const store = useStore()
|
||||
const goToChosenAsset = (id) => {
|
||||
store.commit('setChosenEmployee', id);
|
||||
store.commit('changeToEmployee');
|
||||
};
|
||||
const employeeFilter = computed(() => store.state.filteredByCustomer);
|
||||
|
||||
const darkMode = ref(true)
|
||||
const userList = ref([]);
|
||||
|
||||
//get all users
|
||||
const getEmployees = async () => {
|
||||
if (!(employeeFilter.value === '')) {
|
||||
await getFilteredUsersByUser();
|
||||
} else {
|
||||
try {
|
||||
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllEmployees`);
|
||||
userList.value = response.data;
|
||||
} catch (err) {
|
||||
console.log(err.response.statusText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get all users based on the searched user
|
||||
const getFilteredUsersByUser = async () => {
|
||||
try {
|
||||
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedEmployeesByEmployee/${employeeFilter.value}`);
|
||||
userList.value = response.data;
|
||||
} catch (err) {
|
||||
console.log(err.response.statusText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
watch(employeeFilter, getEmployees);
|
||||
|
||||
onMounted(async () => {
|
||||
await getEmployees();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AssetTable",
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.data {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
align-self: stretch;
|
||||
padding: 1.25rem 1.875rem;
|
||||
gap: 1.25rem;
|
||||
border-radius: 0.625rem;
|
||||
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.section-darkmode {
|
||||
background-color: #2c2c2c;
|
||||
}
|
||||
|
||||
.section-lightmode {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.input {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.data-darkmode {
|
||||
background-color: #212121;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.data-lightmode {
|
||||
background-color: #EBEBEB;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.div-darkmode {
|
||||
background-color: #2c2c2c;
|
||||
}
|
||||
|
||||
.div-lightmode {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
width: 100%;
|
||||
padding: 0 0.625rem;
|
||||
table-layout: fixed;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 3.125rem;
|
||||
padding: 0.625rem;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
.tr-head-darkmode {
|
||||
border-top: none;
|
||||
border-bottom: 0.0625rem solid #000000;
|
||||
}
|
||||
|
||||
.tr-head-lightmode {
|
||||
border-top: none;
|
||||
border-bottom: 0.0625rem solid #8e8e8e;
|
||||
}
|
||||
|
||||
.tr-darkmode {
|
||||
border-top: 0.0625rem solid #000000;
|
||||
}
|
||||
|
||||
.tr-lightmode {
|
||||
border-top: 0.0625rem solid #8e8e8e;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
height: 1.875rem;
|
||||
text-align: left;
|
||||
padding: 0;
|
||||
letter-spacing: 5%;
|
||||
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||
}
|
||||
|
||||
.th-darkmode,
|
||||
.td-darkmode {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.th-lightmode,
|
||||
.td-lightmode {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
th {
|
||||
font: 700 0.875rem/1.875rem Overpass, sans-serif;
|
||||
}
|
||||
|
||||
.Name {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.Name-darkmode {
|
||||
border-right: 0.0625rem solid #000000;
|
||||
}
|
||||
|
||||
.Name-lightmode {
|
||||
border-right: 0.0625rem solid #8e8e8e;
|
||||
}
|
||||
|
||||
.Username {
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.Username-darkmode {
|
||||
border-right: 0.0625rem solid #000000;
|
||||
}
|
||||
|
||||
.Username-lightmode {
|
||||
border-right: 0.0625rem solid #8e8e8e;
|
||||
}
|
||||
|
||||
.ID {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
#nuxt-link {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
@ -1,6 +1,6 @@
|
||||
<mxfile host="Electron" modified="2024-02-27T19:18:30.556Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="pTIMz7977P7LLgTl7RJZ" version="22.0.3" type="device" pages="2">
|
||||
<mxfile host="Electron" modified="2024-03-11T18:43:59.748Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="Ub9Iakw2VLrdzjhM2iAH" version="22.0.3" type="device" pages="2">
|
||||
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
||||
<mxGraphModel dx="395" dy="2842" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<mxGraphModel dx="409" dy="2842" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
@ -395,7 +395,7 @@
|
||||
<mxGeometry y="510" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-15" value="issueSlips" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
||||
<mxGeometry x="2040" y="-560" width="140" height="540" as="geometry" />
|
||||
<mxGeometry x="2040" y="-560" width="140" height="840" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-16" value="primaryID*" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="30" width="140" height="30" as="geometry" />
|
||||
@ -421,33 +421,63 @@
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-21" value="notes" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="240" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-23" value="supplierRequest" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-14" value="deliveryAddress" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="270" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-32" value="supplierOffer" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-23" value="supplierRequestDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="300" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-33" value="customerOffer" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-5" value="supplierRequest" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="330" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-34" value="customerOrder" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-32" value="supplierOfferDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="360" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-35" value="supplierOrder" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-6" value="supplierOffer" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="390" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-36" value="ingress" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-33" value="clientOfferDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="420" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-37" value="egress" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-7" value="clientOffer" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="450" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-38" value="ingressBill" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-34" value="clientOrderDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="480" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-39" value="egressBill" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-8" value="clientOrder" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="510" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-35" value="supplierOrderDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="540" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-9" value="supplierOrder" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="570" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-36" value="ingressDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="600" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-10" value="ingress" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="630" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-11" value="egressDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="660" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-37" value="egress" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="690" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-12" value="ingressBillDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="720" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-38" value="ingressBill" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="750" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="6nz9YpIofWTpyD1iDkT1-13" value="egressBillDate" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="780" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-39" value="egressBill" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-15" vertex="1">
|
||||
<mxGeometry y="810" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-40" value="orderingInfoIssueSlips" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
||||
<mxGeometry x="2220" y="-440" width="140" height="210" as="geometry" />
|
||||
</mxCell>
|
||||
@ -470,7 +500,7 @@
|
||||
<mxGeometry y="180" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-48" value="issues" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
||||
<mxGeometry x="2040" y="120" width="140" height="210" as="geometry" />
|
||||
<mxGeometry x="2040" y="400" width="140" height="210" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-49" value="primaryID*" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-48" vertex="1">
|
||||
<mxGeometry y="30" width="140" height="30" as="geometry" />
|
||||
@ -491,7 +521,7 @@
|
||||
<mxGeometry y="180" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-56" value="issueVariants" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
||||
<mxGeometry x="2220" y="180" width="140" height="240" as="geometry" />
|
||||
<mxGeometry x="2220" y="460" width="140" height="240" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-57" value="primaryID*" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-56" vertex="1">
|
||||
<mxGeometry y="30" width="140" height="30" as="geometry" />
|
||||
|
||||
995
documentation/.$Datenbankmodell.drawio.dtmp
Normal file
995
documentation/.$Datenbankmodell.drawio.dtmp
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
<mxfile host="Electron" modified="2024-03-11T18:43:59.748Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="Ub9Iakw2VLrdzjhM2iAH" version="22.0.3" type="device" pages="2">
|
||||
<mxfile host="Electron" modified="2024-03-15T19:12:52.812Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="paCwt5s8ml-fbCSaMHOa" version="22.0.3" type="device" pages="2">
|
||||
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
||||
<mxGraphModel dx="409" dy="2842" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<mxGraphModel dx="410" dy="2842" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
@ -341,7 +341,7 @@
|
||||
<mxGeometry y="300" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="-K6vikdffkJQkB35vOLp-1" value="users" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry y="-1570" width="150" height="540" as="geometry" />
|
||||
<mxGeometry y="-1570" width="150" height="450" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="-K6vikdffkJQkB35vOLp-2" value="id" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxGeometry y="30" width="150" height="30" as="geometry" />
|
||||
@ -379,21 +379,12 @@
|
||||
<mxCell id="ioDwbpDVXUhE7vu6D29p-8" value="adminBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxGeometry y="360" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ioDwbpDVXUhE7vu6D29p-9" value="technician1Bool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxCell id="ioDwbpDVXUhE7vu6D29p-10" value="technicianBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxGeometry y="390" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ioDwbpDVXUhE7vu6D29p-10" value="technician2Bool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxCell id="ioDwbpDVXUhE7vu6D29p-12" value="readerBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxGeometry y="420" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ioDwbpDVXUhE7vu6D29p-11" value="technicianMonitoringBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxGeometry y="450" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ioDwbpDVXUhE7vu6D29p-12" value="merchantBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxGeometry y="480" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="UjUgOsnL5tA5fsC7Xk2_-1" value="internBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="-K6vikdffkJQkB35vOLp-1" vertex="1">
|
||||
<mxGeometry y="510" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WukdXvazNq34soQIU5Al-15" value="issueSlips" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
||||
<mxGeometry x="2040" y="-560" width="140" height="840" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
@ -60,6 +60,14 @@
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Customers</pre>
|
||||
</Transition>
|
||||
</router-link>
|
||||
<router-link to="/employees" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" @click="defaultEmployeesPage()" id="employees-button">
|
||||
<div class="icon" id="customers-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="/icons/navbar-icons/Customers-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Employees</pre>
|
||||
</Transition>
|
||||
</router-link>
|
||||
</nav>
|
||||
</div>
|
||||
</aside>
|
||||
@ -96,6 +104,11 @@ const defaultIssueSlipPage = () => {
|
||||
store.commit('changeToIssueSliplist')
|
||||
}
|
||||
|
||||
const defaultEmployeesPage = () => {
|
||||
store.commit('resetStore');
|
||||
store.commit('changeToEmployeelist')
|
||||
}
|
||||
|
||||
const ToggleSidebar = () => {
|
||||
isExpanded.value = !isExpanded.value;
|
||||
};
|
||||
|
||||
103
pages/employees.vue
Normal file
103
pages/employees.vue
Normal file
@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<section id="content">
|
||||
<div id="content-header">
|
||||
<router-link to="/employees" class="button" id="employees-button" @click="defaultEmployeePage()">
|
||||
<h1 :class="[darkMode ? 'h1-darkmode' : 'h1-lightmode']" id="page-name">Employees</h1>
|
||||
</router-link>
|
||||
</div>
|
||||
<div id="content-body">
|
||||
<EmployeeSearch v-if="onEmployeelist" />
|
||||
<Employeetable v-if="onEmployeelist" />
|
||||
<Asset v-if="onEmployee" />
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
import EmployeeSearch from "../components/EmployeeSearch.vue";
|
||||
import Employeetable from "../components/server/EmployeeTable.vue";
|
||||
import Asset from "../components/server/Asset.vue";
|
||||
import { useStore } from 'vuex';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const store = useStore();
|
||||
const onEmployeelist = computed(() => store.state.onEmployeelist);
|
||||
const onEmployee = computed(() => store.state.onEmployee);
|
||||
|
||||
definePageMeta({
|
||||
layout: 'default',
|
||||
title: 'Employees'
|
||||
})
|
||||
|
||||
const defaultEmployeePage = () => {
|
||||
store.commit('resetStore');
|
||||
store.commit('changeToEmployeelist')
|
||||
}
|
||||
|
||||
const darkMode = ref(true)
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "EmployeePage",
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
#content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
float: left;
|
||||
justify-content: stretch;
|
||||
align-items: stretch;
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
gap: 0.625rem;
|
||||
padding: 0 1.25rem;
|
||||
}
|
||||
|
||||
#content-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 3.125rem;
|
||||
}
|
||||
|
||||
#page-name {
|
||||
letter-spacing: 5%;
|
||||
font: 400 1.5rem/125% Overpass, -apple-system, Roboto, Helvetica,
|
||||
sans-serif;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.h1-darkmode {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.h1-lightmode {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#content-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
gap: 1.25rem;
|
||||
margin-bottom: 0.625rem;
|
||||
border-radius: 0.625rem;
|
||||
}
|
||||
|
||||
.button {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
@ -128,6 +128,10 @@ const store = createStore({
|
||||
newAmountII: '',
|
||||
newPropertiesII: '',
|
||||
chosenIssueVariantId: -1,
|
||||
|
||||
onEmployeelist: true,
|
||||
onEmployee: false,
|
||||
chosenEmployeeId: -1,
|
||||
};
|
||||
},
|
||||
mutations: {
|
||||
@ -159,10 +163,6 @@ const store = createStore({
|
||||
state.changedCustomerId = id
|
||||
},
|
||||
|
||||
refresh() {
|
||||
//
|
||||
},
|
||||
|
||||
// functions to change the asset pages
|
||||
changeToAssetlist(state) {
|
||||
state.onAssetlist = true
|
||||
@ -486,6 +486,42 @@ const store = createStore({
|
||||
state.deleteIcon = true
|
||||
},
|
||||
|
||||
// functions to change the user pages
|
||||
changeToEmployeelist(state) {
|
||||
state.onEmployeelist = true
|
||||
state.onEmployee = false
|
||||
|
||||
state.addIcon = true
|
||||
state.addSolutionIcon = false
|
||||
state.solutionIcon = false
|
||||
state.addInstanceIcon = false
|
||||
state.filterIcon = true
|
||||
state.searchIcon = false
|
||||
state.instancesIcon = false
|
||||
state.attachmentsIcon = false
|
||||
state.sellIcon = false
|
||||
state.archiveIcon = false
|
||||
state.editIcon = false
|
||||
state.deleteIcon = false
|
||||
},
|
||||
changeToEmployee(state) {
|
||||
state.onEmployeelist = false
|
||||
state.onEmployee = true
|
||||
|
||||
state.addIcon = false
|
||||
state.addSolutionIcon = false
|
||||
state.solutionIcon = false
|
||||
state.addInstanceIcon = false
|
||||
state.filterIcon = false
|
||||
state.searchIcon = false
|
||||
state.instancesIcon = false
|
||||
state.attachmentsIcon = false
|
||||
state.sellIcon = false
|
||||
state.archiveIcon = false
|
||||
state.editIcon = true
|
||||
state.deleteIcon = true
|
||||
},
|
||||
|
||||
// functions to update the asset
|
||||
updateAssetComponent(state, asset) {
|
||||
state.newAssetName = asset.assetName
|
||||
@ -556,7 +592,7 @@ const store = createStore({
|
||||
state.newUserIS = is.user
|
||||
state.newDeliveryAddressIS = is.deliveryAddress
|
||||
},
|
||||
|
||||
|
||||
// functions to update the accounting info component
|
||||
updateOrderingInfoComponent(state, o) {
|
||||
state.newOIs = o.ois
|
||||
@ -623,11 +659,16 @@ const store = createStore({
|
||||
state.chosenIssueId = id
|
||||
},
|
||||
|
||||
// function to set the chosen issue variant
|
||||
setChosenIssueVariant(state, id) {
|
||||
// function to set the chosen issue variant
|
||||
setChosenIssueVariant(state, id) {
|
||||
state.chosenIssueVariantId = id
|
||||
},
|
||||
|
||||
// function to set the chosen user
|
||||
setChosenEmployee(state, id) {
|
||||
state.chosenEmployeeId = id
|
||||
},
|
||||
|
||||
// function to reset the pages
|
||||
resetStore(state) {
|
||||
state.editable = false
|
||||
@ -732,6 +773,9 @@ const store = createStore({
|
||||
state.newStateII = ''
|
||||
state.newAmountII = ''
|
||||
state.newPropertiesII = ''
|
||||
|
||||
// reset the employee page variables
|
||||
state.chosenEmployeeId = -1
|
||||
},
|
||||
|
||||
// functions to (undo) delete an asset
|
||||
@ -777,6 +821,10 @@ const store = createStore({
|
||||
state.onIssueItemList = false
|
||||
state.onIssueItemVariant = false
|
||||
state.onIssueItem = true
|
||||
|
||||
// set the employee variables
|
||||
state.onEmployeelist = false
|
||||
state.onEmployee = true
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
23
server/api/getAllEmployees.ts
Normal file
23
server/api/getAllEmployees.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { employees, errorMsg } from "../middleware/employees";
|
||||
import { OutgoingMessage } from 'http';
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
|
||||
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||
'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||
'Access-Control-Allow-Credentials': 'true',
|
||||
};
|
||||
setResponseHeaders(event, headers)
|
||||
|
||||
if (!(errorMsg === '')) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: errorMsg,
|
||||
})
|
||||
}
|
||||
|
||||
setResponseStatus(event, 200)
|
||||
return employees
|
||||
})
|
||||
23
server/api/getSelectedEmployeesByEmployee/[id].ts
Normal file
23
server/api/getSelectedEmployeesByEmployee/[id].ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { selectedEmployeesByEmployee, errorMsg } from "../../middleware/employees";
|
||||
import { OutgoingMessage } from 'http';
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
|
||||
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||
'Access-Control-Allow-Methods': 'OPTIONS,GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||
'Access-Control-Allow-Credentials': 'true',
|
||||
};
|
||||
setResponseHeaders(event, headers)
|
||||
|
||||
if (!(errorMsg === '')) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: errorMsg,
|
||||
})
|
||||
}
|
||||
|
||||
setResponseStatus(event, 200)
|
||||
return selectedEmployeesByEmployee
|
||||
})
|
||||
271
server/middleware/employees.ts
Normal file
271
server/middleware/employees.ts
Normal file
@ -0,0 +1,271 @@
|
||||
import axios, { AxiosError } from 'axios';
|
||||
import serversideConfig from '../../serversideConfig';
|
||||
import https from 'https';
|
||||
|
||||
let employees = [];
|
||||
let configItem = {};
|
||||
let errorMsg = '';
|
||||
let selectedEmployeesByEmployee = [];
|
||||
let configItemsFromCustomer = [];
|
||||
let selectedConfigItemsByAsset = [];
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
|
||||
const agent = new https.Agent({
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: "*",
|
||||
},
|
||||
httpsAgent: agent
|
||||
});
|
||||
|
||||
if (event.path.startsWith("/api/getAllEmployees")) {
|
||||
// get all users object from backend
|
||||
try {
|
||||
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/users`);
|
||||
employees = res.data;
|
||||
} catch (err) {
|
||||
if (axios.isAxiosError(err)) {
|
||||
const axiosError = err as AxiosError;
|
||||
|
||||
if (axiosError.response) {
|
||||
// Axios error
|
||||
console.error(axiosError.response.data.message);
|
||||
errorMsg = axiosError.response.data.message;
|
||||
} else if (axiosError.request) {
|
||||
console.log(err)
|
||||
// If error was caused by the request
|
||||
console.error(axiosError.request);
|
||||
} else {
|
||||
// Other errors
|
||||
console.error('Error', axiosError.message);
|
||||
}
|
||||
} else {
|
||||
// No AxiosError
|
||||
console.error('Error', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (event.path.startsWith("/api/getConfigItem")) {
|
||||
// // get all config items object from backend
|
||||
// let itemId = null;
|
||||
// const path = event._path;
|
||||
// const pathSegments = path.split('/');
|
||||
// itemId = pathSegments[pathSegments.length - 1];
|
||||
|
||||
// try {
|
||||
// let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/configItem/${itemId}`);
|
||||
// configItem = res.data;
|
||||
// } catch (err) {
|
||||
// if (axios.isAxiosError(err)) {
|
||||
// const axiosError = err as AxiosError;
|
||||
|
||||
// if (axiosError.response) {
|
||||
// // Axios error
|
||||
// console.error(axiosError.response.data.message);
|
||||
// errorMsg = axiosError.response.data.message;
|
||||
// } else if (axiosError.request) {
|
||||
// // If error was caused by the request
|
||||
// console.error(axiosError.request);
|
||||
// } else {
|
||||
// // Other errors
|
||||
// console.error('Error', axiosError.message);
|
||||
// }
|
||||
// } else {
|
||||
// // No AxiosError
|
||||
// console.error('Error', err);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (event.path.startsWith("/api/getCIFromCustomer")) {
|
||||
// // get all config items from a customer from backend
|
||||
// let itemId = null;
|
||||
// const path = event._path;
|
||||
// const pathSegments = path.split('/');
|
||||
// itemId = pathSegments[pathSegments.length - 1];
|
||||
|
||||
// try {
|
||||
// let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/configItemByCustomerID/${itemId}`);
|
||||
// configItemsFromCustomer = res.data;
|
||||
// } catch (err) {
|
||||
// if (axios.isAxiosError(err)) {
|
||||
// const axiosError = err as AxiosError;
|
||||
|
||||
// if (axiosError.response) {
|
||||
// // Axios error
|
||||
// console.error(axiosError.response.data.message);
|
||||
// errorMsg = axiosError.response.data.message;
|
||||
// } else if (axiosError.request) {
|
||||
// // If error was caused by the request
|
||||
// console.error(axiosError.request);
|
||||
// } else {
|
||||
// // Other errors
|
||||
// console.error('Error', axiosError.message);
|
||||
// }
|
||||
// } else {
|
||||
// // No AxiosError
|
||||
// console.error('Error', err);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (event.path.startsWith("/api/updateConfigItem")) {
|
||||
// const body = await readBody(event)
|
||||
// // update the config item in the backend
|
||||
// try {
|
||||
// let res = await axiosInstance.put(`https://${serversideConfig.url}:${serversideConfig.port}/configItem`, body);
|
||||
// } catch (err) {
|
||||
// if (axios.isAxiosError(err)) {
|
||||
// const axiosError = err as AxiosError;
|
||||
|
||||
// if (axiosError.response) {
|
||||
// // Axios error
|
||||
// console.error(axiosError.response.data.message);
|
||||
// errorMsg = axiosError.response.data.message;
|
||||
// } else if (axiosError.request) {
|
||||
// console.log(err)
|
||||
// // If error was caused by the request
|
||||
// console.error(axiosError.request);
|
||||
// } else {
|
||||
// // Other errors
|
||||
// console.error('Error', axiosError.message);
|
||||
// }
|
||||
// } else {
|
||||
// // No AxiosError
|
||||
// console.error('Error', err);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (event.path.startsWith("/api/addConfigItem")) {
|
||||
// const body = await readBody(event)
|
||||
// // add the config item in the backend
|
||||
// try {
|
||||
// let res = await axiosInstance.post(`https://${serversideConfig.url}:${serversideConfig.port}/configItems`, body);
|
||||
// } catch (err) {
|
||||
// if (axios.isAxiosError(err)) {
|
||||
// const axiosError = err as AxiosError;
|
||||
|
||||
// if (axiosError.response) {
|
||||
// // Axios error
|
||||
// console.error(axiosError.response.data.message);
|
||||
// errorMsg = axiosError.response.data.message;
|
||||
// } else if (axiosError.request) {
|
||||
// console.log(err)
|
||||
// // If error was caused by the request
|
||||
// console.error(axiosError.request);
|
||||
// } else {
|
||||
// // Other errors
|
||||
// console.error('Error', axiosError.message);
|
||||
// }
|
||||
// } else {
|
||||
// // No AxiosError
|
||||
// console.error('Error', err);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (event.path.startsWith("/api/deleteConfigItem")) {
|
||||
// let itemId = null;
|
||||
// const path = event._path;
|
||||
// const pathSegments = path.split('/');
|
||||
// itemId = pathSegments[pathSegments.length - 1];
|
||||
|
||||
// // delete the config item in the backend
|
||||
// try {
|
||||
// let res = await axiosInstance.delete(`https://${serversideConfig.url}:${serversideConfig.port}/configItems/${itemId}`);
|
||||
// } catch (err) {
|
||||
// if (axios.isAxiosError(err)) {
|
||||
// const axiosError = err as AxiosError;
|
||||
|
||||
// if (axiosError.response) {
|
||||
// // Axios error
|
||||
// console.error(axiosError.response.data.message);
|
||||
// errorMsg = axiosError.response.data.message;
|
||||
// } else if (axiosError.request) {
|
||||
// console.log(err)
|
||||
// // If error was caused by the request
|
||||
// console.error(axiosError.request);
|
||||
// } else {
|
||||
// // Other errors
|
||||
// console.error('Error', axiosError.message);
|
||||
// }
|
||||
// } else {
|
||||
// // No AxiosError
|
||||
// console.error('Error', err);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (event.path.startsWith("/api/getSelectedEmployeesByEmployee")) {
|
||||
// get selected employees object by employee from backend
|
||||
let filteredEmployee = null;
|
||||
const path = event._path;
|
||||
const pathSegments = path.split('/');
|
||||
filteredEmployee = pathSegments[pathSegments.length - 1];
|
||||
|
||||
try {
|
||||
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedUsersByUser/${filteredEmployee}`);
|
||||
selectedEmployeesByEmployee = res.data;
|
||||
} catch (err) {
|
||||
if (axios.isAxiosError(err)) {
|
||||
const axiosError = err as AxiosError;
|
||||
|
||||
if (axiosError.response) {
|
||||
// Axios error
|
||||
console.error(axiosError.response.data.message);
|
||||
errorMsg = axiosError.response.data.message;
|
||||
} else if (axiosError.request) {
|
||||
// If error was caused by the request
|
||||
console.error(axiosError.request);
|
||||
} else {
|
||||
// Other errors
|
||||
console.error('Error', axiosError.message);
|
||||
}
|
||||
} else {
|
||||
// No AxiosError
|
||||
console.error('Error', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (event.path.startsWith("/api/getSelectedConfigItemsByAsset")) {
|
||||
// // get selected config items object by asset from backend
|
||||
// let filteredAsset = null;
|
||||
// const path = event._path;
|
||||
// const pathSegments = path.split('/');
|
||||
// filteredAsset = pathSegments[pathSegments.length - 1];
|
||||
|
||||
// try {
|
||||
// let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedConfigItemsByAssetName/${filteredAsset}`);
|
||||
// selectedConfigItemsByAsset = res.data;
|
||||
// } catch (err) {
|
||||
// if (axios.isAxiosError(err)) {
|
||||
// const axiosError = err as AxiosError;
|
||||
|
||||
// if (axiosError.response) {
|
||||
// // Axios error
|
||||
// console.error(axiosError.response.data.message);
|
||||
// errorMsg = axiosError.response.data.message;
|
||||
// } else if (axiosError.request) {
|
||||
// // If error was caused by the request
|
||||
// console.error(axiosError.request);
|
||||
// } else {
|
||||
// // Other errors
|
||||
// console.error('Error', axiosError.message);
|
||||
// }
|
||||
// } else {
|
||||
// // No AxiosError
|
||||
// console.error('Error', err);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
})
|
||||
|
||||
export { employees, configItem, selectedEmployeesByEmployee, selectedConfigItemsByAsset, configItemsFromCustomer, errorMsg };
|
||||
Reference in New Issue
Block a user