Blame view

src/components/NCC-topOperation/index.vue 1.32 KB
be009217   monkeyhouyi   处理,通知公告,任务中心
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
  <template>
    <div class="ncc-opts">
      <!--左侧插槽-->
      <slot name="left" />
      <template v-if="isJudgePer">
        <el-button type="primary" @click="add" icon="el-icon-plus" v-has="addPerCode">
          {{ addText === '新建' ? $t(`common.addBtn`) : addText }}
        </el-button>
      </template>
      <template v-else>
        <el-button type="primary" @click="add" icon="el-icon-plus">
          {{ addText === '新建' ? $t(`common.addBtn`) : addText }}
        </el-button>
      </template>
      <!-- 默认右侧插槽 -->
      <slot />
    </div>
  </template>
  <script>
  export default {
    props: {
      refreshText: {
        type: String,
        default: '刷新'
      },
      addText: {
        type: String,
        default: '新建'
      },
      // 刷新加载状态
      loading: {
        type: Boolean,
        default: false
      },
      // 是否展示刷新按钮
      hasRefresh: {
        type: Boolean,
        default: true
      },
      // 新增按钮权限标识
      addPerCode: {
        type: String,
        default: 'btn_add'
      },
      // 是否开启权限判断
      isJudgePer: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {}
    },
    methods: {
      refresh() {
        this.$emit('refresh')
      },
      add() {
        this.$emit('add')
      }
    }
  }
  </script>
  <style lang="scss" scoped>
  .ncc-opts {
    display: inline-block;
  }
  </style>