vue2-client 1.12.14 → 1.12.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.
package/package.json CHANGED
@@ -1,107 +1,107 @@
1
- {
2
- "name": "vue2-client",
3
- "version": "1.12.14",
4
- "private": false,
5
- "scripts": {
6
- "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
7
- "serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
8
- "serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
9
- "serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
10
- "serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
11
- "serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
12
- "mac-serve": "vue-cli-service serve --no-eslint --mode his",
13
- "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
14
- "test:unit": "vue-cli-service test:unit",
15
- "lint": "vue-cli-service lint",
16
- "build:preview": "vue-cli-service build --mode preview",
17
- "lint:nofix": "vue-cli-service lint --no-fix",
18
- "test": "jest"
19
- },
20
- "dependencies": {
21
- "@afwenming123/vue-easy-tree": "^1.0.1",
22
- "@afwenming123/vue-plugin-hiprint": "^0.0.70",
23
- "@amap/amap-jsapi-loader": "^1.0.1",
24
- "@antv/data-set": "^0.11.8",
25
- "@antv/g2plot": "^2.4.31",
26
- "@hufe921/canvas-editor": "^0.9.49",
27
- "@microsoft/fetch-event-source": "^2.0.1",
28
- "@vue/babel-preset-jsx": "^1.4.0",
29
- "animate.css": "^4.1.1",
30
- "ant-design-vue": "^1.7.8",
31
- "axios": "^0.27.2",
32
- "clipboard": "^2.0.11",
33
- "core-js": "^3.33.0",
34
- "crypto-js": "^4.1.1",
35
- "date-fns": "^2.29.3",
36
- "default-passive-events": "^2.0.0",
37
- "dotenv": "^16.3.1",
38
- "echarts": "^5.5.0",
39
- "enquire.js": "^2.1.6",
40
- "file-saver": "^2.0.5",
41
- "highlight.js": "^11.7.0",
42
- "html2canvas": "^1.4.1",
43
- "js-base64": "^3.7.5",
44
- "js-cookie": "^2.2.1",
45
- "jsencrypt": "^3.3.2",
46
- "jspdf": "^2.5.1",
47
- "lodash.clonedeep": "^4.5.0",
48
- "lodash.debounce": "^4",
49
- "lodash.get": "^4.4.2",
50
- "marked": "^4",
51
- "mockjs": "^1.1.0",
52
- "nprogress": "^0.2.0",
53
- "qs": "^6.11.2",
54
- "regenerator-runtime": "^0.14.0",
55
- "videojs-contrib-hls": "^5.15.0",
56
- "viser-vue": "^2.4.8",
57
- "vue": "^2.7.14",
58
- "vue-codemirror": "4.0.6",
59
- "vue-draggable-resizable": "^2",
60
- "vue-i18n": "^8.28.2",
61
- "vue-json-viewer": "^2.2.22",
62
- "vue-router": "^3.6.5",
63
- "vue-video-player": "^5.0.2",
64
- "vue-virtual-scroller": "^1.1.2",
65
- "vuedraggable": "^2.24.3",
66
- "vuex": "^3.6.2",
67
- "xlsx": "0.18.5"
68
- },
69
- "devDependencies": {
70
- "@ant-design/colors": "^7.0.0",
71
- "@babel/core": "^7.22.20",
72
- "@babel/eslint-parser": "^7.22.15",
73
- "@babel/preset-env": "^7.22.20",
74
- "@vue/cli-plugin-babel": "^5.0.8",
75
- "@vue/cli-plugin-eslint": "^5.0.8",
76
- "@vue/cli-service": "^5.0.8",
77
- "@vue/eslint-config-standard": "^8.0.1",
78
- "@vue/test-utils": "^1.3.6",
79
- "@jest/globals": "^29.7.0",
80
- "babel-plugin-transform-remove-console": "^6.9.4",
81
- "compression-webpack-plugin": "^10.0.0",
82
- "css-minimizer-webpack-plugin": "^5.0.1",
83
- "deepmerge": "^4.3.1",
84
- "eslint": "^8.51.0",
85
- "eslint-plugin-vue": "^9.17.0",
86
- "fast-deep-equal": "^3.1.3",
87
- "ignore-loader": "^0.1.2",
88
- "jest": "^29.7.0",
89
- "jest-environment-jsdom": "^29.7.0",
90
- "jest-transform-stub": "^2.0.0",
91
- "less-loader": "^6.2.0",
92
- "script-loader": "^0.7.2",
93
- "style-resources-loader": "^1.5.0",
94
- "vue-cli-plugin-style-resources-loader": "^0.1.5",
95
- "vue-jest": "^4.0.1",
96
- "vue-template-compiler": "^2.7.14",
97
- "webpack": "^5.88.2",
98
- "webpack-theme-color-replacer": "^1.4.7",
99
- "whatwg-fetch": "^3.6.19"
100
- },
101
- "browserslist": [
102
- "> 1%",
103
- "last 2 versions",
104
- "not dead",
105
- "not ie 11"
106
- ]
107
- }
1
+ {
2
+ "name": "vue2-client",
3
+ "version": "1.12.16",
4
+ "private": false,
5
+ "scripts": {
6
+ "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
7
+ "serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
8
+ "serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
9
+ "serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
10
+ "serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
11
+ "serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
12
+ "mac-serve": "vue-cli-service serve --no-eslint --mode his",
13
+ "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
14
+ "test:unit": "vue-cli-service test:unit",
15
+ "lint": "vue-cli-service lint",
16
+ "build:preview": "vue-cli-service build --mode preview",
17
+ "lint:nofix": "vue-cli-service lint --no-fix",
18
+ "test": "jest"
19
+ },
20
+ "dependencies": {
21
+ "@afwenming123/vue-easy-tree": "^1.0.1",
22
+ "@afwenming123/vue-plugin-hiprint": "^0.0.70",
23
+ "@amap/amap-jsapi-loader": "^1.0.1",
24
+ "@antv/data-set": "^0.11.8",
25
+ "@antv/g2plot": "^2.4.31",
26
+ "@hufe921/canvas-editor": "^0.9.49",
27
+ "@microsoft/fetch-event-source": "^2.0.1",
28
+ "@vue/babel-preset-jsx": "^1.4.0",
29
+ "animate.css": "^4.1.1",
30
+ "ant-design-vue": "^1.7.8",
31
+ "axios": "^0.27.2",
32
+ "clipboard": "^2.0.11",
33
+ "core-js": "^3.33.0",
34
+ "crypto-js": "^4.1.1",
35
+ "date-fns": "^2.29.3",
36
+ "default-passive-events": "^2.0.0",
37
+ "dotenv": "^16.3.1",
38
+ "echarts": "^5.5.0",
39
+ "enquire.js": "^2.1.6",
40
+ "file-saver": "^2.0.5",
41
+ "highlight.js": "^11.7.0",
42
+ "html2canvas": "^1.4.1",
43
+ "js-base64": "^3.7.5",
44
+ "js-cookie": "^2.2.1",
45
+ "jsencrypt": "^3.3.2",
46
+ "jspdf": "^2.5.1",
47
+ "lodash.clonedeep": "^4.5.0",
48
+ "lodash.debounce": "^4",
49
+ "lodash.get": "^4.4.2",
50
+ "marked": "^4",
51
+ "mockjs": "^1.1.0",
52
+ "nprogress": "^0.2.0",
53
+ "qs": "^6.11.2",
54
+ "regenerator-runtime": "^0.14.0",
55
+ "videojs-contrib-hls": "^5.15.0",
56
+ "viser-vue": "^2.4.8",
57
+ "vue": "^2.7.14",
58
+ "vue-codemirror": "4.0.6",
59
+ "vue-draggable-resizable": "^2",
60
+ "vue-i18n": "^8.28.2",
61
+ "vue-json-viewer": "^2.2.22",
62
+ "vue-router": "^3.6.5",
63
+ "vue-video-player": "^5.0.2",
64
+ "vue-virtual-scroller": "^1.1.2",
65
+ "vuedraggable": "^2.24.3",
66
+ "vuex": "^3.6.2",
67
+ "xlsx": "0.18.5"
68
+ },
69
+ "devDependencies": {
70
+ "@ant-design/colors": "^7.0.0",
71
+ "@babel/core": "^7.22.20",
72
+ "@babel/eslint-parser": "^7.22.15",
73
+ "@babel/preset-env": "^7.22.20",
74
+ "@vue/cli-plugin-babel": "^5.0.8",
75
+ "@vue/cli-plugin-eslint": "^5.0.8",
76
+ "@vue/cli-service": "^5.0.8",
77
+ "@vue/eslint-config-standard": "^8.0.1",
78
+ "@vue/test-utils": "^1.3.6",
79
+ "@jest/globals": "^29.7.0",
80
+ "babel-plugin-transform-remove-console": "^6.9.4",
81
+ "compression-webpack-plugin": "^10.0.0",
82
+ "css-minimizer-webpack-plugin": "^5.0.1",
83
+ "deepmerge": "^4.3.1",
84
+ "eslint": "^8.51.0",
85
+ "eslint-plugin-vue": "^9.17.0",
86
+ "fast-deep-equal": "^3.1.3",
87
+ "ignore-loader": "^0.1.2",
88
+ "jest": "^29.7.0",
89
+ "jest-environment-jsdom": "^29.7.0",
90
+ "jest-transform-stub": "^2.0.0",
91
+ "less-loader": "^6.2.0",
92
+ "script-loader": "^0.7.2",
93
+ "style-resources-loader": "^1.5.0",
94
+ "vue-cli-plugin-style-resources-loader": "^0.1.5",
95
+ "vue-jest": "^4.0.1",
96
+ "vue-template-compiler": "^2.7.14",
97
+ "webpack": "^5.88.2",
98
+ "webpack-theme-color-replacer": "^1.4.7",
99
+ "whatwg-fetch": "^3.6.19"
100
+ },
101
+ "browserslist": [
102
+ "> 1%",
103
+ "last 2 versions",
104
+ "not dead",
105
+ "not ie 11"
106
+ ]
107
+ }
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <div class="card-box">
2
+ <div class="card-box" v-if="!configurationParameters.drawerMode">
3
3
  <div
4
4
  class="section-tab"
5
- v-bind:innerText="configurationParameters"
5
+ :innerText="configurationParameters"
6
6
  contenteditable="true"
7
7
  :style="{ backgroundColor: configurationParameters.tabBackgroundColor }">
8
8
  <a-icon :type="configurationParameters.icon" style="margin-left: 2%;font-size: medium;"/>
@@ -32,6 +32,47 @@
32
32
  </div>
33
33
  </div>
34
34
  </div>
35
+ <div v-else class="card-box">
36
+ <div
37
+ class="section-tab"
38
+ :innerText="configurationParameters"
39
+ contenteditable="true"
40
+ :style="{ backgroundColor: configurationParameters.tabBackgroundColor }">
41
+ <a-icon :type="configurationParameters.icon" style="margin-left: 2%;font-size: medium;"/>
42
+ {{ configurationParameters.tab }}
43
+ </div>
44
+ <a-collapse accordion class="accordion" :activeKey="activeKey" @change="switchDrawers">
45
+ <a-collapse-panel
46
+ v-for="(time, rowId) in times"
47
+ :header="time"
48
+ :style="{backgroundColor:rowId === rowIndex ? configurationParameters.tabBackgroundColor : '#fff'}"
49
+ :key="rowId" >
50
+ <div class="patient-overview">
51
+ <div
52
+ class="overview-section"
53
+ v-for="(item,index) in data"
54
+ :key="index"
55
+ :style="{borderBottom: index === data.length - 1 ? 'none' : '1px solid #ddd'}">
56
+ <div class="section-header" :style="{ backgroundColor: item.backgroundColor, color: item.fontColor }">
57
+ {{ item.titleName }}({{ item.messageNumber }})
58
+ </div>
59
+ <div class="patient-list-container">
60
+ <div class="patient-list">
61
+ <div
62
+ v-for="(patient, i) in item.showData"
63
+ :key="i"
64
+ class="patient-item"
65
+ :title="`${patient.room_number} - ${patient.patient_name}`">
66
+ <span class="card_data" :style="{ color: item.fontColor }">{{ patient.room_number }}</span>
67
+ <span class="card_data" >{{ patient.patient_name }}</span>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ </a-collapse-panel>
74
+ </a-collapse>
75
+ </div>
35
76
  </template>
36
77
 
37
78
  <script>
@@ -39,22 +80,29 @@
39
80
  import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
40
81
 
41
82
  export default {
42
- name: 'XCardSet',
83
+ name: 'CardComponent',
43
84
  data () {
44
85
  return {
45
86
  tab: 'container',
46
87
  data: [
47
88
  { room_number: '', patient_name: '' }
48
89
  ],
90
+ activeKey: '0',
91
+ times: [],
92
+ DateTimes: [],
93
+ rowIndex: 0,
49
94
  /* 配置参数(titleName:行标题名,dataSource:数据源,parameter:参数,fontColor:文字颜色,backgroundColor:背景颜色,
50
- pageSize:分页数量,tabBackgroundColor:标签背景颜色,isPrimarySource:是否取mainDataSource中的元素) */
95
+ pageSize:分页数量,tabBackgroundColor:标签背景颜色,isPrimarySource:是否取mainDataSource中的元素) drawerMode:是否选用抽屉模式
96
+ times:如果选用抽屉 */
51
97
  configurationParameters: {
98
+ drawerMode: false,
52
99
  tab: '',
53
100
  icon: '',
54
101
  tabBackgroundColor: '',
55
102
  mainDataSource: '',
56
103
  serverName: '',
57
104
  parameter: { pageSize: 8 },
105
+ times: 4,
58
106
  configurationData: [
59
107
  {
60
108
  titleName: '',
@@ -80,28 +128,79 @@ export default {
80
128
  async getData (data) {
81
129
  this.data = []
82
130
  getConfigByName(data, 'af-his', res => {
83
- this.configurationParameters = res
84
- console.log(this.configurationParameters)
85
- runLogic(res.mainDataSource, res.parameter, 'af-his').then(result => {
86
- for (let i = 0; i < res.configurationData.length; i++) {
87
- const ConfigureDisplayData = {
88
- titleName: res.configurationData[i].titleName,
89
- fontColor: res.configurationData[i].fontColor,
90
- backgroundColor: res.configurationData[i].backgroundColor,
91
- messageNumber: result[res.configurationData[i].dataSource + 'Total'][0].total,
92
- showData: []
93
- }
94
- this.data.push(ConfigureDisplayData)
95
- this.data[i].showData = result[res.configurationData[i].dataSource]
131
+ if (!res.drawerMode) {
132
+ this.renderDeck(res)
133
+ } else { this.renderData(res) }
134
+ })
135
+ },
136
+ // 渲染卡片组数据
137
+ async renderDeck (res, times) {
138
+ this.configurationParameters = await res
139
+ if (res.drawerMode) {
140
+ res.parameter.times = await times
141
+ }
142
+ runLogic(res.mainDataSource, res.parameter).then(result => {
143
+ for (let i = 0; i < res.configurationData.length; i++) {
144
+ const ConfigureDisplayData = {
145
+ titleName: res.configurationData[i].titleName,
146
+ fontColor: res.configurationData[i].fontColor,
147
+ backgroundColor: res.configurationData[i].backgroundColor,
148
+ messageNumber: result[res.configurationData[i].dataSource + 'Total'][0].total,
149
+ showData: []
96
150
  }
97
- })
151
+ this.data.push(ConfigureDisplayData)
152
+ this.data[i].showData = result[res.configurationData[i].dataSource]
153
+ }
98
154
  })
155
+ },
156
+ formatTime (date) {
157
+ const year = date.getFullYear()
158
+ const month = String(date.getMonth() + 1).padStart(2, '0')
159
+ const day = String(date.getDate()).padStart(2, '0')
160
+ const hours = String(date.getHours()).padStart(2, '0')
161
+ return `${year}-${month}-${day} ${hours}:00`
162
+ },
163
+ getTimes (n) {
164
+ const times = []
165
+ const now = new Date()
166
+ for (let i = 0; i <= n; i++) {
167
+ const time = new Date(now.getTime() + i * 60 * 60 * 1000)
168
+ times.push(this.formatTime(time))
169
+ }
170
+ return times
171
+ },
172
+ formatTimeToHHMM (timeString) {
173
+ const date = new Date(timeString)
174
+ const hours = String(date.getHours()).padStart(2, '0')
175
+ const minutes = String(date.getMinutes()).padStart(2, '0')
176
+ return `${hours}:${minutes}`
177
+ },
178
+ // 获取数据并渲染数据
179
+ renderData (data) {
180
+ this.times = []
181
+ this.DateTimes = []
182
+ const time = this.getTimes(data.times)
183
+ for (let i = 0; i < data.times; i++) {
184
+ const startTime = this.formatTimeToHHMM(time[i])
185
+ const endTime = this.formatTimeToHHMM(time[i + 1])
186
+ this.times.push(`${startTime} ~ ${endTime}`)
187
+ this.DateTimes.push(`${time[i]} and ${time[i + 1]}`)
188
+ }
189
+ this.renderDeck(data, `${time[0]} and ${time[1]}`)
190
+ },
191
+ // 切换抽屉
192
+ switchDrawers (activeKey) {
193
+ if (activeKey !== undefined) {
194
+ console.log('Active Header:', this.DateTimes[activeKey])
195
+ this.data = []
196
+ this.renderDeck(this.configurationParameters, this.DateTimes[activeKey])
197
+ this.rowIndex = activeKey
198
+ }
99
199
  }
100
200
  },
101
201
  watch: {
102
202
  queryParamsName: {
103
203
  handler (newValue) {
104
- console.log(newValue)
105
204
  this.getData(newValue)
106
205
  },
107
206
  deep: true
@@ -111,6 +210,9 @@ export default {
111
210
  </script>
112
211
 
113
212
  <style scoped>
213
+ .accordion{
214
+ width: 100%;
215
+ }
114
216
  .patient-overview {
115
217
  width: 100%;
116
218
  padding: 0.5%;
@@ -136,7 +238,7 @@ export default {
136
238
  width: 100%;
137
239
  padding-left: 1%;
138
240
  }
139
- .overview-section {
241
+ .overview-section{
140
242
  display: flex;
141
243
  flex-wrap: nowrap;
142
244
  align-items: center;
@@ -188,7 +290,7 @@ export default {
188
290
  flex-direction: row;
189
291
  height: 100%;
190
292
  }
191
- .card_data {
293
+ .card_data{
192
294
  display: inline-block;
193
295
  max-width: 5ch; /* 最多显示 3 个字符 */
194
296
  white-space: nowrap;
@@ -44,18 +44,6 @@ export default {
44
44
  return null
45
45
  },
46
46
  },
47
- setGlobalData: {
48
- default: () => () => {
49
- console.warn('setGlobalData is not provided.')
50
- return null
51
- },
52
- },
53
- getGlobalData: {
54
- default: () => () => {
55
- console.warn('getGlobalData is not provided.')
56
- return null
57
- },
58
- },
59
47
  getSelectedData: {
60
48
  default: () => () => {
61
49
  console.warn('getSelectedData is not provided.')
@@ -166,6 +154,7 @@ export default {
166
154
  question: userMessage,
167
155
  additionalInfo: this.additionalInfo
168
156
  }, this.serviceName)
157
+ this.additionalInfo.f_dialog_id = response.id
169
158
  this.messages.push({ type: 'bot', text: response.value })
170
159
  } else if (this.renderConfig.api) {
171
160
  // 通过api获取消息
@@ -195,6 +184,18 @@ export default {
195
184
  )
196
185
  }
197
186
  },
187
+ setHistoryMessages (messages) {
188
+ console.log(messages)
189
+ // 清空现有消息
190
+ this.messages = []
191
+ // 添加历史消息
192
+ messages.forEach(msg => {
193
+ this.messages.push({
194
+ type: msg.role === 'user' ? 'user' : 'bot',
195
+ text: msg.content
196
+ })
197
+ })
198
+ }
198
199
  },
199
200
  mounted () {
200
201
  this.setAddtionalInfo(this.getMixinData())
@@ -19,6 +19,7 @@ export default {
19
19
  serviceName: 'af-his'
20
20
  })
21
21
  this.$refs.XConversation.setAddtionalInfo({ patient_id: 37 })
22
+ this.$refs.XConversation.setHistoryMessages([{ role: 'user', content: '111' }, { role: 'bot', content: '222' }])
22
23
  }
23
24
  }
24
25
  </script>