2510 lines
110 KiB
JavaScript
2510 lines
110 KiB
JavaScript
import { x as ElFormItem, y as ElInput, h as ElButton, w as ElForm, U as ElRow, V as ElCol, l as ElTooltip, ax as ElPopover, F as ElScrollbar, aC as ElCheckbox, al as ElTable, am as ElTableColumn, aE as magic_stick_default, u as ElEmpty, ao as vLoading, a9 as question_filled_default, T as ElCard, t as ElLink, i as ElIcon, ah as copy_document_default, v as ElDialog, aF as ElSteps, aG as ElStep, aH as ElTreeSelect, s as ElDivider, a3 as ElDescriptions, a4 as ElDescriptionsItem, q as ElTag, aI as ElSpace, m as ElDropdown, n as ElDropdownMenu, o as ElDropdownItem, aq as ElSelect, ar as ElOption, P as ElRadioGroup, Z as ElRadioButton, aJ as ElCheckboxGroup, aK as ElCheckboxButton, aL as ElTree, aM as close_default, aN as back_default, an as edit_default, aO as right_default, aP as download_default, aQ as folder_opened_default, L as ElDrawer, E as ElMessage, D as ElMessageBox } from "./element-plus.CkEW9frc.js";
|
||
import { _ as __unplugin_components_19 } from "./index.fgd49PES.js";
|
||
import { J as defineComponent, m as watch, eu as useClipboard, dZ as useRoute, X as onActivated, t as onMounted, aP as resolveDirective, S as openBlock, _ as createElementBlock, a1 as createBaseVNode, $ as createVNode, a0 as withCtx, a_ as withKeys, a6 as withDirectives, T as createBlock, a9 as createTextVNode, aw as withModifiers, H as Fragment, ay as renderList, a8 as createCommentVNode, aa as toDisplayString, o as unref, ab as vShow, a3 as normalizeClass, r as ref, ak as reactive, j as computed } from "./.pnpm.BW3P1y8f.js";
|
||
import { R } from "./codemirror.CvJAcn2d.js";
|
||
import { l as httpRequest, a as useSettingsStore, m as DictAPI, T as ThemeMode } from "./index.CMd5bD1r.js";
|
||
import { M as MenuAPI } from "./menu.uy9JHUjy.js";
|
||
import { f as formatTree } from "./common.ySZAMJjg.js";
|
||
import { M as MenuTypeEnum } from "./menu.enum.Q9hatFRE.js";
|
||
import "./_plugin-vue_export-helper.1tPrXgE0.js";
|
||
const API_PATH = "/generator/gencode";
|
||
const GencodeAPI = {
|
||
// 查询生成表数据
|
||
listTable(query) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/list`,
|
||
method: "get",
|
||
params: query
|
||
});
|
||
},
|
||
// 查询db数据库列表
|
||
listDbTable(query) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/db/list`,
|
||
method: "get",
|
||
params: query
|
||
});
|
||
},
|
||
// 导入表
|
||
importTable(table_names) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/import`,
|
||
method: "post",
|
||
data: table_names
|
||
});
|
||
},
|
||
// 查询表详细信息
|
||
detailTable(table_id) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/detail/${table_id}`,
|
||
method: "get"
|
||
});
|
||
},
|
||
// 创建表
|
||
createTable(sql) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/create`,
|
||
method: "post",
|
||
data: sql
|
||
});
|
||
},
|
||
// 更新表信息
|
||
updateTable(data, table_id) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/update/${table_id}`,
|
||
method: "put",
|
||
data
|
||
});
|
||
},
|
||
// 删除表数据
|
||
deleteTable(table_ids) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/delete`,
|
||
method: "delete",
|
||
data: table_ids
|
||
});
|
||
},
|
||
// 批量生成代码
|
||
batchGenCode(table_names) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/batch/output`,
|
||
method: "patch",
|
||
data: table_names,
|
||
responseType: "blob"
|
||
});
|
||
},
|
||
// 生成代码到指定路径
|
||
genCodeToPath(table_name) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/output/${table_name}`,
|
||
method: "post"
|
||
});
|
||
},
|
||
// 预览生成代码
|
||
previewTable(id) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/preview/${id}`,
|
||
method: "get"
|
||
});
|
||
},
|
||
// 同步数据库
|
||
syncDb(table_name) {
|
||
return httpRequest({
|
||
url: `${API_PATH}/sync_db/${table_name}`,
|
||
method: "post"
|
||
});
|
||
}
|
||
};
|
||
const _hoisted_1 = { class: "app-container" };
|
||
const _hoisted_2 = { class: "search-container" };
|
||
const _hoisted_3 = { class: "card-header" };
|
||
const _hoisted_4 = { class: "data-table__toolbar" };
|
||
const _hoisted_5 = { class: "data-table__toolbar--left" };
|
||
const _hoisted_6 = { class: "data-table__toolbar--right" };
|
||
const _hoisted_7 = { class: "absolute z-36 right-5 top-2" };
|
||
const _hoisted_8 = { class: "dialog-footer" };
|
||
const _hoisted_9 = { class: "dialog-footer" };
|
||
const _hoisted_10 = { class: "mt-5" };
|
||
const _hoisted_11 = { class: "elTableCustom" };
|
||
const _hoisted_12 = { class: "mb-2 flex items-center gap-2" };
|
||
const _hoisted_13 = { style: { "float": "left" } };
|
||
const _hoisted_14 = { style: { "float": "right", "font-size": "13px", "color": "#8492a6" } };
|
||
const _hoisted_15 = { class: "flex-y-center gap-3" };
|
||
const _hoisted_16 = { class: "ml-1" };
|
||
const _hoisted_17 = { class: "absolute z-36 right-5 top-2" };
|
||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||
...{
|
||
name: "GenCode",
|
||
inheritAttrs: false
|
||
},
|
||
__name: "index",
|
||
setup(__props) {
|
||
const queryRef = ref();
|
||
const table = ref();
|
||
const cmRef = ref();
|
||
const sqlRef = ref();
|
||
const basicInfo = ref();
|
||
const dragTable = ref();
|
||
const loading = ref(false);
|
||
const total = ref(0);
|
||
const uniqueId = ref("");
|
||
const editVisible = ref(false);
|
||
const activeStep = ref(2);
|
||
const createTableVisible = ref(false);
|
||
const importVisible = ref(false);
|
||
const createContent = ref("");
|
||
const dateRange = ref([]);
|
||
const tableList = ref([]);
|
||
const dbTableList = ref([]);
|
||
const ids = ref([]);
|
||
const tableNames = ref([]);
|
||
const importLoading = ref(false);
|
||
const importTotal = ref(0);
|
||
const importQueryFormData = reactive({
|
||
page_no: 1,
|
||
page_size: 10,
|
||
table_name: void 0,
|
||
table_comment: void 0
|
||
});
|
||
const dictOptions = ref([]);
|
||
const menuOptions = ref([]);
|
||
const tables = ref([]);
|
||
async function handleImportClick() {
|
||
importVisible.value = true;
|
||
await getDbList();
|
||
}
|
||
const preview = reactive({
|
||
open: false,
|
||
title: "代码预览",
|
||
data: {},
|
||
active_name: "controller.py"
|
||
});
|
||
const previewScope = ref("all");
|
||
const previewTypeOptions = ["ts", "vue", "python"];
|
||
const previewTypes = ref([...previewTypeOptions]);
|
||
const code = ref("");
|
||
const treeData = ref([]);
|
||
const queryFormData = reactive({
|
||
page_no: 1,
|
||
page_size: 10,
|
||
table_name: void 0,
|
||
table_comment: void 0
|
||
});
|
||
const tableColumns = ref([
|
||
{ prop: "selection", label: "选择框", show: true },
|
||
{ prop: "index", label: "序号", show: true },
|
||
{ prop: "table_name", label: "表名称", show: true },
|
||
{ prop: "table_comment", label: "表描述", show: true },
|
||
{ prop: "class_name", label: "实体", show: true },
|
||
{ prop: "created_time", label: "创建时间", show: true },
|
||
{ prop: "updated_time", label: "更新时间", show: true },
|
||
{ prop: "operation", label: "操作", show: true }
|
||
]);
|
||
const settingsStore = useSettingsStore();
|
||
const codeTheme = computed(() => settingsStore.theme === ThemeMode.DARK ? "dracula" : "default");
|
||
watch(codeTheme, (newTheme) => {
|
||
if (sqlRef.value && sqlRef.value.cminstance) {
|
||
sqlRef.value.cminstance.setOption("theme", newTheme);
|
||
}
|
||
if (cmRef.value && cmRef.value.cminstance) {
|
||
cmRef.value.cminstance.setOption("theme", newTheme);
|
||
}
|
||
});
|
||
const cmOptions = {
|
||
mode: "text/javascript",
|
||
lineNumbers: true,
|
||
smartIndent: true,
|
||
indentUnit: 2,
|
||
tabSize: 2,
|
||
readOnly: false,
|
||
theme: codeTheme.value,
|
||
lineWrapping: true,
|
||
autofocus: false
|
||
};
|
||
const sqlOptions = {
|
||
mode: "text/x-sql",
|
||
lineNumbers: true,
|
||
smartIndent: true,
|
||
indentUnit: 2,
|
||
tabSize: 2,
|
||
readOnly: false,
|
||
theme: codeTheme.value,
|
||
lineWrapping: true,
|
||
autofocus: false
|
||
};
|
||
const { copy } = useClipboard();
|
||
const filteredTreeData = computed(() => {
|
||
if (!treeData.value.length) return [];
|
||
const match = (label, parentPath) => {
|
||
if (previewScope.value !== "all") {
|
||
const isPythonBackend = parentPath.some((part) => part === "backend" || part === "python") || label.includes(".py");
|
||
const isVueFrontend = parentPath.some((part) => part === "frontend" || part === "vue") || label.includes(".vue") || label.includes(".ts");
|
||
if (previewScope.value === "backend" && !isPythonBackend) return false;
|
||
if (previewScope.value === "frontend" && !isVueFrontend) return false;
|
||
}
|
||
if (label.endsWith(".py")) return previewTypes.value.includes("python");
|
||
if (label.endsWith(".vue")) return previewTypes.value.includes("vue");
|
||
if (label.endsWith(".ts")) return previewTypes.value.includes("ts");
|
||
return true;
|
||
};
|
||
const cloneFilter = (node, parents = []) => {
|
||
if (!node.children || node.children.length === 0) {
|
||
return match(node.label, parents) ? { ...node } : null;
|
||
}
|
||
const nextParents = [...parents, node.label];
|
||
const children = (node.children || []).map((c) => cloneFilter(c, nextParents)).filter(Boolean);
|
||
if (!children.length) return null;
|
||
return { label: node.label, children };
|
||
};
|
||
const filtered = treeData.value.map((n) => cloneFilter(n)).filter(Boolean);
|
||
return filtered;
|
||
});
|
||
const canGenerate = computed(() => ids.value.length > 0);
|
||
const handleCopyCode = () => {
|
||
const content = code.value || createContent.value;
|
||
if (content) {
|
||
copy(content);
|
||
ElMessage.success("代码复制成功");
|
||
} else {
|
||
ElMessage.warning("没有可复制的代码");
|
||
}
|
||
};
|
||
function getFileTreeNodeIcon(label) {
|
||
if (label.endsWith(".py")) return "python";
|
||
if (label.endsWith(".vue")) return "vue";
|
||
if (label.endsWith(".ts")) return "typescript";
|
||
return "file";
|
||
}
|
||
function handleFileTreeNodeClick(data) {
|
||
if (data && (!data.children || data.children.length === 0)) {
|
||
code.value = data.content || "";
|
||
}
|
||
}
|
||
function buildTree(data) {
|
||
const root = { label: "前后端代码", children: [] };
|
||
data.forEach((item) => {
|
||
var _a;
|
||
const parts = item.path.split("/").filter((part) => part !== "");
|
||
let currentNode = root;
|
||
parts.forEach((part) => {
|
||
var _a2, _b;
|
||
let node = (_a2 = currentNode.children) == null ? void 0 : _a2.find((child) => child.label === part);
|
||
if (!node) {
|
||
node = { label: part, children: [] };
|
||
(_b = currentNode.children) == null ? void 0 : _b.push(node);
|
||
}
|
||
currentNode = node;
|
||
});
|
||
(_a = currentNode.children) == null ? void 0 : _a.push({
|
||
label: item.file_name,
|
||
content: item == null ? void 0 : item.content
|
||
});
|
||
});
|
||
return root;
|
||
}
|
||
async function handlePreview(row) {
|
||
try {
|
||
if (!row.id) {
|
||
ElMessage.warning("无效的表ID");
|
||
return;
|
||
}
|
||
const response = await GencodeAPI.previewTable(row.id);
|
||
preview.data = response.data.data;
|
||
const filesData = Object.entries(response.data.data).map(([key, content]) => {
|
||
const pathParts = key.split("/");
|
||
let fileName = pathParts.pop() || "";
|
||
const path = pathParts.join("/");
|
||
if (fileName.endsWith(".j2")) {
|
||
fileName = fileName.substring(0, fileName.lastIndexOf(".j2"));
|
||
}
|
||
const contentStr = typeof content === "string" ? content : JSON.stringify(content);
|
||
return {
|
||
path,
|
||
file_name: fileName,
|
||
content: contentStr
|
||
};
|
||
});
|
||
const treeRoot = buildTree(filesData);
|
||
treeData.value = [treeRoot];
|
||
const findFirstLeafNode = (nodes) => {
|
||
for (const node of nodes) {
|
||
if (!node.children || node.children.length === 0) {
|
||
return node;
|
||
}
|
||
const leaf = findFirstLeafNode(node.children);
|
||
if (leaf) return leaf;
|
||
}
|
||
return null;
|
||
};
|
||
const firstLeafNode = findFirstLeafNode(treeData.value);
|
||
code.value = (firstLeafNode == null ? void 0 : firstLeafNode.content) || "";
|
||
preview.open = true;
|
||
preview.active_name = "model.py";
|
||
} catch (error) {
|
||
console.error("预览代码失败:", error);
|
||
}
|
||
}
|
||
async function loadingData() {
|
||
var _a;
|
||
loading.value = true;
|
||
try {
|
||
const response = await GencodeAPI.listTable(queryFormData);
|
||
if ((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) {
|
||
tableList.value = response.data.data.items;
|
||
total.value = response.data.data.total;
|
||
}
|
||
} catch (error) {
|
||
console.error("获取表数据失败:", error);
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
async function handleGenTable(targetGenType, row) {
|
||
let tbNames = [];
|
||
if (row) {
|
||
tbNames = [row.table_name || ""];
|
||
} else if (tableNames.value.length > 0) {
|
||
tbNames = tableNames.value;
|
||
} else {
|
||
ElMessage.error("请选择要生成的数据");
|
||
return;
|
||
}
|
||
loading.value = true;
|
||
try {
|
||
if (targetGenType === "1") {
|
||
if (!Array.isArray(tbNames) || tbNames.length !== 1 || !tbNames[0]) {
|
||
ElMessage.error("自定义路径只能生成单表代码");
|
||
loading.value = false;
|
||
return;
|
||
}
|
||
await GencodeAPI.genCodeToPath(tbNames[0]);
|
||
} else {
|
||
const tableNamesArray = Array.isArray(tbNames) ? tbNames : [tbNames];
|
||
const response = await GencodeAPI.batchGenCode(tableNamesArray);
|
||
const blob = new Blob([response.data], { type: "application/zip" });
|
||
const url = URL.createObjectURL(blob);
|
||
const link = document.createElement("a");
|
||
link.href = url;
|
||
link.download = "code.zip";
|
||
link.click();
|
||
URL.revokeObjectURL(url);
|
||
ElMessage.success("代码生成成功,正在下载...");
|
||
}
|
||
} catch (error) {
|
||
console.error("生成代码失败:", error);
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
async function handleSynchDb(row) {
|
||
const tableName = row.table_name || "";
|
||
if (!tableName) {
|
||
ElMessage.error("表名不能为空");
|
||
return;
|
||
}
|
||
try {
|
||
await ElMessageBox.confirm('确认要强制同步"' + tableName + '"表结构吗?', "确认操作", {
|
||
confirmButtonText: "确定",
|
||
cancelButtonText: "取消",
|
||
type: "warning"
|
||
});
|
||
loading.value = true;
|
||
await GencodeAPI.syncDb(tableName);
|
||
loadingData();
|
||
} catch (error) {
|
||
if (error !== "cancel") {
|
||
console.error("同步表结构失败:", error);
|
||
}
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
async function handleRefresh() {
|
||
dateRange.value = [];
|
||
queryFormData.page_no = 1;
|
||
queryFormData.page_size = 10;
|
||
queryFormData.table_name = void 0;
|
||
queryFormData.table_comment = void 0;
|
||
await loadingData();
|
||
}
|
||
function handleTableSelectionChange(selection) {
|
||
ids.value = selection.map((item) => item.id);
|
||
tableNames.value = selection.map((item) => item.table_name || "").filter(Boolean);
|
||
}
|
||
function handleImportTableSelectionChange(selection) {
|
||
tables.value = selection.map((item) => ({
|
||
table_name: item.table_name || "",
|
||
table_comment: item.table_comment || ""
|
||
}));
|
||
}
|
||
const filterMenuTypes = (nodes) => {
|
||
return nodes.filter((node) => node.type === MenuTypeEnum.CATALOG || node.type === MenuTypeEnum.MENU).map((node) => ({
|
||
...node,
|
||
children: node.children ? filterMenuTypes(node.children) : []
|
||
}));
|
||
};
|
||
async function handlePreviewTable(row) {
|
||
const selectedTableId = (row == null ? void 0 : row.id) || ids.value[0];
|
||
if (selectedTableId) {
|
||
info.table_name = (row == null ? void 0 : row.table_name) || "";
|
||
await loadTableDetail(selectedTableId);
|
||
editVisible.value = true;
|
||
const menu_response = await MenuAPI.listMenu();
|
||
menuOptions.value = formatTree(filterMenuTypes(menu_response.data.data));
|
||
const dict_response = await DictAPI.listDictType({ page_no: 1, page_size: 100 });
|
||
dictOptions.value = dict_response.data.data.items;
|
||
} else {
|
||
ElMessage.error("请选择要修改的数据");
|
||
}
|
||
}
|
||
async function handleDelete(row) {
|
||
const tableIds = (row == null ? void 0 : row.id) ? [row.id] : ids.value;
|
||
if (tableIds.length === 0) {
|
||
ElMessage.error("请选择要删除的数据");
|
||
return;
|
||
}
|
||
try {
|
||
await ElMessageBox.confirm(`是否确认删除选中的${tableIds.length}条数据?`, "删除确认", {
|
||
confirmButtonText: "确定",
|
||
cancelButtonText: "取消",
|
||
type: "warning"
|
||
});
|
||
loading.value = true;
|
||
await GencodeAPI.deleteTable(tableIds);
|
||
loadingData();
|
||
} catch (error) {
|
||
if (error !== "cancel") {
|
||
console.error("删除表数据失败:", error);
|
||
}
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
function loadExampleMysql() {
|
||
const exampleSql = `-- MySQL SQL案例
|
||
CREATE TABLE \`gen_demo01\` (
|
||
\`name\` varchar(64) DEFAULT NULL COMMENT '名称',
|
||
\`id\` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||
\`uuid\` varchar(64) NOT NULL COMMENT 'UUID全局唯一标识',
|
||
\`status\` varchar(10) NOT NULL COMMENT '是否启用(0:启用 1:禁用)',
|
||
\`description\` text COMMENT '备注/描述',
|
||
\`created_time\` datetime NOT NULL COMMENT '创建时间',
|
||
\`updated_time\` datetime NOT NULL COMMENT '更新时间',
|
||
\`created_id\` int DEFAULT NULL COMMENT '创建人ID',
|
||
\`updated_id\` int DEFAULT NULL COMMENT '更新人ID',
|
||
PRIMARY KEY (\`id\`),
|
||
UNIQUE KEY \`uuid\` (\`uuid\`),
|
||
KEY \`ix_gen_demo01_created_id\` (\`created_id\`),
|
||
KEY \`ix_gen_demo01_updated_id\` (\`updated_id\`),
|
||
CONSTRAINT \`gen_demo01_ibfk_1\` FOREIGN KEY (\`created_id\`) REFERENCES \`sys_user\` (\`id\`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||
CONSTRAINT \`gen_demo01_ibfk_2\` FOREIGN KEY (\`updated_id\`) REFERENCES \`sys_user\` (\`id\`) ON DELETE SET NULL ON UPDATE CASCADE
|
||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='示例表'`;
|
||
createContent.value = exampleSql;
|
||
}
|
||
function loadExamplePostgres() {
|
||
const exampleSql = `-- Psstgres SQL案例
|
||
CREATE TABLE gen_demo01(
|
||
id SERIAL NOT NULL,
|
||
uuid varchar(64) NOT NULL,
|
||
name varchar(64),
|
||
status varchar(10) NOT NULL,
|
||
description text,
|
||
created_time timestamp without time zone NOT NULL,
|
||
updated_time timestamp without time zone NOT NULL,
|
||
created_id integer,
|
||
updated_id integer,
|
||
PRIMARY KEY(id),
|
||
CONSTRAINT gen_demo01_created_id_fkey FOREIGN key(created_id) REFERENCES sys_user(id),
|
||
CONSTRAINT gen_demo01_updated_id_fkey FOREIGN key(updated_id) REFERENCES sys_user(id)
|
||
);
|
||
CREATE UNIQUE INDEX en_demo01_uuid_key ON public.gen_demo01 USING btree (uuid);
|
||
CREATE INDEX ix_gen_demo01_created_id ON public.gen_demo01 USING btree (created_id);
|
||
CREATE INDEX ix_gen_demo01_updated_id ON public.gen_demo01 USING btree (updated_id);
|
||
COMMENT ON TABLE gen_demo01 IS '示例表';
|
||
COMMENT ON COLUMN gen_demo01.name IS '名称';
|
||
COMMENT ON COLUMN gen_demo01.id IS '主键ID';
|
||
COMMENT ON COLUMN gen_demo01.uuid IS 'UUID全局唯一标识';
|
||
COMMENT ON COLUMN gen_demo01.status IS '是否启用(0:启用 1:禁用)';
|
||
COMMENT ON COLUMN gen_demo01.description IS '备注/描述';
|
||
COMMENT ON COLUMN gen_demo01.created_time IS '创建时间';
|
||
COMMENT ON COLUMN gen_demo01.updated_time IS '更新时间';
|
||
COMMENT ON COLUMN gen_demo01.created_id IS '创建人ID';
|
||
COMMENT ON COLUMN gen_demo01.updated_id IS '更新人ID';`;
|
||
createContent.value = exampleSql;
|
||
}
|
||
async function handleCreateTable(sql) {
|
||
if (!sql || sql.trim() === "") {
|
||
ElMessage.error("请输入创建表SQL语句");
|
||
return;
|
||
}
|
||
loading.value = true;
|
||
try {
|
||
await GencodeAPI.createTable(sql);
|
||
createTableVisible.value = false;
|
||
createContent.value = "";
|
||
loadingData();
|
||
} catch (error) {
|
||
console.error("创建表数据失败:", error);
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
function handleCreateTableCancel() {
|
||
createTableVisible.value = false;
|
||
createContent.value = "";
|
||
}
|
||
async function handleImportTable() {
|
||
if (tables.value.length === 0) {
|
||
ElMessage.error("请选择要导入的表");
|
||
return;
|
||
}
|
||
importLoading.value = true;
|
||
try {
|
||
const tableNames2 = tables.value.map((table2) => table2.table_name || "");
|
||
await GencodeAPI.importTable(tableNames2);
|
||
importVisible.value = false;
|
||
loadingData();
|
||
} catch (error) {
|
||
console.error("导入表失败:", error);
|
||
} finally {
|
||
importLoading.value = false;
|
||
}
|
||
}
|
||
function clickRow(row) {
|
||
var _a;
|
||
(_a = table.value) == null ? void 0 : _a.toggleRowSelection(row);
|
||
}
|
||
async function getDbList() {
|
||
importLoading.value = true;
|
||
try {
|
||
const res = await GencodeAPI.listDbTable(importQueryFormData);
|
||
if (res.data && res.data.data) {
|
||
dbTableList.value = res.data.data.items;
|
||
importTotal.value = res.data.data.total;
|
||
}
|
||
} catch (error) {
|
||
console.error("获取数据库表列表失败:", error);
|
||
} finally {
|
||
importLoading.value = false;
|
||
}
|
||
}
|
||
async function handleImportQuery() {
|
||
importQueryFormData.page_no = 1;
|
||
await getDbList();
|
||
}
|
||
async function handleImportReset() {
|
||
if (queryRef.value) {
|
||
queryRef.value.resetFields();
|
||
}
|
||
await handleImportQuery();
|
||
}
|
||
async function handleQuery() {
|
||
queryFormData.page_no = 1;
|
||
await loadingData();
|
||
}
|
||
const route = useRoute();
|
||
onActivated(async () => {
|
||
const time = route.query.t;
|
||
if (time != null && String(time) !== uniqueId.value) {
|
||
uniqueId.value = String(time);
|
||
queryFormData.page_no = Number(route.query.page_no || 1);
|
||
dateRange.value = [];
|
||
await loadingData();
|
||
}
|
||
});
|
||
const info = reactive({
|
||
id: void 0,
|
||
table_name: "",
|
||
table_comment: "",
|
||
sub_table_name: "",
|
||
sub_table_fk_name: "",
|
||
class_name: "",
|
||
package_name: "",
|
||
module_name: "",
|
||
business_name: "",
|
||
function_name: "",
|
||
description: "",
|
||
parent_menu_id: void 0,
|
||
pk_column: void 0,
|
||
sub_table: void 0,
|
||
columns: [],
|
||
sub: false
|
||
});
|
||
const rules = {
|
||
table_name: [{ required: true, message: "表名称不能为空", trigger: "blur" }],
|
||
class_name: [{ required: true, message: "实体名称不能为空", trigger: "blur" }],
|
||
package_name: [{ required: true, message: "生成包路径不能为空", trigger: "blur" }],
|
||
module_name: [{ required: true, message: "生成模块名不能为空", trigger: "blur" }],
|
||
business_name: [{ required: true, message: "生成业务名不能为空", trigger: "blur" }],
|
||
function_name: [{ required: true, message: "生成功能名不能为空", trigger: "blur" }],
|
||
parent_menu_id: [{ required: true, message: "所属菜单不能为空", trigger: "change" }]
|
||
};
|
||
async function submitForm() {
|
||
var _a, _b;
|
||
if (!info.id) {
|
||
ElMessage.error("无效的表ID");
|
||
return;
|
||
}
|
||
try {
|
||
loading.value = true;
|
||
if (!info.columns || info.columns.length === 0) {
|
||
ElMessage.error("请配置字段信息");
|
||
return;
|
||
}
|
||
const tableData = {
|
||
...info,
|
||
parent_menu_id: info.parent_menu_id ?? null,
|
||
// 将undefined转换为null,确保属性被传输
|
||
columns: info.columns || []
|
||
// 确保columns存在
|
||
};
|
||
const response = await GencodeAPI.updateTable(tableData, info.id || 0);
|
||
if (((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.code) === 200) {
|
||
ElMessage.success(((_b = response == null ? void 0 : response.data) == null ? void 0 : _b.message) || "保存成功");
|
||
return true;
|
||
}
|
||
} catch (error) {
|
||
console.error("保存表单失败:", error);
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
async function nextStep() {
|
||
if (activeStep.value < 3) {
|
||
activeStep.value++;
|
||
if (activeStep.value === 2 && info.id) {
|
||
await handlePreview({ id: info.id, table_name: info.table_name });
|
||
}
|
||
}
|
||
}
|
||
function prevStep() {
|
||
if (activeStep.value > 0) {
|
||
activeStep.value--;
|
||
}
|
||
}
|
||
function bulkSet(field, value) {
|
||
if (!info.columns || !Array.isArray(info.columns)) return;
|
||
const fieldsToUpdate = Array.isArray(field) ? field : [field];
|
||
info.columns.forEach((column) => {
|
||
if (column && typeof column === "object") {
|
||
fieldsToUpdate.forEach((f) => {
|
||
column[f] = value;
|
||
});
|
||
}
|
||
});
|
||
}
|
||
function close() {
|
||
editVisible.value = false;
|
||
activeStep.value = 0;
|
||
setTimeout(() => {
|
||
var _a;
|
||
(_a = basicInfo.value) == null ? void 0 : _a.resetFields();
|
||
}, 300);
|
||
}
|
||
function handleClose() {
|
||
close();
|
||
}
|
||
async function loadTableDetail(id) {
|
||
var _a;
|
||
try {
|
||
loading.value = true;
|
||
const response = await GencodeAPI.detailTable(Number(id));
|
||
if ((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) {
|
||
const data = response.data.data;
|
||
Object.assign(info, { ...data });
|
||
if (data && data.columns && Array.isArray(data.columns)) {
|
||
info.columns = JSON.parse(JSON.stringify(data.columns));
|
||
info.columns.forEach((item) => {
|
||
item.select = true;
|
||
});
|
||
}
|
||
activeStep.value = 0;
|
||
}
|
||
} catch (error) {
|
||
console.error("获取表详情失败:", error);
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
onMounted(() => {
|
||
loadingData();
|
||
});
|
||
return (_ctx, _cache) => {
|
||
const _component_el_input = ElInput;
|
||
const _component_el_form_item = ElFormItem;
|
||
const _component_el_button = ElButton;
|
||
const _component_el_form = ElForm;
|
||
const _component_el_tooltip = ElTooltip;
|
||
const _component_el_col = ElCol;
|
||
const _component_el_row = ElRow;
|
||
const _component_el_checkbox = ElCheckbox;
|
||
const _component_el_scrollbar = ElScrollbar;
|
||
const _component_el_popover = ElPopover;
|
||
const _component_el_empty = ElEmpty;
|
||
const _component_el_table_column = ElTableColumn;
|
||
const _component_el_table = ElTable;
|
||
const _component_pagination = __unplugin_components_19;
|
||
const _component_el_card = ElCard;
|
||
const _component_el_icon = ElIcon;
|
||
const _component_el_link = ElLink;
|
||
const _component_el_dialog = ElDialog;
|
||
const _component_el_step = ElStep;
|
||
const _component_el_steps = ElSteps;
|
||
const _component_el_tree_select = ElTreeSelect;
|
||
const _component_el_divider = ElDivider;
|
||
const _component_el_descriptions_item = ElDescriptionsItem;
|
||
const _component_el_descriptions = ElDescriptions;
|
||
const _component_el_tag = ElTag;
|
||
const _component_el_dropdown_item = ElDropdownItem;
|
||
const _component_el_dropdown_menu = ElDropdownMenu;
|
||
const _component_el_dropdown = ElDropdown;
|
||
const _component_el_space = ElSpace;
|
||
const _component_el_option = ElOption;
|
||
const _component_el_select = ElSelect;
|
||
const _component_el_radio_button = ElRadioButton;
|
||
const _component_el_radio_group = ElRadioGroup;
|
||
const _component_el_checkbox_button = ElCheckboxButton;
|
||
const _component_el_checkbox_group = ElCheckboxGroup;
|
||
const _component_el_tree = ElTree;
|
||
const _component_el_drawer = ElDrawer;
|
||
const _directive_hasPerm = resolveDirective("hasPerm");
|
||
const _directive_loading = vLoading;
|
||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||
createBaseVNode("div", _hoisted_2, [
|
||
createVNode(_component_el_form, {
|
||
ref_key: "queryRef",
|
||
ref: queryRef,
|
||
model: queryFormData,
|
||
inline: true,
|
||
"label-suffix": ":",
|
||
onSubmit: withModifiers(handleQuery, ["prevent"])
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, {
|
||
label: "表名称",
|
||
prop: "table_name"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: queryFormData.table_name,
|
||
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => queryFormData.table_name = $event),
|
||
placeholder: "请输入表名称",
|
||
clearable: "",
|
||
style: { "width": "200px" },
|
||
onKeyup: withKeys(handleQuery, ["enter"])
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_form_item, {
|
||
label: "表描述",
|
||
prop: "table_comment"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: queryFormData.table_comment,
|
||
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => queryFormData.table_comment = $event),
|
||
placeholder: "请输入表描述",
|
||
clearable: "",
|
||
style: { "width": "200px" },
|
||
onKeyup: withKeys(handleQuery, ["enter"])
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_form_item, { class: "search-buttons" }, {
|
||
default: withCtx(() => [
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
type: "primary",
|
||
icon: "search",
|
||
"native-type": "submit"
|
||
}, {
|
||
default: withCtx(() => [..._cache[41] || (_cache[41] = [
|
||
createTextVNode(" 查询 ", -1)
|
||
])]),
|
||
_: 1
|
||
})), [
|
||
[_directive_hasPerm, ["module_generator:gencode:query"]]
|
||
]),
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
icon: "refresh",
|
||
onClick: handleRefresh
|
||
}, {
|
||
default: withCtx(() => [..._cache[42] || (_cache[42] = [
|
||
createTextVNode(" 重置 ", -1)
|
||
])]),
|
||
_: 1
|
||
})), [
|
||
[_directive_hasPerm, ["module_generator:gencode:query"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["model"])
|
||
]),
|
||
createVNode(_component_el_card, { class: "data-table" }, {
|
||
header: withCtx(() => [
|
||
createBaseVNode("div", _hoisted_3, [
|
||
createBaseVNode("span", null, [
|
||
createVNode(_component_el_tooltip, { content: "生成代码" }, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(question_filled_default), { class: "w-4 h-4 mx-1" })
|
||
]),
|
||
_: 1
|
||
}),
|
||
_cache[43] || (_cache[43] = createTextVNode(" 生成代码 ", -1))
|
||
])
|
||
])
|
||
]),
|
||
footer: withCtx(() => [
|
||
createVNode(_component_pagination, {
|
||
total: total.value,
|
||
"onUpdate:total": _cache[5] || (_cache[5] = ($event) => total.value = $event),
|
||
page: queryFormData.page_no,
|
||
"onUpdate:page": _cache[6] || (_cache[6] = ($event) => queryFormData.page_no = $event),
|
||
limit: queryFormData.page_size,
|
||
"onUpdate:limit": _cache[7] || (_cache[7] = ($event) => queryFormData.page_size = $event),
|
||
onPagination: loadingData
|
||
}, null, 8, ["total", "page", "limit"])
|
||
]),
|
||
default: withCtx(() => [
|
||
createBaseVNode("div", _hoisted_4, [
|
||
createBaseVNode("div", _hoisted_5, [
|
||
createVNode(_component_el_row, { gutter: 10 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_col, { span: 1.5 }, {
|
||
default: withCtx(() => [
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
type: "primary",
|
||
plain: "",
|
||
icon: "Plus",
|
||
onClick: _cache[2] || (_cache[2] = ($event) => createTableVisible.value = true)
|
||
}, {
|
||
default: withCtx(() => [..._cache[44] || (_cache[44] = [
|
||
createTextVNode(" 创建 ", -1)
|
||
])]),
|
||
_: 1
|
||
})), [
|
||
[_directive_hasPerm, ["module_generator:gencode:create"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 1.5 }, {
|
||
default: withCtx(() => [
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
type: "success",
|
||
plain: "",
|
||
icon: "Upload",
|
||
onClick: handleImportClick
|
||
}, {
|
||
default: withCtx(() => [..._cache[45] || (_cache[45] = [
|
||
createTextVNode(" 导入 ", -1)
|
||
])]),
|
||
_: 1
|
||
})), [
|
||
[_directive_hasPerm, ["module_generator:gencode:import"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 1.5 }, {
|
||
default: withCtx(() => [
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
type: "danger",
|
||
plain: "",
|
||
icon: "Delete",
|
||
disabled: ids.value.length === 0,
|
||
onClick: _cache[3] || (_cache[3] = ($event) => handleDelete())
|
||
}, {
|
||
default: withCtx(() => [..._cache[46] || (_cache[46] = [
|
||
createTextVNode(" 批量删除 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["disabled"])), [
|
||
[_directive_hasPerm, ["module_generator:gencode:delete"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 1.5 }, {
|
||
default: withCtx(() => [
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
type: "warning",
|
||
plain: "",
|
||
icon: "Download",
|
||
disabled: !canGenerate.value,
|
||
onClick: _cache[4] || (_cache[4] = ($event) => handleGenTable("0"))
|
||
}, {
|
||
default: withCtx(() => [..._cache[47] || (_cache[47] = [
|
||
createTextVNode(" 批量生成 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["disabled"])), [
|
||
[_directive_hasPerm, ["module_generator:gencode:code"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
createBaseVNode("div", _hoisted_6, [
|
||
createVNode(_component_el_row, { gutter: 10 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_col, { span: 1.5 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_tooltip, { content: "刷新" }, {
|
||
default: withCtx(() => [
|
||
withDirectives(createVNode(_component_el_button, {
|
||
type: "primary",
|
||
icon: "refresh",
|
||
circle: "",
|
||
onClick: handleRefresh
|
||
}, null, 512), [
|
||
[_directive_hasPerm, ["module_generator:gencode:query"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 1.5 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_popover, {
|
||
placement: "bottom",
|
||
trigger: "click"
|
||
}, {
|
||
reference: withCtx(() => [
|
||
createVNode(_component_el_button, {
|
||
type: "danger",
|
||
icon: "operation",
|
||
circle: ""
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_scrollbar, { "max-height": "350px" }, {
|
||
default: withCtx(() => [
|
||
(openBlock(true), createElementBlock(Fragment, null, renderList(tableColumns.value, (column) => {
|
||
return openBlock(), createElementBlock(Fragment, {
|
||
key: column.prop
|
||
}, [
|
||
column.prop ? (openBlock(), createBlock(_component_el_checkbox, {
|
||
key: 0,
|
||
modelValue: column.show,
|
||
"onUpdate:modelValue": ($event) => column.show = $event,
|
||
label: column.label
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : createCommentVNode("", true)
|
||
], 64);
|
||
}), 128))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
])
|
||
]),
|
||
withDirectives((openBlock(), createBlock(_component_el_table, {
|
||
ref: "dataTableRef",
|
||
data: tableList.value,
|
||
"highlight-current-row": "",
|
||
class: "data-table__content",
|
||
height: "500",
|
||
"max-height": "500",
|
||
border: "",
|
||
stripe: "",
|
||
onSelectionChange: handleTableSelectionChange
|
||
}, {
|
||
empty: withCtx(() => [
|
||
createVNode(_component_el_empty, {
|
||
"image-size": 80,
|
||
description: "暂无数据"
|
||
})
|
||
]),
|
||
default: withCtx(() => {
|
||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||
return [
|
||
((_a = tableColumns.value.find((col) => col.prop === "selection")) == null ? void 0 : _a.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 0,
|
||
type: "selection",
|
||
align: "center",
|
||
width: "55"
|
||
})) : createCommentVNode("", true),
|
||
((_b = tableColumns.value.find((col) => col.prop === "index")) == null ? void 0 : _b.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 1,
|
||
label: "序号",
|
||
type: "index",
|
||
"min-width": "30",
|
||
align: "center",
|
||
fixed: ""
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createBaseVNode("span", null, toDisplayString((queryFormData.page_no - 1) * queryFormData.page_size + scope.$index + 1), 1)
|
||
]),
|
||
_: 1
|
||
})) : createCommentVNode("", true),
|
||
((_c = tableColumns.value.find((col) => col.prop === "table_name")) == null ? void 0 : _c.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 2,
|
||
label: "表名称",
|
||
prop: "table_name",
|
||
"show-overflow-tooltip": true
|
||
})) : createCommentVNode("", true),
|
||
((_d = tableColumns.value.find((col) => col.prop === "table_comment")) == null ? void 0 : _d.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 3,
|
||
label: "表描述",
|
||
prop: "table_comment",
|
||
"show-overflow-tooltip": true
|
||
})) : createCommentVNode("", true),
|
||
((_e = tableColumns.value.find((col) => col.prop === "class_name")) == null ? void 0 : _e.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 4,
|
||
label: "实体",
|
||
prop: "class_name",
|
||
"show-overflow-tooltip": true
|
||
})) : createCommentVNode("", true),
|
||
((_f = tableColumns.value.find((col) => col.prop === "created_time")) == null ? void 0 : _f.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 5,
|
||
label: "创建时间",
|
||
prop: "created_time"
|
||
})) : createCommentVNode("", true),
|
||
((_g = tableColumns.value.find((col) => col.prop === "updated_time")) == null ? void 0 : _g.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 6,
|
||
label: "更新时间",
|
||
prop: "updated_time"
|
||
})) : createCommentVNode("", true),
|
||
((_h = tableColumns.value.find((col) => col.prop === "operation")) == null ? void 0 : _h.show) ? (openBlock(), createBlock(_component_el_table_column, {
|
||
key: 7,
|
||
label: "操作",
|
||
align: "center",
|
||
"min-width": "120",
|
||
"class-name": "small-padding fixed-width"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
link: "",
|
||
type: "primary",
|
||
icon: unref(magic_stick_default),
|
||
onClick: ($event) => handlePreviewTable(scope.row)
|
||
}, {
|
||
default: withCtx(() => [..._cache[48] || (_cache[48] = [
|
||
createTextVNode(" 代码生成 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["icon", "onClick"])), [
|
||
[_directive_hasPerm, ["module_generator:gencode:update"]]
|
||
]),
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
link: "",
|
||
type: "danger",
|
||
icon: "Delete",
|
||
onClick: ($event) => handleDelete(scope.row)
|
||
}, {
|
||
default: withCtx(() => [..._cache[49] || (_cache[49] = [
|
||
createTextVNode(" 删除 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["onClick"])), [
|
||
[_directive_hasPerm, ["module_generator:gencode:delete"]]
|
||
]),
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
link: "",
|
||
type: "success",
|
||
icon: "Refresh",
|
||
onClick: ($event) => handleSynchDb(scope.row)
|
||
}, {
|
||
default: withCtx(() => [..._cache[50] || (_cache[50] = [
|
||
createTextVNode(" 同步 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["onClick"])), [
|
||
[_directive_hasPerm, ["module_generator:db:sync"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
})) : createCommentVNode("", true)
|
||
];
|
||
}),
|
||
_: 1
|
||
}, 8, ["data"])), [
|
||
[_directive_loading, loading.value]
|
||
])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dialog, {
|
||
modelValue: createTableVisible.value,
|
||
"onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => createTableVisible.value = $event),
|
||
title: "创建表",
|
||
"append-to-body": ""
|
||
}, {
|
||
footer: withCtx(() => [
|
||
createBaseVNode("div", _hoisted_8, [
|
||
createVNode(_component_el_button, {
|
||
type: "primary",
|
||
loading: loading.value,
|
||
onClick: _cache[9] || (_cache[9] = ($event) => handleCreateTable(createContent.value))
|
||
}, {
|
||
default: withCtx(() => [..._cache[54] || (_cache[54] = [
|
||
createTextVNode(" 确 定 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["loading"]),
|
||
createVNode(_component_el_button, {
|
||
onClick: _cache[10] || (_cache[10] = ($event) => handleCreateTableCancel())
|
||
}, {
|
||
default: withCtx(() => [..._cache[55] || (_cache[55] = [
|
||
createTextVNode("取 消", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
])
|
||
]),
|
||
default: withCtx(() => [
|
||
_cache[56] || (_cache[56] = createBaseVNode("span", null, "创建表语句(支持多个建表sql语句):", -1)),
|
||
createVNode(_component_el_button, {
|
||
type: "warning",
|
||
size: "small",
|
||
class: "ml-1 mb-1",
|
||
onClick: loadExampleMysql
|
||
}, {
|
||
default: withCtx(() => [..._cache[51] || (_cache[51] = [
|
||
createTextVNode(" 加载MySQL示例 ", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_button, {
|
||
type: "primary",
|
||
size: "small",
|
||
class: "ml-1 mb-1",
|
||
onClick: loadExamplePostgres
|
||
}, {
|
||
default: withCtx(() => [..._cache[52] || (_cache[52] = [
|
||
createTextVNode(" 加载Postgres示例 ", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_scrollbar, { "max-height": "72vh" }, {
|
||
default: withCtx(() => [
|
||
createBaseVNode("div", _hoisted_7, [
|
||
createVNode(_component_el_link, {
|
||
type: "primary",
|
||
onClick: handleCopyCode
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_icon, null, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(copy_document_default))
|
||
]),
|
||
_: 1
|
||
}),
|
||
_cache[53] || (_cache[53] = createTextVNode(" 复制代码 ", -1))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
createVNode(unref(R), {
|
||
ref_key: "sqlRef",
|
||
ref: sqlRef,
|
||
value: createContent.value,
|
||
"onUpdate:value": _cache[8] || (_cache[8] = ($event) => createContent.value = $event),
|
||
options: sqlOptions,
|
||
border: "",
|
||
height: "400px",
|
||
width: "100%"
|
||
}, null, 8, ["value"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue"]),
|
||
createVNode(_component_el_dialog, {
|
||
modelValue: importVisible.value,
|
||
"onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => importVisible.value = $event),
|
||
title: "导入表",
|
||
width: "800px",
|
||
top: "5vh",
|
||
"append-to-body": ""
|
||
}, {
|
||
footer: withCtx(() => [
|
||
createBaseVNode("div", _hoisted_9, [
|
||
createVNode(_component_el_button, {
|
||
type: "primary",
|
||
loading: importLoading.value,
|
||
onClick: handleImportTable
|
||
}, {
|
||
default: withCtx(() => [..._cache[59] || (_cache[59] = [
|
||
createTextVNode(" 确 定 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["loading"]),
|
||
createVNode(_component_el_button, {
|
||
onClick: _cache[16] || (_cache[16] = ($event) => importVisible.value = false)
|
||
}, {
|
||
default: withCtx(() => [..._cache[60] || (_cache[60] = [
|
||
createTextVNode("取 消", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
])
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form, {
|
||
ref_key: "queryRef",
|
||
ref: queryRef,
|
||
model: importQueryFormData,
|
||
inline: true
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, {
|
||
label: "表名称",
|
||
prop: "table_name"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: importQueryFormData.table_name,
|
||
"onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => importQueryFormData.table_name = $event),
|
||
placeholder: "请输入表名称",
|
||
clearable: "",
|
||
style: { "width": "180px" },
|
||
onKeyup: withKeys(handleImportQuery, ["enter"])
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_form_item, {
|
||
label: "表描述",
|
||
prop: "table_comment"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: importQueryFormData.table_comment,
|
||
"onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => importQueryFormData.table_comment = $event),
|
||
placeholder: "请输入表描述",
|
||
clearable: "",
|
||
style: { "width": "180px" },
|
||
onKeyup: withKeys(handleImportQuery, ["enter"])
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_form_item, null, {
|
||
default: withCtx(() => [
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
type: "primary",
|
||
icon: "Search",
|
||
onClick: handleImportQuery
|
||
}, {
|
||
default: withCtx(() => [..._cache[57] || (_cache[57] = [
|
||
createTextVNode(" 搜索 ", -1)
|
||
])]),
|
||
_: 1
|
||
})), [
|
||
[_directive_hasPerm, ["module_generator:dblist:query"]]
|
||
]),
|
||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
icon: "Refresh",
|
||
onClick: handleImportReset
|
||
}, {
|
||
default: withCtx(() => [..._cache[58] || (_cache[58] = [
|
||
createTextVNode(" 重置 ", -1)
|
||
])]),
|
||
_: 1
|
||
})), [
|
||
[_directive_hasPerm, ["module_generator:dblist:query"]]
|
||
])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["model"]),
|
||
createVNode(_component_el_row, null, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_table, {
|
||
ref_key: "table",
|
||
ref: table,
|
||
data: dbTableList.value,
|
||
height: "300px",
|
||
border: "",
|
||
onRowClick: clickRow,
|
||
onSelectionChange: handleImportTableSelectionChange
|
||
}, {
|
||
empty: withCtx(() => [
|
||
createVNode(_component_el_empty, {
|
||
"image-size": 80,
|
||
description: "暂无数据"
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_table_column, {
|
||
type: "selection",
|
||
width: "55"
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "序号",
|
||
type: "index",
|
||
"min-width": "30",
|
||
align: "center",
|
||
fixed: ""
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createBaseVNode("span", null, toDisplayString((importQueryFormData.page_no - 1) * importQueryFormData.page_size + scope.$index + 1), 1)
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
prop: "database_name",
|
||
label: "数据库名称",
|
||
"show-overflow-tooltip": true
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
prop: "table_name",
|
||
label: "表名称",
|
||
"show-overflow-tooltip": true
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
prop: "table_comment",
|
||
label: "表描述",
|
||
"show-overflow-tooltip": true
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
prop: "table_type",
|
||
label: "表类型"
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["data"]),
|
||
createVNode(_component_pagination, {
|
||
page: importQueryFormData.page_no,
|
||
"onUpdate:page": _cache[14] || (_cache[14] = ($event) => importQueryFormData.page_no = $event),
|
||
limit: importQueryFormData.page_size,
|
||
"onUpdate:limit": _cache[15] || (_cache[15] = ($event) => importQueryFormData.page_size = $event),
|
||
total: importTotal.value,
|
||
onPagination: getDbList
|
||
}, null, 8, ["page", "limit", "total"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue"]),
|
||
createVNode(_component_el_drawer, {
|
||
modelValue: editVisible.value,
|
||
"onUpdate:modelValue": _cache[40] || (_cache[40] = ($event) => editVisible.value = $event),
|
||
title: "【代码生成】" + info.table_name,
|
||
size: "85%",
|
||
onClose: handleClose
|
||
}, {
|
||
footer: withCtx(() => [
|
||
createVNode(_component_el_button, {
|
||
icon: unref(close_default),
|
||
onClick: close
|
||
}, {
|
||
default: withCtx(() => [..._cache[87] || (_cache[87] = [
|
||
createTextVNode("关闭", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["icon"]),
|
||
activeStep.value != 0 ? (openBlock(), createBlock(_component_el_button, {
|
||
key: 0,
|
||
type: "success",
|
||
icon: unref(back_default),
|
||
onClick: prevStep
|
||
}, {
|
||
default: withCtx(() => [..._cache[88] || (_cache[88] = [
|
||
createTextVNode(" 上一步 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["icon"])) : createCommentVNode("", true),
|
||
activeStep.value != 2 ? withDirectives((openBlock(), createBlock(_component_el_button, {
|
||
key: 1,
|
||
type: "warning",
|
||
icon: unref(edit_default),
|
||
loading: loading.value,
|
||
onClick: submitForm
|
||
}, {
|
||
default: withCtx(() => [..._cache[89] || (_cache[89] = [
|
||
createTextVNode(" 保存配置 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["icon", "loading"])), [
|
||
[_directive_hasPerm, ["module_generator:gencode:update"]]
|
||
]) : createCommentVNode("", true),
|
||
activeStep.value != 2 ? (openBlock(), createBlock(_component_el_button, {
|
||
key: 2,
|
||
type: "primary",
|
||
onClick: nextStep
|
||
}, {
|
||
default: withCtx(() => [
|
||
_cache[90] || (_cache[90] = createTextVNode(" 下一步 ", -1)),
|
||
createVNode(_component_el_icon, { class: "el-icon--right" }, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(right_default))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})) : createCommentVNode("", true),
|
||
activeStep.value === 2 ? (openBlock(), createBlock(_component_el_button, {
|
||
key: 3,
|
||
type: "warning",
|
||
icon: unref(download_default),
|
||
loading: loading.value,
|
||
onClick: _cache[38] || (_cache[38] = ($event) => handleGenTable("0", info))
|
||
}, {
|
||
default: withCtx(() => [..._cache[91] || (_cache[91] = [
|
||
createTextVNode(" 下载代码 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["icon", "loading"])) : createCommentVNode("", true),
|
||
activeStep.value === 2 ? (openBlock(), createBlock(_component_el_button, {
|
||
key: 4,
|
||
type: "primary",
|
||
icon: unref(folder_opened_default),
|
||
loading: loading.value,
|
||
onClick: _cache[39] || (_cache[39] = ($event) => handleGenTable("1", info))
|
||
}, {
|
||
default: withCtx(() => [..._cache[92] || (_cache[92] = [
|
||
createTextVNode(" 写入本地 ", -1)
|
||
])]),
|
||
_: 1
|
||
}, 8, ["icon", "loading"])) : createCommentVNode("", true)
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_steps, {
|
||
active: activeStep.value,
|
||
"finish-status": "success",
|
||
simple: ""
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_step, { title: "基础配置" }),
|
||
createVNode(_component_el_step, { title: "字段配置" }),
|
||
createVNode(_component_el_step, { title: "预览代码" })
|
||
]),
|
||
_: 1
|
||
}, 8, ["active"]),
|
||
createBaseVNode("div", _hoisted_10, [
|
||
withDirectives(createVNode(_component_el_form, {
|
||
ref_key: "basicInfo",
|
||
ref: basicInfo,
|
||
model: info,
|
||
rules,
|
||
"label-width": "150px"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_row, null, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, {
|
||
label: "表名称",
|
||
prop: "table_name"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.table_name,
|
||
"onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => info.table_name = $event),
|
||
placeholder: "请输入表名称"
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, {
|
||
label: "表描述",
|
||
prop: "table_comment"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.table_comment,
|
||
"onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => info.table_comment = $event),
|
||
placeholder: "请输入表描述"
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, {
|
||
label: "实体类名称",
|
||
prop: "class_name"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.class_name,
|
||
"onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => info.class_name = $event),
|
||
placeholder: "请输入"
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, { prop: "package_name" }, {
|
||
label: withCtx(() => [
|
||
_cache[61] || (_cache[61] = createTextVNode(" 包名 ", -1)),
|
||
createVNode(_component_el_tooltip, {
|
||
content: "生成在哪个python模块下,例如 module_gencode",
|
||
placement: "top"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_icon, null, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(question_filled_default))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.package_name,
|
||
"onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => info.package_name = $event)
|
||
}, {
|
||
prepend: withCtx(() => [..._cache[62] || (_cache[62] = [
|
||
createTextVNode("接口路径: api/v1/", -1)
|
||
])]),
|
||
append: withCtx(() => [
|
||
createTextVNode("/" + toDisplayString(info.business_name), 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, { prop: "module_name" }, {
|
||
label: withCtx(() => [
|
||
_cache[63] || (_cache[63] = createTextVNode(" 模块名 ", -1)),
|
||
createVNode(_component_el_tooltip, {
|
||
content: "可理解为子系统名,例如 system",
|
||
placement: "top"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_icon, null, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(question_filled_default))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.module_name,
|
||
"onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => info.module_name = $event)
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, { prop: "business_name" }, {
|
||
label: withCtx(() => [
|
||
_cache[64] || (_cache[64] = createTextVNode(" 业务名 ", -1)),
|
||
createVNode(_component_el_tooltip, {
|
||
content: "可理解为功能英文名,例如 user",
|
||
placement: "top"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_icon, null, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(question_filled_default))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.business_name,
|
||
"onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => info.business_name = $event)
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, { prop: "function_name" }, {
|
||
label: withCtx(() => [
|
||
_cache[65] || (_cache[65] = createTextVNode(" 功能名 ", -1)),
|
||
createVNode(_component_el_tooltip, {
|
||
content: "用作类描述,例如 用户",
|
||
placement: "top"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_icon, null, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(question_filled_default))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.function_name,
|
||
"onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => info.function_name = $event)
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 12 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, null, {
|
||
label: withCtx(() => [
|
||
_cache[66] || (_cache[66] = createTextVNode(" 上级菜单 ", -1)),
|
||
createVNode(_component_el_tooltip, {
|
||
content: "分配到指定菜单下,例如 系统管理",
|
||
placement: "top"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_icon, null, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(question_filled_default))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_tree_select, {
|
||
modelValue: info.parent_menu_id,
|
||
"onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => info.parent_menu_id = $event),
|
||
data: menuOptions.value,
|
||
placeholder: "请选择系统菜单,不选创建目录",
|
||
"check-strictly": "",
|
||
"show-checkbox": "",
|
||
filterable: "",
|
||
"render-after-expand": false,
|
||
clearable: ""
|
||
}, null, 8, ["modelValue", "data"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 24 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_form_item, {
|
||
label: "备注",
|
||
prop: "description"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: info.description,
|
||
"onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => info.description = $event),
|
||
type: "textarea",
|
||
rows: 3
|
||
}, null, 8, ["modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_divider, null, {
|
||
default: withCtx(() => [..._cache[67] || (_cache[67] = [
|
||
createTextVNode("生成文件路径", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 24 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_descriptions, {
|
||
column: 2,
|
||
border: ""
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,后端控制层"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" backend/app/api/v1/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + "/controller.py ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"]),
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,后端业务层"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" backend/app/api/v1/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + "/service.py ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"]),
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,后端数据层"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" backend/app/api/v1/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + "/crud.py ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"]),
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,后端实体层"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" backend/app/api/v1/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + "/model.py ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"]),
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,后端序列化层"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" backend/app/api/v1/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + "/schema.py ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"]),
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,后端初始化"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" backend/app/api/v1/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + "/__init__.py ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"]),
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,前端接口层"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" frontend/src/api/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + ".ts ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"]),
|
||
createVNode(_component_el_descriptions_item, {
|
||
label: info.function_name + "功能,前端视图层"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(" frontend/src/views/" + toDisplayString(info.module_name) + "/" + toDisplayString(info.business_name) + "/index.vue ", 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["label"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["model"]), [
|
||
[vShow, activeStep.value == 0]
|
||
]),
|
||
withDirectives(createBaseVNode("div", _hoisted_11, [
|
||
createBaseVNode("div", _hoisted_12, [
|
||
createVNode(_component_el_tag, {
|
||
size: "small",
|
||
type: "info"
|
||
}, {
|
||
default: withCtx(() => [..._cache[68] || (_cache[68] = [
|
||
createTextVNode("批量设置", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_space, { size: "small" }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_dropdown, null, {
|
||
dropdown: withCtx(() => [
|
||
createVNode(_component_el_dropdown_menu, null, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[27] || (_cache[27] = ($event) => bulkSet("is_query", true))
|
||
}, {
|
||
default: withCtx(() => [..._cache[70] || (_cache[70] = [
|
||
createTextVNode("全选", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[28] || (_cache[28] = ($event) => bulkSet("is_query", false))
|
||
}, {
|
||
default: withCtx(() => [..._cache[71] || (_cache[71] = [
|
||
createTextVNode("全不选", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_button, {
|
||
size: "small",
|
||
type: "primary",
|
||
plain: ""
|
||
}, {
|
||
default: withCtx(() => [..._cache[69] || (_cache[69] = [
|
||
createTextVNode("查询", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dropdown, null, {
|
||
dropdown: withCtx(() => [
|
||
createVNode(_component_el_dropdown_menu, null, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[29] || (_cache[29] = ($event) => bulkSet("is_list", true))
|
||
}, {
|
||
default: withCtx(() => [..._cache[73] || (_cache[73] = [
|
||
createTextVNode("全选", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[30] || (_cache[30] = ($event) => bulkSet("is_list", false))
|
||
}, {
|
||
default: withCtx(() => [..._cache[74] || (_cache[74] = [
|
||
createTextVNode("全不选", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_button, {
|
||
size: "small",
|
||
type: "success",
|
||
plain: ""
|
||
}, {
|
||
default: withCtx(() => [..._cache[72] || (_cache[72] = [
|
||
createTextVNode("列表", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dropdown, null, {
|
||
dropdown: withCtx(() => [
|
||
createVNode(_component_el_dropdown_menu, null, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[31] || (_cache[31] = ($event) => bulkSet("is_insert", true))
|
||
}, {
|
||
default: withCtx(() => [..._cache[76] || (_cache[76] = [
|
||
createTextVNode("全选", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[32] || (_cache[32] = ($event) => bulkSet("is_insert", false))
|
||
}, {
|
||
default: withCtx(() => [..._cache[77] || (_cache[77] = [
|
||
createTextVNode("全不选", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_button, {
|
||
size: "small",
|
||
type: "warning",
|
||
plain: ""
|
||
}, {
|
||
default: withCtx(() => [..._cache[75] || (_cache[75] = [
|
||
createTextVNode("新增", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dropdown, null, {
|
||
dropdown: withCtx(() => [
|
||
createVNode(_component_el_dropdown_menu, null, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[33] || (_cache[33] = ($event) => bulkSet("is_edit", true))
|
||
}, {
|
||
default: withCtx(() => [..._cache[79] || (_cache[79] = [
|
||
createTextVNode("全选", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_dropdown_item, {
|
||
onClick: _cache[34] || (_cache[34] = ($event) => bulkSet("is_edit", false))
|
||
}, {
|
||
default: withCtx(() => [..._cache[80] || (_cache[80] = [
|
||
createTextVNode("全不选", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_button, {
|
||
size: "small",
|
||
type: "danger",
|
||
plain: ""
|
||
}, {
|
||
default: withCtx(() => [..._cache[78] || (_cache[78] = [
|
||
createTextVNode("编辑", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
withDirectives((openBlock(), createBlock(_component_el_table, {
|
||
ref_key: "dragTable",
|
||
ref: dragTable,
|
||
data: info.columns,
|
||
"row-key": "id",
|
||
"max-height": "680",
|
||
"highlight--currentrow": "",
|
||
class: "data-table__content",
|
||
border: "",
|
||
stripe: ""
|
||
}, {
|
||
empty: withCtx(() => [
|
||
createVNode(_component_el_empty, {
|
||
"image-size": 80,
|
||
description: "暂无数据"
|
||
})
|
||
]),
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_table_column, {
|
||
label: "序号",
|
||
type: "index",
|
||
width: "60",
|
||
fixed: ""
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "列名",
|
||
prop: "column_name",
|
||
"min-width": "60",
|
||
"show-overflow-tooltip": true
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "类型",
|
||
prop: "column_type",
|
||
"min-width": "60",
|
||
"show-overflow-tooltip": true
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "长度",
|
||
prop: "column_length",
|
||
width: "80",
|
||
"show-overflow-tooltip": true
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: scope.row.column_length,
|
||
"onUpdate:modelValue": ($event) => scope.row.column_length = $event,
|
||
disabled: scope.row.is_pk === "1"
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "注释",
|
||
"min-width": "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: scope.row.column_comment,
|
||
"onUpdate:modelValue": ($event) => scope.row.column_comment = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "后端类型",
|
||
"min-width": "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_select, {
|
||
modelValue: scope.row.python_type,
|
||
"onUpdate:modelValue": ($event) => scope.row.python_type = $event
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_option, {
|
||
label: "str",
|
||
value: "str"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "int",
|
||
value: "int"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "float",
|
||
value: "float"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "Decimal",
|
||
value: "Decimal"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "date",
|
||
value: "date"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "time",
|
||
value: "time"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "datetime",
|
||
value: "datetime"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "bytes",
|
||
value: "bytes"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "dict",
|
||
value: "dict"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "list",
|
||
value: "list"
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "后端属性",
|
||
"min-width": "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: scope.row.python_field,
|
||
"onUpdate:modelValue": ($event) => scope.row.python_field = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "新增",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_insert,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_insert = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "编辑",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_edit,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_edit = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "列表",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_list,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_list = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "查询",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_query,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_query = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "查询方式",
|
||
"min-width": "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_select, {
|
||
modelValue: scope.row.query_type,
|
||
"onUpdate:modelValue": ($event) => scope.row.query_type = $event
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_option, {
|
||
label: "=",
|
||
value: "EQ"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "!=",
|
||
value: "NE"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: ">",
|
||
value: "GT"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: ">=",
|
||
value: "GTE"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "<",
|
||
value: "LT"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "<=",
|
||
value: "LTE"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "LIKE",
|
||
value: "LIKE"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "BETWEEN",
|
||
value: "BETWEEN"
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "默认值",
|
||
prop: "column_default",
|
||
"min-width": "60",
|
||
"show-overflow-tooltip": true
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_input, {
|
||
modelValue: scope.row.column_default,
|
||
"onUpdate:modelValue": ($event) => scope.row.column_default = $event,
|
||
disabled: scope.row.is_pk === "1"
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "自增",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_increment,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_increment = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "可空",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_nullable,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_nullable = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "唯一",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_unique,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_unique = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "主键",
|
||
width: "60"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_checkbox, {
|
||
modelValue: scope.row.is_pk,
|
||
"onUpdate:modelValue": ($event) => scope.row.is_pk = $event
|
||
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, { label: "表单类型" }, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_select, {
|
||
modelValue: scope.row.html_type,
|
||
"onUpdate:modelValue": ($event) => scope.row.html_type = $event
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_option, {
|
||
label: "文本框",
|
||
value: "input"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "文本域",
|
||
value: "textarea"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "下拉框",
|
||
value: "select"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "单选框",
|
||
value: "radio"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "复选框",
|
||
value: "checkbox"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "日期控件",
|
||
value: "datetime"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "图片上传",
|
||
value: "imageUpload"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "文件上传",
|
||
value: "fileUpload"
|
||
}),
|
||
createVNode(_component_el_option, {
|
||
label: "富文本控件",
|
||
value: "editor"
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_table_column, {
|
||
label: "字典类型",
|
||
fixed: "right"
|
||
}, {
|
||
default: withCtx((scope) => [
|
||
createVNode(_component_el_select, {
|
||
modelValue: scope.row.dict_type,
|
||
"onUpdate:modelValue": ($event) => scope.row.dict_type = $event,
|
||
clearable: "",
|
||
filterable: "",
|
||
placeholder: "请选择"
|
||
}, {
|
||
default: withCtx(() => [
|
||
(openBlock(true), createElementBlock(Fragment, null, renderList(dictOptions.value, (dict) => {
|
||
return openBlock(), createBlock(_component_el_option, {
|
||
key: dict.dict_type,
|
||
label: dict.dict_name,
|
||
value: dict.dict_type || ""
|
||
}, {
|
||
default: withCtx(() => [
|
||
createBaseVNode("span", _hoisted_13, toDisplayString(dict.dict_name), 1),
|
||
createBaseVNode("span", _hoisted_14, toDisplayString(dict.dict_type), 1)
|
||
]),
|
||
_: 2
|
||
}, 1032, ["label", "value"]);
|
||
}), 128))
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue", "onUpdate:modelValue"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["data"])), [
|
||
[_directive_loading, loading.value]
|
||
])
|
||
], 512), [
|
||
[vShow, activeStep.value == 1]
|
||
]),
|
||
withDirectives(createVNode(_component_el_row, null, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_col, {
|
||
span: 24,
|
||
class: "mb-2"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createBaseVNode("div", _hoisted_15, [
|
||
_cache[84] || (_cache[84] = createBaseVNode("span", { class: "text-sm color-#909399" }, "预览范围", -1)),
|
||
createVNode(_component_el_radio_group, {
|
||
modelValue: previewScope.value,
|
||
"onUpdate:modelValue": _cache[35] || (_cache[35] = ($event) => previewScope.value = $event),
|
||
size: "small"
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_radio_button, { value: "all" }, {
|
||
default: withCtx(() => [..._cache[81] || (_cache[81] = [
|
||
createTextVNode("全部", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_radio_button, { value: "frontend" }, {
|
||
default: withCtx(() => [..._cache[82] || (_cache[82] = [
|
||
createTextVNode("前端", -1)
|
||
])]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_radio_button, { value: "backend" }, {
|
||
default: withCtx(() => [..._cache[83] || (_cache[83] = [
|
||
createTextVNode("后端", -1)
|
||
])]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue"]),
|
||
_cache[85] || (_cache[85] = createBaseVNode("span", { class: "ml-3 text-sm color-#909399" }, "类型", -1)),
|
||
createVNode(_component_el_checkbox_group, {
|
||
modelValue: previewTypes.value,
|
||
"onUpdate:modelValue": _cache[36] || (_cache[36] = ($event) => previewTypes.value = $event),
|
||
size: "small"
|
||
}, {
|
||
default: withCtx(() => [
|
||
(openBlock(), createElementBlock(Fragment, null, renderList(previewTypeOptions, (t) => {
|
||
return createVNode(_component_el_checkbox_button, {
|
||
key: t,
|
||
value: t
|
||
}, {
|
||
default: withCtx(() => [
|
||
createTextVNode(toDisplayString(t), 1)
|
||
]),
|
||
_: 2
|
||
}, 1032, ["value"]);
|
||
}), 64))
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue"])
|
||
])
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 6 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_scrollbar, { "max-height": "72vh" }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_tree, {
|
||
data: filteredTreeData.value,
|
||
"default-expand-all": "",
|
||
"highlight-current": "",
|
||
onNodeClick: handleFileTreeNodeClick
|
||
}, {
|
||
default: withCtx(({ data }) => [
|
||
createBaseVNode("div", {
|
||
class: normalizeClass(`i-svg:${getFileTreeNodeIcon(data.label)}`)
|
||
}, null, 2),
|
||
createBaseVNode("span", _hoisted_16, toDisplayString(data.label), 1)
|
||
]),
|
||
_: 1
|
||
}, 8, ["data"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}),
|
||
createVNode(_component_el_col, { span: 18 }, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_scrollbar, { "max-height": "72vh" }, {
|
||
default: withCtx(() => [
|
||
createBaseVNode("div", _hoisted_17, [
|
||
createVNode(_component_el_link, {
|
||
type: "primary",
|
||
onClick: handleCopyCode
|
||
}, {
|
||
default: withCtx(() => [
|
||
createVNode(_component_el_icon, null, {
|
||
default: withCtx(() => [
|
||
createVNode(unref(copy_document_default))
|
||
]),
|
||
_: 1
|
||
}),
|
||
_cache[86] || (_cache[86] = createTextVNode(" 复制代码 ", -1))
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
createVNode(unref(R), {
|
||
ref_key: "cmRef",
|
||
ref: cmRef,
|
||
value: code.value,
|
||
"onUpdate:value": _cache[37] || (_cache[37] = ($event) => code.value = $event),
|
||
options: cmOptions,
|
||
border: "",
|
||
readonly: true,
|
||
height: "100%",
|
||
width: "100%"
|
||
}, null, 8, ["value"])
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
})
|
||
]),
|
||
_: 1
|
||
}, 512), [
|
||
[vShow, activeStep.value == 2]
|
||
])
|
||
])
|
||
]),
|
||
_: 1
|
||
}, 8, ["modelValue", "title"])
|
||
]);
|
||
};
|
||
}
|
||
});
|
||
export {
|
||
_sfc_main as default
|
||
};
|