hookehuyr

URL中可能带扩展字段提交表单

<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-02-16 10:18:37
* @LastEditTime: 2023-02-22 10:56:40
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
......@@ -148,6 +148,10 @@ const postData = ref({});
// 编辑模式不能提交操作
const model = $route.query.model;
// 模仿金数据的扩展参数
const x_field_1 = $route.query.x_field_1 ? $route.query.x_field_1 : null;
// 周期ID标识
const x_cycle = $route.query.x_cycle ? $route.query.x_cycle : null;
// 格式化表单数据结构
const formatData = (data) => {
......@@ -456,7 +460,9 @@ const preValidData = (values) => {
const onSubmit = async (values) => {
// 表单数据处理
postData.value = preValidData(values)
postData.value = preValidData(values);
// 合并扩展字段
postData.value = { ...postData.value, x_field_1, x_cycle };
// 检查非表单输入项
if (validOther().status) {
// 编辑模式不能提交数据
......