vue2-client 1.14.11 → 1.14.13
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/base-client/components/common/XForm/XFormItem.vue +1 -0
- package/src/base-client/components/his/XHisEditor/XHisEditor.vue +1 -0
- package/src/base-client/components/his/XSidebar/XSidebar.vue +3 -3
- package/src/base-client/components/his/XTitle/README.md +113 -0
- package/src/base-client/components/his/XTitle/XTitle.vue +159 -41
- package/src/router/async/router.map.js +2 -2
package/package.json
CHANGED
|
@@ -132,14 +132,14 @@ export default {
|
|
|
132
132
|
currentCol = currentCol.parentNode
|
|
133
133
|
}
|
|
134
134
|
if (currentCol) {
|
|
135
|
-
//
|
|
135
|
+
// 更新当前列的宽度
|
|
136
136
|
const drawerWidth = isOpen ? 33.3 : 2
|
|
137
137
|
// 强制更新样式
|
|
138
138
|
currentCol.style.cssText = `
|
|
139
139
|
flex: 0 0 ${drawerWidth}% !important;
|
|
140
140
|
max-width: ${drawerWidth}% !important;
|
|
141
141
|
transition: all 0.3s;`
|
|
142
|
-
//
|
|
142
|
+
// 触发XTab组件重新计算宽度
|
|
143
143
|
this.$nextTick(() => {
|
|
144
144
|
const tabComponent = this.$el.querySelector('.ant-tabs')
|
|
145
145
|
if (tabComponent) {
|
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
window.dispatchEvent(new Event('resize'))
|
|
148
148
|
}
|
|
149
149
|
})
|
|
150
|
-
//
|
|
150
|
+
// 更新其他列宽度
|
|
151
151
|
otherCols.forEach((col, index) => {
|
|
152
152
|
if (index < this.mainWithData.length) {
|
|
153
153
|
const widthValue = isOpen ? this.mainWithData[index].min : this.mainWithData[index].max
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# XTitle 组件
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
XTitle 是一个多功能的标题组件,可以显示标题文本或按钮,支持自定义下划线样式、颜色和宽度。
|
|
6
|
+
|
|
7
|
+
## 功能特点
|
|
8
|
+
|
|
9
|
+
- 支持显示标题或按钮
|
|
10
|
+
- 支持为标题添加下划线
|
|
11
|
+
- 支持自定义下划线颜色
|
|
12
|
+
- 支持自定义宽度
|
|
13
|
+
- 支持点击事件触发
|
|
14
|
+
|
|
15
|
+
## 使用方法
|
|
16
|
+
|
|
17
|
+
### 基本用法
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<x-title query-params-name="我的标题-title"></x-title>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 配置参数格式
|
|
24
|
+
|
|
25
|
+
XTitle 组件通过一个字符串参数进行配置
|
|
26
|
+
|
|
27
|
+
各部分说明:
|
|
28
|
+
|
|
29
|
+
1. `标题文本`: 显示的文本内容
|
|
30
|
+
2. `类型`: 可选值为 `title` 或 `button`
|
|
31
|
+
3. `点击事件名`: 点击时触发的事件名称
|
|
32
|
+
4. `线条`: 设置为 `line` 时显示下划线
|
|
33
|
+
5. `颜色`: 下划线的颜色(如 `red`、`#FF0000`)
|
|
34
|
+
6. `宽度`: 组件宽度,单位为像素(如 `800`)
|
|
35
|
+
|
|
36
|
+
## 使用示例
|
|
37
|
+
|
|
38
|
+
### 1. 基本标题
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<x-title query-params-name="患者信息-title"></x-title>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. 带下划线的标题
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<x-title query-params-name="患者信息-title--line"></x-title>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. 自定义下划线颜色和宽度
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<x-title query-params-name="患者信息-title--line-red-800"></x-title>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 4. 带点击事件的标题
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<x-title query-params-name="患者信息-title-showPatient-line" @showPatient="handleShowPatient"></x-title>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 5. 按钮模式
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<x-title query-params-name="提交-button-submit" @submit="handleSubmit"></x-title>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 事件
|
|
69
|
+
|
|
70
|
+
当组件类型为 `button` 或在标题配置中设置了点击事件名时,点击组件会触发相应的事件。
|
|
71
|
+
|
|
72
|
+
```vue
|
|
73
|
+
<template>
|
|
74
|
+
<x-title query-params-name="提交-button-submit" @submit="handleSubmit"></x-title>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script>
|
|
78
|
+
export default {
|
|
79
|
+
methods: {
|
|
80
|
+
handleSubmit() {
|
|
81
|
+
// 处理提交逻辑
|
|
82
|
+
console.log('提交按钮被点击');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 样式自定义
|
|
90
|
+
|
|
91
|
+
组件内部样式已预设,但可以通过父级样式或特定类名进行覆盖:
|
|
92
|
+
|
|
93
|
+
```vue
|
|
94
|
+
<template>
|
|
95
|
+
<div class="custom-container">
|
|
96
|
+
<x-title query-params-name="自定义标题-title"></x-title>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<style scoped>
|
|
101
|
+
.custom-container :deep(.x-title) {
|
|
102
|
+
font-size: 20px;
|
|
103
|
+
color: blue;
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 注意事项
|
|
109
|
+
|
|
110
|
+
1. 当未指定类型时,默认为 `title` 类型
|
|
111
|
+
2. 线条颜色需要是合法的 CSS 颜色值
|
|
112
|
+
3. 宽度值必须是数字,单位为像素
|
|
113
|
+
4. 组件默认宽度为 100%,设置自定义宽度时会覆盖此值
|
|
@@ -1,62 +1,180 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
<div class="x-title-container">
|
|
3
|
+
<div
|
|
4
|
+
v-if="config.type === 'title'"
|
|
5
|
+
class="x-title"
|
|
6
|
+
:class="{ 'with-underline': config.line === 'line' }">
|
|
7
|
+
<span>{{ config.label }}</span>
|
|
8
|
+
<div
|
|
9
|
+
v-if="config.line === 'line'"
|
|
10
|
+
class="underline"
|
|
11
|
+
:style="getLineStyle()">
|
|
12
|
+
</div>
|
|
4
13
|
</div>
|
|
14
|
+
<div v-else-if="config.type === 'button'" class="x-button-container">
|
|
15
|
+
<a-button type="primary" @click="handleClick">{{ config.label }}</a-button>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
5
18
|
</template>
|
|
6
19
|
|
|
7
20
|
<script>
|
|
8
21
|
export default {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
name: 'XTitle',
|
|
23
|
+
props: {
|
|
24
|
+
queryParamsName: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data () {
|
|
30
|
+
return {
|
|
31
|
+
config: {
|
|
32
|
+
label: '',
|
|
33
|
+
type: 'title',
|
|
34
|
+
clickName: '',
|
|
35
|
+
line: '',
|
|
36
|
+
color: '',
|
|
37
|
+
lineLength: ''
|
|
19
38
|
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
created () {
|
|
42
|
+
this.getData(this.queryParamsName)
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
getData (data) {
|
|
46
|
+
if (!data) return
|
|
47
|
+
|
|
48
|
+
// 检查是否包含分隔符
|
|
49
|
+
if (data.includes('-')) {
|
|
50
|
+
const parts = data.split('-')
|
|
51
|
+
|
|
52
|
+
// 根据部分数量设置配置
|
|
53
|
+
if (parts.length >= 6) {
|
|
54
|
+
// 包含颜色和线长度
|
|
55
|
+
this.config = {
|
|
56
|
+
label: parts[0],
|
|
57
|
+
type: parts[1],
|
|
58
|
+
clickName: parts[2],
|
|
59
|
+
line: parts[3],
|
|
60
|
+
color: parts[4],
|
|
61
|
+
lineLength: parts[5]
|
|
62
|
+
}
|
|
63
|
+
} else if (parts.length === 5) {
|
|
64
|
+
// 只包含颜色
|
|
65
|
+
this.config = {
|
|
66
|
+
label: parts[0],
|
|
67
|
+
type: parts[1],
|
|
68
|
+
clickName: parts[2],
|
|
69
|
+
line: parts[3],
|
|
70
|
+
color: parts[4],
|
|
71
|
+
lineLength: ''
|
|
72
|
+
}
|
|
73
|
+
} else if (parts.length === 4) {
|
|
74
|
+
this.config = {
|
|
75
|
+
label: parts[0],
|
|
76
|
+
type: parts[1],
|
|
77
|
+
clickName: parts[2],
|
|
78
|
+
line: parts[3],
|
|
79
|
+
color: '',
|
|
80
|
+
lineLength: ''
|
|
81
|
+
}
|
|
82
|
+
} else if (parts.length === 3) {
|
|
83
|
+
this.config = {
|
|
84
|
+
label: parts[0],
|
|
85
|
+
type: parts[1],
|
|
86
|
+
clickName: parts[2],
|
|
87
|
+
line: '',
|
|
88
|
+
color: '',
|
|
89
|
+
lineLength: ''
|
|
90
|
+
}
|
|
91
|
+
} else if (parts.length === 2) {
|
|
92
|
+
this.config = {
|
|
93
|
+
label: parts[0],
|
|
94
|
+
type: parts[1],
|
|
95
|
+
clickName: '',
|
|
96
|
+
line: '',
|
|
97
|
+
color: '',
|
|
98
|
+
lineLength: ''
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
this.config = {
|
|
102
|
+
label: data,
|
|
103
|
+
type: 'title',
|
|
104
|
+
clickName: '',
|
|
105
|
+
line: '',
|
|
106
|
+
color: '',
|
|
107
|
+
lineLength: ''
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
// 没有分隔符,按原来的方式处理
|
|
112
|
+
this.config = {
|
|
113
|
+
label: data,
|
|
114
|
+
type: 'title',
|
|
115
|
+
clickName: '',
|
|
116
|
+
line: '',
|
|
117
|
+
color: '',
|
|
118
|
+
lineLength: ''
|
|
30
119
|
}
|
|
120
|
+
}
|
|
31
121
|
},
|
|
32
|
-
|
|
33
|
-
|
|
122
|
+
handleClick () {
|
|
123
|
+
if (this.config.clickName) {
|
|
124
|
+
this.$emit(this.config.clickName)
|
|
125
|
+
}
|
|
34
126
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
127
|
+
getLineStyle () {
|
|
128
|
+
const style = {}
|
|
129
|
+
|
|
130
|
+
// 设置线条颜色
|
|
131
|
+
if (this.config.color) {
|
|
132
|
+
style.backgroundColor = this.config.color
|
|
133
|
+
} else {
|
|
134
|
+
style.backgroundColor = '#5D5C5C'
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 设置线条宽度
|
|
138
|
+
if (this.config.lineLength) {
|
|
139
|
+
style.width = this.config.lineLength + 'px'
|
|
140
|
+
} else {
|
|
141
|
+
style.width = '800'
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return style
|
|
39
145
|
}
|
|
40
146
|
}
|
|
147
|
+
}
|
|
41
148
|
</script>
|
|
149
|
+
|
|
42
150
|
<style scoped>
|
|
151
|
+
.x-title-container {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: space-between;
|
|
155
|
+
}
|
|
156
|
+
|
|
43
157
|
.x-title {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
158
|
+
font-size: 18px;
|
|
159
|
+
font-weight: bold;
|
|
160
|
+
height: 26px;
|
|
161
|
+
width: 100%;
|
|
162
|
+
text-align: left;
|
|
163
|
+
font-family: "Source Han Sans", sans-serif;
|
|
164
|
+
color: #5D5C5C;
|
|
165
|
+
position: relative;
|
|
51
166
|
}
|
|
52
167
|
|
|
53
|
-
.
|
|
54
|
-
|
|
168
|
+
.underline {
|
|
169
|
+
position: absolute;
|
|
170
|
+
bottom: 0;
|
|
171
|
+
left: 0;
|
|
172
|
+
height: 1px;
|
|
173
|
+
width: 100%;
|
|
174
|
+
background-color: #5D5C5C;
|
|
55
175
|
}
|
|
56
176
|
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
background-color: #5D5C5C;
|
|
60
|
-
margin: 13px 0;
|
|
177
|
+
.x-button-container {
|
|
178
|
+
text-align: right;
|
|
61
179
|
}
|
|
62
180
|
</style>
|
|
@@ -59,7 +59,7 @@ routerResource.example = {
|
|
|
59
59
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
60
60
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
61
61
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
62
|
-
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
62
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
63
63
|
// component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
|
|
64
64
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
65
65
|
// component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),
|
|
@@ -74,7 +74,7 @@ routerResource.example = {
|
|
|
74
74
|
// component: () => import('@vue2-client/components/g2Charts/demo.vue'),
|
|
75
75
|
// component: () => import('@vue2-client/pages/LogicCallExample/index.vue'),
|
|
76
76
|
// component: () => import('@vue2-client/components/FilePreview/FilePreviewDemo.vue'),
|
|
77
|
-
|
|
77
|
+
component: () => import('@vue2-client/pages/ReportGrid/index.vue'),
|
|
78
78
|
}
|
|
79
79
|
// routerResource.example = () =>
|
|
80
80
|
// import('@vue2-client/pages/Example')
|