houzhongjian
2024-07-11 759b1c71011abd6b58c37d2566f3f3c208c2f1b2
提交 | 用户 | 时间
759b1c 1 <template>
H 2   <el-form ref="basicInfoForm" :model="info" :rules="rules" label-width="150px">
3     <el-row>
4       <el-col :span="12">
5         <el-form-item label="表名称" prop="tableName">
6           <el-input placeholder="请输入仓库名称" v-model="info.tableName" />
7         </el-form-item>
8       </el-col>
9       <el-col :span="12">
10         <el-form-item label="表描述" prop="tableComment">
11           <el-input placeholder="请输入" v-model="info.tableComment" />
12         </el-form-item>
13       </el-col>
14
15       <el-col :span="12">
16         <el-form-item prop="className">
17           <span slot="label">
18             实体类名称
19             <el-tooltip content="默认去除表名的前缀。如果存在重复,则需要手动添加前缀,避免 MyBatis 报 Alias 重复的问题。" placement="top">
20               <i class="el-icon-question"></i>
21             </el-tooltip>
22           </span>
23           <el-input placeholder="请输入" v-model="info.className" />
24         </el-form-item>
25       </el-col>
26       <el-col :span="12">
27         <el-form-item label="作者" prop="author">
28           <el-input placeholder="请输入" v-model="info.author" />
29         </el-form-item>
30       </el-col>
31       <el-col :span="24">
32         <el-form-item label="备注" prop="remark">
33           <el-input type="textarea" :rows="3" v-model="info.remark"></el-input>
34         </el-form-item>
35       </el-col>
36     </el-row>
37   </el-form>
38 </template>
39 <script>
40 export default {
41   name: "BasicInfoForm",
42   props: {
43     info: {
44       type: Object,
45       default: null
46     }
47   },
48   data() {
49     return {
50       rules: {
51         tableName: [
52           { required: true, message: "请输入表名称", trigger: "blur" }
53         ],
54         tableComment: [
55           { required: true, message: "请输入表描述", trigger: "blur" }
56         ],
57         className: [
58           { required: true, message: "请输入实体类名称", trigger: "blur" }
59         ],
60         author: [
61           { required: true, message: "请输入作者", trigger: "blur" }
62         ]
63       }
64     };
65   }
66 };
67 </script>