Skip to content

sidigi/bgs-admin-lte-vue-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

bgs-admin-lte-vue-components

ΠŸΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅

<!-- Insert the vue core before vue-toasted -->
<script src="./dist/bgs-admin-lte-vue-ui-components.umd.js"></script>

<link rel="stylesheet" href="./bgs-admin-lte-vue-ui-components.css" />

<script>
  Vue.use(window.bgsAdminLteVueUIComponents);
</script>

ΠšΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ bgs-widget-stats-card

<bgs-widget-stats-card
  header="header"
  subheader="subheader"
  :loader="loader"
  class="col-xs-12 col-sm-4 col-md-3"
  @bgs-widget-stats-item-click="itemClick"
  @bgs-widget-stats-collapse="collapse"
>
  <template v-slot:employee-card>
    <!-- Π‘Π»ΠΎΡ‚ для ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡ΠΊΠΈ со статистикой для сотрудника -->
  </template>

  <template v-slot:buttons>
    <!-- Π‘Π»ΠΎΡ‚ для ΠΊΠ½ΠΎΠΏΠΎΠΊ -->
    <span
      role="button"
      title="Show detailed statistics"
      class="info-box-toolbar-button hover-translucent employee-statistics-show-details-button"
    >
      <i class="fa fa-list"></i>
    </span>
  </template>

  <template>
    <!-- Π‘Π»ΠΎΡ‚ основного ΠΊΠΎΠ½Ρ‚Π΅Π½Ρ‚Π° -->
  </template>
</bgs-widget-stats-card>
Property Description
header Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ
subheader Подпись
loader Π—Π°Π³Ρ€ΡƒΠ·Ρ‡ΠΈΠΊ
@bgs-widget-stats-item-click Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ ΠΏΠΎ ΠΊΠ»ΠΈΠΊΡƒ Π½Π° Π°Π²Π°Ρ‚Π°Ρ€ΠΊΡƒ
@bgs-widget-stats-collapse Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ ΠΏΡ€ΠΈ Ρ€Π°Π·Π²ΠΎΡ€Π°Ρ‡ΠΈΠ²Π°Π½ΠΈΠΈ/Ρ€Π°Π·Π²ΠΎΡ€Π°Ρ‡ΠΈΠ²Π°Π½ΠΈΠΈ ΠΏΠΎΠ΄Ρ‡ΠΈΠ½Ρ‘Π½Π½Ρ‹Ρ…

ΠšΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ bgs-widget-stats-employee-card

<bgs-widget-stats-employee-card
  :header="30001"
  icon="eye"
  :link="{href: 'link'}"
  class="bg-maroon"
  @bgs-widget-stats-employee-card-click="clickCard"
>
  <template v-slot:subheader>
    <!-- Π‘Π»ΠΎΡ‚ подписи -->
    <p>
      Last modified 2 month ago
      <br />on LNG
    </p>
  </template>
</bgs-widget-stats-employee-card>
Property Description
header Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ
icon ion ΠΈΠΊΠΎΠ½ΠΊΠ°
link ΠžΠ±ΡŠΠ΅ΠΊΡ‚ ссылка ( {link: 'http://link.eu', title: 'Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ'})
@bgs-widget-stats-employee-card-click Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ ΠΏΠΎ ΠΊΠ»ΠΈΠΊΡƒ Π½Π° Π°Π²Π°Ρ‚Π°Ρ€ΠΊΡƒ

ΠšΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ bgs-widget-stats-employees

<bgs-widget-stats-employees :items="items"></bgs-widget-stats-employees>
Property Description
items ΠžΠΏΡ€Π΅Π΄Π΅Π»Ρ‘Π½Π½ΠΎΠ³ΠΎ Π²ΠΈΠ΄Π° массив ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ² (сотрудников)

ΠšΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ дослСТки

<template>
  <div id="app">
    <bgs-widget-payment-by-contract-expire
      :employees="employees"
      :loader="loader"
      :card="card"
      @bgs-widget-stats-item-click="itemClick"
      @bgs-widget-stats-collapse="collapse"
      @bgs-widget-stats-employee-card-click="cardClick"
      @bgs-widget-stats-refresh="refresh"
    ></bgs-widget-payment-by-contract-expire>
  </div>
</template>

<script>
  import axios from "axios";

  let token = "";

  axios.defaults.headers.common = { Authorization: `Bearer ${token}` };

  export default {
    name: "app",

    data() {
      return {
        card: null,
        employees: {
          items: []
        },
        loader: false,
        date: new Date().toISOString().split("T")[0],
        userId: 1
      };
    },

    async mounted() {
      await this.load();
    },

    methods: {
      itemClick() {},
      collapse() {},
      cardClick() {},
      error(message) {
        this.card = {
          header: `Error: ${message}`,
          type: "error"
        };
      },
      refresh() {
        this.load();
      },
      async load() {
        this.loader = true;

        try {
          let response = await axios.get(
            `http://bgs-auth.local/api/widget/payment-by-contract-expire/${
              this.userId
            }`,
            {
              params: {
                "filter[paid]": false,
                "filter[date_of_payment_by_contract_before]": this.date
              }
            }
          );

          if (response.status === 200) {
            let { card, items } = response.data.data;
            this.employees.items = items;

            if (card) {
              this.card = {
                header: card.value,
                subheader: "Total overdue sum",
                type: card.value ? "danger" : null
              };
            }
          }
        } catch (error) {
          this.error(error.response.statusText);
        }

        this.loader = false;
      }
    }
  };
</script>

ΠŸΠΎΠ»Π½Ρ‹ΠΉ ΠΏΡ€ΠΈΠΌΠ΅Ρ€

<template>
  <bgs-widget-stats-card
    header="header"
    subheader="subheader"
    :loader="loader"
    class="col-xs-12 col-sm-4 col-md-3"
    @bgs-widget-stats-item-click="itemClick"
    @bgs-widget-stats-collapse="collapse"
  >
    <template v-slot:employee-card>
      <bgs-widget-stats-employee-card
        :header="30001"
        icon="eye"
        :link="{href: 'link'}"
        class="bg-maroon"
        @bgs-widget-stats-employee-card-click="clickCard"
      >
        <template v-slot:subheader>
          <p>
            Last modified 2 month ago
            <br />on LNG
          </p>
        </template>
      </bgs-widget-stats-employee-card>
    </template>

    <template v-slot:buttons>
      <span
        role="button"
        title="Show detailed statistics"
        class="info-box-toolbar-button hover-translucent employee-statistics-show-details-button"
      >
        <i class="fa fa-list"></i>
      </span>
      <span
        role="button"
        title="Set plan"
        class="info-box-toolbar-button hover-translucent employee-statistics-show-planning-button"
      >
        <i class="fa fa-gears"></i>
      </span>
      <span
        role="button"
        title="Refresh"
        class="info-box-toolbar-button hover-translucent employee-statistics-refresh-button"
      >
        <i class="fa fa-refresh"></i>
      </span>
    </template>

    <template>
      <bgs-widget-stats-employees :items="items"></bgs-widget-stats-employees>
    </template>
  </bgs-widget-stats-card>
</template>

<script>
  import { setTimeout } from "timers";
  export default {
    mounted() {
      //Π·Π°Π³Ρ€ΡƒΠ·Ρ‡ΠΈΠΊ
      this.loader = true;

      //ΠΏΡ€ΠΈΠΌΠ΅Ρ€ получСния Π΄Π°Π½Π½Ρ‹Ρ…
      setTimeout(() => {
        this.items = this.getItems();

        this.loader = false;
      }, 5000);
    },

    data() {
      return {
        // Π—Π°Π³Ρ€ΡƒΠ·Ρ‡ΠΈΠΊ
        loader: false,
        items: null
      };
    },

    methods: {
      //Клик ΠΏΠΎ Π°Π²Π°Ρ‚Π°Ρ€ΠΊΠ΅
      itemClick(item) {},

      //Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ ΠΏΡ€ΠΈ Ρ€Π°Π·Π²ΠΎΡ€ΠΎΡ‚Π΅
      collapse(item) {},

      //Клик ΠΏΠΎ ΠΊΠ°Ρ€Ρ‚Π΅
      clickCard(e) {
        // ΠžΡ‚ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ стандартноС ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅ ΠΊΠ»ΠΈΠΊΠ°
        e.preventDefault();
      },

      getItems() {
        return [
          {
            id: 1, // ΡƒΠ½ΠΈΠΊΠ°Π»ΡŒΠ½Ρ‹ΠΉ id
            active: true, // Ρ„Π»Π°Π³ активности
            collapsed: false, // ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Ρ‚ΡŒ Ρ€Π°Π·Π²Ρ‘Ρ€Π½ΡƒΡ‚Ρ‹ΠΌ (ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Ρ‚ΡŒ список сотрудников)
            avatar: "foto.jpg", // Аватарка
            name: "Name 1", // Имя
            data: "Data", // Π”Π°Π½Π½Ρ‹Π΅ для ΠΏΠΎΠΊΠ°Π·Π°
            collapsed_data: "expanded", // Π”Π°Π½Π½Ρ‹Π΅, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π±ΡƒΠ΄ΡƒΡ‚ ΠΏΠΎΠΊΠ°Π·Π°Π½Ρ‹ ΠΏΡ€ΠΈ раскрытом спискС сотрудников
            other: [1, 2, 3], // Π»ΡŽΠ±Ρ‹Π΅ Π΄Ρ€ΡƒΠ³ΠΈΠ΅ Π΄Π°Π½Π½Ρ‹Π΅, Π½Π΅ΠΎΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎ other
            items: [
              // Π’Π»ΠΎΠΆΠ΅Π½Π½Ρ‹Π΅ элСмСнты
              {
                id: 2,
                active: false,
                collapsed: false,
                avatar: "cb59bc5fefe8bab6abf2fbc2e93eb208/gDAc5YF0mgY.jpg",
                name: "Name 12",
                data: "text"
              },
              {
                id: 3,
                active: true,
                collapsed: false,
                avatar: "MAKJOEIRd9c.jpg",
                name: "Name 13",
                data: "text"
              }
            ],
            // Π³Ρ€ΡƒΠΏΠΏΠ° элСмСнтов Π²Π½Π΅ ΠΈΠ΅Ρ€Π°Ρ€Ρ…ΠΈΠΈ, элСмСнты, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΠΏΠΎΠ΄ Ρ‡Π΅Ρ€Ρ‚ΠΎΠΉ
            disabledItems: [
              {
                id: 122, // ΡƒΠ½ΠΈΠΊΠ°Π»ΡŒΠ½Ρ‹ΠΉ id
                avatar: "MAKJOEIRd9c.jpg", // Аватарка
                name: "Name" // Имя
              }
            ]
          },
          {
            id: 51,
            active: true,
            collapsed: false,
            avatar: "IMG_1402.png",
            name: "Name 14",
            data: "data",
            items: [
              {
                id: 52,
                active: true,
                collapsed: false,
                avatar: "%D0%BE%D0%B3.png",
                name: "Name 15",
                data: "data",
                items: [
                  {
                    id: 53,
                    active: true,
                    collapsed: false,
                    avatar: "xgFmfkZaEHg.jpg",
                    name: "Name 152",
                    data: "data"
                  },
                  {
                    id: 54,
                    active: false,
                    collapsed: false,
                    avatar: "IMG_0257-10-09-18-02-17.JPG",
                    name: "Name 1Π²Π°Ρ‹",
                    data: "data"
                  }
                ]
              }
            ]
          }
        ];
      }
    }
  };
</script>

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published