@skyfox2000/webui 0.1.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/.eslintrc.js +23 -0
- package/.prettierrc +11 -0
- package/.vscode/settings.json +25 -0
- package/README.md +104 -0
- package/env.d.ts +11 -0
- package/index.html +19 -0
- package/lib/AceEditor.d.ts +4 -0
- package/lib/BasicLayout.d.ts +4 -0
- package/lib/Error403.d.ts +4 -0
- package/lib/Error404.d.ts +4 -0
- package/lib/ExcelForm.d.ts +4 -0
- package/lib/UploadForm.d.ts +4 -0
- package/lib/assets/modules/basicLayout-YP_-EySb.js +726 -0
- package/lib/assets/modules/error403-Bi0E2twj.js +33 -0
- package/lib/assets/modules/error404-BF7vasR_.js +33 -0
- package/lib/assets/modules/excelForm-Dzndz-SG.js +109 -0
- package/lib/assets/modules/excelForm-WJVQmaDT.js +317 -0
- package/lib/assets/modules/index-FzWSvscZ.js +107 -0
- package/lib/assets/modules/index-ekkaExvB.js +49 -0
- package/lib/assets/modules/uploadForm-BahGnrAq.js +415 -0
- package/lib/assets/modules/uploadForm-DEnOjhwc.js +308 -0
- package/lib/components/common/button/index.vue.d.ts +42 -0
- package/lib/components/common/button/index.vue.d.ts.map +1 -0
- package/lib/components/common/icon/appicon.vue.d.ts +12 -0
- package/lib/components/common/icon/appicon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/fullscreen.vue.d.ts +4 -0
- package/lib/components/common/icon/fullscreen.vue.d.ts.map +1 -0
- package/lib/components/common/icon/helper.vue.d.ts +23 -0
- package/lib/components/common/icon/helper.vue.d.ts.map +1 -0
- package/lib/components/common/icon/index.vue.d.ts +244 -0
- package/lib/components/common/icon/index.vue.d.ts.map +1 -0
- package/lib/components/common/icon/layoutIcon.vue.d.ts +44 -0
- package/lib/components/common/icon/layoutIcon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/projectIcon.vue.d.ts +60 -0
- package/lib/components/common/icon/projectIcon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/toolIcon.vue.d.ts +44 -0
- package/lib/components/common/icon/toolIcon.vue.d.ts.map +1 -0
- package/lib/components/common/index.d.ts +19 -0
- package/lib/components/common/index.d.ts.map +1 -0
- package/lib/components/common/tooltip/index.vue.d.ts +22 -0
- package/lib/components/common/tooltip/index.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/excelForm.vue.d.ts +31 -0
- package/lib/components/content/dialog/excelForm.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/index.vue.d.ts +35 -0
- package/lib/components/content/dialog/index.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/uploadForm.vue.d.ts +25 -0
- package/lib/components/content/dialog/uploadForm.vue.d.ts.map +1 -0
- package/lib/components/content/drawer/index.vue.d.ts +27 -0
- package/lib/components/content/drawer/index.vue.d.ts.map +1 -0
- package/lib/components/content/form/formItem.vue.d.ts +26 -0
- package/lib/components/content/form/formItem.vue.d.ts.map +1 -0
- package/lib/components/content/form/index.vue.d.ts +26 -0
- package/lib/components/content/form/index.vue.d.ts.map +1 -0
- package/lib/components/content/index.d.ts +27 -0
- package/lib/components/content/index.d.ts.map +1 -0
- package/lib/components/content/search/index.vue.d.ts +30 -0
- package/lib/components/content/search/index.vue.d.ts.map +1 -0
- package/lib/components/content/search/searchItem.vue.d.ts +24 -0
- package/lib/components/content/search/searchItem.vue.d.ts.map +1 -0
- package/lib/components/content/table/index.vue.d.ts +37 -0
- package/lib/components/content/table/index.vue.d.ts.map +1 -0
- package/lib/components/content/table/tableOperate.vue.d.ts +19 -0
- package/lib/components/content/table/tableOperate.vue.d.ts.map +1 -0
- package/lib/components/content/toolbar/icontool.vue.d.ts +8 -0
- package/lib/components/content/toolbar/icontool.vue.d.ts.map +1 -0
- package/lib/components/content/toolbar/index.vue.d.ts +19 -0
- package/lib/components/content/toolbar/index.vue.d.ts.map +1 -0
- package/lib/components/content/tree/index.vue.d.ts +47 -0
- package/lib/components/content/tree/index.vue.d.ts.map +1 -0
- package/lib/components/error/error403.vue.d.ts +4 -0
- package/lib/components/error/error403.vue.d.ts.map +1 -0
- package/lib/components/error/error404.vue.d.ts +4 -0
- package/lib/components/error/error404.vue.d.ts.map +1 -0
- package/lib/components/form/aceEditor/aceConfig.d.ts +9 -0
- package/lib/components/form/aceEditor/aceConfig.d.ts.map +1 -0
- package/lib/components/form/aceEditor/index.vue.d.ts +13 -0
- package/lib/components/form/aceEditor/index.vue.d.ts.map +1 -0
- package/lib/components/form/autoComplete/index.vue.d.ts +140 -0
- package/lib/components/form/autoComplete/index.vue.d.ts.map +1 -0
- package/lib/components/form/cascader/index.vue.d.ts +110 -0
- package/lib/components/form/cascader/index.vue.d.ts.map +1 -0
- package/lib/components/form/checkbox/index.vue.d.ts +129 -0
- package/lib/components/form/checkbox/index.vue.d.ts.map +1 -0
- package/lib/components/form/datePicker/index.vue.d.ts +7 -0
- package/lib/components/form/datePicker/index.vue.d.ts.map +1 -0
- package/lib/components/form/index.d.ts +41 -0
- package/lib/components/form/index.d.ts.map +1 -0
- package/lib/components/form/input/index.vue.d.ts +27 -0
- package/lib/components/form/input/index.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputIcon.vue.d.ts +11 -0
- package/lib/components/form/input/inputIcon.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputNumber.vue.d.ts +4 -0
- package/lib/components/form/input/inputNumber.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputPassword.vue.d.ts +4 -0
- package/lib/components/form/input/inputPassword.vue.d.ts.map +1 -0
- package/lib/components/form/propEditor/index.vue.d.ts +13 -0
- package/lib/components/form/propEditor/index.vue.d.ts.map +1 -0
- package/lib/components/form/radio/index.vue.d.ts +134 -0
- package/lib/components/form/radio/index.vue.d.ts.map +1 -0
- package/lib/components/form/radio/radioStatus.vue.d.ts +32 -0
- package/lib/components/form/radio/radioStatus.vue.d.ts.map +1 -0
- package/lib/components/form/rangePicker/index.vue.d.ts +17 -0
- package/lib/components/form/rangePicker/index.vue.d.ts.map +1 -0
- package/lib/components/form/select/index.vue.d.ts +143 -0
- package/lib/components/form/select/index.vue.d.ts.map +1 -0
- package/lib/components/form/switch/index.vue.d.ts +44 -0
- package/lib/components/form/switch/index.vue.d.ts.map +1 -0
- package/lib/components/form/textarea/index.vue.d.ts +4 -0
- package/lib/components/form/textarea/index.vue.d.ts.map +1 -0
- package/lib/components/form/transfer/index.vue.d.ts +39 -0
- package/lib/components/form/transfer/index.vue.d.ts.map +1 -0
- package/lib/components/form/transfer/transferTable.vue.d.ts +39 -0
- package/lib/components/form/transfer/transferTable.vue.d.ts.map +1 -0
- package/lib/components/form/treeSelect/index.vue.d.ts +39 -0
- package/lib/components/form/treeSelect/index.vue.d.ts.map +1 -0
- package/lib/components/form/upload/uploadList.vue.d.ts +477 -0
- package/lib/components/form/upload/uploadList.vue.d.ts.map +1 -0
- package/lib/components/index.d.ts +9 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/layout/breadcrumb/index.vue.d.ts +4 -0
- package/lib/components/layout/breadcrumb/index.vue.d.ts.map +1 -0
- package/lib/components/layout/content/index.vue.d.ts +23 -0
- package/lib/components/layout/content/index.vue.d.ts.map +1 -0
- package/lib/components/layout/datetime/index.vue.d.ts +4 -0
- package/lib/components/layout/datetime/index.vue.d.ts.map +1 -0
- package/lib/components/layout/header/headerExits.vue.d.ts +4 -0
- package/lib/components/layout/header/headerExits.vue.d.ts.map +1 -0
- package/lib/components/layout/header/index.vue.d.ts +4 -0
- package/lib/components/layout/header/index.vue.d.ts.map +1 -0
- package/lib/components/layout/index.d.ts +17 -0
- package/lib/components/layout/index.d.ts.map +1 -0
- package/lib/components/layout/menu/index.vue.d.ts +7 -0
- package/lib/components/layout/menu/index.vue.d.ts.map +1 -0
- package/lib/components/layout/menu/menuTabs.vue.d.ts +4 -0
- package/lib/components/layout/menu/menuTabs.vue.d.ts.map +1 -0
- package/lib/components/layout/page/basicLayout.vue.d.ts +7 -0
- package/lib/components/layout/page/basicLayout.vue.d.ts.map +1 -0
- package/lib/es/AceEditor/index.js +168 -0
- package/lib/es/BasicLayout/index.js +4 -0
- package/lib/es/Error403/index.js +4 -0
- package/lib/es/Error404/index.js +4 -0
- package/lib/es/ExcelForm/index.js +5 -0
- package/lib/es/UploadForm/index.js +5 -0
- package/lib/index.d.ts +2 -0
- package/lib/webui.css +1 -0
- package/lib/webui.es.js +3349 -0
- package/package.json +66 -0
- package/plugins/vite-plugin-auto-generate-vue.ts +105 -0
- package/postcss.config.ts +6 -0
- package/src/assets/global.css +9 -0
- package/src/components/common/button/index.vue +126 -0
- package/src/components/common/icon/appicon.vue +28 -0
- package/src/components/common/icon/fullscreen.vue +13 -0
- package/src/components/common/icon/helper.vue +30 -0
- package/src/components/common/icon/index.vue +426 -0
- package/src/components/common/icon/layoutIcon.vue +33 -0
- package/src/components/common/icon/projectIcon.vue +41 -0
- package/src/components/common/icon/toolIcon.vue +33 -0
- package/src/components/common/index.ts +19 -0
- package/src/components/common/tooltip/index.vue +25 -0
- package/src/components/content/dialog/excelForm.vue +479 -0
- package/src/components/content/dialog/index.vue +149 -0
- package/src/components/content/dialog/uploadForm.vue +228 -0
- package/src/components/content/drawer/index.vue +93 -0
- package/src/components/content/form/formItem.vue +76 -0
- package/src/components/content/form/index.vue +48 -0
- package/src/components/content/index.ts +32 -0
- package/src/components/content/search/index.vue +135 -0
- package/src/components/content/search/searchItem.vue +52 -0
- package/src/components/content/table/index.vue +215 -0
- package/src/components/content/table/tableOperate.vue +131 -0
- package/src/components/content/toolbar/icontool.vue +151 -0
- package/src/components/content/toolbar/index.vue +107 -0
- package/src/components/content/tree/index.vue +140 -0
- package/src/components/error/error403.vue +14 -0
- package/src/components/error/error404.vue +14 -0
- package/src/components/form/aceEditor/aceConfig.ts +90 -0
- package/src/components/form/aceEditor/index.vue +175 -0
- package/src/components/form/autoComplete/index.vue +171 -0
- package/src/components/form/cascader/index.vue +110 -0
- package/src/components/form/checkbox/index.vue +108 -0
- package/src/components/form/datePicker/index.vue +29 -0
- package/src/components/form/index.ts +54 -0
- package/src/components/form/input/index.vue +70 -0
- package/src/components/form/input/inputIcon.vue +39 -0
- package/src/components/form/input/inputNumber.vue +23 -0
- package/src/components/form/input/inputPassword.vue +22 -0
- package/src/components/form/propEditor/index.vue +81 -0
- package/src/components/form/radio/index.vue +132 -0
- package/src/components/form/radio/radioStatus.vue +42 -0
- package/src/components/form/rangePicker/index.vue +64 -0
- package/src/components/form/select/index.vue +186 -0
- package/src/components/form/switch/index.vue +58 -0
- package/src/components/form/textarea/index.vue +23 -0
- package/src/components/form/transfer/index.vue +95 -0
- package/src/components/form/transfer/transferTable.vue +124 -0
- package/src/components/form/treeSelect/index.vue +108 -0
- package/src/components/form/upload/uploadList.vue +235 -0
- package/src/components/index.ts +97 -0
- package/src/components/layout/breadcrumb/index.vue +38 -0
- package/src/components/layout/content/index.vue +28 -0
- package/src/components/layout/datetime/index.vue +16 -0
- package/src/components/layout/header/headerExits.vue +28 -0
- package/src/components/layout/header/index.vue +43 -0
- package/src/components/layout/index.ts +16 -0
- package/src/components/layout/menu/index.vue +64 -0
- package/src/components/layout/menu/menuTabs.vue +56 -0
- package/src/components/layout/page/basicLayout.vue +67 -0
- package/src/vite-env.d.ts +8 -0
- package/tailwind.config.ts +11 -0
- package/tsconfig.json +53 -0
- package/vite.config.ts +117 -0
- package//344/273/243/347/240/201/350/247/204/350/214/203/345/217/212/351/243/216/346/240/274/346/214/207/345/215/227.md +116 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* 图标组件
|
|
4
|
+
* @component
|
|
5
|
+
* @name Icon
|
|
6
|
+
* @summary 提供一个可点击的图标按钮,支持自动切换图标,发送点击事件等功能。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { ref, computed, inject, watch, useAttrs } from 'vue';
|
|
10
|
+
import Tooltip from '../tooltip/index.vue';
|
|
11
|
+
import { getIconTransform } from '@skyfox2000/webbase';
|
|
12
|
+
|
|
13
|
+
// 关闭自动继承属性到根元素
|
|
14
|
+
defineOptions({
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
});
|
|
17
|
+
const attrs = useAttrs(); // 手动获取 $attrs
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
/**
|
|
21
|
+
* 点击后自动切换
|
|
22
|
+
* @props
|
|
23
|
+
* @name autoSwitch
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
autoSwitch: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true,
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* 提示标题
|
|
33
|
+
* @props
|
|
34
|
+
* @name tiptext
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
tiptext: {
|
|
38
|
+
type: String,
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* 提示尺寸
|
|
42
|
+
* @props
|
|
43
|
+
* @name tipsize
|
|
44
|
+
* @type {string}
|
|
45
|
+
*/
|
|
46
|
+
tipsize: {
|
|
47
|
+
type: String,
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* 提示背景色
|
|
51
|
+
* @props
|
|
52
|
+
* @name tipcolor
|
|
53
|
+
* @type {string}
|
|
54
|
+
*/
|
|
55
|
+
tipcolor: {
|
|
56
|
+
type: String,
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* 提示显示位置
|
|
60
|
+
* @props
|
|
61
|
+
* @name placement
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @default 'top'
|
|
64
|
+
*/
|
|
65
|
+
placement: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'top',
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* IconFont图标
|
|
71
|
+
* @props
|
|
72
|
+
* @name icon
|
|
73
|
+
* @type {string}
|
|
74
|
+
* @summary IconFont图标显示,使用sym-开头的使用svg模式显示
|
|
75
|
+
*/
|
|
76
|
+
icon: {
|
|
77
|
+
type: String,
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* IconFont图标组
|
|
81
|
+
* @props
|
|
82
|
+
* @name icons
|
|
83
|
+
* @type {Array<string>}
|
|
84
|
+
* @summary IconFont图标组显示,使用sym-开头的使用svg模式显示
|
|
85
|
+
* @default []
|
|
86
|
+
*/
|
|
87
|
+
icons: {
|
|
88
|
+
type: Array<string>,
|
|
89
|
+
default: () => [],
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* 图标索引
|
|
93
|
+
* @props
|
|
94
|
+
* @name iconIndex
|
|
95
|
+
* @type {number}
|
|
96
|
+
* @default 0
|
|
97
|
+
*/
|
|
98
|
+
iconIndex: {
|
|
99
|
+
type: Number,
|
|
100
|
+
default: 0,
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* 可点击,鼠标手
|
|
104
|
+
* @props
|
|
105
|
+
* @name clickable
|
|
106
|
+
* @type {boolean}
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
clickable: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false,
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* 点击事件
|
|
115
|
+
* @props
|
|
116
|
+
* @name clickEvent
|
|
117
|
+
* @summary 格式 "空间名#事件名",空间名和事件名用#分隔,事件名用.分隔
|
|
118
|
+
* @type {string}
|
|
119
|
+
*/
|
|
120
|
+
clickEvent: {
|
|
121
|
+
type: String,
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* 点击传输数据
|
|
125
|
+
* @props
|
|
126
|
+
* @name data
|
|
127
|
+
* @summary 点击事件传输的默认数据
|
|
128
|
+
* @type {object|string}
|
|
129
|
+
*/
|
|
130
|
+
data: {
|
|
131
|
+
type: [Object, String],
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* 字体大小
|
|
135
|
+
* @props
|
|
136
|
+
* @name size
|
|
137
|
+
* @summary 字体大小
|
|
138
|
+
* @type {string}
|
|
139
|
+
* @default 20px
|
|
140
|
+
*/
|
|
141
|
+
fontsize: {
|
|
142
|
+
type: String, // 大小
|
|
143
|
+
default: '20px',
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* 空间大小
|
|
147
|
+
* @props
|
|
148
|
+
* @name size
|
|
149
|
+
* @summary 空间大小
|
|
150
|
+
* @type {string, [string, string]}
|
|
151
|
+
* @default 20px
|
|
152
|
+
*/
|
|
153
|
+
size: {
|
|
154
|
+
type: [String, Array<String>], // 大小
|
|
155
|
+
default: () => ['20px', '20px'],
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* 图标位置
|
|
159
|
+
* @props
|
|
160
|
+
* @name position
|
|
161
|
+
* @summary 图标位置
|
|
162
|
+
* @type {[string|number, string|number]}
|
|
163
|
+
*/
|
|
164
|
+
position: {
|
|
165
|
+
type: Array<string | number>, // 图标位置
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* 旋转中心
|
|
169
|
+
* @props
|
|
170
|
+
* @name center
|
|
171
|
+
* @summary 旋转中心
|
|
172
|
+
* @type {string}
|
|
173
|
+
*/
|
|
174
|
+
center: {
|
|
175
|
+
type: String, // 旋转中心
|
|
176
|
+
},
|
|
177
|
+
/**
|
|
178
|
+
* 指定角度
|
|
179
|
+
* @props
|
|
180
|
+
* @name angle
|
|
181
|
+
* @summary 指定角度
|
|
182
|
+
* @type {number}
|
|
183
|
+
*/
|
|
184
|
+
angle: {
|
|
185
|
+
type: Number, // 指定角度
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* 颜色
|
|
189
|
+
* @props
|
|
190
|
+
* @name color
|
|
191
|
+
* @summary 颜色
|
|
192
|
+
* @type {string}
|
|
193
|
+
*/
|
|
194
|
+
color: {
|
|
195
|
+
type: String, // 颜色
|
|
196
|
+
default: '',
|
|
197
|
+
},
|
|
198
|
+
/**
|
|
199
|
+
* 样式
|
|
200
|
+
* @props
|
|
201
|
+
* @name hovercolor
|
|
202
|
+
* @summary 样式
|
|
203
|
+
* @type {string}
|
|
204
|
+
*/
|
|
205
|
+
className: {
|
|
206
|
+
type: String, // 样式
|
|
207
|
+
default: '',
|
|
208
|
+
},
|
|
209
|
+
/**
|
|
210
|
+
* 水平翻转
|
|
211
|
+
* @props
|
|
212
|
+
* @name flip
|
|
213
|
+
* @summary 水平翻转
|
|
214
|
+
* @type {boolean}
|
|
215
|
+
* @default false
|
|
216
|
+
*/
|
|
217
|
+
flip: {
|
|
218
|
+
type: Boolean, // 水平翻转
|
|
219
|
+
default: false,
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* 自动旋转
|
|
223
|
+
* @props
|
|
224
|
+
* @name spin
|
|
225
|
+
* @summary 自动旋转
|
|
226
|
+
* @type {boolean}
|
|
227
|
+
* @default false
|
|
228
|
+
*/
|
|
229
|
+
spin: {
|
|
230
|
+
type: Boolean, // 自动旋转
|
|
231
|
+
default: false,
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// 定义组件发出的事件
|
|
236
|
+
const emits = defineEmits([
|
|
237
|
+
/**
|
|
238
|
+
* 点击事件
|
|
239
|
+
* @emits
|
|
240
|
+
* @name click
|
|
241
|
+
* @summary 图标按钮点击时触发的事件
|
|
242
|
+
*/
|
|
243
|
+
'click',
|
|
244
|
+
/**
|
|
245
|
+
* 图标索引更新
|
|
246
|
+
* @emits
|
|
247
|
+
* @name update:iconIndex
|
|
248
|
+
* @summary 图标索引发生变化时触发的事件
|
|
249
|
+
* @param {number} index - 新的图标索引
|
|
250
|
+
*/
|
|
251
|
+
'update:iconIndex',
|
|
252
|
+
]);
|
|
253
|
+
|
|
254
|
+
const boxSize = computed(() => {
|
|
255
|
+
if (Array.isArray(props.size)) return props.size;
|
|
256
|
+
else {
|
|
257
|
+
let size = props.size;
|
|
258
|
+
return [size, size];
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
const curIcon = ref(props.icon);
|
|
263
|
+
const curIndex = ref(props.iconIndex);
|
|
264
|
+
|
|
265
|
+
watch(
|
|
266
|
+
() => props.icon,
|
|
267
|
+
(newVal) => {
|
|
268
|
+
curIcon.value = newVal;
|
|
269
|
+
},
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
watch(
|
|
273
|
+
() => props.iconIndex,
|
|
274
|
+
(newVal) => {
|
|
275
|
+
curIndex.value = newVal;
|
|
276
|
+
curIcon.value = props.icons[newVal];
|
|
277
|
+
},
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
const iconIndex = computed<number>({
|
|
281
|
+
get() {
|
|
282
|
+
return curIndex.value;
|
|
283
|
+
},
|
|
284
|
+
set(val) {
|
|
285
|
+
curIndex.value = val;
|
|
286
|
+
emits('update:iconIndex', curIndex.value);
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
if (props.icons.length > 0) {
|
|
291
|
+
iconIndex.value = iconIndex.value >= props.icons.length ? 0 : iconIndex.value;
|
|
292
|
+
curIcon.value = props.icons[curIndex.value];
|
|
293
|
+
} else {
|
|
294
|
+
curIcon.value = props.icon;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const onClicked = (e: MouseEvent) => {
|
|
298
|
+
e.stopPropagation();
|
|
299
|
+
if (props.clickEvent) {
|
|
300
|
+
const eventNames = props.clickEvent.split('#');
|
|
301
|
+
if (eventNames.length === 2) {
|
|
302
|
+
const $Bus = inject('$' + eventNames[0]) as any;
|
|
303
|
+
$Bus.$emit(eventNames[1], props.data);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (props.autoSwitch && props.icons.length > 0) {
|
|
307
|
+
iconIndex.value = (iconIndex.value + 1) % props.icons.length;
|
|
308
|
+
curIcon.value = props.icons[curIndex.value];
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
emits('click');
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
const getIconClass = (): string => {
|
|
315
|
+
let className = '';
|
|
316
|
+
if (props.spin) {
|
|
317
|
+
className += 'rotate';
|
|
318
|
+
}
|
|
319
|
+
if (props.flip) {
|
|
320
|
+
className += ' flip';
|
|
321
|
+
}
|
|
322
|
+
return className;
|
|
323
|
+
};
|
|
324
|
+
</script>
|
|
325
|
+
<template>
|
|
326
|
+
<Tooltip
|
|
327
|
+
:title="props.tiptext"
|
|
328
|
+
:disabled="props.tiptext ? undefined : 'disabled'"
|
|
329
|
+
:color="tipcolor"
|
|
330
|
+
:placement="placement"
|
|
331
|
+
:size="tipsize"
|
|
332
|
+
>
|
|
333
|
+
<div
|
|
334
|
+
class="re-icon-container"
|
|
335
|
+
v-if="curIcon"
|
|
336
|
+
:style="{
|
|
337
|
+
width: boxSize[0].toString(),
|
|
338
|
+
height: boxSize[1].toString(),
|
|
339
|
+
}"
|
|
340
|
+
>
|
|
341
|
+
<!--
|
|
342
|
+
使用动态 class 绑定,通过 icon-class 控制图标样式,curIcon 是计算属性,
|
|
343
|
+
可以根据 iconIndex 控制图标显示,点击图标时执行 onClicked 方法
|
|
344
|
+
-->
|
|
345
|
+
<i
|
|
346
|
+
v-bind="attrs"
|
|
347
|
+
v-if="!curIcon?.startsWith('sym-')"
|
|
348
|
+
class="re-icon iconfont fontclass"
|
|
349
|
+
:class="[props.clickable ? 'clickable' : '', 'icon-' + curIcon, getIconClass(), props.className]"
|
|
350
|
+
:style="{
|
|
351
|
+
top: props.position ? props.position[1] : 1,
|
|
352
|
+
left: props.position ? props.position[0] : 0,
|
|
353
|
+
fontSize: props.fontsize,
|
|
354
|
+
transformOrigin: props.center ?? 'center center',
|
|
355
|
+
transform: getIconTransform(props.angle, props.flip),
|
|
356
|
+
color: props.color,
|
|
357
|
+
}"
|
|
358
|
+
aria-hidden="true"
|
|
359
|
+
@click="onClicked"
|
|
360
|
+
></i>
|
|
361
|
+
<svg
|
|
362
|
+
v-else
|
|
363
|
+
v-bind="attrs"
|
|
364
|
+
class="re-icon symbol"
|
|
365
|
+
aria-hidden="true"
|
|
366
|
+
:class="[props.clickable ? 'clickable' : '', getIconClass(), props.className]"
|
|
367
|
+
:style="{
|
|
368
|
+
top: props.position ? props.position[1] : 0,
|
|
369
|
+
left: props.position ? props.position[0] : 0,
|
|
370
|
+
fontSize: props.fontsize,
|
|
371
|
+
transformOrigin: props.center ?? 'center center',
|
|
372
|
+
transform: getIconTransform(),
|
|
373
|
+
color: props.color,
|
|
374
|
+
}"
|
|
375
|
+
>
|
|
376
|
+
<use :xlink:href="'#icon-' + curIcon.replace('sym-', '')"></use>
|
|
377
|
+
</svg>
|
|
378
|
+
</div>
|
|
379
|
+
</Tooltip>
|
|
380
|
+
</template>
|
|
381
|
+
<style scoped>
|
|
382
|
+
.re-icon-container {
|
|
383
|
+
position: relative;
|
|
384
|
+
display: inline-flex;
|
|
385
|
+
vertical-align: middle;
|
|
386
|
+
justify-content: center;
|
|
387
|
+
align-items: center;
|
|
388
|
+
overflow: hidden;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.re-icon.symbol {
|
|
392
|
+
position: relative;
|
|
393
|
+
margin: 5px 0;
|
|
394
|
+
width: 1em;
|
|
395
|
+
height: 1em;
|
|
396
|
+
vertical-align: -0.15em;
|
|
397
|
+
fill: currentColor;
|
|
398
|
+
overflow: hidden;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.re-icon.fontclass {
|
|
402
|
+
position: relative;
|
|
403
|
+
font-style: normal;
|
|
404
|
+
-webkit-font-smoothing: antialiased;
|
|
405
|
+
-webkit-text-stroke-width: 0.2px;
|
|
406
|
+
-moz-osx-font-smoothing: grayscale;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.re-icon[disabled] {
|
|
410
|
+
pointer-events: none;
|
|
411
|
+
cursor: not-allowed;
|
|
412
|
+
color: #666;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.clickable {
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.rotate {
|
|
420
|
+
animation: rotate 2s linear infinite;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.flip {
|
|
424
|
+
transform: scaleX(-1);
|
|
425
|
+
}
|
|
426
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { SERVER_HOST } from '@skyfox2000/fapi';
|
|
3
|
+
import { createFromIconfont } from '@skyfox2000/webbase';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
icon: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
icons: {
|
|
10
|
+
type: Array<string>,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* 基座图标加载
|
|
15
|
+
* @returns 基座图标集
|
|
16
|
+
*/
|
|
17
|
+
const LayoutIcon = () => {
|
|
18
|
+
return createFromIconfont({
|
|
19
|
+
iconUrl: `${SERVER_HOST.MICROLAYOUT_ICONS}`,
|
|
20
|
+
monoColor: true,
|
|
21
|
+
icon: props.icon,
|
|
22
|
+
icons: props.icons,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 基座图标集
|
|
28
|
+
*/
|
|
29
|
+
const LayoutIcons = LayoutIcon();
|
|
30
|
+
</script>
|
|
31
|
+
<template>
|
|
32
|
+
<LayoutIcons v-if="icon || icons" :icon="icon" :icons="icons" v-bind="$attrs" />
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { SERVER_HOST } from '@skyfox2000/fapi';
|
|
3
|
+
import { createFromIconfont } from '@skyfox2000/webbase';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
icon: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
icons: {
|
|
10
|
+
type: Array<string>,
|
|
11
|
+
},
|
|
12
|
+
iconUrl: {
|
|
13
|
+
type: String,
|
|
14
|
+
},
|
|
15
|
+
monoColor: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 项目图标加载
|
|
23
|
+
* @returns 项目图标集
|
|
24
|
+
*/
|
|
25
|
+
const ProjectIcon = () => {
|
|
26
|
+
return createFromIconfont({
|
|
27
|
+
iconUrl: `${props.iconUrl ?? SERVER_HOST.PROJECT_ICONS ?? SERVER_HOST.TOOL_ICONS}`,
|
|
28
|
+
monoColor: props.monoColor,
|
|
29
|
+
icon: props.icon,
|
|
30
|
+
icons: props.icons,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 加载全部项目图标
|
|
36
|
+
*/
|
|
37
|
+
const ProjectIcons = ProjectIcon();
|
|
38
|
+
</script>
|
|
39
|
+
<template>
|
|
40
|
+
<ProjectIcons v-if="icon || icons" :icon="icon" :icons="icons" v-bind="$attrs" />
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { SERVER_HOST } from '@skyfox2000/fapi';
|
|
3
|
+
import { createFromIconfont } from '@skyfox2000/webbase';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
icon: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
icons: {
|
|
10
|
+
type: Array<string>,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* 表格工具图标加载
|
|
15
|
+
* @returns 表格工具图标加载
|
|
16
|
+
*/
|
|
17
|
+
const ToolIcon = () => {
|
|
18
|
+
return createFromIconfont({
|
|
19
|
+
iconUrl: `${SERVER_HOST.TOOL_ICONS}`,
|
|
20
|
+
monoColor: true,
|
|
21
|
+
icon: props.icon,
|
|
22
|
+
icons: props.icons,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 表格工具图标集
|
|
28
|
+
*/
|
|
29
|
+
const ToolIcons = ToolIcon();
|
|
30
|
+
</script>
|
|
31
|
+
<template>
|
|
32
|
+
<ToolIcons v-if="icon || icons" :icon="icon" :icons="icons" v-bind="$attrs" />
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Button from './button/index.vue';
|
|
2
|
+
export { Button };
|
|
3
|
+
import Tooltip from './tooltip/index.vue';
|
|
4
|
+
export { Tooltip };
|
|
5
|
+
|
|
6
|
+
import AppIcon from './icon/appicon.vue';
|
|
7
|
+
export { AppIcon };
|
|
8
|
+
import Fullscreen from './icon/fullscreen.vue';
|
|
9
|
+
export { Fullscreen };
|
|
10
|
+
import Helper from './icon/helper.vue';
|
|
11
|
+
export { Helper };
|
|
12
|
+
import Icon from './icon/index.vue';
|
|
13
|
+
export { Icon };
|
|
14
|
+
import LayoutIcon from './icon/layoutIcon.vue';
|
|
15
|
+
export { LayoutIcon };
|
|
16
|
+
import ProjectIcon from './icon/projectIcon.vue';
|
|
17
|
+
export { ProjectIcon };
|
|
18
|
+
import ToolIcon from './icon/toolIcon.vue';
|
|
19
|
+
export { ToolIcon };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CSSProperties } from 'vue';
|
|
3
|
+
import { Tooltip } from 'ant-design-vue';
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
size?: string;
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const overlayStyle: CSSProperties = {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const overlayInnerStyle: CSSProperties = {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (props.size === 'small') {
|
|
15
|
+
overlayInnerStyle.fontSize = '12px';
|
|
16
|
+
overlayInnerStyle.padding = '4px 6px';
|
|
17
|
+
overlayInnerStyle.minHeight = '26px';
|
|
18
|
+
overlayStyle.height = '30px';
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
<template>
|
|
22
|
+
<Tooltip :overlayInnerStyle="overlayInnerStyle" :overlayStyle="overlayStyle">
|
|
23
|
+
<slot />
|
|
24
|
+
</Tooltip>
|
|
25
|
+
</template>
|