!64 版本升级
* Merge branch 'dev' of gitee.com:JavaLionLi/plus-ui into ts * 升级依赖 * !61 fix: 删除重复环境变量ElUploadInstance * fix: 删除重复环境变量ElUploadInstance
This commit is contained in:
@ -3,27 +3,27 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="表名称" prop="tableName">
|
||||
<el-input placeholder="请输入仓库名称" v-model="infoForm.tableName" />
|
||||
<el-input v-model="infoForm.tableName" placeholder="请输入仓库名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="表描述" prop="tableComment">
|
||||
<el-input placeholder="请输入" v-model="infoForm.tableComment" />
|
||||
<el-input v-model="infoForm.tableComment" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实体类名称" prop="className">
|
||||
<el-input placeholder="请输入" v-model="infoForm.className" />
|
||||
<el-input v-model="infoForm.className" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="作者" prop="functionAuthor">
|
||||
<el-input placeholder="请输入" v-model="infoForm.functionAuthor" />
|
||||
<el-input v-model="infoForm.functionAuthor" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" :rows="3" v-model="infoForm.remark"></el-input>
|
||||
<el-input v-model="infoForm.remark" type="textarea" :rows="3"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -31,19 +31,19 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { propTypes } from "@/utils/propTypes";
|
||||
import { propTypes } from '@/utils/propTypes';
|
||||
|
||||
const prop = defineProps({
|
||||
info: propTypes.any.def({})
|
||||
});
|
||||
|
||||
const infoForm = computed(() => prop.info)
|
||||
const infoForm = computed(() => prop.info);
|
||||
|
||||
// 表单校验
|
||||
const rules = ref({
|
||||
tableName: [{ required: true, message: "请输入表名称", trigger: "blur" }],
|
||||
tableComment: [{ required: true, message: "请输入表描述", trigger: "blur" }],
|
||||
className: [{ required: true, message: "请输入实体类名称", trigger: "blur" }],
|
||||
functionAuthor: [{ required: true, message: "请输入作者", trigger: "blur" }]
|
||||
tableName: [{ required: true, message: '请输入表名称', trigger: 'blur' }],
|
||||
tableComment: [{ required: true, message: '请输入表描述', trigger: 'blur' }],
|
||||
className: [{ required: true, message: '请输入实体类名称', trigger: 'blur' }],
|
||||
functionAuthor: [{ required: true, message: '请输入作者', trigger: 'blur' }]
|
||||
});
|
||||
</script>
|
||||
|
@ -35,22 +35,22 @@
|
||||
|
||||
<el-table-column label="插入" min-width="5%">
|
||||
<template #default="scope">
|
||||
<el-checkbox true-label="1" false-label="0" v-model="scope.row.isInsert"></el-checkbox>
|
||||
<el-checkbox v-model="scope.row.isInsert" true-label="1" false-label="0"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编辑" min-width="5%">
|
||||
<template #default="scope">
|
||||
<el-checkbox true-label="1" false-label="0" v-model="scope.row.isEdit"></el-checkbox>
|
||||
<el-checkbox v-model="scope.row.isEdit" true-label="1" false-label="0"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="列表" min-width="5%">
|
||||
<template #default="scope">
|
||||
<el-checkbox true-label="1" false-label="0" v-model="scope.row.isList"></el-checkbox>
|
||||
<el-checkbox v-model="scope.row.isList" true-label="1" false-label="0"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询" min-width="5%">
|
||||
<template #default="scope">
|
||||
<el-checkbox true-label="1" false-label="0" v-model="scope.row.isQuery"></el-checkbox>
|
||||
<el-checkbox v-model="scope.row.isQuery" true-label="1" false-label="0"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询方式" min-width="10%">
|
||||
@ -69,7 +69,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="必填" min-width="5%">
|
||||
<template #default="scope">
|
||||
<el-checkbox true-label="1" false-label="0" v-model="scope.row.isRequired"></el-checkbox>
|
||||
<el-checkbox v-model="scope.row.isRequired" true-label="1" false-label="0"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="显示类型" min-width="12%">
|
||||
@ -104,7 +104,7 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form label-width="100px">
|
||||
<div style="text-align: center;margin-left:-100px;margin-top:10px;">
|
||||
<div style="text-align: center; margin-left: -100px; margin-top: 10px">
|
||||
<el-button type="primary" @click="submitForm()">提交</el-button>
|
||||
<el-button @click="close()">返回</el-button>
|
||||
</div>
|
||||
@ -118,7 +118,7 @@ import { DbColumnVO, DbTableVO } from '@/api/tool/gen/types';
|
||||
import { optionselect as getDictOptionselect } from '@/api/system/dict/type';
|
||||
import { DictTypeVO } from '@/api/system/dict/type/types';
|
||||
import BasicInfoForm from './basicInfoForm.vue';
|
||||
import GenInfoForm from "./genInfoForm.vue";
|
||||
import GenInfoForm from './genInfoForm.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -138,8 +138,8 @@ const submitForm = () => {
|
||||
const basicForm = basicInfo.value?.$refs.basicInfoForm;
|
||||
const genForm = genInfo.value?.$refs.genInfoForm;
|
||||
|
||||
Promise.all([basicForm, genForm].map(getFormPromise)).then(async res => {
|
||||
const validateResult = res.every(item => !!item);
|
||||
Promise.all([basicForm, genForm].map(getFormPromise)).then(async (res) => {
|
||||
const validateResult = res.every((item) => !!item);
|
||||
if (validateResult) {
|
||||
const genTable: any = Object.assign({}, info.value);
|
||||
genTable.columns = columns.value;
|
||||
@ -155,24 +155,24 @@ const submitForm = () => {
|
||||
close();
|
||||
}
|
||||
} else {
|
||||
proxy?.$modal.msgError("表单校验未通过,请重新检查提交内容");
|
||||
proxy?.$modal.msgError('表单校验未通过,请重新检查提交内容');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const getFormPromise = (form: any) => {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
form.validate((res: any) => {
|
||||
resolve(res);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
const close = () => {
|
||||
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } };
|
||||
const obj = { path: '/tool/gen', query: { t: Date.now(), pageNum: route.query.pageNum } };
|
||||
proxy?.$tab.closeOpenPage(obj);
|
||||
}
|
||||
};
|
||||
|
||||
(async () => {
|
||||
const tableId = route.params && route.params.tableId as string;
|
||||
const tableId = route.params && (route.params.tableId as string);
|
||||
if (tableId) {
|
||||
// 获取表详细信息
|
||||
const res = await getGenTable(tableId);
|
||||
|
@ -95,7 +95,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" v-if="infoForm.genType == '1'">
|
||||
<el-col v-if="infoForm.genType == '1'" :span="24">
|
||||
<el-form-item prop="genPath">
|
||||
<template #label>
|
||||
自定义路径
|
||||
@ -223,7 +223,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listMenu } from '@/api/system/menu';
|
||||
import { propTypes } from "@/utils/propTypes";
|
||||
import { propTypes } from '@/utils/propTypes';
|
||||
|
||||
interface MenuOptionsType {
|
||||
menuId: number | string;
|
||||
@ -246,21 +246,21 @@ const table = computed(() => props.tables);
|
||||
|
||||
// 表单校验
|
||||
const rules = ref({
|
||||
tplCategory: [{ required: true, message: "请选择生成模板", trigger: "blur" }],
|
||||
packageName: [{ required: true, message: "请输入生成包路径", trigger: "blur" }],
|
||||
moduleName: [{ required: true, message: "请输入生成模块名", trigger: "blur" }],
|
||||
businessName: [{ required: true, message: "请输入生成业务名", trigger: "blur" }],
|
||||
functionName: [{ required: true, message: "请输入生成功能名", trigger: "blur" }]
|
||||
tplCategory: [{ required: true, message: '请选择生成模板', trigger: 'blur' }],
|
||||
packageName: [{ required: true, message: '请输入生成包路径', trigger: 'blur' }],
|
||||
moduleName: [{ required: true, message: '请输入生成模块名', trigger: 'blur' }],
|
||||
businessName: [{ required: true, message: '请输入生成业务名', trigger: 'blur' }],
|
||||
functionName: [{ required: true, message: '请输入生成功能名', trigger: 'blur' }]
|
||||
});
|
||||
const subSelectChange = () => {
|
||||
infoForm.value.subTableFkName = "";
|
||||
}
|
||||
infoForm.value.subTableFkName = '';
|
||||
};
|
||||
const tplSelectChange = (value: string) => {
|
||||
if (value !== "sub") {
|
||||
infoForm.value.subTableName = "";
|
||||
infoForm.value.subTableFkName = "";
|
||||
if (value !== 'sub') {
|
||||
infoForm.value.subTableName = '';
|
||||
infoForm.value.subTableFkName = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
const setSubTableColumns = (value: string) => {
|
||||
table.value.forEach((item: any) => {
|
||||
const name = item.tableName;
|
||||
@ -268,24 +268,27 @@ const setSubTableColumns = (value: string) => {
|
||||
subColumns.value = item.columns;
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 查询菜单下拉树结构 */
|
||||
const getMenuTreeselect = async () => {
|
||||
const res = await listMenu();
|
||||
res.data.forEach(m => m.menuId = m.menuId.toString());
|
||||
const data = proxy?.handleTree<MenuOptionsType>(res.data, "menuId");
|
||||
res.data.forEach((m) => (m.menuId = m.menuId.toString()));
|
||||
const data = proxy?.handleTree<MenuOptionsType>(res.data, 'menuId');
|
||||
if (data) {
|
||||
menuOptions.value = data
|
||||
menuOptions.value = data;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
watch(() => props.info.subTableName, val => {
|
||||
setSubTableColumns(val);
|
||||
});
|
||||
watch(
|
||||
() => props.info.subTableName,
|
||||
(val) => {
|
||||
setSubTableColumns(val);
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
getMenuTreeselect();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<!-- 导入表 -->
|
||||
<el-dialog title="导入表" v-model="visible" width="1100px" top="5vh" append-to-body>
|
||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true">
|
||||
<el-dialog v-model="visible" title="导入表" width="1100px" top="5vh" append-to-body>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="数据源" prop="dataName">
|
||||
<el-select v-model="queryParams.dataName" filterable placeholder="请选择/输入数据源名称" style="width: 200px">
|
||||
<el-option v-for="item in dataNameList" :key="item" :label="item" :value="item"> </el-option>
|
||||
@ -19,14 +19,14 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-table @row-click="clickRow" ref="tableRef" :data="dbTableList" @selection-change="handleSelectionChange" height="260px">
|
||||
<el-table ref="tableRef" :data="dbTableList" height="260px" @row-click="clickRow" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column prop="tableName" label="表名称" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="tableComment" label="表描述" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间"></el-table-column>
|
||||
<el-table-column prop="updateTime" label="更新时间"></el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||
</el-row>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@ -59,7 +59,7 @@ const queryParams = reactive<DbTableQuery>({
|
||||
});
|
||||
const dataNameList = ref<Array<string>>([]);
|
||||
|
||||
const emit = defineEmits(["ok"]);
|
||||
const emit = defineEmits(['ok']);
|
||||
|
||||
/** 查询参数列表 */
|
||||
const show = (dataName: string) => {
|
||||
@ -71,53 +71,53 @@ const show = (dataName: string) => {
|
||||
}
|
||||
getList();
|
||||
visible.value = true;
|
||||
}
|
||||
};
|
||||
/** 单击选择行 */
|
||||
const clickRow = (row: DbTableVO) => {
|
||||
// ele bug
|
||||
tableRef.value?.toggleRowSelection(row, false);
|
||||
}
|
||||
};
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DbTableVO[]) => {
|
||||
tables.value = selection.map(item => item.tableName);
|
||||
}
|
||||
tables.value = selection.map((item) => item.tableName);
|
||||
};
|
||||
/** 查询表数据 */
|
||||
const getList = async () => {
|
||||
const res = await listDbTable(queryParams);
|
||||
dbTableList.value = res.rows;
|
||||
total.value = res.total;
|
||||
}
|
||||
};
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
};
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
};
|
||||
/** 导入按钮操作 */
|
||||
const handleImportTable = async () => {
|
||||
const tableNames = tables.value.join(",");
|
||||
if (tableNames == "") {
|
||||
proxy?.$modal.msgError("请选择要导入的表");
|
||||
const tableNames = tables.value.join(',');
|
||||
if (tableNames == '') {
|
||||
proxy?.$modal.msgError('请选择要导入的表');
|
||||
return;
|
||||
}
|
||||
const res = await importTable({ tables: tableNames, dataName: queryParams.dataName });
|
||||
proxy?.$modal.msgSuccess(res.msg);
|
||||
if (res.code === 200) {
|
||||
visible.value = false;
|
||||
emit("ok");
|
||||
emit('ok');
|
||||
}
|
||||
}
|
||||
};
|
||||
/** 查询多数据源名称 */
|
||||
const getDataNameList = async () => {
|
||||
const res = await getDataNames()
|
||||
const res = await getDataNames();
|
||||
dataNameList.value = res.data;
|
||||
}
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
show
|
||||
});
|
||||
</script>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div class="mb-[10px]" v-show="showSearch">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="68px">
|
||||
<el-form-item label="数据源" prop="dataName">
|
||||
<el-select v-model="queryParams.dataName" filterable clearable placeholder="请选择/输入数据源名称" style="width: 200px">
|
||||
<el-option key="" label="全部" value="" />
|
||||
@ -39,20 +39,20 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Download" @click="handleGenTable()" v-hasPermi="['tool:gen:code']">生成</el-button>
|
||||
<el-button v-hasPermi="['tool:gen:code']" type="primary" plain icon="Download" @click="handleGenTable()">生成</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="openImportTable" v-hasPermi="['tool:gen:import']">导入</el-button>
|
||||
<el-button v-hasPermi="['tool:gen:import']" type="info" plain icon="Upload" @click="openImportTable">导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleEditTable()" v-hasPermi="['tool:gen:edit']">修改</el-button>
|
||||
<el-button v-hasPermi="['tool:gen:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleEditTable()">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['tool:gen:remove']">
|
||||
<el-button v-hasPermi="['tool:gen:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
@ -72,28 +72,28 @@
|
||||
<el-table-column label="操作" align="center" width="330" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="预览" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handlePreview(scope.row)" v-hasPermi="['tool:gen:preview']"></el-button>
|
||||
<el-button v-hasPermi="['tool:gen:preview']" link type="primary" icon="View" @click="handlePreview(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleEditTable(scope.row)" v-hasPermi="['tool:gen:edit']"></el-button>
|
||||
<el-button v-hasPermi="['tool:gen:edit']" link type="primary" icon="Edit" @click="handleEditTable(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['tool:gen:remove']"></el-button>
|
||||
<el-button v-hasPermi="['tool:gen:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="同步" placement="top">
|
||||
<el-button link type="primary" icon="Refresh" @click="handleSynchDb(scope.row)" v-hasPermi="['tool:gen:edit']"></el-button>
|
||||
<el-button v-hasPermi="['tool:gen:edit']" link type="primary" icon="Refresh" @click="handleSynchDb(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="生成代码" placement="top">
|
||||
<el-button link type="primary" icon="Download" @click="handleGenTable(scope.row)" v-hasPermi="['tool:gen:code']"></el-button>
|
||||
<el-button v-hasPermi="['tool:gen:code']" link type="primary" icon="Download" @click="handleGenTable(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 预览界面 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="80%" top="5vh" append-to-body class="scrollbar">
|
||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="80%" top="5vh" append-to-body class="scrollbar">
|
||||
<el-tabs v-model="preview.activeName">
|
||||
<el-tab-pane
|
||||
v-for="(value, key) in preview.data"
|
||||
@ -101,7 +101,7 @@
|
||||
:name="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))"
|
||||
:key="value"
|
||||
>
|
||||
<el-link :underline="false" icon="DocumentCopy" v-copyText="value" v-copyText:callback="copyTextSuccess" style="float:right">
|
||||
<el-link v-copyText="value" v-copyText:callback="copyTextSuccess" :underline="false" icon="DocumentCopy" style="float: right">
|
||||
复制
|
||||
</el-link>
|
||||
<pre>{{ value }}</pre>
|
||||
@ -129,7 +129,7 @@ const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const uniqueId = ref("");
|
||||
const uniqueId = ref('');
|
||||
const dataNameList = ref<Array<string>>([]);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
@ -140,13 +140,13 @@ const queryParams = ref<TableQuery>({
|
||||
pageSize: 10,
|
||||
tableName: '',
|
||||
tableComment: '',
|
||||
dataName: ""
|
||||
})
|
||||
dataName: ''
|
||||
});
|
||||
|
||||
const preview = ref<any>({
|
||||
data: {},
|
||||
activeName: 'domain.java'
|
||||
})
|
||||
});
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '代码预览'
|
||||
@ -161,13 +161,13 @@ onActivated(() => {
|
||||
queryFormRef.value?.resetFields();
|
||||
getList();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/** 查询多数据源名称 */
|
||||
const getDataNameList = async () => {
|
||||
const res = await getDataNames()
|
||||
const res = await getDataNames();
|
||||
dataNameList.value = res.data;
|
||||
}
|
||||
};
|
||||
|
||||
/** 查询表集合 */
|
||||
const getList = async () => {
|
||||
@ -176,65 +176,65 @@ const getList = async () => {
|
||||
tableList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
};
|
||||
/** 生成代码操作 */
|
||||
const handleGenTable = async (row?: TableVO) => {
|
||||
const tbIds = row?.tableId || ids.value;
|
||||
if (tbIds == "") {
|
||||
if (tbIds == '') {
|
||||
proxy?.$modal.msgError('请选择要生成的数据');
|
||||
return;
|
||||
}
|
||||
if (row?.genType === "1") {
|
||||
if (row?.genType === '1') {
|
||||
await genCode(row.tableId);
|
||||
proxy?.$modal.msgSuccess('成功生成到自定义路径:' + row.genPath);
|
||||
} else {
|
||||
proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
|
||||
}
|
||||
}
|
||||
};
|
||||
/** 同步数据库操作 */
|
||||
const handleSynchDb = async (row: TableVO) => {
|
||||
const tableId = row.tableId;
|
||||
await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?');
|
||||
await synchDb(tableId);
|
||||
proxy?.$modal.msgSuccess('同步成功');
|
||||
}
|
||||
};
|
||||
/** 打开导入表弹窗 */
|
||||
const openImportTable = () => {
|
||||
importRef.value?.show(queryParams.value.dataName);
|
||||
}
|
||||
};
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
dateRange.value = ['', ''];
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
};
|
||||
/** 预览按钮 */
|
||||
const handlePreview = async (row: TableVO) => {
|
||||
const res = await previewTable(row.tableId);
|
||||
preview.value.data = res.data;
|
||||
dialog.visible = true;
|
||||
preview.value.activeName = 'domain.java';
|
||||
}
|
||||
};
|
||||
/** 复制代码成功 */
|
||||
const copyTextSuccess = () => {
|
||||
proxy?.$modal.msgSuccess('复制成功');
|
||||
}
|
||||
};
|
||||
// 多选框选中数据
|
||||
const handleSelectionChange = (selection: TableVO[]) => {
|
||||
ids.value = selection.map(item => item.tableId);
|
||||
ids.value = selection.map((item) => item.tableId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
};
|
||||
/** 修改按钮操作 */
|
||||
const handleEditTable = (row?: TableVO) => {
|
||||
const tableId = row?.tableId || ids.value[0];
|
||||
router.push({ path: '/tool/gen-edit/index/' + tableId, query: { pageNum: queryParams.value.pageNum } });
|
||||
}
|
||||
};
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: TableVO) => {
|
||||
const tableIds = row?.tableId || ids.value;
|
||||
@ -242,10 +242,10 @@ const handleDelete = async (row?: TableVO) => {
|
||||
await delTable(tableIds);
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getDataNameList();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user