vue2-client 1.15.79 → 1.15.80

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.79",
3
+ "version": "1.15.80",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
package/public/index.html CHANGED
@@ -13,7 +13,7 @@
13
13
  </head>
14
14
  <body>
15
15
  <noscript>
16
- <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
16
+ <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
17
17
  </noscript>
18
18
  <div id="popContainer" class="beauty-scroll" style="height: 100%; overflow-y: auto">
19
19
  <div id="app"></div>
@@ -14,7 +14,7 @@ export default {
14
14
  return {
15
15
  isRecording: false, // 标识是否正在录音
16
16
  mediaRecorder: null, // MediaRecorder 实例
17
- audioChunks: [], // 存储录音数据块
17
+ audioChunks: [], // 存储录音数据块
18
18
  audioUrl: null, // 录音生成的 URL
19
19
  inputData: '',
20
20
  config: {}
@@ -3,21 +3,51 @@
3
3
  <a-button-group>
4
4
  <a-button
5
5
  v-for="(button) in renderConfig"
6
+ :style="buttonStyle"
6
7
  :key="button.key"
7
8
  :ref="'buttonGroup-' + button.key"
8
9
  :type="button.type || 'default'"
9
10
  :disabled="button.disabled"
10
- :icon="button.icon"
11
+ :class="{
12
+ 'selected-button': enableSelect && selectedButtonKey === button.key,
13
+ 'icon-only-button': buttonsMode === 'icon'
14
+ }"
11
15
  @click="handleButtonClick(button)"
12
16
  >
13
- {{ button.label }}
17
+ <!-- 水印图标(watermarkMode为true时显示) -->
18
+ <div class="watermark-icon" v-if="watermarkMode && button.icon">
19
+ <a-icon :type="button.icon" />
20
+ </div>
21
+
22
+ <!-- 普通模式 -->
23
+ <template v-if="buttonsMode === 'default'">
24
+ <a-icon v-if="!watermarkMode && button.icon" :type="button.icon" />
25
+ {{ button.label }}
26
+ </template>
27
+
28
+ <!-- 图标模式(只显示图标) -->
29
+ <template v-if="buttonsMode === 'icon' && button.icon">
30
+ <a-icon :type="button.icon" />
31
+ <span class="sr-only">{{ button.label }}</span>
32
+ </template>
33
+
34
+ <!-- 卡片模式 -->
35
+ <template v-if="buttonsMode === 'card'">
36
+ <div class="card-content">
37
+ <div class="card-label">{{ button.label }}</div>
38
+ <div class="card-value">
39
+ <span class="number">{{ button.value || 0 }}</span>
40
+ <span class="unit">{{ button.unit || '' }}</span>
41
+ </div>
42
+ </div>
43
+ </template>
14
44
  </a-button>
15
45
  </a-button-group>
16
46
  </div>
17
47
  </template>
18
48
 
19
49
  <script>
20
- import { getConfigByName } from '@vue2-client/services/api/common'
50
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
21
51
 
22
52
  export default {
23
53
  name: 'XButtons',
@@ -38,6 +68,18 @@ export default {
38
68
  return {
39
69
  // 配置内容
40
70
  renderConfig: undefined,
71
+ // 按钮格式
72
+ buttonsMode: 'default',
73
+ // 按钮事件禁用开启状态
74
+ eventDisabled: false,
75
+ // 按钮样式
76
+ buttonStyle: '',
77
+ // 选中效果
78
+ enableSelect: false,
79
+ // 选中key
80
+ selectedButtonKey: undefined,
81
+ // 按钮图标样式
82
+ watermarkMode: false
41
83
  }
42
84
  },
43
85
  methods: {
@@ -47,10 +89,25 @@ export default {
47
89
  initData (parameter) {
48
90
  // 按钮组需要主动调用初始化方法
49
91
  getConfigByName(parameter, this.serviceName, (res) => {
50
- this.init({
51
- ...res,
52
- serviceName: this.serviceName,
53
- })
92
+ this.buttonsMode = ['default', 'card', 'icon'].includes(res.buttonsMode) ? res.buttonsMode : 'default'
93
+ this.enableSelect = res.enableSelect ?? false
94
+ this.buttonStyle = res.style ?? ''
95
+ this.eventDisabled = res.eventDisabled ?? false
96
+ this.watermarkMode = res.watermarkMode ?? false
97
+ if (res.logicName) {
98
+ runLogic(res.logicName, {}, this.serviceName).then((result) => {
99
+ res.value = result
100
+ this.init({
101
+ ...res,
102
+ serviceName: this.serviceName,
103
+ })
104
+ })
105
+ } else {
106
+ this.init({
107
+ ...res,
108
+ serviceName: this.serviceName,
109
+ })
110
+ }
54
111
  }, this.env === 'dev')
55
112
  },
56
113
  init (params) {
@@ -60,12 +117,18 @@ export default {
60
117
  } = params
61
118
  this.renderConfig = value
62
119
  },
120
+ getKey () {
121
+ return this.selectedButtonKey
122
+ },
63
123
  handleButtonClick (item) {
64
- if (item.clickEventName && this.$listeners[item.clickEventName]) {
65
- // 交由父级处理
66
- this.$emit(item.clickEventName, item)
67
- } else {
68
- this.defaultAction(item.clickEventName, item)
124
+ this.selectedButtonKey = this.selectedButtonKey === item.key ? null : item.key
125
+ if (!this.eventDisabled) {
126
+ if (item.clickEventName && this.$listeners[item.clickEventName]) {
127
+ // 交由父级处理
128
+ this.$emit(item.clickEventName, item)
129
+ } else {
130
+ this.defaultAction(item.clickEventName, item)
131
+ }
69
132
  }
70
133
  },
71
134
  defaultAction (clickEventName, item, callback) {
@@ -90,4 +153,132 @@ export default {
90
153
  .ant-btn-group {
91
154
  flex-wrap: wrap;
92
155
  }
156
+ /* 选中按钮的样式 */
157
+ .selected-button {
158
+ background-color: #1890ff !important; /* 蓝色背景 */
159
+ color: white !important; /* 白色文字 */
160
+ border-color: #1890ff !important; /* 蓝色边框 */
161
+ }
162
+ /* 卡片模式样式 */
163
+ .card-button {
164
+ width: 120px;
165
+ height: 80px;
166
+ padding: 8px;
167
+ display: flex;
168
+ flex-direction: column;
169
+ justify-content: space-between;
170
+ position: relative;
171
+ }
172
+
173
+ .card-content {
174
+ width: 100%;
175
+ height: 100%;
176
+ display: flex;
177
+ flex-direction: column;
178
+ }
179
+
180
+ .card-label {
181
+ font-size: 24px;
182
+ text-align: left;
183
+ align-self: flex-start;
184
+ margin-top: 20px;
185
+ font-weight: normal;
186
+ font-family: Source Han Sans;
187
+ }
188
+
189
+ .card-value {
190
+ text-align: right;
191
+ align-self: flex-end;
192
+ margin-top: auto;
193
+ font-family: Source Han Sans;
194
+
195
+ }
196
+
197
+ .card-value .number {
198
+ font-size: 32px;
199
+ font-weight: bold;
200
+ line-height: 39px;
201
+ color: #1890ff;
202
+ }
203
+
204
+ .card-value .unit {
205
+ font-size: 20px;
206
+ font-weight: normal;
207
+ line-height: 39px;
208
+ }
209
+ /* 水印图标样式 */
210
+ .watermark-icon {
211
+ position: absolute;
212
+ font-size: 164px;
213
+ opacity: 0.15;
214
+ z-index: 0;
215
+ top: 50%;
216
+ left: 50%;
217
+ transform: translate(-50%, -50%);
218
+ pointer-events: none; /* 防止水印图标拦截点击事件 */
219
+ }
220
+ /* 当有水印图标时,自动应用背景色 */
221
+ .ant-btn:has(.watermark-icon) {
222
+ background-color: #f0f0f0 !important; /* 浅灰色背景 */
223
+ border-color: #d9d9d9 !important; /* 边框色 */
224
+ }
225
+
226
+ /* 普通模式下的图标位置调整 */
227
+ .ant-btn > .anticon + span {
228
+ margin-left: 8px;
229
+ }
230
+
231
+ /* 水印模式下的文字层级 */
232
+ .button-label {
233
+ position: relative;
234
+ z-index: 1;
235
+ }
236
+
237
+ /* 纯图标模式核心样式 */
238
+ .icon-only-button {
239
+ /* 移除所有边框和背景 */
240
+ border: none !important;
241
+ background: transparent !important;
242
+ box-shadow: none !important;
243
+
244
+ /* 控制按钮大小与图标一致 */
245
+ width: auto !important;
246
+ height: auto !important;
247
+ padding: 4px !important; /* 缩小内边距 */
248
+ min-width: unset !important; /* 移除默认最小宽度 */
249
+
250
+ /* 确保图标居中 */
251
+ display: inline-flex !important;
252
+ align-items: center !important;
253
+ justify-content: center !important;
254
+ }
255
+
256
+ /* 图标大小控制 */
257
+ .icon-only-button .anticon {
258
+ font-size: 24px !important; /* 图标大小 */
259
+ color: #888888 !important; /* 默认图标颜色 */
260
+ }
261
+
262
+ /* 悬停和激活状态优化 */
263
+ .icon-only-button:hover {
264
+ background-color: #e6f7ff !important; /* 轻微hover背景 */
265
+ color: #1890ff !important; /* hover时图标颜色 */
266
+ }
267
+
268
+ .icon-only-button.selected-button {
269
+ background-color: #e6f7ff !important;
270
+ color: #1890ff !important;
271
+ }
272
+
273
+ /* 屏幕阅读器专用样式(视觉隐藏,语义保留) */
274
+ .sr-only {
275
+ position: absolute !important;
276
+ width: 1px !important;
277
+ height: 1px !important;
278
+ padding: 0 !important;
279
+ margin: -1px !important;
280
+ overflow: hidden !important;
281
+ clip: rect(0, 0, 0, 0) !important;
282
+ border: 0 !important;
283
+ }
93
284
  </style>
@@ -824,7 +824,7 @@ export default {
824
824
  this.$refs.xTable.refresh(toFirstPage)
825
825
  },
826
826
  /**
827
- * 刷新表格
827
+ * 刷新表格
828
828
  * @param toFirstPage 是否到第一页
829
829
  */
830
830
  refresh (toFirstPage = true) {
@@ -8,7 +8,7 @@
8
8
  @action="action"
9
9
  @selectRow="selectRow"
10
10
  @columnClick="columnClick"
11
- serviceName="af-revenue"
11
+ serviceName="af-system"
12
12
  ref="xFormTable">
13
13
  </x-form-table>
14
14
  </a-card>
@@ -26,7 +26,7 @@ export default {
26
26
  data () {
27
27
  return {
28
28
  // 查询配置文件名
29
- queryParamsName: 'UserFilesListCRUD',
29
+ queryParamsName: 'ceshiCRUD',
30
30
  // 新增表单固定值
31
31
  fixedAddForm: {},
32
32
  // 是否显示详情抽屉
@@ -265,7 +265,7 @@ export default {
265
265
  // 保留获取后端数据的逻辑
266
266
  await runLogic(param.dataLogic,
267
267
  {}, 'af-his').then(res => {
268
- preliDiagnoData = res
268
+ preliDiagnoData = res
269
269
  })
270
270
 
271
271
  // 创建脚本元素
@@ -282,7 +282,7 @@ export default {
282
282
  document.dispatchEvent(event);
283
283
  }
284
284
 
285
- // 初始化诊断下拉菜单,使用自定义事件触发函数
285
+ // 初始化诊断下拉菜单,使用自定义事件触发函数
286
286
  (${initDiagnosisDropdown.toString()})(
287
287
  editor,
288
288
  ${JSON.stringify(preliDiagnoData)},
@@ -323,7 +323,7 @@ export default {
323
323
  onload (e) {
324
324
  if (e && e.target && e.target.contentWindow) {
325
325
  this.editorRef = e.target.contentWindow.editor
326
- // 等待文档加载完成
326
+ // 等待文档加载完成
327
327
  this.$emit('init', {})
328
328
  }
329
329
  },
@@ -365,7 +365,7 @@ export default {
365
365
  // 文件加载完成后再初始化自动完成
366
366
  await this.initDiagnosisAutocomplete(dropDownBoxParams)
367
367
  })
368
- this.loadResList()
368
+ this.loadResList()
369
369
  },
370
370
  // 加载文档
371
371
  loadFile (fileUrl, bindObject, currResData) {
@@ -382,7 +382,7 @@ export default {
382
382
  }
383
383
  // 拿取多于模板中的数据
384
384
  const diff = this.bindObject? Object.fromEntries(
385
- Object.entries(this.bindObject)
385
+ Object.entries(this.bindObject)
386
386
  .filter(([key]) => !(key in this.editorRef.getBindObject()))
387
387
  ) : {}
388
388
  this.codeData = {...this.codeData,...diff}
@@ -431,6 +431,7 @@ export default {
431
431
  return false
432
432
  }
433
433
  this.save()
434
+
434
435
  return true
435
436
  } else {
436
437
  return false
@@ -477,7 +478,7 @@ export default {
477
478
  // 检查templates数组是否存在
478
479
  if (!templateData.templates || !Array.isArray(templateData.templates)) {
479
480
  console.warn('templateData.templates不存在或不是数组')
480
- return
481
+ return newBindObject
481
482
  }
482
483
  // 遍历templates数组中的每个属性名
483
484
  templateData.templates.forEach(propName => {
@@ -550,7 +551,6 @@ export default {
550
551
  // 保存HTML文档和结构化数据到后端服务
551
552
  runLogic(this.saveDataLogicName, data, this.serviceName).then(res => {
552
553
  this.$message.success('保存成功')
553
- console.log('保存成功', )
554
554
  this.changeRes(res.currResData.id)
555
555
  this.$emit('saveafter', data.dataObject)
556
556
  }).finally(() => {
@@ -107,7 +107,7 @@ export default {
107
107
  const byteArray = this.convertTo16BitPCM(resampledData)
108
108
 
109
109
  const finalData = new Uint8Array(1 + byteArray.length) // 创建最终数据数组
110
- finalData[0] = 1 // 第一个字节为类型,值为1
110
+ finalData[0] = 1 // 第一个字节为类型,值为1
111
111
  finalData.set(byteArray, 1) // 设置实际数据
112
112
 
113
113
  this.ws.send(finalData) // 发送最终数据