Merge pull request #36 from dderbentsov/UC-13

Добавлен mock для таблицы клиентов
This commit is contained in:
Алексей Дёмин
2022-10-17 11:19:17 +03:00
committed by GitHub
6 changed files with 455 additions and 32 deletions

View File

@@ -6,6 +6,11 @@ import "./assets/sass/fonts.sass";
import "./assets/sass/tailwind.sass";
import "./assets/sass/variables.sass";
import "./assets/css/iconfonts.css";
import { clientsServer } from "../server.js";
if (process.env.NODE_ENV === "development") {
clientsServer({ environment: "development" });
}
moment.locale("ru");

View File

@@ -66,39 +66,17 @@ export default {
return {
selectAll: false,
marked: [],
dataClients: [
{
id: "1",
fullName: "Вильгейльм Арнольд Витальевич",
age: "34",
jobTitle: "Менеджер",
priority: "Высокий",
phone: "+7 (915) 6572114",
email: "Superboyband@yandex.ru",
networks: [],
meetingTime: {
date: "02.06.22",
time: "18:3019:30",
},
},
{
id: "2",
fullName: "Астафоркина Екатерина Геннадьевна",
age: "54",
jobTitle: "Менеджер",
priority: "-",
phone: "+7 (574) 3645336",
email: "antimag@gmail.com",
networks: [],
meetingTime: {
date: "14.07.22",
time: "17:3021:30",
},
},
],
dataClients: [],
};
},
methods: {
saveDataClients(data) {
this.dataClients = data.dataClients;
},
fetchDataClients() {
// eslint-disable-next-line
fetch("/api/clients").then((res) => res.json()).then((data) => this.saveDataClients(data))
},
selectedCheck(e) {
if (e.target.id === "all") {
this.selectAll = !this.selectAll;
@@ -119,6 +97,9 @@ export default {
}
},
},
mounted() {
this.fetchDataClients();
},
};
</script>

View File

@@ -26,7 +26,7 @@
span.meeting-time.text-xs.leading-5 {{meetingTime.time}}
td.py-5
.px-4
.relative.dots-button.icon-dots.text-center.cursor-pointer.leading-6(@click="openPopup")
.relative.dots-button.icon-dots.text-center.cursor-pointer.leading-6(:tabindex="1" @click="(e) => openPopup(e)" @blur="handleUnFocusPopup")
clients-action-popup(v-if="isOpenPopup")
</template>
@@ -55,9 +55,13 @@ export default {
meetingTime: Object,
},
methods: {
openPopup() {
openPopup(e) {
e.target.focus();
this.isOpenPopup = !this.isOpenPopup;
},
handleUnFocusPopup() {
this.isOpenPopup = false;
},
},
};
</script>