| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="width: 100%;display: flex;flex-direction: row;justify-content: end;margin-top: 16px"> |
| | | <el-button @click="generatorCode()" type="primary">生成</el-button> |
| | | <el-button :loading="loading" @click="generatorCode()" type="primary">生成</el-button> |
| | | </div> |
| | | </Dialog> |
| | | </template> |
| | |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | // 代码生成loading |
| | | const loading = ref(false) |
| | | /** 提交表单 */ |
| | | const generatorCode = async () => { |
| | | const data = await MpkApi.generatorCode(formData.value) |
| | | download.zip(data, formData.value.zipFileName) |
| | | dialogVisible.value = false |
| | | try { |
| | | loading.value = true |
| | | const data = await MpkApi.generatorCode(formData.value) |
| | | download.zip(data, formData.value.zipFileName) |
| | | }finally { |
| | | loading.value = false |
| | | dialogVisible.value = false |
| | | } |
| | | |
| | | } |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |