Muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalar universetuti


Edit MB malumotlarni tahrirlash Edit MB malumotlarni tahrirlashni koding qismi


Download 12.22 Kb.
bet2/3
Sana05.04.2023
Hajmi12.22 Kb.
#1277020
1   2   3
Bog'liq
MBBBAAAAA

Edit MB malumotlarni tahrirlash

Edit MB malumotlarni tahrirlashni koding qismi

  • async getEditUserServer() {
  • await axios.patch(
  • "http://localhost:3000/users/" + this.$route.query.id,
  • this.editUser
  • );
  • this.toHomePage();
  • },

 editUserInfo() {

  •  editUserInfo() {
  • const editUser = {
  • fullName: this.fullName,
  • departament: this.departament,
  • position: this.position,
  • gender: this.newGender,
  • age: +this.age,
  • };
  • this.editUser = editUser;
  • console.log(this.editUser);
  • this.getEditUserServer();
  • },
  • getRadioBtn(result) {
  • this.newGender = result.target.value;
  • console.log(this.newGender);
  • },

Delete MB dan malumotlarni o’chirish

Delete MB dan malumotlarni o’chirishning coding qismi

  •  async deleteUser() {
  • console.log(this.id);
  • alert(`Rostdan ham ${this.fullName} ro'yxatdan o'chirmoqchimis!`);
  • await axios.delete("http://localhost:3000/users/" + this.id);
  • console.log("User o'chirildi");
  • this.toHomePage();
  • },

 async mounted() {

  •  async mounted() {
  • const respons = await axios.get(
  • "http://localhost:3000/users/" + this.$route.params.id
  • );
  • console.log(respons.data);
  • const res = respons.data;
  • this.fullName = res.fullName;
  • this.departament = res.departament;
  • this.position = res.position;
  • this.gender = res.gender;
  • this.age = res.age;
  • },
  • };

MB dagi malumotlarni ustida qayta ishlash (Sort,Search,pagination,statistika)

Sort fungsiyasini hosil qilish

  • sortDepartament() {
  • this.sortNumberDepartament += 1;
  • this.paginationUser = this.paginationUser2;
  • if (this.sortNumberDepartament > 3) {
  • this.sortNumberDepartament = 0;
  • this.paginationUser = this.paginationUser2;
  • }
  • if (this.sortNumberDepartament === 1) {
  • this.paginationUser = this.paginationUser.filter(
  • (user) => user.departament === "IT"
  • );
  • } else if (this.sortNumberDepartament === 2) {
  • this.paginationUser = this.paginationUser.filter(
  • (user) => user.departament === "Marketing"
  • );
  • } else if (this.sortNumberDepartament === 3) {
  • this.paginationUser = this.paginationUser.filter(
  • (user) => user.departament === "Acounting"
  • );
  • } else {
  • return this.paginationUser;
  • }
  • },

Download 12.22 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling