选煤厂安全管理系统前端代码
houzhongjian
2024-11-25 37b2044f04a09e89f82f8484279b5f06b7194481
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<script lang="ts" setup>
import { setCssVar } from '@/utils'
 
import { useDesign } from '@/hooks/web/useDesign'
import { useWatermark } from '@/hooks/web/useWatermark'
import { useAppStore } from '@/store/modules/app'
 
defineOptions({ name: 'InterfaceDisplay' })
 
const { t } = useI18n()
const { getPrefixCls } = useDesign()
const { setWatermark } = useWatermark()
const prefixCls = getPrefixCls('interface-display')
const appStore = useAppStore()
 
const water = ref()
 
// 面包屑
const breadcrumb = ref(appStore.getBreadcrumb)
 
const breadcrumbChange = (show: boolean) => {
  appStore.setBreadcrumb(show)
}
 
// 面包屑图标
const breadcrumbIcon = ref(appStore.getBreadcrumbIcon)
 
const breadcrumbIconChange = (show: boolean) => {
  appStore.setBreadcrumbIcon(show)
}
 
// 折叠图标
const hamburger = ref(appStore.getHamburger)
 
const hamburgerChange = (show: boolean) => {
  appStore.setHamburger(show)
}
 
// 全屏图标
const screenfull = ref(appStore.getScreenfull)
 
const screenfullChange = (show: boolean) => {
  appStore.setScreenfull(show)
}
 
// 尺寸图标
const size = ref(appStore.getSize)
 
const sizeChange = (show: boolean) => {
  appStore.setSize(show)
}
 
// 多语言图标
const locale = ref(appStore.getLocale)
 
const localeChange = (show: boolean) => {
  appStore.setLocale(show)
}
 
// 消息图标
const message = ref(appStore.getMessage)
 
const messageChange = (show: boolean) => {
  appStore.setMessage(show)
}
 
// 标签页
const tagsView = ref(appStore.getTagsView)
 
const tagsViewChange = (show: boolean) => {
  // 切换标签栏显示时,同步切换标签栏的高度
  setCssVar('--tags-view-height', show ? '35px' : '0px')
  appStore.setTagsView(show)
}
 
// 标签页图标
const tagsViewIcon = ref(appStore.getTagsViewIcon)
 
const tagsViewIconChange = (show: boolean) => {
  appStore.setTagsViewIcon(show)
}
 
// logo
const logo = ref(appStore.getLogo)
 
const logoChange = (show: boolean) => {
  appStore.setLogo(show)
}
 
// 菜单手风琴
const uniqueOpened = ref(appStore.getUniqueOpened)
 
const uniqueOpenedChange = (uniqueOpened: boolean) => {
  appStore.setUniqueOpened(uniqueOpened)
}
 
// 固定头部
const fixedHeader = ref(appStore.getFixedHeader)
 
const fixedHeaderChange = (show: boolean) => {
  appStore.setFixedHeader(show)
}
 
// 页脚
const footer = ref(appStore.getFooter)
 
const footerChange = (show: boolean) => {
  appStore.setFooter(show)
}
 
// 灰色模式
const greyMode = ref(appStore.getGreyMode)
 
const greyModeChange = (show: boolean) => {
  appStore.setGreyMode(show)
}
 
// 固定菜单
const fixedMenu = ref(appStore.getFixedMenu)
 
const fixedMenuChange = (show: boolean) => {
  appStore.setFixedMenu(show)
}
 
// 设置水印
const setWater = () => {
  setWatermark(water.value)
}
 
const layout = computed(() => appStore.getLayout)
 
watch(
  () => layout.value,
  (n) => {
    if (n === 'top') {
      appStore.setCollapse(false)
    }
  }
)
</script>
 
<template>
  <div :class="prefixCls">
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.breadcrumb') }}</span>
      <ElSwitch v-model="breadcrumb" @change="breadcrumbChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.breadcrumbIcon') }}</span>
      <ElSwitch v-model="breadcrumbIcon" @change="breadcrumbIconChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.hamburgerIcon') }}</span>
      <ElSwitch v-model="hamburger" @change="hamburgerChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.screenfullIcon') }}</span>
      <ElSwitch v-model="screenfull" @change="screenfullChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.sizeIcon') }}</span>
      <ElSwitch v-model="size" @change="sizeChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.localeIcon') }}</span>
      <ElSwitch v-model="locale" @change="localeChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.messageIcon') }}</span>
      <ElSwitch v-model="message" @change="messageChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.tagsView') }}</span>
      <ElSwitch v-model="tagsView" @change="tagsViewChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.tagsViewIcon') }}</span>
      <ElSwitch v-model="tagsViewIcon" @change="tagsViewIconChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.logo') }}</span>
      <ElSwitch v-model="logo" @change="logoChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.uniqueOpened') }}</span>
      <ElSwitch v-model="uniqueOpened" @change="uniqueOpenedChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.fixedHeader') }}</span>
      <ElSwitch v-model="fixedHeader" @change="fixedHeaderChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.footer') }}</span>
      <ElSwitch v-model="footer" @change="footerChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.greyMode') }}</span>
      <ElSwitch v-model="greyMode" @change="greyModeChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('setting.fixedMenu') }}</span>
      <ElSwitch v-model="fixedMenu" @change="fixedMenuChange" />
    </div>
 
    <div class="flex items-center justify-between">
      <span class="text-14px">{{ t('watermark.watermark') }}</span>
      <ElInput v-model="water" class="right-1 w-20" @change="setWater()" />
    </div>
  </div>
</template>