优化代码生成
This commit is contained in:
parent
9c5156c8ad
commit
1ec0d42e33
@ -190,6 +190,7 @@ function submitForm() {
|
||||
checkedBtn: info.value.checkedBtn,
|
||||
permissionPrefix: info.value.permissionPrefix,
|
||||
colNum: info.value.colNum,
|
||||
generateRepo: info.value.generateRepo
|
||||
}
|
||||
console.log('genForm', genTable)
|
||||
|
||||
@ -221,7 +222,7 @@ listType({ pageSize: 100 }).then((response) => {
|
||||
function close() {
|
||||
const obj = {
|
||||
path: '/tool/gen',
|
||||
query: { t: Date.now(), pageNum: route.query.pageNum },
|
||||
query: { t: Date.now(), pageNum: route.query.pageNum }
|
||||
}
|
||||
proxy.$tab.closeOpenPage(obj)
|
||||
}
|
||||
@ -262,7 +263,7 @@ const tableSort = () => {
|
||||
nextTick(() => {
|
||||
console.log(columns.value)
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="24" v-if="info.genType == '1'">
|
||||
<el-col :lg="12" v-if="info.genType == '1'">
|
||||
<el-form-item prop="genPath">
|
||||
<template #label>
|
||||
自定义路径
|
||||
@ -146,7 +146,7 @@
|
||||
<el-input v-model="info.genPath"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-col :lg="24">
|
||||
<el-form-item prop="colNum" label="一行显示列">
|
||||
<el-radio v-model="info.colNum" :label="12">2列</el-radio>
|
||||
<el-radio v-model="info.colNum" :label="24">1列</el-radio>
|
||||
@ -173,6 +173,14 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="是否生成仓储层">
|
||||
<el-radio-group v-model="info.generateRepo">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-show="info.tplCategory == 'tree'">
|
||||
@ -288,18 +296,18 @@ const menuOptions = ref([])
|
||||
const props = defineProps({
|
||||
info: {
|
||||
type: Object,
|
||||
default: null,
|
||||
default: null
|
||||
},
|
||||
// 字表
|
||||
tables: {
|
||||
type: Array,
|
||||
default: null,
|
||||
default: null
|
||||
},
|
||||
// 列
|
||||
columns: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
default: []
|
||||
}
|
||||
})
|
||||
// 表单校验
|
||||
const rules = ref({
|
||||
@ -309,23 +317,23 @@ const rules = ref({
|
||||
required: true,
|
||||
message: '请输入生成模块名',
|
||||
trigger: 'blur',
|
||||
pattern: /^[A-Za-z]+$/,
|
||||
},
|
||||
pattern: /^[A-Za-z]+$/
|
||||
}
|
||||
],
|
||||
businessName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入生成业务名',
|
||||
trigger: 'blur',
|
||||
pattern: /^[A-Za-z]+$/,
|
||||
},
|
||||
pattern: /^[A-Za-z]+$/
|
||||
}
|
||||
],
|
||||
functionName: [{ required: true, message: '请输入生成功能名', trigger: 'blur' }],
|
||||
permissionPrefix: {
|
||||
required: true,
|
||||
message: '请输入权限前缀',
|
||||
trigger: 'blur',
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
})
|
||||
function subSelectChange(value) {
|
||||
props.info.subTableFkName = ''
|
||||
@ -366,7 +374,7 @@ watch(
|
||||
() => props.info.subTableName,
|
||||
(val) => {
|
||||
setSubTableColumns(val)
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
getMenuTreeselect()
|
||||
|
||||
@ -15,19 +15,22 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-table ref="table" @row-click="clickRow" :data="dbTableList" highlight-current-row height="300px" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
ref="table"
|
||||
@row-click="clickRow"
|
||||
:data="dbTableList"
|
||||
highlight-current-row
|
||||
height="300px"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column prop="name" label="表名" sortable="custom" width="380" />
|
||||
<el-table-column prop="description" label="表描述" />
|
||||
</el-table>
|
||||
<pagination v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" v-model:total="total" @pagination="getList" />
|
||||
|
||||
</el-row>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleImportTable">确 定</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
<el-button text @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleImportTable">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -46,10 +49,10 @@ const queryParams = reactive({
|
||||
dbName: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
tableName: undefined,
|
||||
tableName: undefined
|
||||
})
|
||||
const rules = reactive({
|
||||
dbName: [{ required: true, message: '请选择数据库名称', trigger: 'blur' }],
|
||||
dbName: [{ required: true, message: '请选择数据库名称', trigger: 'blur' }]
|
||||
})
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
@ -65,7 +68,7 @@ function clickRow(row) {
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
tables.value = selection.map((item) => item.name)
|
||||
console.log(tables.value)
|
||||
console.log(tables.value)
|
||||
}
|
||||
/** 查询表数据 */
|
||||
function getList() {
|
||||
@ -93,7 +96,7 @@ function resetQuery() {
|
||||
function handleImportTable() {
|
||||
importTable({
|
||||
tables: tables.value.join(','),
|
||||
dbName: queryParams.dbName,
|
||||
dbName: queryParams.dbName
|
||||
}).then((res) => {
|
||||
proxy.$modal.msgSuccess(res.msg)
|
||||
if (res.code === 200) {
|
||||
@ -104,6 +107,6 @@ function handleImportTable() {
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user