vue2-client 1.16.85 → 1.16.87

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.
Files changed (23) hide show
  1. package/package.json +1 -1
  2. package/src/assets/img/paymentMethod/icon1.png +0 -0
  3. package/src/assets/img/paymentMethod/icon2.png +0 -0
  4. package/src/assets/img/paymentMethod/icon3.png +0 -0
  5. package/src/assets/img/paymentMethod/icon4.png +0 -0
  6. package/src/assets/img/paymentMethod/icon5.png +0 -0
  7. package/src/assets/img/paymentMethod/icon6.png +0 -0
  8. package/src/base-client/components/common/HIS/HButtons/HButtons.vue +32 -1
  9. package/src/base-client/components/common/HIS/HForm/HForm.vue +14 -0
  10. package/src/base-client/components/common/HIS/HFormTable/HFormTable.vue +5 -0
  11. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +8 -0
  12. package/src/base-client/components/common/XDatePicker/index.vue +16 -4
  13. package/src/base-client/components/common/XForm/XFormItem.vue +6 -0
  14. package/src/base-client/components/common/XFormTable/XFormTable.vue +6 -0
  15. package/src/base-client/components/common/XReport/XReportHospitalizationDemo.vue +45 -0
  16. package/src/base-client/components/common/XTable/XTable.vue +9 -1
  17. package/src/base-client/components/his/XCheckbox/XCheckbox.vue +14 -1
  18. package/src/base-client/components/his/XIcon/XIcon.vue +73 -73
  19. package/src/base-client/components/his/XIcon/index.js +3 -3
  20. package/src/base-client/components/his/XIcon/index.md +177 -177
  21. package/src/base-client/components/his/XImportExcelButton/XImportExcelButton.vue +46 -2
  22. package/src-base-client/components/his/XCharge/README.md +0 -0
  23. package/src-base-client/components/his/XCharge/XCharge.vue +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.16.85",
3
+ "version": "1.16.87",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -21,7 +21,7 @@ const wrapperClassObject = computed(() => {
21
21
 
22
22
  // 通用布尔样式开关(以存在/空字符串/'true' 为真)
23
23
  const booleanStyleKeys = [
24
- 'max-width200', 'width173', 'button_refresh'
24
+ 'max-width200', 'width173', 'button_refresh', 'border', 'no-style', 'fill-container'
25
25
  ]
26
26
  for (const key of booleanStyleKeys) {
27
27
  const val = a[key]
@@ -377,5 +377,36 @@ defineExpose({
377
377
  width: 173px !important;
378
378
  }
379
379
  }
380
+ // 按钮无边框+无图标+无阴影
381
+ &.h-button-no-style{
382
+ :deep(.ant-btn) {
383
+ border: 0px;
384
+ .anticon{
385
+ display: none;
386
+ }
387
+ }
388
+ :deep(.ant-btn-primary){
389
+ text-shadow: none;
390
+ box-shadow: none;
391
+ }
392
+ }
393
+ // 按钮组边距
394
+ &.h-button-border{
395
+ border: 1px solid #E5E9F0;
396
+ border-radius: 6px;
397
+ }
398
+ // 按钮撑开整个容器
399
+ &.h-buttons-fill-container{
400
+ :deep(.x-buttons) {
401
+ width: 100%;
402
+ .ant-btn-group{
403
+ width: 100%;
404
+ .ant-btn{
405
+ width: 100%;
406
+ margin-right: 0px;
407
+ }
408
+ }
409
+ }
410
+ }
380
411
  }
381
412
  </style>
@@ -5,6 +5,18 @@ import { ref, computed, useAttrs } from 'vue'
5
5
  const xAddNativeFormRef = ref()
6
6
 
7
7
  const attrs = useAttrs()
8
+ const props = defineProps({
9
+ // 是否启用 horizontal 模式的自定义配置
10
+ enableHorizontalCustom: {
11
+ type: Boolean,
12
+ default: false
13
+ }
14
+ })
15
+ // 启动时间选择框弹出到body
16
+ const enablePopupToBody = computed(() => {
17
+ const a = attrs
18
+ return a.enablePopupToBody === 'true' || a.enablePopupToBody === true
19
+ })
8
20
  const wrapperClassObject = computed(() => {
9
21
  const a = attrs
10
22
  const classes = {}
@@ -47,6 +59,8 @@ defineExpose({
47
59
  <x-add-native-form
48
60
  ref="xAddNativeFormRef"
49
61
  v-bind="$attrs"
62
+ :enable-popup-to-body="enablePopupToBody"
63
+ :enable-horizontal-custom="props.enableHorizontalCustom"
50
64
  v-on="$listeners"
51
65
  >
52
66
  <template v-for="(_, name) in $slots" #[name]="slotData">
@@ -164,6 +164,10 @@ const isCustomPagination = computed(() => {
164
164
  const paginationAttr = (a && a.paginationStyle) || ''
165
165
  return props.tableStyle === 'custom-pagination' || paginationAttr === 'custom-pagination'
166
166
  })
167
+ // 是否隐藏顶部功能区
168
+ const isHiddenFunctionalArea = computed(() => {
169
+ return attrs.hiddenFunctionalArea === 'true' || attrs.hiddenFunctionalArea === true
170
+ })
167
171
  </script>
168
172
 
169
173
  <template>
@@ -178,6 +182,7 @@ const isCustomPagination = computed(() => {
178
182
  ref="xFormTableRef"
179
183
  v-bind="$attrs"
180
184
  :customPagination="isCustomPagination"
185
+ :hiddenFunctionalArea="isHiddenFunctionalArea"
181
186
  @expand="onExpandLog"
182
187
  v-on="$listeners"
183
188
  >
@@ -51,6 +51,7 @@
51
51
  :rules="rules[`${item.formItem.name}${item.formItem.model}`]"
52
52
  :get-data-params="getDataParams"
53
53
  :env="env"
54
+ :enablePopupToBody="enablePopupToBody"
54
55
  @x-form-item-emit-func="emitFunc"
55
56
  @rowChoose="rowChoose"
56
57
  :setForm="setForm"
@@ -94,6 +95,7 @@
94
95
  :style="layout === 'inline' ? { marginTop:'5px' } : undefined"
95
96
  :form="form"
96
97
  :images="images"
98
+ :enablePopupToBody="enablePopupToBody"
97
99
  :service-name="serviceName"
98
100
  mode="新增/修改"
99
101
  :layout="layout"
@@ -147,6 +149,7 @@
147
149
  :disabled="itemDisabled(formItem)"
148
150
  :readonly="readonly(formItem)"
149
151
  :files="files"
152
+ :enablePopupToBody="enablePopupToBody"
150
153
  v-bind="formItemLayoutGen"
151
154
  :style="layout ==='inline'?{marginTop:'5px'}:undefined"
152
155
  :form="form[groupItem.model]"
@@ -223,6 +226,11 @@ export default {
223
226
  enableHorizontalCustom: {
224
227
  type: Boolean,
225
228
  default: false
229
+ },
230
+ // 是否启用时间弹出到最外层
231
+ enablePopupToBody: {
232
+ type: Boolean,
233
+ default: false
226
234
  }
227
235
  },
228
236
  data () {
@@ -40,6 +40,11 @@ export default {
40
40
  type: Boolean,
41
41
  default: false,
42
42
  },
43
+ // 是否启用时间弹出到最外层
44
+ enablePopupToBody: {
45
+ type: Boolean,
46
+ default: false
47
+ },
43
48
  },
44
49
  model: {
45
50
  prop: 'value',
@@ -183,6 +188,9 @@ export default {
183
188
  moment(value[1]).format(this.formatType),
184
189
  ]
185
190
  },
191
+ getBodyContainer (triggerNode) {
192
+ return document.body
193
+ }
186
194
  },
187
195
  }
188
196
  </script>
@@ -195,7 +203,8 @@ export default {
195
203
  (attr?.queryType !== 'BETWEEN' || mode !== '查询')) ||
196
204
  (['rangePicker'].includes(attr.type) && mode !== '查询')
197
205
  "
198
- :getCalendarContainer="(triggerNode) => triggerNode.parentNode"
206
+ :getCalendarContainer="enablePopupToBody? undefined :(triggerNode) => triggerNode.parentNode"
207
+ :getPopupContainer="enablePopupToBody? getBodyContainer : undefined"
199
208
  v-model="localValue"
200
209
  :disabled="disabled || readOnly"
201
210
  style="width: 100%"
@@ -211,7 +220,8 @@ export default {
211
220
  attr.type === 'monthPicker' ||
212
221
  (attr.type === 'monthRangePicker' && mode !== '查询')
213
222
  "
214
- :getCalendarContainer="(triggerNode) => triggerNode.parentNode"
223
+ :getCalendarContainer="enablePopupToBody? undefined :(triggerNode) => triggerNode.parentNode"
224
+ :getPopupContainer="enablePopupToBody? getBodyContainer : undefined"
215
225
  v-model="localValue"
216
226
  :disabled="disabled || readOnly"
217
227
  :show-time="true"
@@ -225,7 +235,8 @@ export default {
225
235
  attr.type === 'yearPicker' ||
226
236
  (attr.type === 'yearRangePicker' && mode !== '查询')
227
237
  "
228
- :getCalendarContainer="(triggerNode) => triggerNode.parentNode"
238
+ :getCalendarContainer="enablePopupToBody? undefined :(triggerNode) => triggerNode.parentNode"
239
+ :getPopupContainer="enablePopupToBody? getBodyContainer : undefined"
229
240
  v-model="localValue"
230
241
  :disabled="disabled || readOnly"
231
242
  format="YYYY"
@@ -250,7 +261,8 @@ export default {
250
261
  (attr.type === 'rangePicker' && mode === '查询') ||
251
262
  ['yearRangePicker', 'monthRangePicker'].includes(attr.type)
252
263
  "
253
- :getCalendarContainer="(triggerNode) => triggerNode.parentNode"
264
+ :getCalendarContainer="enablePopupToBody? undefined :(triggerNode) => triggerNode.parentNode"
265
+ :getPopupContainer="enablePopupToBody? getBodyContainer : undefined"
254
266
  v-model="localValue"
255
267
  :disabled="disabled"
256
268
  :placeholder="placeholder"
@@ -381,6 +381,7 @@
381
381
  <XFormDatePicker
382
382
  :attr="attr"
383
383
  :mode="mode"
384
+ :enablePopupToBody="enablePopupToBody"
384
385
  :disabled="disabled"
385
386
  :readOnly="readOnly"
386
387
  :showLabel="showLabel"
@@ -815,6 +816,11 @@ export default {
815
816
  return []
816
817
  }
817
818
  },
819
+ // 是否启用时间弹出到最外层
820
+ enablePopupToBody: {
821
+ type: Boolean,
822
+ default: false
823
+ },
818
824
  serviceName: {
819
825
  type: String,
820
826
  default:
@@ -67,6 +67,7 @@
67
67
  :pageMaxSize="realQueryConfig.queryPagesSize"
68
68
  :externalSelectedRowKeys="externalSelectedRowKeys"
69
69
  :customPagination="customPagination"
70
+ :hiddenFunctionalArea="hiddenFunctionalArea"
70
71
  @add="add"
71
72
  @move="move"
72
73
  @edit="edit"
@@ -409,6 +410,11 @@ export default {
409
410
  customPagination: {
410
411
  type: Boolean,
411
412
  default: false
413
+ },
414
+ // 是否隐藏顶部功能区域
415
+ hiddenFunctionalArea: {
416
+ type: Boolean,
417
+ default: false
412
418
  }
413
419
  },
414
420
  watch: {
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div id="xreport-hosp-demo">
3
+ <a-space style="margin-bottom: 12px;">
4
+ <a-button type="primary" @click="doInit">手动初始化</a-button>
5
+ </a-space>
6
+ <XReport
7
+ ref="reportRef"
8
+ :edit-mode="true"
9
+ :show-save-button="true"
10
+ :show-img-in-cell="false"
11
+ :use-oss-for-img="false"
12
+ server-name="af-his"
13
+ @updateImg="onUpdateImg"/>
14
+ </div>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { ref } from 'vue'
19
+ import XReport from '@vue2-client/base-client/components/common/XReport'
20
+
21
+ const reportRef = ref(null)
22
+
23
+ const payload = {
24
+ arr: [
25
+ { BQ: '病房区', RY: 0, CY: 0, CW: 0, SW: 0, SS: 0, ZC: 0, ZR: 0, ZY: 0 },
26
+ { BQ: '感染科', RY: 0, CY: 0, CW: 0, SW: 0, SS: 0, ZC: 0, ZR: 0, ZY: 0 },
27
+ { BQ: '骨科病区', RY: 0, CY: 0, CW: 0, SW: 0, SS: 0, ZC: 0, ZR: 0, ZY: 0 },
28
+ { BQ: '呼吸科病区', RY: 0, CY: 0, CW: 0, SW: 0, SS: 0, ZC: 0, ZR: 0, ZY: 0 },
29
+ { BQ: '急症科病区', RY: 0, CY: 0, CW: 0, SW: 0, SS: 0, ZC: 0, ZR: 0, ZY: 0 },
30
+ { BQ: '内科二病区', RY: 0, CY: 0, CW: 0, SW: 0, SS: 0, ZC: 0, ZR: 0, ZY: 0 }
31
+ ]
32
+ }
33
+
34
+ const doInit = async () => {
35
+ if (!reportRef.value || !reportRef.value.init) return
36
+ await reportRef.value.init({
37
+ configName: 'hospitalizationStatsReport',
38
+ configData: payload
39
+ })
40
+ }
41
+
42
+ const onUpdateImg = data => {
43
+ console.warn('updateImg:', data)
44
+ }
45
+ </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div v-show="tableColumns.length > 0">
3
- <a-row :gutter="48">
3
+ <a-row :class="{'hiddenFunctionalArea':hiddenFunctionalArea}" :gutter="hiddenFunctionalArea ? 0 :48">
4
4
  <a-col v-show="showLeftOperaBtn">
5
5
  <span :style="{ float: 'left', marginBottom: '8px' }">
6
6
  <a-space>
@@ -529,6 +529,11 @@ export default {
529
529
  customPagination: {
530
530
  type: Boolean,
531
531
  default: false
532
+ },
533
+ // 是否隐藏顶部功能区
534
+ hiddenFunctionalArea: {
535
+ type: Boolean,
536
+ default: false
532
537
  }
533
538
  },
534
539
  computed: {
@@ -1607,4 +1612,7 @@ export default {
1607
1612
  margin: 0;
1608
1613
  }
1609
1614
  }
1615
+ .hiddenFunctionalArea{
1616
+ display: none;
1617
+ }
1610
1618
  </style>
@@ -74,7 +74,7 @@ export default {
74
74
  const attrs = this.$attrs || {}
75
75
  const classes = {}
76
76
  const booleanStyleKeys = [
77
- 'compact', 'out-checkbox'
77
+ 'compact', 'out-checkbox', 'justify-content-start'
78
78
  ]
79
79
  booleanStyleKeys.forEach(key => {
80
80
  const val = attrs[key]
@@ -178,4 +178,17 @@ export default {
178
178
  }
179
179
  }
180
180
  }
181
+ // 从左到右右排列
182
+ .x-checkbox-justify-content-start{
183
+ &.x-checkbox-container,
184
+ .x-checkbox-container {
185
+ :deep(.x-checkbox-group){
186
+ display: flex;
187
+ justify-content: start;
188
+ }
189
+ :deep(.x-checkbox-item-container){
190
+ flex-direction: row
191
+ }
192
+ }
193
+ }
181
194
  </style>
@@ -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 内容会被缓存,避免重复加载
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="import-button">
2
+ <div class="import-button" :class="wrapperClassObject">
3
3
  <a-button
4
4
  type="type"
5
5
  ref="importExcelButton"
@@ -37,6 +37,23 @@ export default {
37
37
  components: {
38
38
  XFrontImportExcel
39
39
  },
40
+ computed: {
41
+ // 参考 HForm 的 wrapperClassObject 规则,支持通过组件属性动态控制样式
42
+ wrapperClassObject () {
43
+ const a = this.$attrs || {}
44
+ const classes = {}
45
+ // 多个布尔型样式开关(存在且为真则生效)
46
+ const booleanStyleKeys = [
47
+ 'fill-container'
48
+ ]
49
+ booleanStyleKeys.forEach(key => {
50
+ const val = a[key]
51
+ const truthy = val === true || val === '' || val === 'true'
52
+ if (truthy) classes[`x-import-button-${key}`] = true
53
+ })
54
+ return classes
55
+ }
56
+ },
40
57
  data () {
41
58
  return {
42
59
  // 图标样式
@@ -99,5 +116,32 @@ export default {
99
116
  },
100
117
  }
101
118
  </script>
102
- <style scoped>
119
+ <style scoped lang="less">
120
+ .import-button {
121
+ // 基础样式
122
+ :deep(.ant-btn) {
123
+ border-radius: 6px;
124
+ background-color: #FFFFFF;
125
+ //border: 1px solid #9499A0;
126
+ //color: #313131;
127
+ font-weight: normal;
128
+ letter-spacing: 0em;
129
+ width: 110px;
130
+ font-size: 16px;
131
+ font-family: "Source Han Sans";
132
+ line-height: normal;
133
+ margin-right: 25px;
134
+ height: 32px;
135
+ border: 1px solid #CDCDCD;
136
+ color: #5D5C5C;
137
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
138
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
139
+ }
140
+ }
141
+ .x-import-button-fill-container {
142
+ :deep(.ant-btn) {
143
+ width: 100%;
144
+ margin-right: 0px
145
+ }
146
+ }
103
147
  </style>