[WIP] Добавил отправку расписания с шаблоном графиков, поправил стили

This commit is contained in:
megavrilinvv
2023-01-23 18:09:09 +03:00
parent 11af24f8bc
commit 5f004e05b6
7 changed files with 34 additions and 33 deletions

View File

@@ -91,4 +91,5 @@ export default {
border-radius: 50% border-radius: 50%
z-index: 5 z-index: 5
opacity: 0 opacity: 0
cursor: pointer
</style> </style>

View File

@@ -5,11 +5,12 @@
v-model="value", v-model="value",
:options="items", :options="items",
:disable="disable", :disable="disable",
bg-color="var(--bg-disable-grey-color)" :behavior="behavior",
bg-color="var(--bg-disable-grey-color)",
outlined, outlined,
dense, dense,
emit-value, emit-value,
map-options, map-options
) )
template(v-slot:selected) template(v-slot:selected)
span {{ textSelect }} span {{ textSelect }}
@@ -29,6 +30,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
behavior: {
type: String,
default: "menu",
},
disable: Boolean, disable: Boolean,
label: String, label: String,
}, },

View File

@@ -96,7 +96,7 @@ export default {
text: "'В'", text: "'В'",
}, },
], ],
template: { item: { id: null, label: null } }, template: { item: {} },
startMonth: moment().startOf("month"), startMonth: moment().startOf("month"),
showTime: false, showTime: false,
schedulesDate: {}, schedulesDate: {},
@@ -147,6 +147,7 @@ export default {
}, },
filterScheduleEmployee() { filterScheduleEmployee() {
let serialized = []; let serialized = [];
this.template.item = {};
this.scheduleList.forEach((e) => { this.scheduleList.forEach((e) => {
let foundedElem = serialized.find((elem) => elem.id === e.employee.id); let foundedElem = serialized.find((elem) => elem.id === e.employee.id);
if (!foundedElem) { if (!foundedElem) {
@@ -200,6 +201,8 @@ export default {
end_time: this.times.end_time, end_time: this.times.end_time,
status: this.buttons.find((e) => e.active)?.work, status: this.buttons.find((e) => e.active)?.work,
}; };
if (this.template.item.label)
data.kind_template = this.template.item.name;
if (this.insideSchedules?.length > 0) { if (this.insideSchedules?.length > 0) {
this.postUpdateSchedule(); this.postUpdateSchedule();
if (this.outsideSchedules) { if (this.outsideSchedules) {

View File

@@ -2,14 +2,14 @@
.wrapper-bar.flex.flex-col.gap-y-4.p-5.justify-between .wrapper-bar.flex.flex-col.gap-y-4.p-5.justify-between
.flex.w-full.justify-around.gap-x-4 .flex.w-full.justify-around.gap-x-4
.time-wrapper.flex.justify-between.p-7 .time-wrapper.flex.justify-between.p-7
base-input( base-input.items-center(
type="time", type="time",
v-model="times.start_time", v-model="times.start_time",
label="Начало", label="Начало",
outlined outlined
) )
.flex.items-center.mt-6 .flex.items-center.mt-6
base-input( base-input.items-center(
type="time", type="time",
v-model="times.end_time", v-model="times.end_time",
label="Конец", label="Конец",
@@ -31,18 +31,11 @@
style="width: 200px" style="width: 200px"
) )
.graph-template.flex.flex-col.items-center.gap-y-4 .graph-template.flex.flex-col.items-center.gap-y-4
base-select( base-select.w-52(
:items="templateList", :items="templateList",
v-model="template.item", v-model="template.item",
placeholder="Шаблоны графиков" placeholder="Выберите шаблон"
) label="Шаблоны графиков"
base-input.w-28(
v-if="template.item.id === 1"
mask="#/#",
placeholder="0/0",
label="Введите график",
v-model="template.item.label",
outlined
) )
.flex.justify-center.gap-x-6.h-10 .flex.justify-center.gap-x-6.h-10
q-btn( q-btn(
@@ -83,10 +76,9 @@ export default {
data() { data() {
return { return {
templateList: [ templateList: [
{ label: "Индивидуальный", id: 1 }, { label: "2/2", name: "2/2", symbol: "'2/2'" },
{ label: "2/2", id: 2 }, { label: "Дежурство", name: "DUTY", symbol: "'Д'" },
{ label: "3/2", id: 3 }, { label: "Смена", name: "FirstEvenSecondOdd", symbol: "'С'" },
{ label: "5/2", id: 4 },
], ],
}; };
}, },

View File

@@ -70,7 +70,9 @@ export default {
this.setActiveButton(); this.setActiveButton();
return { return {
"--bg-color-status": this.activeButton?.color, "--bg-color-status": this.activeButton?.color,
"--text-status": this.activeButton?.text, "--text-status": !this.template.item?.label
? this.activeButton?.text
: this.template.item.symbol,
}; };
}, },
}, },
@@ -154,7 +156,8 @@ export default {
if (resStart || resMiddle || resEnd) if (resStart || resMiddle || resEnd)
return { return {
status: !!this.activeButton, "set-template": !!this.template.item?.label,
status: !!this.activeButton && !this.template.item,
"set-date": !this.activeButton, "set-date": !this.activeButton,
}; };
}, },
@@ -209,13 +212,4 @@ export default {
border-radius: 4px border-radius: 4px
width: 400px width: 400px
height: 500px height: 500px
.status
background-color: var(--bg-color-status) !important
.status::after
content: var(--text-status)
.set-date
background-color: var(--btn-blue-color-4) !important
</style> </style>

View File

@@ -116,4 +116,7 @@ export default {
.status::after .status::after
content: var(--text-status) content: var(--text-status)
.set-template
background-color: var(--bg-event-orange-color) !important
</style> </style>

View File

@@ -99,12 +99,15 @@ export default {
&:last-child &:last-child
border-right: none border-right: none
.set-date
background-color: var(--btn-blue-color-4) !important
.status .status
background-color: var(--bg-color-status) !important background-color: var(--bg-color-status) !important
.status::after .status::after
content: var(--text-status) content: var(--text-status)
.set-date
background-color: var(--btn-blue-color-4) !important
.set-template
background-color: var(--bg-event-orange-color) !important
</style> </style>