zant-admin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +36 -0
- package/README.md +248 -0
- package/SCAFFOLD_README.md +215 -0
- package/bin/cli.js +99 -0
- package/bin/generator.js +503 -0
- package/bin/prompts.js +159 -0
- package/bin/utils.js +134 -0
- package/package.json +74 -0
- package/public/logo.png +0 -0
- package/src/App.vue +16 -0
- package/src/api/methods/logError.js +8 -0
- package/src/api/methods/logOperation.js +8 -0
- package/src/api/methods/login.js +6 -0
- package/src/api/methods/quartz.js +36 -0
- package/src/api/methods/region.js +16 -0
- package/src/api/methods/sysAccount.js +30 -0
- package/src/api/methods/sysDict.js +29 -0
- package/src/api/methods/sysDictItem.js +26 -0
- package/src/api/methods/sysMenu.js +42 -0
- package/src/api/methods/sysRole.js +35 -0
- package/src/api/methods/sysUser.js +25 -0
- package/src/api/methods/system.js +16 -0
- package/src/api/request.js +225 -0
- package/src/assets/css/style.css +70 -0
- package/src/assets/css/zcui.css +340 -0
- package/src/assets/imgs/loginbackground.svg +69 -0
- package/src/assets/imgs/logo.png +0 -0
- package/src/assets/imgs/md/1.png +0 -0
- package/src/assets/imgs/md/10.png +0 -0
- package/src/assets/imgs/md/11.png +0 -0
- package/src/assets/imgs/md/2.png +0 -0
- package/src/assets/imgs/md/3.png +0 -0
- package/src/assets/imgs/md/4.png +0 -0
- package/src/assets/imgs/md/5.png +0 -0
- package/src/assets/imgs/md/6.png +0 -0
- package/src/assets/imgs/md/7.png +0 -0
- package/src/assets/imgs/md/8.png +0 -0
- package/src/assets/imgs/md/9.png +0 -0
- package/src/components/FormTable.vue +875 -0
- package/src/components/IconPicker.vue +344 -0
- package/src/components/MainPage.vue +957 -0
- package/src/components/details/logErrorDetails.vue +58 -0
- package/src/components/details/logOperationDetails.vue +76 -0
- package/src/components/edit/QuartzEdit.vue +221 -0
- package/src/components/edit/SysAccountEdit.vue +178 -0
- package/src/components/edit/SysDictEdit.vue +114 -0
- package/src/components/edit/SysDictItemEdit.vue +134 -0
- package/src/components/edit/SysRoleEdit.vue +109 -0
- package/src/components/edit/sysMenuEdit.vue +305 -0
- package/src/config/index.js +74 -0
- package/src/directives/permission.js +45 -0
- package/src/main.js +38 -0
- package/src/router/index.js +270 -0
- package/src/stores/config.js +37 -0
- package/src/stores/dict.js +33 -0
- package/src/stores/menu.js +57 -0
- package/src/stores/user.js +21 -0
- package/src/utils/baseEcharts.js +661 -0
- package/src/utils/dictTemplate.js +26 -0
- package/src/utils/regionUtils.js +169 -0
- package/src/utils/useFormCRUD.js +60 -0
- package/src/views/baiscstatis/center.vue +463 -0
- package/src/views/baiscstatis/iframePage.vue +31 -0
- package/src/views/baiscstatis/notFound.vue +192 -0
- package/src/views/console.vue +771 -0
- package/src/views/demo/importexport.vue +123 -0
- package/src/views/demo/region.vue +240 -0
- package/src/views/demo/statistics.vue +195 -0
- package/src/views/home.vue +7 -0
- package/src/views/login.vue +272 -0
- package/src/views/operations/log/logError.vue +78 -0
- package/src/views/operations/log/logLogin.vue +66 -0
- package/src/views/operations/log/logOperation.vue +103 -0
- package/src/views/operations/log/logQuartz.vue +57 -0
- package/src/views/operations/quartz.vue +181 -0
- package/src/views/operations/serviceMonitoring.vue +134 -0
- package/src/views/system/sysAccount.vue +123 -0
- package/src/views/system/sysDict.vue +156 -0
- package/src/views/system/sysDictItem.vue +118 -0
- package/src/views/system/sysMenu.vue +223 -0
- package/src/views/system/sysRole.vue +184 -0
- package/templates/env.production +2 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="icon-picker">
|
|
3
|
+
<a-input-group compact>
|
|
4
|
+
<a-input
|
|
5
|
+
v-model:value="selectedIconName"
|
|
6
|
+
placeholder="请选择图标"
|
|
7
|
+
readonly
|
|
8
|
+
style="width: calc(100% - 40px)"
|
|
9
|
+
/>
|
|
10
|
+
<a-button
|
|
11
|
+
type="primary"
|
|
12
|
+
@click="showPicker = true"
|
|
13
|
+
style="width: 40px"
|
|
14
|
+
>
|
|
15
|
+
<template #icon>
|
|
16
|
+
<SearchOutlined />
|
|
17
|
+
</template>
|
|
18
|
+
</a-button>
|
|
19
|
+
</a-input-group>
|
|
20
|
+
|
|
21
|
+
<!-- 图标选择弹窗 -->
|
|
22
|
+
<a-modal
|
|
23
|
+
v-model:open="showPicker"
|
|
24
|
+
title="选择图标"
|
|
25
|
+
width="800px"
|
|
26
|
+
:footer="null"
|
|
27
|
+
@cancel="showPicker = false"
|
|
28
|
+
>
|
|
29
|
+
<div class="icon-picker-modal">
|
|
30
|
+
<!-- 搜索框 -->
|
|
31
|
+
<div class="search-section">
|
|
32
|
+
<a-input
|
|
33
|
+
v-model:value="searchText"
|
|
34
|
+
placeholder="搜索图标名称"
|
|
35
|
+
allow-clear
|
|
36
|
+
@change="handleSearch"
|
|
37
|
+
>
|
|
38
|
+
<template #prefix>
|
|
39
|
+
<SearchOutlined />
|
|
40
|
+
</template>
|
|
41
|
+
</a-input>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- 图标分类 -->
|
|
45
|
+
<div class="category-section">
|
|
46
|
+
<a-radio-group v-model:value="selectedCategory" @change="handleCategoryChange">
|
|
47
|
+
<a-radio-button value="all">全部</a-radio-button>
|
|
48
|
+
<a-radio-button value="outlined">线框风格</a-radio-button>
|
|
49
|
+
<a-radio-button value="filled">实底风格</a-radio-button>
|
|
50
|
+
<a-radio-button value="twoTone">双色风格</a-radio-button>
|
|
51
|
+
</a-radio-group>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<!-- 图标列表 -->
|
|
55
|
+
<div class="icon-list-section">
|
|
56
|
+
<a-spin :spinning="loading">
|
|
57
|
+
<div class="icon-grid">
|
|
58
|
+
<div
|
|
59
|
+
v-for="icon in filteredIcons"
|
|
60
|
+
:key="icon.name"
|
|
61
|
+
class="icon-item"
|
|
62
|
+
:class="{ 'icon-item-selected': selectedIconName === icon.name }"
|
|
63
|
+
@click="selectIcon(icon)"
|
|
64
|
+
>
|
|
65
|
+
<div class="icon-wrapper">
|
|
66
|
+
<component :is="icon.component" class="icon-display" />
|
|
67
|
+
</div>
|
|
68
|
+
<div class="icon-name">{{ icon.displayName }}</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</a-spin>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<!-- 选中的图标预览 -->
|
|
75
|
+
<div v-if="selectedIconName" class="selected-preview">
|
|
76
|
+
<div class="preview-title">当前选中:</div>
|
|
77
|
+
<div class="preview-content">
|
|
78
|
+
<component :is="selectedIconComponent" class="preview-icon" />
|
|
79
|
+
<span class="preview-name">{{ selectedIconName }}</span>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!-- 操作按钮 -->
|
|
84
|
+
<div class="action-section">
|
|
85
|
+
<a-space>
|
|
86
|
+
<a-button type="primary" @click="confirmSelection">确认选择</a-button>
|
|
87
|
+
<a-button @click="clearSelection">清空</a-button>
|
|
88
|
+
<a-button @click="showPicker = false">取消</a-button>
|
|
89
|
+
</a-space>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</a-modal>
|
|
93
|
+
</div>
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<script setup>
|
|
97
|
+
import { ref, computed, onMounted } from 'vue'
|
|
98
|
+
import * as Icons from '@ant-design/icons-vue'
|
|
99
|
+
import { SearchOutlined } from '@ant-design/icons-vue'
|
|
100
|
+
|
|
101
|
+
// 定义 props
|
|
102
|
+
const props = defineProps({
|
|
103
|
+
value: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: ''
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
// 定义 emits
|
|
110
|
+
const emit = defineEmits(['update:value', 'change'])
|
|
111
|
+
|
|
112
|
+
// 响应式数据
|
|
113
|
+
const showPicker = ref(false)
|
|
114
|
+
const searchText = ref('')
|
|
115
|
+
const selectedCategory = ref('all')
|
|
116
|
+
const loading = ref(false)
|
|
117
|
+
const selectedIconName = ref(props.value)
|
|
118
|
+
|
|
119
|
+
// 图标数据
|
|
120
|
+
const allIcons = ref([])
|
|
121
|
+
|
|
122
|
+
// 过滤后的图标列表
|
|
123
|
+
const filteredIcons = computed(() => {
|
|
124
|
+
let icons = allIcons.value
|
|
125
|
+
|
|
126
|
+
// 按分类过滤
|
|
127
|
+
if (selectedCategory.value !== 'all') {
|
|
128
|
+
icons = icons.filter(icon => {
|
|
129
|
+
if (selectedCategory.value === 'outlined') {
|
|
130
|
+
return icon.name.endsWith('Outlined')
|
|
131
|
+
} else if (selectedCategory.value === 'filled') {
|
|
132
|
+
return icon.name.endsWith('Filled')
|
|
133
|
+
} else if (selectedCategory.value === 'twoTone') {
|
|
134
|
+
return icon.name.endsWith('TwoTone')
|
|
135
|
+
}
|
|
136
|
+
return true
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 按搜索文本过滤
|
|
141
|
+
if (searchText.value) {
|
|
142
|
+
const searchLower = searchText.value.toLowerCase()
|
|
143
|
+
icons = icons.filter(icon =>
|
|
144
|
+
icon.displayName.toLowerCase().includes(searchLower) ||
|
|
145
|
+
icon.name.toLowerCase().includes(searchLower)
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return icons
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
// 选中的图标组件
|
|
153
|
+
const selectedIconComponent = computed(() => {
|
|
154
|
+
if (!selectedIconName.value) return null
|
|
155
|
+
return allIcons.value.find(icon => icon.name === selectedIconName.value)?.component || null
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
// 初始化图标数据
|
|
159
|
+
const initIcons = () => {
|
|
160
|
+
loading.value = true
|
|
161
|
+
|
|
162
|
+
// 过滤掉一些不常用的图标
|
|
163
|
+
const excludedIcons = ['IconProvider', 'createFromIconfontCN']
|
|
164
|
+
|
|
165
|
+
const iconList = Object.keys(Icons)
|
|
166
|
+
.filter(key => !excludedIcons.includes(key))
|
|
167
|
+
.map(key => ({
|
|
168
|
+
name: key,
|
|
169
|
+
displayName: key.replace(/([A-Z])/g, ' $1').trim(),
|
|
170
|
+
component: Icons[key]
|
|
171
|
+
}))
|
|
172
|
+
.sort((a, b) => a.displayName.localeCompare(b.displayName))
|
|
173
|
+
|
|
174
|
+
allIcons.value = iconList
|
|
175
|
+
loading.value = false
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 处理搜索
|
|
179
|
+
const handleSearch = () => {
|
|
180
|
+
// 搜索逻辑已在 computed 中处理
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// 处理分类变化
|
|
184
|
+
const handleCategoryChange = () => {
|
|
185
|
+
// 分类逻辑已在 computed 中处理
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// 选择图标
|
|
189
|
+
const selectIcon = (icon) => {
|
|
190
|
+
selectedIconName.value = icon.name
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// 确认选择
|
|
194
|
+
const confirmSelection = () => {
|
|
195
|
+
emit('update:value', selectedIconName.value)
|
|
196
|
+
emit('change', selectedIconName.value)
|
|
197
|
+
showPicker.value = false
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// 清空选择
|
|
201
|
+
const clearSelection = () => {
|
|
202
|
+
selectedIconName.value = ''
|
|
203
|
+
emit('update:value', '')
|
|
204
|
+
emit('change', '')
|
|
205
|
+
showPicker.value = false
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// 监听外部 value 变化
|
|
209
|
+
const updateSelectedIcon = (newValue) => {
|
|
210
|
+
selectedIconName.value = newValue
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// 暴露方法给父组件
|
|
214
|
+
defineExpose({
|
|
215
|
+
updateSelectedIcon
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
// 生命周期
|
|
219
|
+
onMounted(() => {
|
|
220
|
+
initIcons()
|
|
221
|
+
})
|
|
222
|
+
</script>
|
|
223
|
+
|
|
224
|
+
<style scoped>
|
|
225
|
+
.icon-picker {
|
|
226
|
+
width: 100%;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.icon-picker-modal {
|
|
230
|
+
max-height: 60vh;
|
|
231
|
+
overflow-y: auto;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.search-section {
|
|
235
|
+
margin-bottom: 16px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.category-section {
|
|
239
|
+
margin-bottom: 16px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.icon-list-section {
|
|
243
|
+
margin-bottom: 16px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.icon-grid {
|
|
247
|
+
display: grid;
|
|
248
|
+
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
|
|
249
|
+
gap: 12px;
|
|
250
|
+
max-height: 300px;
|
|
251
|
+
overflow-y: auto;
|
|
252
|
+
padding: 8px 0;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.icon-item {
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
align-items: center;
|
|
259
|
+
padding: 12px 8px;
|
|
260
|
+
border: 1px solid #d9d9d9;
|
|
261
|
+
border-radius: 6px;
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
transition: all 0.3s;
|
|
264
|
+
background: #fff;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.icon-item:hover {
|
|
268
|
+
border-color: #1890ff;
|
|
269
|
+
box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.icon-item-selected {
|
|
273
|
+
border-color: #1890ff;
|
|
274
|
+
background-color: #f0f8ff;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.icon-wrapper {
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
justify-content: center;
|
|
281
|
+
width: 40px;
|
|
282
|
+
height: 40px;
|
|
283
|
+
margin-bottom: 8px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.icon-display {
|
|
287
|
+
font-size: 24px;
|
|
288
|
+
color: #666;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.icon-item:hover .icon-display,
|
|
292
|
+
.icon-item-selected .icon-display {
|
|
293
|
+
color: #1890ff;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.icon-name {
|
|
297
|
+
font-size: 12px;
|
|
298
|
+
color: #666;
|
|
299
|
+
text-align: center;
|
|
300
|
+
word-break: break-all;
|
|
301
|
+
line-height: 1.2;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.selected-preview {
|
|
305
|
+
padding: 16px;
|
|
306
|
+
border-top: 1px solid #f0f0f0;
|
|
307
|
+
margin-top: 16px;
|
|
308
|
+
background: #fafafa;
|
|
309
|
+
border-radius: 6px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.preview-title {
|
|
313
|
+
font-weight: 500;
|
|
314
|
+
margin-bottom: 8px;
|
|
315
|
+
color: #333;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.preview-content {
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
gap: 12px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.preview-icon {
|
|
325
|
+
font-size: 24px;
|
|
326
|
+
color: #1890ff;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.preview-name {
|
|
330
|
+
font-family: monospace;
|
|
331
|
+
background: #f5f5f5;
|
|
332
|
+
padding: 4px 8px;
|
|
333
|
+
border-radius: 4px;
|
|
334
|
+
font-size: 14px;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.action-section {
|
|
338
|
+
display: flex;
|
|
339
|
+
justify-content: flex-end;
|
|
340
|
+
margin-top: 16px;
|
|
341
|
+
padding-top: 16px;
|
|
342
|
+
border-top: 1px solid #f0f0f0;
|
|
343
|
+
}
|
|
344
|
+
</style>
|