vue2-client 1.16.80 → 1.16.82
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/package.json +1 -1
- package/src/assets/img/paymentMethod/icon1.png +0 -0
- package/src/assets/img/paymentMethod/icon2.png +0 -0
- package/src/assets/img/paymentMethod/icon3.png +0 -0
- package/src/assets/img/paymentMethod/icon4.png +0 -0
- package/src/assets/img/paymentMethod/icon5.png +0 -0
- package/src/assets/img/paymentMethod/icon6.png +0 -0
- package/src/base-client/components/common/HIS/HFormTable/HFormTable.vue +16 -1
- package/src/base-client/components/common/HIS/HTab/HTab.vue +16 -11
- package/src/base-client/components/common/XCollapse/XCollapse.vue +1 -1
- package/src/base-client/components/common/XInput/XInput.vue +25 -1
- package/src/base-client/components/common/XReport/XReportHospitalizationDemo.vue +45 -0
- package/src/base-client/components/his/XCheckbox/XCheckbox.vue +31 -2
- package/src/base-client/components/his/XHDescriptions/XHDescriptions.vue +115 -28
- package/src/base-client/components/his/XIcon/XIcon.vue +73 -73
- package/src/base-client/components/his/XIcon/index.js +3 -3
- package/src/base-client/components/his/XIcon/index.md +177 -177
- package/src/base-client/components/his/XRadio/XRadio.vue +17 -1
- package/src/base-client/components/his/XSidebar/XSidebar.vue +15 -14
- package/src/base-client/components/his/XTimeSelect/XTimeSelect.vue +72 -3
- package/src/base-client/components/his/XTitle/XTitle.vue +24 -2
- package/src/router/async/router.map.js +1 -2
- package/src-base-client/components/his/XCharge/README.md +0 -0
- package/src-base-client/components/his/XCharge/XCharge.vue +0 -0
- package/.npmignore +0 -21
- package/.serena/.npmignore +0 -1
- package/yarn.lock +0 -11468
|
@@ -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 内容会被缓存,避免重复加载
|
|
@@ -131,7 +131,7 @@ export default {
|
|
|
131
131
|
const attrs = this.$attrs || {}
|
|
132
132
|
const classes = {}
|
|
133
133
|
const booleanStyleKeys = [
|
|
134
|
-
'item-0padding'
|
|
134
|
+
'item-0padding', 'compact'
|
|
135
135
|
]
|
|
136
136
|
booleanStyleKeys.forEach(key => {
|
|
137
137
|
const val = attrs[key]
|
|
@@ -303,4 +303,20 @@ export default {
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
+
.x-radio-compact {
|
|
307
|
+
&.x-radio-container,
|
|
308
|
+
.x-radio-container {
|
|
309
|
+
:deep(.simple-inline-item){
|
|
310
|
+
padding: 0px !important;
|
|
311
|
+
}
|
|
312
|
+
:deep(.ant-radio-group){
|
|
313
|
+
display: flex;
|
|
314
|
+
justify-content: space-between;
|
|
315
|
+
}
|
|
316
|
+
:deep(.x-radio-item) > span:last-child {
|
|
317
|
+
padding-right: 2px;
|
|
318
|
+
padding-left: 2px;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
306
322
|
</style>
|
|
@@ -212,7 +212,7 @@ export default {
|
|
|
212
212
|
return []
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
|
|
215
|
+
// 计算mainCol,currentCol可以设置的总宽度
|
|
216
216
|
computeRemainingWidth (allElements, mainCol, currentCol) {
|
|
217
217
|
if (!allElements || allElements.length === 0) {
|
|
218
218
|
return '0px'
|
|
@@ -223,33 +223,34 @@ export default {
|
|
|
223
223
|
element !== mainCol && element !== currentCol
|
|
224
224
|
)
|
|
225
225
|
|
|
226
|
-
if (filteredElements.length === 0) {
|
|
227
|
-
return '0px'
|
|
228
|
-
}
|
|
229
|
-
|
|
230
226
|
let totalWidth = 0
|
|
231
227
|
|
|
228
|
+
// 计算过滤后元素的总宽度(包括外边距)
|
|
232
229
|
filteredElements.forEach(element => {
|
|
233
230
|
if (element && element.style) {
|
|
234
|
-
// 获取元素的计算样式
|
|
235
231
|
const computedStyle = window.getComputedStyle(element)
|
|
236
|
-
|
|
237
|
-
// 获取宽度(包括padding和border)
|
|
238
232
|
const width = parseFloat(computedStyle.width) || 0
|
|
239
|
-
|
|
240
|
-
// 获取左右margin
|
|
241
233
|
const marginLeft = parseFloat(computedStyle.marginLeft) || 0
|
|
242
234
|
const marginRight = parseFloat(computedStyle.marginRight) || 0
|
|
243
|
-
|
|
244
|
-
// 累加总宽度(宽度 + 左右margin)
|
|
245
235
|
totalWidth += width + marginLeft + marginRight
|
|
246
236
|
}
|
|
247
237
|
})
|
|
248
238
|
|
|
249
|
-
//
|
|
239
|
+
// 添加 mainCol 和 currentCol 的左右外边距
|
|
240
|
+
const addMarginsFromElements = (element) => {
|
|
241
|
+
if (element && element.style) {
|
|
242
|
+
const computedStyle = window.getComputedStyle(element)
|
|
243
|
+
const marginLeft = parseFloat(computedStyle.marginLeft) || 0
|
|
244
|
+
const marginRight = parseFloat(computedStyle.marginRight) || 0
|
|
245
|
+
totalWidth += marginLeft + marginRight
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
addMarginsFromElements(mainCol)
|
|
250
|
+
addMarginsFromElements(currentCol)
|
|
251
|
+
|
|
250
252
|
return totalWidth > 0 ? `${totalWidth}px` : '0px'
|
|
251
253
|
},
|
|
252
|
-
|
|
253
254
|
updateLayout (isOpen) {
|
|
254
255
|
this.$nextTick(() => {
|
|
255
256
|
try {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="x-time-select">
|
|
2
|
+
<div class="x-time-select" :class="wrapperClassObject">
|
|
3
3
|
<div class="time-select-container">
|
|
4
4
|
<div v-if="type === 'range'" class="picker-wrapper">
|
|
5
|
+
<span v-if="showCalendarIcon" class="left-calendar-icon"><a-icon type="calendar" /></span>
|
|
5
6
|
<a-range-picker
|
|
6
7
|
:value="dateRange"
|
|
7
8
|
:placeholder="['开始日期', '结束日期']"
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
/>
|
|
15
16
|
</div>
|
|
16
17
|
<div v-if="type === 'date'" class="picker-wrapper">
|
|
18
|
+
<span v-if="showCalendarIcon" class="left-calendar-icon"><a-icon type="calendar" /></span>
|
|
17
19
|
<a-date-picker
|
|
18
20
|
:value="dateRange[0]"
|
|
19
21
|
:format="format"
|
|
@@ -64,10 +66,27 @@ export default {
|
|
|
64
66
|
data () {
|
|
65
67
|
return {
|
|
66
68
|
dateRange: [],
|
|
67
|
-
type: 'range'
|
|
69
|
+
type: 'range',
|
|
70
|
+
showCalendarIcon: false
|
|
68
71
|
}
|
|
69
72
|
},
|
|
70
73
|
computed: {
|
|
74
|
+
// 与 XHDescriptions 一致的样式配置模式:通过 $attrs 映射布尔/尺寸类
|
|
75
|
+
wrapperClassObject () {
|
|
76
|
+
const attrs = this.$attrs || {}
|
|
77
|
+
const classes = {}
|
|
78
|
+
const booleanStyleKeys = [
|
|
79
|
+
'yizhu-date'
|
|
80
|
+
]
|
|
81
|
+
booleanStyleKeys.forEach(key => {
|
|
82
|
+
const val = attrs[key]
|
|
83
|
+
const truthy = val === true || val === '' || val === 'true'
|
|
84
|
+
if (truthy) classes[`xtime-${key}`] = true
|
|
85
|
+
})
|
|
86
|
+
const size = attrs.size
|
|
87
|
+
if (size && typeof size === 'string') classes[`xtime-size-${size}`] = true
|
|
88
|
+
return classes
|
|
89
|
+
},
|
|
71
90
|
showTime () {
|
|
72
91
|
// 根据format判断是否需要显示时间选择器
|
|
73
92
|
return this.format && (this.format.includes('HH:mm') || this.format.includes('hh:mm'))
|
|
@@ -134,6 +153,8 @@ export default {
|
|
|
134
153
|
if (res.format !== undefined) {
|
|
135
154
|
this.format = res.format
|
|
136
155
|
}
|
|
156
|
+
// 处理图标开关配置(默认关闭)
|
|
157
|
+
this.showCalendarIcon = res && res.showCalendarIcon === true
|
|
137
158
|
// 处理defaultTime配置
|
|
138
159
|
if (res.defaultTime !== undefined) {
|
|
139
160
|
if (res.defaultTime === 'now') {
|
|
@@ -157,7 +178,7 @@ export default {
|
|
|
157
178
|
}
|
|
158
179
|
</script>
|
|
159
180
|
|
|
160
|
-
<style scoped>
|
|
181
|
+
<style scoped lang="less">
|
|
161
182
|
.x-time-select {
|
|
162
183
|
position: relative;
|
|
163
184
|
width: 100%;
|
|
@@ -172,6 +193,7 @@ export default {
|
|
|
172
193
|
|
|
173
194
|
.picker-wrapper {
|
|
174
195
|
flex: 1;
|
|
196
|
+
position: relative;
|
|
175
197
|
}
|
|
176
198
|
|
|
177
199
|
.x-time-select :deep(.ant-picker-range),
|
|
@@ -197,4 +219,51 @@ export default {
|
|
|
197
219
|
.x-time-select :deep(.ant-input) {
|
|
198
220
|
width: 100%;
|
|
199
221
|
}
|
|
222
|
+
|
|
223
|
+
/* 左侧日历图标 */
|
|
224
|
+
.left-calendar-icon {
|
|
225
|
+
position: absolute;
|
|
226
|
+
left: 10px;
|
|
227
|
+
top: 1.8px;
|
|
228
|
+
width: 18.2px;
|
|
229
|
+
height: 91%;
|
|
230
|
+
opacity: 1;
|
|
231
|
+
color: #848484;
|
|
232
|
+
z-index: 2;
|
|
233
|
+
pointer-events: none;
|
|
234
|
+
display: inline-flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* 为日期输入增加左内边距,避免与图标重叠(兼容 ant 不同版本) */
|
|
239
|
+
.x-time-select :deep(.ant-picker-input > input) {
|
|
240
|
+
padding-left: 26px;
|
|
241
|
+
}
|
|
242
|
+
.x-time-select :deep(.ant-calendar-picker-input) {
|
|
243
|
+
padding-left: 26px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* yizhu-date 样式(通过 $attrs 使用:<XTimeSelect yizhu-date />) */
|
|
247
|
+
.x-time-select.xtime-yizhu-date {
|
|
248
|
+
margin: 2px 2px 0 10px;
|
|
249
|
+
width: 224px;
|
|
250
|
+
height: 32px;
|
|
251
|
+
border-radius: 7px;
|
|
252
|
+
opacity: 1;
|
|
253
|
+
background: #FFFFFF;
|
|
254
|
+
box-sizing: border-box;
|
|
255
|
+
border: 1px solid #E5E9F0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* 覆盖内部 antd 选择器在该样式下的尺寸与边框 */
|
|
259
|
+
.x-time-select.xtime-yizhu-date :deep(.ant-picker-range),
|
|
260
|
+
.x-time-select.xtime-yizhu-date :deep(.ant-picker),
|
|
261
|
+
.x-time-select.xtime-yizhu-date :deep(.ant-calendar-picker),
|
|
262
|
+
.x-time-select.xtime-yizhu-date :deep(.ant-calendar-picker-input) {
|
|
263
|
+
width: 224px;
|
|
264
|
+
height: 32px;
|
|
265
|
+
border-radius: 7px;
|
|
266
|
+
background: #FFFFFF;
|
|
267
|
+
border: 1px solid #E5E9F0;
|
|
268
|
+
}
|
|
200
269
|
</style>
|
|
@@ -66,7 +66,11 @@ const attrs = useAttrs()
|
|
|
66
66
|
const wrapperClassObject = computed(() => {
|
|
67
67
|
const classes = {}
|
|
68
68
|
const booleanStyleKeys = [
|
|
69
|
-
|
|
69
|
+
'center',
|
|
70
|
+
'littlefont',
|
|
71
|
+
'dot',
|
|
72
|
+
'nodot',
|
|
73
|
+
'yizhu-title'
|
|
70
74
|
]
|
|
71
75
|
booleanStyleKeys.forEach(key => {
|
|
72
76
|
const val = attrs[key]
|
|
@@ -219,7 +223,25 @@ onMounted(() => {
|
|
|
219
223
|
}
|
|
220
224
|
}
|
|
221
225
|
}
|
|
222
|
-
|
|
226
|
+
.x-title-yizhu-title {
|
|
227
|
+
&.x-title-container,
|
|
228
|
+
.x-title-container {
|
|
229
|
+
margin-top: 3px;
|
|
230
|
+
margin-left: 6px;
|
|
231
|
+
margin-bottom: 7px;
|
|
232
|
+
:deep(.x-title) {
|
|
233
|
+
height: 26px;
|
|
234
|
+
opacity: 1;
|
|
235
|
+
font-family: "Source Han Sans";
|
|
236
|
+
font-size: 18px;
|
|
237
|
+
font-weight: bold;
|
|
238
|
+
line-height: normal;
|
|
239
|
+
letter-spacing: 0em;
|
|
240
|
+
font-feature-settings: "kern" on;
|
|
241
|
+
color: #5D5C5C;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
223
245
|
// nodot 样式特有部分
|
|
224
246
|
.x-title-nodot {
|
|
225
247
|
&.x-title-container,
|
|
@@ -53,9 +53,8 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
|
|
|
53
53
|
routerResource.example = {
|
|
54
54
|
path: 'example',
|
|
55
55
|
name: '示例主页面',
|
|
56
|
-
component: () => import('@vue2-client/base-client/components/common/XForm/demo.vue')
|
|
57
56
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo2.vue'),
|
|
58
|
-
|
|
57
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
59
58
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
60
59
|
// component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
|
|
61
60
|
// component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
|
|
File without changes
|
|
File without changes
|
package/.npmignore
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.DS_Store
|
|
2
|
-
node_modules/
|
|
3
|
-
dist/
|
|
4
|
-
admindb/
|
|
5
|
-
npm-debug.log*
|
|
6
|
-
yarn-debug.log*
|
|
7
|
-
yarn-error.log*
|
|
8
|
-
/test/unit/coverage/
|
|
9
|
-
/test/e2e/reports/
|
|
10
|
-
selenium-debug.log
|
|
11
|
-
|
|
12
|
-
# Editor directories and files
|
|
13
|
-
.idea
|
|
14
|
-
.vscode
|
|
15
|
-
*.suo
|
|
16
|
-
*.ntvs*
|
|
17
|
-
*.njsproj
|
|
18
|
-
*.sln
|
|
19
|
-
package-lock.json
|
|
20
|
-
.env.production.local
|
|
21
|
-
lib/
|
package/.serena/.npmignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/cache
|