hookehuyr

编辑模式不能提交数据

<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-08 14:57:55
* @LastEditTime: 2022-12-08 17:54:44
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
......@@ -44,10 +44,7 @@
/>
</van-cell-group>
<div v-if="formData.length" style="margin: 16px">
<van-button v-if="model === 'edit'" round block type="primary">
{{ PCommit.text ? PCommit.text : '提交' }}
</van-button>
<van-button v-else round block type="primary" native-type="submit">
<van-button round block type="primary" native-type="submit">
{{ PCommit.text ? PCommit.text : '提交' }}
</van-button>
</div>
......@@ -407,6 +404,8 @@ const onSubmit = async (values) => {
postData.value = _.assign(postData.value, rest_data);
// 检查非表单输入项
if (validOther().status) {
// 编辑模式不能提交数据
if (model === 'edit') return false;
// 通过验证
const result = await addFormDataAPI({
form_code: $route.query.code,
......