浏览代码

代码生成-完整版

sr 4 年之前
父节点
当前提交
9953fbc4f0
共有 1 个文件被更改,包括 28 次插入20 次删除
  1. 28 20
      ruoyi-ui/src/views/tool/gen/editTable.vue

+ 28 - 20
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -1,24 +1,15 @@
 <template>
   <el-card>
-    <el-row type="flex" v-if="activeName=='basic' || activeName=='cloum'" justify="space-between" style="margin: 10px 0;">
+    <el-row type="flex" justify="space-between" style="margin: 10px 0;">
       <el-col :span="1.5" style="display: flex; align-items: center;">
         <el-form label-width="100px" style="display: flex; align-items: center;">
           <el-form-item style="text-align: center;margin-left:-100px;margin-top:0; margin-bottom: 0;">
-            <el-button type="primary" @click="submitForm()">保存</el-button>
+            <el-button type="primary" v-if="activeName=='basic' || activeName=='cloum'" @click="submitForm()">保存</el-button>
             <el-button @click="close()">返回</el-button>
           </el-form-item>
         </el-form>
       </el-col>
-      <el-row type="flex" v-if="activeName=='cloum'" :gutter="10" justify="end">
-        <el-col :span="1.5" style="display: flex; align-items: center;">
-          <el-button type="warning" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
-        </el-col>
-        <el-col :span="1.5" style="display: flex; align-items: center;">
-          <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
-            v-hasPermi="['system:post:remove']">删除</el-button>
-        </el-col>
-        <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
-      </el-row>
+
     </el-row>
 
     <el-tabs v-model="activeName">
@@ -26,6 +17,16 @@
         <basic-info-form ref="basicInfo" :info="info" />
       </el-tab-pane>
       <el-tab-pane label="字段信息" name="cloum">
+        <el-row type="flex" style="margin-bottom: 20px;" v-if="activeName=='cloum'" :gutter="10" justify="end">
+          <el-col :span="1.5" style="display: flex; align-items: center;">
+            <el-button style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;" type="warning" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
+          </el-col>
+          <el-col :span="1.5" style="display: flex; align-items: center;">
+            <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
+              v-hasPermi="['system:post:remove']" style="background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;">删除</el-button>
+          </el-col>
+          <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
+        </el-row>
         <el-table ref="dragTable" @row-dblclick="dbSelectedZd" :data="cloumns" row-key="columnId" :max-height="tableHeight" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="55" align="center" />
           <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" />
@@ -298,11 +299,10 @@
         </el-row>
         <el-form>
           <el-form-item label="创建语句:" style="margin-top: 20px;">
-            <div class="resizeNone" v-html="tableSqlData.createSql" style="resize: none;width: 600px;" type="textarea"></div>
-
+            <el-input class="resizeNone" v-model="tableSqlData.createSql" type="textarea"/>
           </el-form-item>
           <el-form-item label="修改日志:">
-            <div class="resizeNone" v-html="tableSqlData.createLog" style="resize: none;width: 600px;" type="textarea"></div>
+            <el-input class="resizeNone" v-model="tableSqlData.createLog" type="textarea"/>
           </el-form-item>
         </el-form>
       </el-tab-pane>
@@ -595,13 +595,20 @@
         });
       },
       sxCreaBtn() {
+        const tableId = this.$route.params && this.$route.params.tableId
         getReload({
-          tableId: this.$route.params && this.$route.params.tableId,
+          tableId,
           createSql: this.tableSqlData.createSql,
           createLog: this.tableSqlData.createLog,
           id: this.tableSqlData.id
         }).then(res => {
           this.msgSuccess('刷新成功')
+          //查询数据库sql
+          tableSql(tableId).then(res => {
+            if(res.data){
+              this.tableSqlData = res.data
+            }
+          })
         })
       },
       zxCreaBtn() {
@@ -830,10 +837,11 @@
     height: 35px;
   }
   .resizeNone{
-     width: 70vw;
-     margin-left: 80px;
-     padding: 8px 10px;
-     border: 1px solid #CDCDCD;
+     width: 60vw;
      border-radius: 3px;
+     .el-textarea__inner{ //el_input中的隐藏属性
+              resize: none;  //主要是这个样式
+              height: 200px;
+          }
    }
 </style>