vue2-client 1.18.52 → 1.18.53
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
|
@@ -516,19 +516,6 @@ export default {
|
|
|
516
516
|
},
|
|
517
517
|
setForm(obj) {
|
|
518
518
|
this.form = Object.assign(this.form, obj)
|
|
519
|
-
},
|
|
520
|
-
/**
|
|
521
|
-
* 主动触发表单提交
|
|
522
|
-
* 用于 queryTable 等场景,确保走相同的数据处理流程
|
|
523
|
-
* @param {Object} conditionParams - 额外的查询条件参数
|
|
524
|
-
*/
|
|
525
|
-
submitForm(conditionParams = {}) {
|
|
526
|
-
// 将外部参数合并到表单中
|
|
527
|
-
if (Object.keys(conditionParams).length > 0) {
|
|
528
|
-
this.form = Object.assign({}, this.form, conditionParams)
|
|
529
|
-
}
|
|
530
|
-
// 调用现有的 onSubmit 方法,触发 emit
|
|
531
|
-
this.onSubmit()
|
|
532
519
|
}
|
|
533
520
|
},
|
|
534
521
|
mounted() {
|
|
@@ -1032,10 +1032,7 @@ export default {
|
|
|
1032
1032
|
if (this.tableShowMode === 'popup') {
|
|
1033
1033
|
this.formQueryLoading = true
|
|
1034
1034
|
}
|
|
1035
|
-
|
|
1036
|
-
// 这会触发 emit 'onSubmit',然后走现有的 onSearchSubmit 逻辑
|
|
1037
|
-
// 最终通过 setQueryForm → refresh → loadData 进行数据处理
|
|
1038
|
-
this.$refs.xForm.submitForm(conditionParams)
|
|
1035
|
+
this.$refs.xTable.queryTable(conditionParams)
|
|
1039
1036
|
},
|
|
1040
1037
|
/**
|
|
1041
1038
|
* 向外暴露 resetForm 函数
|
|
@@ -1220,6 +1220,18 @@ export default {
|
|
|
1220
1220
|
// 如果要实质修改 form 需要在 x-form 中赋值
|
|
1221
1221
|
const _from = JSON.parse(JSON.stringify(this.form))
|
|
1222
1222
|
this.form = Object.assign(_from, conditionParams)
|
|
1223
|
+
for (const key of Object.keys(this.form)) {
|
|
1224
|
+
if (this.form[key] === null || this.form[key] === '') {
|
|
1225
|
+
this.form[key] = undefined
|
|
1226
|
+
}
|
|
1227
|
+
// 树形选择框重置后会重置为[undefined],查询时为[null]
|
|
1228
|
+
if (
|
|
1229
|
+
Array.isArray(this.form[key]) &&
|
|
1230
|
+
(this.form[key].length === 0 || this.form[key][0] === null || this.form[key][0] === undefined)
|
|
1231
|
+
) {
|
|
1232
|
+
this.form[key] = undefined
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1223
1235
|
await this.refresh(true)
|
|
1224
1236
|
this.form = _from
|
|
1225
1237
|
},
|