riku
2024-10-15 e38ea524ec4107ed7f8b1d7491a4177632dd3402
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
  <div class="layout">
    <el-row v-if="title">
      <el-col :span="16" class="title">{{ title }}</el-col>
      <el-col :span="8">
        <el-row justify="end" class="btn-group">
          <el-button
            v-for="(b, i) in buttons"
            :key="i"
            :type="b.color ? b.color : 'primary'"
            size="small"
            @click="b.click"
            >{{ b.name }}</el-button
          >
        </el-row>
      </el-col>
    </el-row>
    <el-row class="tag-group" v-if="title">
      <el-space>
        <el-tag v-for="(d, i) in descriptions" :key="i" type="info" size="small">{{
          d.name + ': ' + d.value
        }}</el-tag>
      </el-space>
    </el-row>
  </div>
</template>
 
<script>
export default {
  // 主界面内部操作面板工具栏
  props: {
    loading: Boolean,
    title: String,
    descriptions: {
      type: Array,
      default: () => [
        {
          name: '',
          value: ''
        }
      ]
    },
    buttons: {
      type: Array,
      default: () => [
        {
          name: '',
          color: 'primary',
          click: () => {}
        }
      ]
    }
  }
};
</script>
<style scoped>
.layout {
  /* background-color: beige; */
  height: var(--height-toolbar);
  /* border-bottom: 1px solid var(--el-color-info-light-7); */
}
 
.cell-item {
  display: flex;
  align-items: center;
}
 
.title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.btn-group {
  /* background-color: rgb(32, 127, 211); */
  white-space: nowrap;
}
 
.tag-group {
  margin-top: 2px;
}
</style>