vue2-client 1.9.86 → 1.9.87
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
|
@@ -92,8 +92,10 @@
|
|
|
92
92
|
</x-form-table>
|
|
93
93
|
</a-card>
|
|
94
94
|
</a-row>
|
|
95
|
-
<a-row type="flex" justify="
|
|
96
|
-
<
|
|
95
|
+
<a-row type="flex" :justify="btnPlace" :style="{paddingLeft: '16px',paddingRight: '16px'}">
|
|
96
|
+
<slot name="footer" :loading="loading">
|
|
97
|
+
<a-button v-if="showSubmitBtn" :loading="loading" type="primary" @click="onSubmit()">{{ btnName }}</a-button>
|
|
98
|
+
</slot>
|
|
97
99
|
</a-row>
|
|
98
100
|
</a-form-model>
|
|
99
101
|
</div>
|
|
@@ -153,8 +155,14 @@ export default {
|
|
|
153
155
|
modifyModelData: {},
|
|
154
156
|
// 当前环境
|
|
155
157
|
env: 'prod',
|
|
158
|
+
// 表单主键
|
|
159
|
+
primaryKey: null,
|
|
156
160
|
// 表单模式 horizontal | vertical | inline
|
|
157
|
-
layout: 'horizontal'
|
|
161
|
+
layout: 'horizontal',
|
|
162
|
+
// 提交按钮名称
|
|
163
|
+
btnName: '提交',
|
|
164
|
+
// 提交按钮位置 start / center / end
|
|
165
|
+
btnPlace: 'center'
|
|
158
166
|
}
|
|
159
167
|
},
|
|
160
168
|
computed: {
|
|
@@ -236,9 +244,9 @@ export default {
|
|
|
236
244
|
init (params) {
|
|
237
245
|
const {
|
|
238
246
|
configName, configContent, formItems, formJson, viewMode, isHandleFormKey, isKeyHandle = true,
|
|
239
|
-
showSubmitBtn = true, serviceName,
|
|
247
|
+
showSubmitBtn = true, serviceName, primaryKey,
|
|
240
248
|
modifyModelData = {}, businessType, title, fixedAddForm = {}, getDataParams = {},
|
|
241
|
-
simpleFormJsonData = {}, env = 'prod', layout, xAddFormLayout = 'horizontal'
|
|
249
|
+
simpleFormJsonData = {}, env = 'prod', layout, xAddFormLayout = 'horizontal', btnName = '提交', btnPlace = 'center'
|
|
242
250
|
} = params
|
|
243
251
|
this.loaded = false
|
|
244
252
|
// 兼容需要省略 传递 layout: res.xAddFormLayout 可以使用 ...res 展开运算符 直接转递
|
|
@@ -259,12 +267,15 @@ export default {
|
|
|
259
267
|
this.formItems = this.getFromItem(formItems, formJson)
|
|
260
268
|
this.viewMode = viewMode
|
|
261
269
|
this.showSubmitBtn = showSubmitBtn
|
|
270
|
+
this.primaryKey = primaryKey
|
|
262
271
|
this.serviceName = serviceName
|
|
263
272
|
this.businessType = businessType
|
|
264
273
|
this.title = title
|
|
265
274
|
this.getDataParams = getDataParams
|
|
266
275
|
this.simpleFormJsonData = simpleFormJsonData
|
|
267
276
|
this.env = env
|
|
277
|
+
this.btnName = btnName
|
|
278
|
+
this.btnPlace = btnPlace
|
|
268
279
|
// 如果 fixedAddForm 有 selected_id 值,并且设置了处理表单key值,则多给 selected_id 加前缀 避免处理错误
|
|
269
280
|
if (fixedAddForm.selected_id && this.isHandleFormKey) {
|
|
270
281
|
fixedAddForm._selected_id = fixedAddForm.selected_id
|
|
@@ -859,7 +870,16 @@ export default {
|
|
|
859
870
|
if (this.childFormData.length > 0) {
|
|
860
871
|
for (const item of this.childFormData) {
|
|
861
872
|
const child = this.$refs[item.model]
|
|
862
|
-
|
|
873
|
+
// 有主键,且主键有值,添加主键条件
|
|
874
|
+
if (this.primaryKey && this.form[this.primaryKey]) {
|
|
875
|
+
const foreignKey = item.foreignKey
|
|
876
|
+
if (!child.fixedQueryForm) {
|
|
877
|
+
child.fixedQueryForm = { [foreignKey]: this.form[this.primaryKey] }
|
|
878
|
+
} else {
|
|
879
|
+
Object.assign(child.fixedQueryForm, { [foreignKey]: this.form[this.primaryKey] })
|
|
880
|
+
}
|
|
881
|
+
child.refreshTable()
|
|
882
|
+
}
|
|
863
883
|
}
|
|
864
884
|
}
|
|
865
885
|
},
|
|
@@ -558,12 +558,14 @@ export default {
|
|
|
558
558
|
}
|
|
559
559
|
param = Object.assign(param, await runLogic(res.paramLogicName, selectedId, cell.serviceName))
|
|
560
560
|
}
|
|
561
|
+
console.info('给表单赋值', res)
|
|
561
562
|
this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
|
|
562
563
|
serviceName: cell.serviceName,
|
|
563
564
|
formItems: res.formJson,
|
|
564
565
|
showSubmitBtn: !this.isInAModal,
|
|
565
566
|
businessType: param.businessType || '新增',
|
|
566
567
|
layout: res.xAddFormLayout,
|
|
568
|
+
primaryKey: res.primaryKey,
|
|
567
569
|
...res,
|
|
568
570
|
fixedAddForm: param,
|
|
569
571
|
modifyModelData: {
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
this.inputData = ''
|
|
16
16
|
this.audioChunks = []
|
|
17
17
|
|
|
18
|
-
const url = 'ws://192.168.50.67:
|
|
18
|
+
const url = 'ws://192.168.50.67:30288/websocket/bash' // WebSocket地址
|
|
19
19
|
this.setupWebSocket(url)
|
|
20
20
|
|
|
21
21
|
// 等待 WebSocket 连接成功
|
|
@@ -199,7 +199,27 @@ export default {
|
|
|
199
199
|
},
|
|
200
200
|
|
|
201
201
|
getRecordingData () {
|
|
202
|
-
return
|
|
202
|
+
return new Promise((resolve, reject) => {
|
|
203
|
+
if (!this.ws) {
|
|
204
|
+
// 如果 WebSocket 未初始化,直接拒绝
|
|
205
|
+
reject(this.inputData)
|
|
206
|
+
return
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// 保存原有的 onclose 处理逻辑
|
|
210
|
+
const originalOnClose = this.ws.onclose
|
|
211
|
+
|
|
212
|
+
// 新增的 onclose 逻辑
|
|
213
|
+
this.ws.onclose = (event) => {
|
|
214
|
+
// 触发原有的 onclose 回调
|
|
215
|
+
if (typeof originalOnClose === 'function') {
|
|
216
|
+
originalOnClose(event)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// 返回数据
|
|
220
|
+
resolve(this.inputData)
|
|
221
|
+
}
|
|
222
|
+
})
|
|
203
223
|
},
|
|
204
224
|
|
|
205
225
|
resRecordingData () {
|