Commit c5165051 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化应用添加字段交互

parent c45a113e
...@@ -160,7 +160,9 @@ ...@@ -160,7 +160,9 @@
</a-form-model> </a-form-model>
<div slot="footer"> <div slot="footer">
<a-button @click="handleReset">重置</a-button> <a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button> <a-button type="primary" @click="handleOk" :loading="loading"
>确定</a-button
>
</div> </div>
</a-modal> </a-modal>
</div> </div>
...@@ -230,6 +232,7 @@ export default { ...@@ -230,6 +232,7 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
fieldTypeItem, fieldTypeItem,
fieldType: [ fieldType: [
{ {
...@@ -317,6 +320,7 @@ export default { ...@@ -317,6 +320,7 @@ export default {
handleOk() { handleOk() {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
this.loading = true;
let bol = this.templeteList.some((v) => v.fieldType == "table"); let bol = this.templeteList.some((v) => v.fieldType == "table");
if (bol && !this.form.id && this.form.fieldType == "table") { if (bol && !this.form.id && this.form.fieldType == "table") {
this.$message.warn("只能存在一个表格"); this.$message.warn("只能存在一个表格");
...@@ -343,6 +347,7 @@ export default { ...@@ -343,6 +347,7 @@ export default {
? JSON.stringify(apiParamsObj) ? JSON.stringify(apiParamsObj)
: "", : "",
}); });
this.loading = false;
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment