vue2-client 1.15.44 → 1.15.46

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.15.44",
3
+ "version": "1.15.46",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -2,14 +2,23 @@
2
2
  <div>
3
3
  <a-collapse
4
4
  :activeKey="activeKey"
5
- @change="handleChange">
5
+ @change="handleChange"
6
+ :bordered="config.bordered || true"
7
+ :expand-icon-position="config.expandIconPosition || 'right'"
8
+ :style="config.style || ''"
9
+ >
6
10
  <a-collapse-panel
7
11
  v-for="(panel, panelIndex) in config.showData"
8
12
  :key="panelIndex.toString()"
9
- :show-arrow="false"
13
+ :show-arrow="config.showArrow || false"
10
14
  :disabled="config.collapsible">
11
15
  <template #header>
12
16
  <div class="header-content">
17
+ <!-- 新增蓝色圆点图标,根据配置显示 -->
18
+ <div
19
+ v-if="config.showCircleIcon"
20
+ class="blue-circle-icon"
21
+ :style="config.circleIconStyle || {}"></div>
13
22
  <span
14
23
  class="header-text"
15
24
  :style="config.titleStyle">
@@ -44,19 +53,30 @@
44
53
  @click.stop/>
45
54
  </div>
46
55
  </template>
56
+
57
+ <!-- 新增设置图标,根据配置显示 -->
58
+ <template #extra v-if="config.showSettingIcon">
59
+ <a-icon
60
+ v-if="activeKey.includes(panelIndex.toString())"
61
+ :type="config.settingIconType || 'setting'"
62
+ class="setting-icon"
63
+ @click.stop="handleSettingClick(panel, panelIndex)"/>
64
+ </template>
65
+
47
66
  <!-- 根据类型显示不同内容 -->
48
67
  <template v-if="panel.type === 'picture'">
49
68
  <img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
50
69
  </template>
51
- <template v-else-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio', 'x-text-card'].includes(panel.type)">
70
+ <template v-else-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio', 'x-text-card','x-tree-rows'].includes(panel.type)">
52
71
  <component
53
72
  :is="getComponentName(panel.type)"
54
73
  :ref="`dynamicComponent_${ panel.type }_${ panelIndex }`"
55
- serverName="af-his"
74
+ :serverName="panel.serverName || 'af-his'"
56
75
  :queryParamsName="panel.configName"
57
76
  :parameter="panel.parameter"
58
77
  :countVisible="false"
59
78
  :env="env"
79
+ :style="config.componentStyle || ''"
60
80
  @deleteData="deleteData"
61
81
  @add="add"
62
82
  @listClick="listClick"
@@ -92,7 +112,8 @@ export default {
92
112
  XInput: () => import('@vue2-client/base-client/components/common/XInput/XInput.vue'),
93
113
  XTimeLine: () => import('@vue2-client/base-client/components/common/XTimeline/XTimeline.vue'),
94
114
  XRadio: () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue'),
95
- XTextCard: () => import('@vue2-client/base-client/components/his/XTextCard/XTextCard.vue')
115
+ XTextCard: () => import('@vue2-client/base-client/components/his/XTextCard/XTextCard.vue'),
116
+ XTreeRows: () => import('@vue2-client/base-client/components/his/XTreeRows/XTreeRows.vue')
96
117
  },
97
118
  data () {
98
119
  return {
@@ -146,6 +167,7 @@ export default {
146
167
  },
147
168
  async getData (config, parameter) {
148
169
  this.configName = config
170
+ config = 'collapseTestConfig'
149
171
  getConfigByName(config, 'af-his', res => {
150
172
  this.config = res
151
173
  console.warn(this.config)
@@ -160,7 +182,12 @@ export default {
160
182
  })
161
183
  this.$forceUpdate()
162
184
  }
163
- this.activeKey = this.config.showData.map((_, panelIndex) => panelIndex.toString())
185
+ const shouldCollapseAll = this.config.collapseAllByDefault || false
186
+ console.log('11', this.config.collapseAllByDefault)
187
+ // 初始化展开状态
188
+ this.activeKey = shouldCollapseAll
189
+ ? []
190
+ : this.config.showData.map((_, i) => i.toString())
164
191
  })
165
192
  })
166
193
  },
@@ -179,10 +206,14 @@ export default {
179
206
  },
180
207
  handleChange (keys) {
181
208
  this.activeKey = keys
209
+ // console.log(this.activeKey)
182
210
  },
183
211
  onSearch (value, panelIndex) {
184
212
  this.$emit('searchChange', { value: value, panelIndex: panelIndex })
185
213
  },
214
+ handleSettingClick (panel, panelIndex) {
215
+ this.$emit('settingClick', { panel, panelIndex })
216
+ }
186
217
  },
187
218
  watch: {
188
219
  queryParamsName: {
@@ -230,6 +261,7 @@ export default {
230
261
  position: relative;
231
262
  border-bottom: v-bind('config.showLine ? "1px solid #000000" : "none"');
232
263
  align-items: center !important;
264
+ background-color: #ffffff;
233
265
  }
234
266
 
235
267
  :deep(.ant-collapse-header-text) {
@@ -250,4 +282,45 @@ export default {
250
282
  :deep(.ant-collapse-item-disabled > .ant-collapse-header) {
251
283
  cursor: default !important;
252
284
  }
285
+
286
+ /* 新增样式 */
287
+ .blue-circle-icon {
288
+ width: 12px;
289
+ height: 12px;
290
+ border-radius: 6px;
291
+ background: #3362da;
292
+ margin-right: 8px;
293
+ flex-shrink: 0;
294
+ }
295
+
296
+ .setting-icon {
297
+ font-size: 16px;
298
+ cursor: pointer;
299
+ display: inline-flex;
300
+ align-items: center;
301
+ justify-content: center;
302
+ height: 100%;
303
+ line-height: 1;
304
+ vertical-align: middle;
305
+ margin-top: -20px; /* 微调偏移量(根据实际情况调整) */
306
+ }
307
+
308
+ :deep(.ant-collapse-extra) {
309
+ display: flex !important;
310
+ align-items: center;
311
+ }
312
+
313
+ .configurable-area {
314
+ padding: 16px;
315
+ min-height: 100px;
316
+ border: 1px dashed #d9d9d9;
317
+ border-radius: 4px;
318
+ background-color: #fafafa;
319
+ }
320
+
321
+ .empty-hint {
322
+ color: #999;
323
+ text-align: center;
324
+ margin: 20px 0;
325
+ }
253
326
  </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <!-- 列表卡片模式 listMode: card -->
3
- <div v-if="true"
3
+ <div v-if="listMode"
4
4
  class="demo-infinite-container"
5
5
  ref="listRef">
6
6
  <a-list :grid="{ gutter: 16, xs: 1, sm: 2, md: 2, lg: 3, xl: 3, xxl: 4 }"
@@ -1,197 +1,237 @@
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 '@vue2-client/base-client/components/his/XTreeRows/TreeNode.vue'
21
- import { getConfigByName, runLogic } from '@vue2-client/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
- float: right;
186
- margin-right: 15px;
187
- font-size: 14px;
188
- font-weight: 400;
189
- color: #5D5C5C;
190
- cursor: pointer;
191
- user-select: none;
192
- }
193
-
194
- .tree-expand-all:hover {
195
- color: #989a9a;
196
- }
197
- </style>
1
+ <template>
2
+ <div class="tree-container">
3
+ <div class="tree-header">
4
+ <span class="tree-title" :style="config.style">{{ 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 '@vue2-client/base-client/components/his/XTreeRows/TreeNode.vue'
21
+ import { getConfigByName, runLogic } from '@vue2-client/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
+ config: {}
94
+ }
95
+ },
96
+ methods: {
97
+ toggleNode (node) {
98
+ console.log('触发')
99
+ node.expanded = !node.expanded
100
+ this.$emit('node-toggle', node)
101
+ },
102
+ isToOpenAll () {
103
+ console.log('展开事件触发')
104
+ this.isExpanded = !this.isExpanded
105
+ this.expandAllNodes(this.showData, this.isExpanded)
106
+ this.$emit('isOpenAll', this.isExpanded)
107
+ },
108
+ expandAllNodes (nodes, expand) {
109
+ nodes.forEach(node => {
110
+ if (node.children && node.children.length > 0) {
111
+ node.expanded = expand
112
+ this.expandAllNodes(node.children, expand)
113
+ }
114
+ })
115
+ },
116
+ /**
117
+ * 构建树数据
118
+ * @param allData 子节点所有数据
119
+ * @param gid 根节点id
120
+ * @returns {*|*[]}
121
+ */
122
+ buildTreeByRootId (allData, gid) {
123
+ console.log(allData, gid)
124
+ // 1. 找到所有直接子节点
125
+ const directChildren = allData.filter(item => item.pid === gid)
126
+ if (directChildren.length === 0) return [] // 如果没有子节点,返回空数组
127
+ // 2. 递归构建子树
128
+ const buildTree = (parentId) => {
129
+ const children = allData.filter(item => item.pid === parentId)
130
+ return children.map(child => ({
131
+ title: child.label,
132
+ id: child.value,
133
+ children: buildTree(child.value), // 递归处理子节点
134
+ }))
135
+ }
136
+ console.log('child', directChildren)
137
+ // 3. 返回直接子节点的完整子树
138
+ return directChildren.map(child => ({
139
+ title: child.label,
140
+ id: child.value,
141
+ children: buildTree(child.value),
142
+ expanded: false
143
+ }))
144
+ },
145
+ init (config, parameterData) {
146
+ getConfigByName(config, 'af-his', res => {
147
+ console.log('config', config)
148
+ this.isShowOpen = res.isShowOpen
149
+ this.title = res.title
150
+ this.config = res
151
+ console.log(res)
152
+ if (!res.isCheck) {
153
+ this.showData = res.showData
154
+ return
155
+ }
156
+ const parameter = { ...parameterData, ...this.parameter }
157
+ runLogic(res.logicName, parameter, 'af-his').then(result => {
158
+ console.log('构造前数据', result)
159
+ if (result.isConstruction) { // 对数据重新构造
160
+ this.showData = this.buildTreeByRootId(result.allData, result.gId)
161
+ console.log('构造后数据', this.showData)
162
+ } else {
163
+ this.showData = result
164
+ }
165
+ })
166
+ })
167
+ }
168
+ },
169
+ watch: {
170
+ queryParamsName: {
171
+ immediate: true,
172
+ handler (newValue) {
173
+ console.log(newValue)
174
+ this.init(newValue, {})
175
+ },
176
+ deep: true
177
+ }
178
+ }
179
+ }
180
+ </script>
181
+
182
+ <style scoped>
183
+ .tree-container {
184
+ width: 100%;
185
+ height: 320px;
186
+ overflow-y: auto;
187
+ overflow-x: auto;
188
+ padding: 6px;
189
+ box-sizing: border-box;
190
+ }
191
+ /* 自定义滚动条样式 */
192
+ .tree-container::-webkit-scrollbar {
193
+ width: 4px;
194
+ height: 4px;
195
+ }
196
+ .tree-container::-webkit-scrollbar-thumb {
197
+ background-color: #ccc;
198
+ border-radius: 2px;
199
+ }
200
+ .tree-container::-webkit-scrollbar-track {
201
+ background-color: #f5f5f5;
202
+ }
203
+ .tree-list {
204
+ font-size: 14px;
205
+ min-width: 100%;
206
+ }
207
+
208
+ .tree-header {
209
+ padding: 8px 4px;
210
+ border-bottom: 1px solid #e8e8e8;
211
+ margin-bottom: 8px;
212
+ position: sticky;
213
+ top: 0;
214
+ background-color: #fff;
215
+ z-index: 1;
216
+ }
217
+
218
+ .tree-title {
219
+ font-size: 16px;
220
+ font-weight: 700;
221
+ color:#5D5C5C;
222
+ }
223
+
224
+ .tree-expand-all {
225
+ float: right;
226
+ margin-right: 15px;
227
+ font-size: 14px;
228
+ font-weight: 400;
229
+ color: #5D5C5C;
230
+ cursor: pointer;
231
+ user-select: none;
232
+ }
233
+
234
+ .tree-expand-all:hover {
235
+ color: #989a9a;
236
+ }
237
+ </style>