From 3c4fee1db116c11d4f04727cfe076d7c94daeaf2 Mon Sep 17 00:00:00 2001 From: yanzhaofeige <yanzhaofeige@qq.com> Date: Mon, 30 Sep 2024 12:10:57 +0800 Subject: [PATCH] init --- cpzidc-ui/src/views/tool/gen/createTable.vue | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/cpzidc-ui/src/views/tool/gen/createTable.vue b/cpzidc-ui/src/views/tool/gen/createTable.vue new file mode 100644 index 0000000..f914b5d --- /dev/null +++ b/cpzidc-ui/src/views/tool/gen/createTable.vue @@ -0,0 +1,45 @@ +<template> + <!-- 创建表 --> + <el-dialog title="创建表" :visible.sync="visible" width="800px" top="5vh" append-to-body> + <span>创建表语句(支持多个建表语句):</span> + <el-input type="textarea" :rows="10" placeholder="请输入文本" v-model="content"></el-input> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="handleCreateTable">确 定</el-button> + <el-button @click="visible = false">取 消</el-button> + </div> + </el-dialog> +</template> + +<script> +import { createTable } from "@/api/tool/gen"; +export default { + data() { + return { + // 遮罩层 + visible: false, + // 文本内容 + content: "" + }; + }, + methods: { + // 显示弹框 + show() { + this.visible = true; + }, + /** 创建按钮操作 */ + handleCreateTable() { + if (this.content === "") { + this.$modal.msgError("请输入建表语句"); + return; + } + createTable({ sql: this.content }).then(res => { + this.$modal.msgSuccess(res.msg); + if (res.code === 200) { + this.visible = false; + this.$emit("ok"); + } + }); + } + } +}; +</script> -- Gitblit v1.9.3