vue2-client 1.18.28 → 1.18.29

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.
@@ -1,73 +1,73 @@
1
- <template>
2
- <svg
3
- class="x-icon anticon"
4
- xmlns="http://www.w3.org/2000/svg"
5
- width="1em"
6
- height="1em"
7
- :viewBox="viewBox"
8
- :style="iconStyle"
9
- >
10
- <path
11
- v-for="(path, index) in iconPaths"
12
- :key="index"
13
- :fill="path.fill || 'currentColor'"
14
- :d="path.d"
15
- />
16
- </svg>
17
- </template>
18
-
19
- <script setup>
20
- import { computed } from 'vue'
21
-
22
- const props = defineProps({
23
- // 图标名称
24
- name: {
25
- type: String,
26
- required: true
27
- }
28
- })
29
-
30
- // 简化的图标配置(先确保基本功能正常)
31
- const iconConfigs = {
32
- icon001: {
33
- viewBox: '0 0 13.066129684448242 14',
34
- paths: [{
35
- d: 'M0.72589612,0C0.32499826,0,0,0.34822667,0,0.77777773L0,13.222221C0,13.651789,0.32499826,14,0.72589612,14L12.340235,14C12.741146,14,13.066131,13.651789,13.066131,13.222221L13.066131,0.77777773C13.066131,0.34822667,12.741146,0,12.340235,0L0.72589612,0ZM2.9035845,4.6666665L2.9035845,3.1111109L10.162547,3.1111109L10.162547,4.6666665L2.9035845,4.6666665ZM2.9035845,7.7777777L2.9035845,6.2222219L10.162547,6.2222219L10.162547,7.7777777L2.9035845,7.7777777ZM10.162547,10.888889L2.9035845,10.888889L2.9035845,9.333333L10.162547,9.333333L10.162547,10.888889Z',
36
- fill: 'currentColor'
37
- }]
38
- }
39
- }
40
-
41
- // 计算图标配置
42
- const iconConfig = computed(() => {
43
- return iconConfigs[props.name] || {
44
- viewBox: '0 0 24 24',
45
- paths: []
46
- }
47
- })
48
-
49
- // 计算 viewBox
50
- const viewBox = computed(() => {
51
- return iconConfig.value.viewBox
52
- })
53
-
54
- // 计算图标路径
55
- const iconPaths = computed(() => {
56
- return iconConfig.value.paths
57
- })
58
-
59
- // 计算样式
60
- const iconStyle = computed(() => ({
61
- ...props.style
62
- }))
63
- </script>
64
-
65
- <style scoped>
66
- .x-icon {
67
- display: inline-flex;
68
- align-items: center;
69
- justify-content: center;
70
- vertical-align: middle;
71
- line-height: 1;
72
- }
73
- </style>
1
+ <template>
2
+ <svg
3
+ class="x-icon anticon"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="1em"
6
+ height="1em"
7
+ :viewBox="viewBox"
8
+ :style="iconStyle"
9
+ >
10
+ <path
11
+ v-for="(path, index) in iconPaths"
12
+ :key="index"
13
+ :fill="path.fill || 'currentColor'"
14
+ :d="path.d"
15
+ />
16
+ </svg>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { computed } from 'vue'
21
+
22
+ const props = defineProps({
23
+ // 图标名称
24
+ name: {
25
+ type: String,
26
+ required: true
27
+ }
28
+ })
29
+
30
+ // 简化的图标配置(先确保基本功能正常)
31
+ const iconConfigs = {
32
+ icon001: {
33
+ viewBox: '0 0 13.066129684448242 14',
34
+ paths: [{
35
+ d: 'M0.72589612,0C0.32499826,0,0,0.34822667,0,0.77777773L0,13.222221C0,13.651789,0.32499826,14,0.72589612,14L12.340235,14C12.741146,14,13.066131,13.651789,13.066131,13.222221L13.066131,0.77777773C13.066131,0.34822667,12.741146,0,12.340235,0L0.72589612,0ZM2.9035845,4.6666665L2.9035845,3.1111109L10.162547,3.1111109L10.162547,4.6666665L2.9035845,4.6666665ZM2.9035845,7.7777777L2.9035845,6.2222219L10.162547,6.2222219L10.162547,7.7777777L2.9035845,7.7777777ZM10.162547,10.888889L2.9035845,10.888889L2.9035845,9.333333L10.162547,9.333333L10.162547,10.888889Z',
36
+ fill: 'currentColor'
37
+ }]
38
+ }
39
+ }
40
+
41
+ // 计算图标配置
42
+ const iconConfig = computed(() => {
43
+ return iconConfigs[props.name] || {
44
+ viewBox: '0 0 24 24',
45
+ paths: []
46
+ }
47
+ })
48
+
49
+ // 计算 viewBox
50
+ const viewBox = computed(() => {
51
+ return iconConfig.value.viewBox
52
+ })
53
+
54
+ // 计算图标路径
55
+ const iconPaths = computed(() => {
56
+ return iconConfig.value.paths
57
+ })
58
+
59
+ // 计算样式
60
+ const iconStyle = computed(() => ({
61
+ ...props.style
62
+ }))
63
+ </script>
64
+
65
+ <style scoped>
66
+ .x-icon {
67
+ display: inline-flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ vertical-align: middle;
71
+ line-height: 1;
72
+ }
73
+ </style>
@@ -1,3 +1,3 @@
1
- import XIcon from './XIcon.vue'
2
-
3
- export default XIcon
1
+ import XIcon from './XIcon.vue'
2
+
3
+ export default XIcon
@@ -1,177 +1,177 @@
1
- # XIcon 自定义图标组件
2
-
3
- ## 概述
4
-
5
- XIcon 是一个统一管理自定义图标的组件,提供了丰富的内置图标,支持自定义样式,并且可以与 XTitle 组件无缝集成。
6
-
7
- ## 特性
8
-
9
- - 🎨 丰富的内置图标库
10
- - 🎯 支持自定义样式
11
- - 🔧 易于扩展新图标
12
- - 📱 响应式设计
13
- - 🎪 与 XTitle 组件完美集成
14
-
15
- # XIcon 自定义图标组件
16
-
17
- ## 概述
18
-
19
- XIcon 是一个专门管理自定义图标的组件,**动态加载** `src/assets/svg/his/` 目录下的 SVG 文件,支持自定义样式,并且可以与 XTitle 组件无缝集成。
20
-
21
- ## 特性
22
-
23
- - 🎨 **动态加载 SVG 文件**,无需硬编码图标内容
24
- - 🎯 支持自定义样式
25
- - 🔧 **自动发现新图标**,添加 SVG 文件即可使用
26
- - 📱 响应式设计
27
- - 🎪 与 XTitle 组件完美集成
28
- - ⚡ 纯 SVG 渲染,性能优异
29
- - 💾 SVG 内容缓存,避免重复加载
30
-
31
- ## 内置图标
32
-
33
- 组件会自动加载 `src/assets/svg/his/` 目录下的所有 SVG 文件,使用文件名(去掉 `.svg` 扩展名)作为图标名称。
34
-
35
- ### 当前可用的图标
36
- - `icon001` - HIS 系统图标(来自 `icon001.svg`)
37
-
38
- ### 添加新图标
39
- 只需在 `src/assets/svg/his/` 目录下添加新的 SVG 文件,组件会自动发现并可以使用:
40
-
41
- ```bash
42
- # 添加新图标文件
43
- src/assets/svg/his/
44
- ├── icon001.svg # 已存在
45
- ├── icon002.svg # 新添加的图标
46
- ├── user.svg # 新添加的图标
47
- └── setting.svg # 新添加的图标
48
- ```
49
-
50
- 使用方式:
51
- ```vue
52
- <XIcon name="icon002" />
53
- <XIcon name="user" />
54
- <XIcon name="setting" />
55
- ```
56
-
57
- ## 基础用法
58
-
59
- ```vue
60
- <template>
61
- <!-- 使用动态加载的图标 -->
62
- <XIcon name="icon001" />
63
-
64
- <!-- 自定义样式 -->
65
- <XIcon
66
- name="icon001"
67
- :style="{ color: '#52c41a', fontSize: '20px' }"
68
- />
69
-
70
- <!-- 自定义类名 -->
71
- <XIcon
72
- name="icon001"
73
- className="custom-icon"
74
- />
75
- </template>
76
-
77
- <script setup>
78
- import XIcon from '@/base-client/components/his/XIcon/XIcon.vue'
79
- </script>
80
- ```
81
-
82
- ## 在 XTitle 中使用
83
-
84
- ```vue
85
- <template>
86
- <!-- 使用 Ant Design 内置图标 -->
87
- <XTitle icon="user" title="用户管理" />
88
- <XTitle icon="setting" title="系统设置" />
89
-
90
- <!-- 使用动态加载的自定义图标 -->
91
- <XTitle customIcon="icon001" title="HIS 系统" />
92
-
93
- <!-- 配置图标颜色 -->
94
- <XTitle customIcon="icon001" title="HIS 系统" iconColor="red" />
95
-
96
- <!-- 配置图标大小 -->
97
- <XTitle customIcon="icon001" title="HIS 系统" iconSize="24px" />
98
-
99
- <!-- 组合使用 -->
100
- <XTitle customIcon="icon001" title="HIS 系统" iconColor="blue" iconSize="20px" dot />
101
-
102
- <!-- 使用自定义 SVG 组件 -->
103
- <XTitle :iconComponent="CustomIcon" title="自定义图标" />
104
- </template>
105
-
106
- <script setup>
107
- import XTitle from '@/base-client/components/his/XTitle/XTitle.vue'
108
- import CustomIcon from './CustomIcon.vue'
109
- </script>
110
- ```
111
-
112
- ## XTitle 属性说明
113
-
114
- ### 默认样式
115
- XTitle 组件默认包含以下样式:
116
- - 只有右侧有 8px 间距
117
- - 图标垂直居中对齐
118
- - 图标默认样式(16px 字体大小)
119
-
120
- ### 图标样式属性
121
- | 属性 | 类型 | 默认值 | 说明 |
122
- |------|------|--------|------|
123
- | `iconColor` | String | - | 图标颜色,支持 CSS 颜色值 |
124
- | `iconSize` | String | - | 图标大小,支持 CSS 尺寸值 |
125
- | `iconStyle` | Object | - | 自定义样式对象,会合并到图标样式中 |
126
-
127
- ### 其他样式属性
128
- - `dot` - 显示圆点
129
- - `nodot` - 隐藏圆点
130
- - `center` - 居中对齐
131
- - `littlefont` - 小字体
132
-
133
- ## Props
134
-
135
- | 参数 | 说明 | 类型 | 默认值 |
136
- |------|------|------|--------|
137
- | name | 图标名称 | String | - |
138
- | style | 自定义样式 | Object | {} |
139
- | className | 自定义类名 | String | '' |
140
-
141
- ## 扩展新图标
142
-
143
- 现在添加新图标非常简单,**无需修改代码**:
144
-
145
- 1. **添加 SVG 文件**:在 `src/assets/svg/his/` 目录下添加新的 SVG 文件
146
- 2. **使用图标**:直接使用文件名(去掉 `.svg` 扩展名)作为图标名称
147
-
148
- ```bash
149
- # 示例:添加新图标
150
- src/assets/svg/his/
151
- ├── icon001.svg # 已存在
152
- ├── icon002.svg # 新添加
153
- ├── user.svg # 新添加
154
- └── setting.svg # 新添加
155
- ```
156
-
157
- ```vue
158
- <!-- 直接使用,无需任何配置 -->
159
- <XIcon name="icon002" />
160
- <XIcon name="user" />
161
- <XIcon name="setting" />
162
- ```
163
-
164
- ### SVG 文件要求
165
- - 文件格式:`.svg`
166
- - 文件位置:`src/assets/svg/his/` 目录
167
- - 文件内容:标准的 SVG 格式,包含 `<path>` 元素
168
- - 命名:使用有意义的文件名,去掉 `.svg` 扩展名后就是图标名称
169
-
170
- ## 注意事项
171
-
172
- 1. **动态加载**:图标会在首次使用时动态加载,后续使用会从缓存中读取
173
- 2. **SVG 格式**:确保在不同分辨率下都能清晰显示
174
- 3. **颜色继承**:所有图标都使用 `currentColor` 作为填充色,会自动继承父元素的文字颜色
175
- 4. **文件命名**:使用有意义的文件名,避免特殊字符和空格
176
- 5. **SVG 结构**:确保 SVG 文件包含有效的 `<path>` 元素
177
- 6. **缓存机制**:SVG 内容会被缓存,避免重复加载
1
+ # XIcon 自定义图标组件
2
+
3
+ ## 概述
4
+
5
+ XIcon 是一个统一管理自定义图标的组件,提供了丰富的内置图标,支持自定义样式,并且可以与 XTitle 组件无缝集成。
6
+
7
+ ## 特性
8
+
9
+ - 🎨 丰富的内置图标库
10
+ - 🎯 支持自定义样式
11
+ - 🔧 易于扩展新图标
12
+ - 📱 响应式设计
13
+ - 🎪 与 XTitle 组件完美集成
14
+
15
+ # XIcon 自定义图标组件
16
+
17
+ ## 概述
18
+
19
+ XIcon 是一个专门管理自定义图标的组件,**动态加载** `src/assets/svg/his/` 目录下的 SVG 文件,支持自定义样式,并且可以与 XTitle 组件无缝集成。
20
+
21
+ ## 特性
22
+
23
+ - 🎨 **动态加载 SVG 文件**,无需硬编码图标内容
24
+ - 🎯 支持自定义样式
25
+ - 🔧 **自动发现新图标**,添加 SVG 文件即可使用
26
+ - 📱 响应式设计
27
+ - 🎪 与 XTitle 组件完美集成
28
+ - ⚡ 纯 SVG 渲染,性能优异
29
+ - 💾 SVG 内容缓存,避免重复加载
30
+
31
+ ## 内置图标
32
+
33
+ 组件会自动加载 `src/assets/svg/his/` 目录下的所有 SVG 文件,使用文件名(去掉 `.svg` 扩展名)作为图标名称。
34
+
35
+ ### 当前可用的图标
36
+ - `icon001` - HIS 系统图标(来自 `icon001.svg`)
37
+
38
+ ### 添加新图标
39
+ 只需在 `src/assets/svg/his/` 目录下添加新的 SVG 文件,组件会自动发现并可以使用:
40
+
41
+ ```bash
42
+ # 添加新图标文件
43
+ src/assets/svg/his/
44
+ ├── icon001.svg # 已存在
45
+ ├── icon002.svg # 新添加的图标
46
+ ├── user.svg # 新添加的图标
47
+ └── setting.svg # 新添加的图标
48
+ ```
49
+
50
+ 使用方式:
51
+ ```vue
52
+ <XIcon name="icon002" />
53
+ <XIcon name="user" />
54
+ <XIcon name="setting" />
55
+ ```
56
+
57
+ ## 基础用法
58
+
59
+ ```vue
60
+ <template>
61
+ <!-- 使用动态加载的图标 -->
62
+ <XIcon name="icon001" />
63
+
64
+ <!-- 自定义样式 -->
65
+ <XIcon
66
+ name="icon001"
67
+ :style="{ color: '#52c41a', fontSize: '20px' }"
68
+ />
69
+
70
+ <!-- 自定义类名 -->
71
+ <XIcon
72
+ name="icon001"
73
+ className="custom-icon"
74
+ />
75
+ </template>
76
+
77
+ <script setup>
78
+ import XIcon from '@/base-client/components/his/XIcon/XIcon.vue'
79
+ </script>
80
+ ```
81
+
82
+ ## 在 XTitle 中使用
83
+
84
+ ```vue
85
+ <template>
86
+ <!-- 使用 Ant Design 内置图标 -->
87
+ <XTitle icon="user" title="用户管理" />
88
+ <XTitle icon="setting" title="系统设置" />
89
+
90
+ <!-- 使用动态加载的自定义图标 -->
91
+ <XTitle customIcon="icon001" title="HIS 系统" />
92
+
93
+ <!-- 配置图标颜色 -->
94
+ <XTitle customIcon="icon001" title="HIS 系统" iconColor="red" />
95
+
96
+ <!-- 配置图标大小 -->
97
+ <XTitle customIcon="icon001" title="HIS 系统" iconSize="24px" />
98
+
99
+ <!-- 组合使用 -->
100
+ <XTitle customIcon="icon001" title="HIS 系统" iconColor="blue" iconSize="20px" dot />
101
+
102
+ <!-- 使用自定义 SVG 组件 -->
103
+ <XTitle :iconComponent="CustomIcon" title="自定义图标" />
104
+ </template>
105
+
106
+ <script setup>
107
+ import XTitle from '@/base-client/components/his/XTitle/XTitle.vue'
108
+ import CustomIcon from './CustomIcon.vue'
109
+ </script>
110
+ ```
111
+
112
+ ## XTitle 属性说明
113
+
114
+ ### 默认样式
115
+ XTitle 组件默认包含以下样式:
116
+ - 只有右侧有 8px 间距
117
+ - 图标垂直居中对齐
118
+ - 图标默认样式(16px 字体大小)
119
+
120
+ ### 图标样式属性
121
+ | 属性 | 类型 | 默认值 | 说明 |
122
+ |------|------|--------|------|
123
+ | `iconColor` | String | - | 图标颜色,支持 CSS 颜色值 |
124
+ | `iconSize` | String | - | 图标大小,支持 CSS 尺寸值 |
125
+ | `iconStyle` | Object | - | 自定义样式对象,会合并到图标样式中 |
126
+
127
+ ### 其他样式属性
128
+ - `dot` - 显示圆点
129
+ - `nodot` - 隐藏圆点
130
+ - `center` - 居中对齐
131
+ - `littlefont` - 小字体
132
+
133
+ ## Props
134
+
135
+ | 参数 | 说明 | 类型 | 默认值 |
136
+ |------|------|------|--------|
137
+ | name | 图标名称 | String | - |
138
+ | style | 自定义样式 | Object | {} |
139
+ | className | 自定义类名 | String | '' |
140
+
141
+ ## 扩展新图标
142
+
143
+ 现在添加新图标非常简单,**无需修改代码**:
144
+
145
+ 1. **添加 SVG 文件**:在 `src/assets/svg/his/` 目录下添加新的 SVG 文件
146
+ 2. **使用图标**:直接使用文件名(去掉 `.svg` 扩展名)作为图标名称
147
+
148
+ ```bash
149
+ # 示例:添加新图标
150
+ src/assets/svg/his/
151
+ ├── icon001.svg # 已存在
152
+ ├── icon002.svg # 新添加
153
+ ├── user.svg # 新添加
154
+ └── setting.svg # 新添加
155
+ ```
156
+
157
+ ```vue
158
+ <!-- 直接使用,无需任何配置 -->
159
+ <XIcon name="icon002" />
160
+ <XIcon name="user" />
161
+ <XIcon name="setting" />
162
+ ```
163
+
164
+ ### SVG 文件要求
165
+ - 文件格式:`.svg`
166
+ - 文件位置:`src/assets/svg/his/` 目录
167
+ - 文件内容:标准的 SVG 格式,包含 `<path>` 元素
168
+ - 命名:使用有意义的文件名,去掉 `.svg` 扩展名后就是图标名称
169
+
170
+ ## 注意事项
171
+
172
+ 1. **动态加载**:图标会在首次使用时动态加载,后续使用会从缓存中读取
173
+ 2. **SVG 格式**:确保在不同分辨率下都能清晰显示
174
+ 3. **颜色继承**:所有图标都使用 `currentColor` 作为填充色,会自动继承父元素的文字颜色
175
+ 4. **文件命名**:使用有意义的文件名,避免特殊字符和空格
176
+ 5. **SVG 结构**:确保 SVG 文件包含有效的 `<path>` 元素
177
+ 6. **缓存机制**:SVG 内容会被缓存,避免重复加载