|
@@ -11,15 +11,17 @@
|
|
|
append-to-body
|
|
|
>
|
|
|
<component
|
|
|
+ ref="ElementPropEditComp"
|
|
|
:is="curEditComponent"
|
|
|
:instance="curElement"
|
|
|
- @modified="modified"
|
|
|
:key="curElement.id"
|
|
|
- ref="CompositionDialog"
|
|
|
+ @modified="modified"
|
|
|
></component>
|
|
|
|
|
|
<div slot="footer">
|
|
|
- <el-button type="primary" @click="submit">确认</el-button>
|
|
|
+ <el-button type="primary" :disabled="loading" @click="submit"
|
|
|
+ >确认</el-button
|
|
|
+ >
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -52,7 +54,7 @@ export default {
|
|
|
EditGrids
|
|
|
},
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return { loading: false };
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState("card", ["curElement", "openElementEditDialog"]),
|
|
@@ -83,7 +85,12 @@ export default {
|
|
|
this.setOpenElementEditDialog(true);
|
|
|
},
|
|
|
submit() {
|
|
|
- this.$refs.CompositionDialog.submit();
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ this.$refs.ElementPropEditComp.submit();
|
|
|
},
|
|
|
modified(element) {
|
|
|
// 编辑试题
|