fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!--
 * @Author: 张嘉彬
 * @Date: 2022-03-03 17:47:43
 * @Description:
-->
<template>
  <div class="drawer-container">
    <div>
      <div class="drawer-item">
        <span>样式</span>
        <el-radio-group v-model="btnStyleVal.type" style="margin-left:20px;">
          <el-radio label="text">文字样式</el-radio>
          <el-radio label="base">基础样式</el-radio>
        </el-radio-group>
      </div>
      <div class="drawer-item">
        <span>尺寸</span>
        <el-radio-group v-model="btnStyleVal.size" style="margin-left:20px;">
          <el-radio label="">默认</el-radio>
          <el-radio label="medium">中等</el-radio>
          <el-radio label="small">小型</el-radio>
          <el-radio label="mini">超小</el-radio>
        </el-radio-group>
      </div>
      <div class="drawer-item">
        <span style="margin-right:20px;">预览</span>
        <el-button :size="btnStyleVal.size" :type="btnStyleVal.type==='text'?'text':'primary'">
          {{btnStyleVal.type==='text'?'文字样式':'基础样式'}}
        </el-button>
      </div>
      <div style="text-align:center;margin-top:100px;">
        <el-button size="small" type="primary" icon="el-icon-circle-check" @click="saveSetting">
          保存配置
        </el-button>
        <el-button size="small" icon="el-icon-refresh" @click="resetSetting">
          重置配置
        </el-button>
      </div>
    </div>
  </div>
</template>
 
<script>
 
export default {
  data () {
    return {
      btnStyleVal: {
        type: 'text',
        size: ''
      }
    }
  },
  created () {
    this.btnStyleVal = { ...this.$store.state.btnStyleVal }
  },
  methods: {
    saveSetting () {
      this.$store.commit('setBtnStyle', this.btnStyleVal)
      this.$message.success('保存成功')
      this.$emit('close')
    },
    resetSetting () {
      this.$store.commit('setBtnStyle', {
        type: 'text',
        size: ''
      })
      this.$message.success('重置成功')
      this.$emit('close')
    }
  }
}
</script>
 
<style lang="scss" scoped>
.setting-drawer-content {
  .setting-drawer-title {
    margin-bottom: 12px;
    color: rgba(0, 0, 0, 0.85);
    font-size: 14px;
    line-height: 22px;
    font-weight: bold;
  }
 
  .setting-drawer-block-checbox {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 20px;
 
    .setting-drawer-block-checbox-item {
      position: relative;
      margin-right: 16px;
      border-radius: 2px;
      cursor: pointer;
 
      img {
        width: 48px;
        height: 48px;
      }
 
      .setting-drawer-block-checbox-selectIcon {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        padding-top: 15px;
        padding-left: 24px;
        color: #1890ff;
        font-weight: 700;
        font-size: 14px;
      }
    }
  }
}
 
.drawer-container {
  padding: 24px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
 
  .drawer-title {
    margin-bottom: 12px;
    color: rgba(0, 0, 0, 0.85);
    font-size: 14px;
    line-height: 22px;
  }
 
  .drawer-item {
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
    padding: 12px 0;
  }
 
  .drawer-switch {
    float: right;
  }
}
</style>