vue2-client 1.13.14 → 1.13.16

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.
@@ -62,7 +62,7 @@ export default {
62
62
  // 配置参数名称,用于获取时间轴配置
63
63
  queryParamsName: {
64
64
  type: String,
65
- default: 'XTimelineExampleConfig'
65
+ default: ''
66
66
  }
67
67
  },
68
68
 
@@ -207,7 +207,7 @@ export default {
207
207
 
208
208
  // 前一天
209
209
  goToPrevDay () {
210
- const newDate = moment(this.baseDate).subtract(1, 'day')
210
+ const newDate = moment(this.currentDate).subtract(1, 'day')
211
211
  if (this.config?.minDate && newDate.isBefore(this.config.minDate)) {
212
212
  return
213
213
  }
@@ -224,7 +224,7 @@ export default {
224
224
 
225
225
  // 后一天
226
226
  goToNextDay () {
227
- const newDate = moment(this.baseDate).add(1, 'day')
227
+ const newDate = moment(this.currentDate).add(1, 'day')
228
228
  if (this.config?.maxDate && newDate.isAfter(this.config.maxDate)) {
229
229
  return
230
230
  }
@@ -115,7 +115,7 @@ export default {
115
115
  frameborder: 0
116
116
  },
117
117
  // 数据模式
118
- modeType: 'readonly',
118
+ modeType: 'form',
119
119
  // 是否显示模式切换功能
120
120
  showModeChoose: true,
121
121
  // 数据模式列表
@@ -213,7 +213,7 @@ export default {
213
213
  dropDownBoxParams,
214
214
  serviceName,
215
215
  showModeChoose = true,
216
- modeType = 'readonly'
216
+ modeType = 'form'
217
217
  } = params
218
218
  this.resId = resId
219
219
  if (bindObject) {
@@ -2,15 +2,17 @@
2
2
  <div class="x-time-select">
3
3
  <div class="time-select-container">
4
4
  <span v-if="label" class="time-select-label">{{ label }}</span>
5
- <a-range-picker
6
- :value="dateRange"
7
- :placeholder="['开始日期', '结束日期']"
8
- separator=""
9
- :disabled="disabled"
10
- :allowClear="allowClear"
11
- :format="format"
12
- @change="handleDateChange"
13
- />
5
+ <div class="picker-wrapper">
6
+ <a-range-picker
7
+ :value="dateRange"
8
+ :placeholder="['开始日期', '结束日期']"
9
+ separator=""
10
+ :disabled="disabled"
11
+ :allowClear="allowClear"
12
+ :format="format"
13
+ @change="handleDateChange"
14
+ />
15
+ </div>
14
16
  </div>
15
17
  </div>
16
18
  </template>
@@ -91,13 +93,16 @@ export default {
91
93
  .time-select-container {
92
94
  display: flex;
93
95
  align-items: center;
94
- gap: 4px;
95
96
  }
96
97
 
97
98
  .time-select-label {
98
99
  white-space: nowrap;
99
100
  color: rgba(0, 0, 0, 0.85);
100
- min-width: 30px;
101
+ padding-right: 8px;
102
+ }
103
+
104
+ .picker-wrapper {
105
+ flex: 1;
101
106
  }
102
107
 
103
108
  .x-time-select :deep(.ant-picker-range),
@@ -0,0 +1,100 @@
1
+ <template>
2
+ <div class="tree-node">
3
+ <div class="node-content" @click="handleClick">
4
+ <span v-if="hasChildren" class="toggle-icon">
5
+ {{ node.expanded ? '-' : '+' }}
6
+ </span>
7
+ <span v-else class="empty-space"></span>
8
+ <span class="node-title" :title="node.title">{{ node.title }}</span>
9
+ </div>
10
+ <div v-if="hasChildren && node.expanded" class="node-children">
11
+ <tree-node
12
+ v-for="child in node.children"
13
+ :key="child.id"
14
+ :node="child"
15
+ @toggle="handleToggle"
16
+ :level="level + 1"/>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: 'TreeNode',
24
+ props: {
25
+ node: {
26
+ type: Object,
27
+ required: true
28
+ },
29
+ level: {
30
+ type: Number,
31
+ default: 0
32
+ }
33
+ },
34
+ computed: {
35
+ hasChildren () {
36
+ return this.node.children && this.node.children.length > 0
37
+ }
38
+ },
39
+ methods: {
40
+ handleClick () {
41
+ if (this.hasChildren) {
42
+ this.$emit('toggle', this.node)
43
+ }
44
+ },
45
+ handleToggle (childNode) {
46
+ this.$emit('toggle', childNode)
47
+ }
48
+ }
49
+ }
50
+ </script>
51
+
52
+ <style scoped>
53
+ .tree-node {
54
+ margin: 1px 0;
55
+ white-space: nowrap;
56
+ }
57
+
58
+ .node-content {
59
+ display: flex;
60
+ align-items: center;
61
+ padding: 3px 2px;
62
+ user-select: none;
63
+ border-radius: 2px;
64
+ overflow: hidden;
65
+ }
66
+
67
+ .toggle-icon {
68
+ width: 12px;
69
+ text-align: center;
70
+ font-size: 14px;
71
+ color:#5D5C5C;
72
+ font-weight: 400;
73
+ margin-right: 3px;
74
+ cursor: pointer;
75
+ flex-shrink: 0;
76
+ }
77
+
78
+ .empty-space {
79
+ width: 12px;
80
+ margin-right: 3px;
81
+ flex-shrink: 0;
82
+ }
83
+
84
+ .node-title {
85
+ flex: 1;
86
+ cursor: default;
87
+ white-space: nowrap;
88
+ overflow: hidden;
89
+ text-overflow: ellipsis;
90
+ min-width: 0;
91
+ }
92
+
93
+ .node-content:hover {
94
+ background-color: #f5f5f5;
95
+ }
96
+
97
+ .node-children {
98
+ padding-left: 15px;
99
+ }
100
+ </style>
@@ -0,0 +1,196 @@
1
+ <template>
2
+ <div class="tree-container">
3
+ <div class="tree-header">
4
+ <span class="tree-title">{{ title }}</span>
5
+ <span class="tree-expand-all" @click="isToOpenAll" v-if="isShowOpen">
6
+ {{ isExpanded ? '收起' : '全部展开' }}
7
+ </span>
8
+ </div>
9
+ <div class="tree-list">
10
+ <tree-node
11
+ v-for="node in showData"
12
+ :key="node.id"
13
+ :node="node"
14
+ @toggle="toggleNode"/>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ import TreeNode from './TreeNode.vue'
21
+ import { getConfigByName, runLogic } from '@/services/api/common'
22
+
23
+ export default {
24
+ name: 'XTreeRows',
25
+ components: {
26
+ TreeNode
27
+ },
28
+ props: {
29
+ queryParamsName: {
30
+ type: String,
31
+ default: ''
32
+ },
33
+ isOpenAll: {
34
+ type: Boolean,
35
+ default: false
36
+ },
37
+ parameter: {
38
+ type: Object,
39
+ default: () => {
40
+ return {}
41
+ }
42
+ }
43
+ },
44
+ data () {
45
+ return {
46
+ treeData: [
47
+ {
48
+ id: '1',
49
+ title: '体征',
50
+ expanded: false,
51
+ children: [
52
+ {
53
+ id: '1-1',
54
+ title: '一般情况'
55
+ },
56
+ {
57
+ id: '1-2',
58
+ title: '皮肤粘膜'
59
+ },
60
+ {
61
+ id: '1-3',
62
+ title: '头颈',
63
+ expanded: false,
64
+ children: [
65
+ {
66
+ id: '1-3-1',
67
+ title: '头部头部头部头部头部头部头部头部头部头部头部头部头部头部',
68
+ expanded: false,
69
+ children: [
70
+ {
71
+ id: '1-3-1-1',
72
+ title: '123456'
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ id: '1-2-2',
78
+ title: '颈部'
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ id: '1-4',
84
+ title: '胸部'
85
+ },
86
+ ]
87
+ }
88
+ ],
89
+ isExpanded: false,
90
+ showData: [],
91
+ isShowOpen: true,
92
+ title: '标题'
93
+ }
94
+ },
95
+ methods: {
96
+ toggleNode (node) {
97
+ node.expanded = !node.expanded
98
+ this.$emit('node-toggle', node)
99
+ },
100
+ isToOpenAll () {
101
+ this.isExpanded = !this.isExpanded
102
+ this.expandAllNodes(this.showData, this.isExpanded)
103
+ this.$emit('isOpenAll', this.isExpanded)
104
+ },
105
+ expandAllNodes (nodes, expand) {
106
+ nodes.forEach(node => {
107
+ if (node.children && node.children.length > 0) {
108
+ node.expanded = expand
109
+ this.expandAllNodes(node.children, expand)
110
+ }
111
+ })
112
+ },
113
+ init (config, parameterData) {
114
+ getConfigByName(config, 'af-his', res => {
115
+ this.isShowOpen = res.isShowOpen
116
+ this.title = res.title
117
+ console.log(res)
118
+ if (!res.isCheck) {
119
+ this.showData = res.showData
120
+ return
121
+ }
122
+ const parameter = { ...parameterData, ...this.parameter }
123
+ runLogic(res.logicName, parameter, 'af-his').then(result => {
124
+ this.showData = result
125
+ })
126
+ })
127
+ }
128
+ },
129
+ watch: {
130
+ queryParamsName: {
131
+ immediate: true,
132
+ handler (newValue) {
133
+ console.log(newValue)
134
+ this.init(newValue, {})
135
+ },
136
+ deep: true
137
+ }
138
+ }
139
+ }
140
+ </script>
141
+
142
+ <style scoped>
143
+ .tree-container {
144
+ width: 100%;
145
+ height: 320px;
146
+ overflow-y: auto;
147
+ overflow-x: auto;
148
+ padding: 6px;
149
+ box-sizing: border-box;
150
+ }
151
+ /* 自定义滚动条样式 */
152
+ .tree-container::-webkit-scrollbar {
153
+ width: 4px;
154
+ height: 4px;
155
+ }
156
+ .tree-container::-webkit-scrollbar-thumb {
157
+ background-color: #ccc;
158
+ border-radius: 2px;
159
+ }
160
+ .tree-container::-webkit-scrollbar-track {
161
+ background-color: #f5f5f5;
162
+ }
163
+ .tree-list {
164
+ font-size: 14px;
165
+ min-width: 100%;
166
+ }
167
+
168
+ .tree-header {
169
+ padding: 8px 4px;
170
+ border-bottom: 1px solid #e8e8e8;
171
+ margin-bottom: 8px;
172
+ position: sticky;
173
+ top: 0;
174
+ background-color: #fff;
175
+ z-index: 1;
176
+ }
177
+
178
+ .tree-title {
179
+ font-size: 16px;
180
+ font-weight: 700;
181
+ color:#5D5C5C;
182
+ }
183
+
184
+ .tree-expand-all {
185
+ margin-left: 5px;
186
+ font-size: 14px;
187
+ font-weight: 400;
188
+ color: #5D5C5C;
189
+ cursor: pointer;
190
+ user-select: none;
191
+ }
192
+
193
+ .tree-expand-all:hover {
194
+ color: #989a9a;
195
+ }
196
+ </style>