QuickVisit.vue 1.21 KB
Newer Older
1
<template>
潘际乾 committed
2 3
  <CellWrapper title="快速访问" :cellContentHeight="cellContentHeight">
    <template v-slot:header>
4
      <span class="el-icon-setting" title="设置" @click="openSetting"></span>
潘际乾 committed
5
    </template>
6

7 8 9
    <quick
      ref="quick"
      quickType="visit"
潘际乾 committed
10
      :cellContentHeight="cellContentHeight"
11
    ></quick>
潘际乾 committed
12
  </CellWrapper>
13 14 15
</template>

<script>
潘际乾 committed
16 17
import CellWrapper from "../common/CellWrapper.vue";
import quick from "../common/quick.vue";
18

潘际乾 committed
19
import defaultVisitItems from "../common/defaultQuickVisitItems.js";
20 21

export default {
潘际乾 committed
22
  name: "QuickVisit",
潘际乾 committed
23
  components: { CellWrapper, quick },
潘际乾 committed
24
  props: {
潘际乾 committed
25
    cellContentHeight: {
潘际乾 committed
26 27 28 29
      type: Number,
      required: true,
    },
  },
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  created() {
    const admin = localStorage.getItem("quick-visit-admin");
    if (!admin) {
      localStorage.setItem(
        "quick-visit-admin",
        JSON.stringify(defaultVisitItems.admin)
      );
    }
    const normal = localStorage.getItem("quick-visit-normal");
    if (!normal) {
      localStorage.setItem(
        "quick-visit-normal",
        JSON.stringify(defaultVisitItems.normal)
      );
    }
45 46
  },
  methods: {
47 48 49 50
    openSetting() {
      this.$refs.quick.openSetting();
    },
  },
51 52 53
};
</script>

54
<style scoped></style>