mirror of
https://github.com/yangzongzhuan/RuoYi-Vue3.git
synced 2025-09-28 15:22:42 +00:00
remove all semicolons
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
</el-col>
|
||||
</template>
|
||||
<script setup name="DraggableItem">
|
||||
import draggable from "vuedraggable/dist/vuedraggable.common";
|
||||
import draggable from "vuedraggable/dist/vuedraggable.common"
|
||||
import render from '@/utils/generator/render'
|
||||
|
||||
const props = defineProps({
|
||||
|
@@ -36,7 +36,7 @@ defineProps({
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// 表单校验
|
||||
const rules = ref({
|
||||
@@ -44,5 +44,5 @@ const rules = ref({
|
||||
tableComment: [{ required: true, message: "请输入表描述", trigger: "blur" }],
|
||||
className: [{ required: true, message: "请输入实体类名称", trigger: "blur" }],
|
||||
functionAuthor: [{ required: true, message: "请输入作者", trigger: "blur" }]
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
@@ -13,34 +13,34 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { createTable } from "@/api/tool/gen";
|
||||
import { createTable } from "@/api/tool/gen"
|
||||
|
||||
const visible = ref(false);
|
||||
const content = ref("");
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits(["ok"]);
|
||||
const visible = ref(false)
|
||||
const content = ref("")
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emit = defineEmits(["ok"])
|
||||
|
||||
/** 显示弹框 */
|
||||
function show() {
|
||||
visible.value = true;
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
/** 导入按钮操作 */
|
||||
function handleImportTable() {
|
||||
if (content.value === "") {
|
||||
proxy.$modal.msgError("请输入建表语句");
|
||||
return;
|
||||
proxy.$modal.msgError("请输入建表语句")
|
||||
return
|
||||
}
|
||||
createTable({ sql: content.value }).then(res => {
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
proxy.$modal.msgSuccess(res.msg)
|
||||
if (res.code === 200) {
|
||||
visible.value = false;
|
||||
emit("ok");
|
||||
visible.value = false
|
||||
emit("ok")
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
@@ -127,74 +127,74 @@
|
||||
</template>
|
||||
|
||||
<script setup name="GenEdit">
|
||||
import { getGenTable, updateGenTable } from "@/api/tool/gen";
|
||||
import { optionselect as getDictOptionselect } from "@/api/system/dict/type";
|
||||
import basicInfoForm from "./basicInfoForm";
|
||||
import genInfoForm from "./genInfoForm";
|
||||
import { getGenTable, updateGenTable } from "@/api/tool/gen"
|
||||
import { optionselect as getDictOptionselect } from "@/api/system/dict/type"
|
||||
import basicInfoForm from "./basicInfoForm"
|
||||
import genInfoForm from "./genInfoForm"
|
||||
|
||||
const route = useRoute();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const route = useRoute()
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const activeName = ref("columnInfo");
|
||||
const tableHeight = ref(document.documentElement.scrollHeight - 245 + "px");
|
||||
const tables = ref([]);
|
||||
const columns = ref([]);
|
||||
const dictOptions = ref([]);
|
||||
const info = ref({});
|
||||
const activeName = ref("columnInfo")
|
||||
const tableHeight = ref(document.documentElement.scrollHeight - 245 + "px")
|
||||
const tables = ref([])
|
||||
const columns = ref([])
|
||||
const dictOptions = ref([])
|
||||
const info = ref({})
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
const basicForm = proxy.$refs.basicInfo.$refs.basicInfoForm;
|
||||
const genForm = proxy.$refs.genInfo.$refs.genInfoForm;
|
||||
const basicForm = proxy.$refs.basicInfo.$refs.basicInfoForm
|
||||
const genForm = proxy.$refs.genInfo.$refs.genInfoForm
|
||||
Promise.all([basicForm, genForm].map(getFormPromise)).then(res => {
|
||||
const validateResult = res.every(item => !!item);
|
||||
const validateResult = res.every(item => !!item)
|
||||
if (validateResult) {
|
||||
const genTable = Object.assign({}, info.value);
|
||||
genTable.columns = columns.value;
|
||||
const genTable = Object.assign({}, info.value)
|
||||
genTable.columns = columns.value
|
||||
genTable.params = {
|
||||
treeCode: info.value.treeCode,
|
||||
treeName: info.value.treeName,
|
||||
treeParentCode: info.value.treeParentCode,
|
||||
parentMenuId: info.value.parentMenuId
|
||||
};
|
||||
}
|
||||
updateGenTable(genTable).then(res => {
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
proxy.$modal.msgSuccess(res.msg)
|
||||
if (res.code === 200) {
|
||||
close();
|
||||
close()
|
||||
}
|
||||
});
|
||||
})
|
||||
} else {
|
||||
proxy.$modal.msgError("表单校验未通过,请重新检查提交内容");
|
||||
proxy.$modal.msgError("表单校验未通过,请重新检查提交内容")
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function getFormPromise(form) {
|
||||
return new Promise(resolve => {
|
||||
form.validate(res => {
|
||||
resolve(res);
|
||||
});
|
||||
});
|
||||
resolve(res)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function close() {
|
||||
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } };
|
||||
proxy.$tab.closeOpenPage(obj);
|
||||
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } }
|
||||
proxy.$tab.closeOpenPage(obj)
|
||||
}
|
||||
|
||||
(() => {
|
||||
const tableId = route.params && route.params.tableId;
|
||||
const tableId = route.params && route.params.tableId
|
||||
if (tableId) {
|
||||
// 获取表详细信息
|
||||
getGenTable(tableId).then(res => {
|
||||
columns.value = res.data.rows;
|
||||
info.value = res.data.info;
|
||||
tables.value = res.data.tables;
|
||||
});
|
||||
columns.value = res.data.rows
|
||||
info.value = res.data.info
|
||||
tables.value = res.data.tables
|
||||
})
|
||||
/** 查询字典下拉列表 */
|
||||
getDictOptionselect().then(response => {
|
||||
dictOptions.value = response.data;
|
||||
});
|
||||
dictOptions.value = response.data
|
||||
})
|
||||
}
|
||||
})();
|
||||
})()
|
||||
</script>
|
||||
|
@@ -235,11 +235,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listMenu } from "@/api/system/menu";
|
||||
import { listMenu } from "@/api/system/menu"
|
||||
|
||||
const subColumns = ref([]);
|
||||
const menuOptions = ref([]);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const subColumns = ref([])
|
||||
const menuOptions = ref([])
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const props = defineProps({
|
||||
info: {
|
||||
@@ -250,7 +250,7 @@ const props = defineProps({
|
||||
type: Array,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// 表单校验
|
||||
const rules = ref({
|
||||
@@ -259,25 +259,25 @@ const rules = ref({
|
||||
moduleName: [{ required: true, message: "请输入生成模块名", trigger: "blur" }],
|
||||
businessName: [{ required: true, message: "请输入生成业务名", trigger: "blur" }],
|
||||
functionName: [{ required: true, message: "请输入生成功能名", trigger: "blur" }]
|
||||
});
|
||||
})
|
||||
|
||||
function subSelectChange(value) {
|
||||
props.info.subTableFkName = "";
|
||||
props.info.subTableFkName = ""
|
||||
}
|
||||
|
||||
function tplSelectChange(value) {
|
||||
if (value !== "sub") {
|
||||
props.info.subTableName = "";
|
||||
props.info.subTableFkName = "";
|
||||
props.info.subTableName = ""
|
||||
props.info.subTableFkName = ""
|
||||
}
|
||||
}
|
||||
|
||||
function setSubTableColumns(value) {
|
||||
for (var item in props.tables) {
|
||||
const name = props.tables[item].tableName;
|
||||
const name = props.tables[item].tableName
|
||||
if (value === name) {
|
||||
subColumns.value = props.tables[item].columns;
|
||||
break;
|
||||
subColumns.value = props.tables[item].columns
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -285,22 +285,21 @@ function setSubTableColumns(value) {
|
||||
/** 查询菜单下拉树结构 */
|
||||
function getMenuTreeselect() {
|
||||
listMenu().then(response => {
|
||||
menuOptions.value = proxy.handleTree(response.data, "menuId");
|
||||
});
|
||||
menuOptions.value = proxy.handleTree(response.data, "menuId")
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getMenuTreeselect();
|
||||
getMenuTreeselect()
|
||||
})
|
||||
|
||||
watch(() => props.info.subTableName, val => {
|
||||
setSubTableColumns(val);
|
||||
});
|
||||
setSubTableColumns(val)
|
||||
})
|
||||
|
||||
watch(() => props.info.tplWebType, val => {
|
||||
if (val === '') {
|
||||
props.info.tplWebType = "element-plus";
|
||||
props.info.tplWebType = "element-plus"
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
|
@@ -51,76 +51,76 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listDbTable, importTable } from "@/api/tool/gen";
|
||||
import { listDbTable, importTable } from "@/api/tool/gen"
|
||||
|
||||
const total = ref(0);
|
||||
const visible = ref(false);
|
||||
const tables = ref([]);
|
||||
const dbTableList = ref([]);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const total = ref(0)
|
||||
const visible = ref(false)
|
||||
const tables = ref([])
|
||||
const dbTableList = ref([])
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
tableName: undefined,
|
||||
tableComment: undefined
|
||||
});
|
||||
})
|
||||
|
||||
const emit = defineEmits(["ok"]);
|
||||
const emit = defineEmits(["ok"])
|
||||
|
||||
/** 查询参数列表 */
|
||||
function show() {
|
||||
getList();
|
||||
visible.value = true;
|
||||
getList()
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
/** 单击选择行 */
|
||||
function clickRow(row) {
|
||||
proxy.$refs.table.toggleRowSelection(row);
|
||||
proxy.$refs.table.toggleRowSelection(row)
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
tables.value = selection.map(item => item.tableName);
|
||||
tables.value = selection.map(item => item.tableName)
|
||||
}
|
||||
|
||||
/** 查询表数据 */
|
||||
function getList() {
|
||||
listDbTable(queryParams).then(res => {
|
||||
dbTableList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
dbTableList.value = res.rows
|
||||
total.value = res.total
|
||||
})
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
queryParams.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 导入按钮操作 */
|
||||
function handleImportTable() {
|
||||
const tableNames = tables.value.join(",");
|
||||
const tableNames = tables.value.join(",")
|
||||
if (tableNames == "") {
|
||||
proxy.$modal.msgError("请选择要导入的表");
|
||||
return;
|
||||
proxy.$modal.msgError("请选择要导入的表")
|
||||
return
|
||||
}
|
||||
importTable({ tables: tableNames }).then(res => {
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
proxy.$modal.msgSuccess(res.msg)
|
||||
if (res.code === 200) {
|
||||
visible.value = false;
|
||||
emit("ok");
|
||||
visible.value = false
|
||||
emit("ok")
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
@@ -146,25 +146,25 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Gen">
|
||||
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
||||
import router from "@/router";
|
||||
import importTable from "./importTable";
|
||||
import createTable from "./createTable";
|
||||
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"
|
||||
import router from "@/router"
|
||||
import importTable from "./importTable"
|
||||
import createTable from "./createTable"
|
||||
|
||||
const route = useRoute();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const route = useRoute()
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const tableList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const tableNames = ref([]);
|
||||
const dateRange = ref([]);
|
||||
const uniqueId = ref("");
|
||||
const defaultSort = ref({ prop: "createTime", order: "descending" });
|
||||
const tableList = ref([])
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const tableNames = ref([])
|
||||
const dateRange = ref([])
|
||||
const uniqueId = ref("")
|
||||
const defaultSort = ref({ prop: "createTime", order: "descending" })
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
@@ -181,126 +181,126 @@ const data = reactive({
|
||||
data: {},
|
||||
activeName: "domain.java"
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
const { queryParams, preview } = toRefs(data);
|
||||
const { queryParams, preview } = toRefs(data)
|
||||
|
||||
onActivated(() => {
|
||||
const time = route.query.t;
|
||||
const time = route.query.t
|
||||
if (time != null && time != uniqueId.value) {
|
||||
uniqueId.value = time;
|
||||
queryParams.value.pageNum = Number(route.query.pageNum);
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryForm");
|
||||
getList();
|
||||
uniqueId.value = time
|
||||
queryParams.value.pageNum = Number(route.query.pageNum)
|
||||
dateRange.value = []
|
||||
proxy.resetForm("queryForm")
|
||||
getList()
|
||||
}
|
||||
})
|
||||
|
||||
/** 查询表集合 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
loading.value = true
|
||||
listTable(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
||||
tableList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
tableList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 生成代码操作 */
|
||||
function handleGenTable(row) {
|
||||
const tbNames = row.tableName || tableNames.value;
|
||||
const tbNames = row.tableName || tableNames.value
|
||||
if (tbNames == "") {
|
||||
proxy.$modal.msgError("请选择要生成的数据");
|
||||
return;
|
||||
proxy.$modal.msgError("请选择要生成的数据")
|
||||
return
|
||||
}
|
||||
if (row.genType === "1") {
|
||||
genCode(row.tableName).then(response => {
|
||||
proxy.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
|
||||
});
|
||||
proxy.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath)
|
||||
})
|
||||
} else {
|
||||
proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "ruoyi.zip");
|
||||
proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "ruoyi.zip")
|
||||
}
|
||||
}
|
||||
|
||||
/** 同步数据库操作 */
|
||||
function handleSynchDb(row) {
|
||||
const tableName = row.tableName;
|
||||
const tableName = row.tableName
|
||||
proxy.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function () {
|
||||
return synchDb(tableName);
|
||||
return synchDb(tableName)
|
||||
}).then(() => {
|
||||
proxy.$modal.msgSuccess("同步成功");
|
||||
}).catch(() => {});
|
||||
proxy.$modal.msgSuccess("同步成功")
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
/** 打开导入表弹窗 */
|
||||
function openImportTable() {
|
||||
proxy.$refs["importRef"].show();
|
||||
proxy.$refs["importRef"].show()
|
||||
}
|
||||
|
||||
/** 打开创建表弹窗 */
|
||||
function openCreateTable() {
|
||||
proxy.$refs["createRef"].show();
|
||||
proxy.$refs["createRef"].show()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
queryParams.value.pageNum = 1;
|
||||
proxy.$refs["genRef"].sort(defaultSort.value.prop, defaultSort.value.order);
|
||||
dateRange.value = []
|
||||
proxy.resetForm("queryRef")
|
||||
queryParams.value.pageNum = 1
|
||||
proxy.$refs["genRef"].sort(defaultSort.value.prop, defaultSort.value.order)
|
||||
}
|
||||
|
||||
/** 预览按钮 */
|
||||
function handlePreview(row) {
|
||||
previewTable(row.tableId).then(response => {
|
||||
preview.value.data = response.data;
|
||||
preview.value.open = true;
|
||||
preview.value.activeName = "domain.java";
|
||||
});
|
||||
preview.value.data = response.data
|
||||
preview.value.open = true
|
||||
preview.value.activeName = "domain.java"
|
||||
})
|
||||
}
|
||||
|
||||
/** 复制代码成功 */
|
||||
function copyTextSuccess() {
|
||||
proxy.$modal.msgSuccess("复制成功");
|
||||
proxy.$modal.msgSuccess("复制成功")
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.tableId);
|
||||
tableNames.value = selection.map(item => item.tableName);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
ids.value = selection.map(item => item.tableId)
|
||||
tableNames.value = selection.map(item => item.tableName)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 排序触发事件 */
|
||||
function handleSortChange(column, prop, order) {
|
||||
queryParams.value.orderByColumn = column.prop;
|
||||
queryParams.value.isAsc = column.order;
|
||||
getList();
|
||||
queryParams.value.orderByColumn = column.prop
|
||||
queryParams.value.isAsc = column.order
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleEditTable(row) {
|
||||
const tableId = row.tableId || ids.value[0];
|
||||
router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } });
|
||||
const tableId = row.tableId || ids.value[0]
|
||||
router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } })
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const tableIds = row.tableId || ids.value;
|
||||
const tableIds = row.tableId || ids.value
|
||||
proxy.$modal.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?').then(function () {
|
||||
return delTable(tableIds);
|
||||
return delTable(tableIds)
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
getList();
|
||||
getList()
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user