vue2-client 1.17.45 → 1.17.47

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 (25) hide show
  1. package/.env +20 -20
  2. package/package.json +1 -1
  3. package/src/base-client/components/common/XCollapse/XCollapse.vue +4 -4
  4. package/src/base-client/components/common/XForm/XFormItem.vue +1 -0
  5. package/src/base-client/components/common/XForm/XTreeSelect.vue +276 -276
  6. package/src/base-client/components/his/HChart/HChart.vue +493 -493
  7. package/src/base-client/components/his/HChart/demo.vue +88 -88
  8. package/src/base-client/components/his/HChart/index.md +798 -798
  9. package/src/base-client/components/his/XIcon/XIcon.vue +73 -73
  10. package/src/base-client/components/his/XIcon/index.js +3 -3
  11. package/src/base-client/components/his/XIcon/index.md +177 -177
  12. package/src/base-client/components/his/XSidebar/XSidebar.vue +1 -1
  13. package/src/pages/WorkflowDetail/WorkFlowDemo4.vue +127 -0
  14. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformation.vue +417 -417
  15. package/src/router/async/router.map.js +2 -2
  16. package/src/services/api/restTools.js +215 -215
  17. package/src/assets/img/paymentMethod/icon1.png +0 -0
  18. package/src/assets/img/paymentMethod/icon2.png +0 -0
  19. package/src/assets/img/paymentMethod/icon3.png +0 -0
  20. package/src/assets/img/paymentMethod/icon4.png +0 -0
  21. package/src/assets/img/paymentMethod/icon5.png +0 -0
  22. package/src/assets/img/paymentMethod/icon6.png +0 -0
  23. package/src/base-client/components/common/XReport/XReportHospitalizationDemo.vue +0 -45
  24. package/src-base-client/components/his/XCharge/README.md +0 -0
  25. package/src-base-client/components/his/XCharge/XCharge.vue +0 -0
@@ -53,9 +53,9 @@ 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/his/HChart/demo.vue'),
56
+ // component: () => import('@vue2-client/base-client/components/his/HChart/demo.vue'),
57
57
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
58
- // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
58
+ component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
59
59
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
60
60
  // component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
61
61
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
@@ -1,215 +1,215 @@
1
- import { getSystemVersion, METHOD, request } from '@vue2-client/utils/request'
2
- import { ACCESS_TOKEN, V4_ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
3
-
4
- /**
5
- * GET请求
6
- * @param url 请求地址
7
- * @param parameter 路径参数
8
- * @returns {Promise<AxiosResponse<T>>}
9
- */
10
- function get (url, parameter) {
11
- return request(url, METHOD.GET, parameter)
12
- }
13
-
14
- /**
15
- * POST请求
16
- * @param url 请求地址
17
- * @param parameter 请求参数
18
- * @param config
19
- * @returns {Promise<AxiosResponse<T>>}
20
- */
21
- function post (url, parameter, config = {}) {
22
- return request(url, METHOD.POST, parameter, config)
23
- }
24
-
25
- /**
26
- * POST请求
27
- * @param url 请求地址
28
- * @param parameter 请求参数
29
- * @param serviceName
30
- * @param isDev
31
- * @param config
32
- * @returns {Promise<AxiosResponse<T>>}
33
- */
34
- function postByServiceName (url, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev, config = {}) {
35
- if (url.startsWith('api/') || url.startsWith('/api/')) {
36
- return request(url, METHOD.POST, parameter, config)
37
- }
38
- let apiPre = '/api/'
39
- if (isDev) {
40
- apiPre = '/devApi/'
41
- }
42
- if (!url.startsWith('/')) {
43
- url = '/' + url
44
- }
45
- url = apiPre + serviceName + url
46
- return request(url, METHOD.POST, parameter, config)
47
- }
48
-
49
- /**
50
- * DELETE请求
51
- * @param url 请求地址
52
- * @param parameter 请求参数
53
- * @param config
54
- * @returns {Promise<AxiosResponse<T>>}
55
- */
56
- function del (url, parameter, config = {}) {
57
- return request(url, METHOD.DELETE, parameter, config)
58
- }
59
-
60
- /**
61
- * PUT请求
62
- * @param url 请求地址
63
- * @param parameter 请求参数
64
- * @param config
65
- * @returns {Promise<AxiosResponse<T>>}
66
- */
67
- function put (url, parameter, config = {}) {
68
- return request(url, METHOD.PUT, parameter, config)
69
- }
70
-
71
- /**
72
- * 封装 EventSource 请求函数
73
- * @param {string} url - 请求地址
74
- * @param {Object} options - 请求选项(包括 method, headers, body 等)
75
- * @param {Function} onDataUpdate - 数据更新回调,每次接收到新的数据都会调用
76
- * @param {Function} onError - 错误处理回调
77
- * @returns {Function} - 用于取消请求的函数
78
- */
79
- function startEventStreamPOST (url, params, headers = {}, onDataUpdate, onError, serviceName = process.env.VUE_APP_SYSTEM_NAME, method = 'GET') {
80
- return startEventStream(url, params, headers, onDataUpdate, onError, serviceName, 'POST')
81
- }
82
- function startEventStream (url, params, headers = {}, onDataUpdate, onError, serviceName = process.env.VUE_APP_SYSTEM_NAME, method = 'GET') {
83
- // let isStopped = false
84
- let isStopped = false
85
- let requestCount = 0
86
-
87
- if (!(url.startsWith('api/') || url.startsWith('/api/') || url.startsWith('http'))) {
88
- if (!url.startsWith('/')) {
89
- url = '/' + url
90
- }
91
- url = '/api/' + serviceName + url
92
- }
93
-
94
- console.log(`[EventStream] 开始新的请求: ${url}`, {
95
- params,
96
- headers,
97
- method
98
- })
99
-
100
- const controller = new AbortController()
101
- const { signal } = controller
102
- const token = localStorage.getItem(ACCESS_TOKEN)
103
- // 增加 V4 登录请求头
104
- if (token) {
105
- const compatible = getSystemVersion()
106
- if (compatible === 'V4') {
107
- // V4 环境则添加 V4请求头
108
- headers[V4_ACCESS_TOKEN] = token
109
- } else {
110
- headers[ACCESS_TOKEN] = token
111
- }
112
- }
113
- fetch(url, {
114
- method: method,
115
- headers: {
116
- ...headers,
117
- Accept: 'text/event-stream',
118
- 'Cache-Control': 'no-cache',
119
- Connection: 'keep-alive'
120
- },
121
- body: JSON.stringify(params),
122
- signal
123
- }).then(response => {
124
- if (!response.ok) {
125
- throw new Error(`HTTP error! status: ${response.status}`)
126
- }
127
-
128
- requestCount++
129
- console.log(`[EventStream] 请求已打开 (第${requestCount}次): ${url}`, {
130
- status: response.status,
131
- statusText: response.statusText
132
- })
133
-
134
- const reader = response.body.getReader()
135
- const decoder = new TextDecoder()
136
- let buffer = ''
137
-
138
- function processStream () {
139
- if (isStopped) {
140
- console.log(`[EventStream] 请求已停止,停止读取流: ${url}`)
141
- return
142
- }
143
-
144
- reader.read().then(({ done, value }) => {
145
- if (done) {
146
- console.log(`[EventStream] 流读取完成: ${url}`)
147
- return
148
- }
149
-
150
- const chunk = decoder.decode(value, { stream: true })
151
- buffer += chunk
152
-
153
- // 处理接收到的数据
154
- const lines = buffer.split('\n')
155
- buffer = lines.pop() // 保留最后一个不完整的行
156
-
157
- let currentEvent = null
158
- let currentData = null
159
-
160
- for (const line of lines) {
161
- if (line.startsWith('event: ')) {
162
- currentEvent = line.slice(7)
163
- } else if (line.startsWith('data: ')) {
164
- currentData = line.slice(6)
165
- try {
166
- const parsedData = JSON.parse(currentData)
167
- if (currentEvent === 'additionalInfo') {
168
- // 触发 additionalInfo 回调
169
- onDataUpdate?.(parsedData, 'additionalInfo')
170
- } else {
171
- // 普通消息数据
172
- onDataUpdate?.(parsedData, 'sourceInfo')
173
- }
174
- } catch (e) {
175
- if (currentEvent === 'sourceInfo') {
176
- // 触发 sourceInfo 回调
177
- onDataUpdate?.(currentData, 'sourceInfo')
178
- } else {
179
- onDataUpdate?.(currentData, 'data')
180
- }
181
- }
182
- // 重置当前事件和数据
183
- currentEvent = null
184
- currentData = null
185
- }
186
- }
187
-
188
- processStream()
189
- }).catch(error => {
190
- console.error(`[EventStream] 流读取错误: ${url}`, error)
191
- if (!isStopped) {
192
- isStopped = true
193
- onError?.(error)
194
- }
195
- })
196
- }
197
-
198
- processStream()
199
- }).catch(error => {
200
- console.error(`[EventStream] 请求错误: ${url}`, error)
201
- if (!isStopped) {
202
- isStopped = true
203
- onError?.(error)
204
- }
205
- })
206
-
207
- // 返回停止函数
208
- return () => {
209
- isStopped = true
210
- controller.abort()
211
- console.log('连接已关闭')
212
- }
213
- }
214
-
215
- export { get, post, del, put, postByServiceName, startEventStream, startEventStreamPOST }
1
+ import { getSystemVersion, METHOD, request } from '@vue2-client/utils/request'
2
+ import { ACCESS_TOKEN, V4_ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
3
+
4
+ /**
5
+ * GET请求
6
+ * @param url 请求地址
7
+ * @param parameter 路径参数
8
+ * @returns {Promise<AxiosResponse<T>>}
9
+ */
10
+ function get (url, parameter) {
11
+ return request(url, METHOD.GET, parameter)
12
+ }
13
+
14
+ /**
15
+ * POST请求
16
+ * @param url 请求地址
17
+ * @param parameter 请求参数
18
+ * @param config
19
+ * @returns {Promise<AxiosResponse<T>>}
20
+ */
21
+ function post (url, parameter, config = {}) {
22
+ return request(url, METHOD.POST, parameter, config)
23
+ }
24
+
25
+ /**
26
+ * POST请求
27
+ * @param url 请求地址
28
+ * @param parameter 请求参数
29
+ * @param serviceName
30
+ * @param isDev
31
+ * @param config
32
+ * @returns {Promise<AxiosResponse<T>>}
33
+ */
34
+ function postByServiceName (url, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev, config = {}) {
35
+ if (url.startsWith('api/') || url.startsWith('/api/')) {
36
+ return request(url, METHOD.POST, parameter, config)
37
+ }
38
+ let apiPre = '/api/'
39
+ if (isDev) {
40
+ apiPre = '/devApi/'
41
+ }
42
+ if (!url.startsWith('/')) {
43
+ url = '/' + url
44
+ }
45
+ url = apiPre + serviceName + url
46
+ return request(url, METHOD.POST, parameter, config)
47
+ }
48
+
49
+ /**
50
+ * DELETE请求
51
+ * @param url 请求地址
52
+ * @param parameter 请求参数
53
+ * @param config
54
+ * @returns {Promise<AxiosResponse<T>>}
55
+ */
56
+ function del (url, parameter, config = {}) {
57
+ return request(url, METHOD.DELETE, parameter, config)
58
+ }
59
+
60
+ /**
61
+ * PUT请求
62
+ * @param url 请求地址
63
+ * @param parameter 请求参数
64
+ * @param config
65
+ * @returns {Promise<AxiosResponse<T>>}
66
+ */
67
+ function put (url, parameter, config = {}) {
68
+ return request(url, METHOD.PUT, parameter, config)
69
+ }
70
+
71
+ /**
72
+ * 封装 EventSource 请求函数
73
+ * @param {string} url - 请求地址
74
+ * @param {Object} options - 请求选项(包括 method, headers, body 等)
75
+ * @param {Function} onDataUpdate - 数据更新回调,每次接收到新的数据都会调用
76
+ * @param {Function} onError - 错误处理回调
77
+ * @returns {Function} - 用于取消请求的函数
78
+ */
79
+ function startEventStreamPOST (url, params, headers = {}, onDataUpdate, onError, serviceName = process.env.VUE_APP_SYSTEM_NAME, method = 'GET') {
80
+ return startEventStream(url, params, headers, onDataUpdate, onError, serviceName, 'POST')
81
+ }
82
+ function startEventStream (url, params, headers = {}, onDataUpdate, onError, serviceName = process.env.VUE_APP_SYSTEM_NAME, method = 'GET') {
83
+ // let isStopped = false
84
+ let isStopped = false
85
+ let requestCount = 0
86
+
87
+ if (!(url.startsWith('api/') || url.startsWith('/api/') || url.startsWith('http'))) {
88
+ if (!url.startsWith('/')) {
89
+ url = '/' + url
90
+ }
91
+ url = '/api/' + serviceName + url
92
+ }
93
+
94
+ console.log(`[EventStream] 开始新的请求: ${url}`, {
95
+ params,
96
+ headers,
97
+ method
98
+ })
99
+
100
+ const controller = new AbortController()
101
+ const { signal } = controller
102
+ const token = localStorage.getItem(ACCESS_TOKEN)
103
+ // 增加 V4 登录请求头
104
+ if (token) {
105
+ const compatible = getSystemVersion()
106
+ if (compatible === 'V4') {
107
+ // V4 环境则添加 V4请求头
108
+ headers[V4_ACCESS_TOKEN] = token
109
+ } else {
110
+ headers[ACCESS_TOKEN] = token
111
+ }
112
+ }
113
+ fetch(url, {
114
+ method: method,
115
+ headers: {
116
+ ...headers,
117
+ Accept: 'text/event-stream',
118
+ 'Cache-Control': 'no-cache',
119
+ Connection: 'keep-alive'
120
+ },
121
+ body: JSON.stringify(params),
122
+ signal
123
+ }).then(response => {
124
+ if (!response.ok) {
125
+ throw new Error(`HTTP error! status: ${response.status}`)
126
+ }
127
+
128
+ requestCount++
129
+ console.log(`[EventStream] 请求已打开 (第${requestCount}次): ${url}`, {
130
+ status: response.status,
131
+ statusText: response.statusText
132
+ })
133
+
134
+ const reader = response.body.getReader()
135
+ const decoder = new TextDecoder()
136
+ let buffer = ''
137
+
138
+ function processStream () {
139
+ if (isStopped) {
140
+ console.log(`[EventStream] 请求已停止,停止读取流: ${url}`)
141
+ return
142
+ }
143
+
144
+ reader.read().then(({ done, value }) => {
145
+ if (done) {
146
+ console.log(`[EventStream] 流读取完成: ${url}`)
147
+ return
148
+ }
149
+
150
+ const chunk = decoder.decode(value, { stream: true })
151
+ buffer += chunk
152
+
153
+ // 处理接收到的数据
154
+ const lines = buffer.split('\n')
155
+ buffer = lines.pop() // 保留最后一个不完整的行
156
+
157
+ let currentEvent = null
158
+ let currentData = null
159
+
160
+ for (const line of lines) {
161
+ if (line.startsWith('event: ')) {
162
+ currentEvent = line.slice(7)
163
+ } else if (line.startsWith('data: ')) {
164
+ currentData = line.slice(6)
165
+ try {
166
+ const parsedData = JSON.parse(currentData)
167
+ if (currentEvent === 'additionalInfo') {
168
+ // 触发 additionalInfo 回调
169
+ onDataUpdate?.(parsedData, 'additionalInfo')
170
+ } else {
171
+ // 普通消息数据
172
+ onDataUpdate?.(parsedData, 'sourceInfo')
173
+ }
174
+ } catch (e) {
175
+ if (currentEvent === 'sourceInfo') {
176
+ // 触发 sourceInfo 回调
177
+ onDataUpdate?.(currentData, 'sourceInfo')
178
+ } else {
179
+ onDataUpdate?.(currentData, 'data')
180
+ }
181
+ }
182
+ // 重置当前事件和数据
183
+ currentEvent = null
184
+ currentData = null
185
+ }
186
+ }
187
+
188
+ processStream()
189
+ }).catch(error => {
190
+ console.error(`[EventStream] 流读取错误: ${url}`, error)
191
+ if (!isStopped) {
192
+ isStopped = true
193
+ onError?.(error)
194
+ }
195
+ })
196
+ }
197
+
198
+ processStream()
199
+ }).catch(error => {
200
+ console.error(`[EventStream] 请求错误: ${url}`, error)
201
+ if (!isStopped) {
202
+ isStopped = true
203
+ onError?.(error)
204
+ }
205
+ })
206
+
207
+ // 返回停止函数
208
+ return () => {
209
+ isStopped = true
210
+ controller.abort()
211
+ console.log('连接已关闭')
212
+ }
213
+ }
214
+
215
+ export { get, post, del, put, postByServiceName, startEventStream, startEventStreamPOST }
@@ -1,45 +0,0 @@
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>
File without changes