bugfix
This commit is contained in:
@ -33,11 +33,6 @@ export function register(data) {
|
||||
|
||||
// 获取用户详细信息
|
||||
export function getInfo() {
|
||||
// if (useUserStore().userInfoRes) {
|
||||
// return new Promise((resolve, reject) => {
|
||||
// resolve(useUserStore().userInfoRes);
|
||||
// });
|
||||
// }
|
||||
return request({
|
||||
url: "/getInfo",
|
||||
method: "get",
|
||||
|
@ -7,16 +7,13 @@ export const check = (tenantId) => {
|
||||
});
|
||||
};
|
||||
|
||||
// /tenant/init/createTables/{tenantId}
|
||||
export const createTables = (tenantId) => {
|
||||
return request({
|
||||
url: `/tenant/init/createTables/${tenantId}`,
|
||||
method: "POST",
|
||||
// timeout:1
|
||||
});
|
||||
};
|
||||
|
||||
// /tenant/init/initData/{tenantId}
|
||||
export const initData = (tenantId) => {
|
||||
return request({
|
||||
url: `/tenant/init/initData/${tenantId}`,
|
||||
|
@ -37,6 +37,8 @@ const useSettingsStore = defineStore("settings", {
|
||||
storageSetting.dynamicTitle === undefined
|
||||
? dynamicTitle
|
||||
: storageSetting.dynamicTitle,
|
||||
// 生成代码下载选项,默认:all
|
||||
downloadGenCodeType: "all",
|
||||
}),
|
||||
actions: {
|
||||
// 修改布局设置
|
||||
@ -51,7 +53,16 @@ const useSettingsStore = defineStore("settings", {
|
||||
this.title = title;
|
||||
useDynamicTitle();
|
||||
},
|
||||
setDownloadGenCodeType(type) {
|
||||
this.downloadGenCodeType = type;
|
||||
},
|
||||
},
|
||||
persist: [
|
||||
{
|
||||
paths: ["downloadGenCodeType"],
|
||||
storage: localStorage,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export default useSettingsStore;
|
||||
|
@ -27,17 +27,6 @@
|
||||
@change="handleTenantChange"
|
||||
@confirm="handleTenantConfirm"
|
||||
/>
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="loginForm.tenant"-->
|
||||
<!-- auto-complete="off"-->
|
||||
<!-- placeholder="租户"-->
|
||||
<!-- size="large"-->
|
||||
<!-- type="text"-->
|
||||
<!-- >-->
|
||||
<!-- <template #prefix>-->
|
||||
<!-- <svg-icon class="el-input__icon input-icon" icon-class="user"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-input>-->
|
||||
</el-form-item>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
|
@ -127,9 +127,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="初始化状态">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-tag :type="row.initialized === '1' ? 'success' : 'warning'"-->
|
||||
<!-- >{{ row.initialized === "1" ? "是" : "否" }}-->
|
||||
<!-- </el-tag>-->
|
||||
<dict-tag :options="initStatusDict" :value="row.initialized" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -359,7 +356,6 @@
|
||||
inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 折叠按钮, 切换折叠状态时有旋转动画效果 -->
|
||||
<el-divider content-position="left">
|
||||
<div
|
||||
class="show-advanced"
|
||||
@ -380,7 +376,6 @@
|
||||
</el-divider>
|
||||
<Transition name="slide-fade">
|
||||
<div v-if="showDatasourceAdvanced">
|
||||
<!-- initCount minCount maxCount -->
|
||||
<el-form-item label="初始化连接数" prop="initCount">
|
||||
<el-input-number v-model="dataSourceForm.initCount" :min="0" />
|
||||
</el-form-item>
|
||||
|
@ -58,11 +58,9 @@
|
||||
>
|
||||
<el-col :span="12">
|
||||
<div class="data-card init-check-base-data">
|
||||
<!-- 卡片左上角小标题, 覆盖在边框上 -->
|
||||
<div class="card-title">
|
||||
<span>基础数据</span>
|
||||
</div>
|
||||
<!-- 左边是标题,右边是值, 标题加粗黑色, 值比标题略小,略灰, -->
|
||||
<div class="card-content">
|
||||
<div class="card-content-item">
|
||||
<span class="card-content-item-title">租户名称:</span>
|
||||
|
@ -26,8 +26,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
>搜索
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -40,8 +40,8 @@
|
||||
icon="Download"
|
||||
@click="handleGenTable"
|
||||
v-hasPermi="['tool:gen:code']"
|
||||
>生成</el-button
|
||||
>
|
||||
>生成
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -50,8 +50,8 @@
|
||||
icon="Upload"
|
||||
@click="openImportTable"
|
||||
v-hasPermi="['tool:gen:import']"
|
||||
>导入</el-button
|
||||
>
|
||||
>导入
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -61,8 +61,8 @@
|
||||
:disabled="single"
|
||||
@click="handleEditTable"
|
||||
v-hasPermi="['tool:gen:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -72,8 +72,8 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['tool:gen:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@ -212,8 +212,8 @@
|
||||
v-copyText="value"
|
||||
v-copyText:callback="copyTextSuccess"
|
||||
style="float: right"
|
||||
> 复制</el-link
|
||||
>
|
||||
> 复制
|
||||
</el-link>
|
||||
<pre>{{ value }}</pre>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -222,16 +222,13 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Gen">
|
||||
import {
|
||||
listTable,
|
||||
previewTable,
|
||||
delTable,
|
||||
genCode,
|
||||
synchDb,
|
||||
} from "@/api/tool/gen";
|
||||
<script setup name="Gen" lang="jsx">
|
||||
import { delTable, listTable, previewTable, synchDb } from "@/api/tool/gen";
|
||||
import router from "@/router";
|
||||
import importTable from "./importTable";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { ref } from "vue";
|
||||
import useSettingsStore from "@/store/modules/settings";
|
||||
|
||||
const route = useRoute();
|
||||
const { proxy } = getCurrentInstance();
|
||||
@ -282,18 +279,44 @@ function getList() {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
// 下载生成代码选项
|
||||
const downloadArg = ref(null);
|
||||
|
||||
/** 生成代码操作 */
|
||||
function handleGenTable(row) {
|
||||
proxy.$download.zip(
|
||||
"/tool/gen/download/" + row.tableId,
|
||||
row.tableName + ".zip"
|
||||
downloadArg.value = useSettingsStore().downloadGenCodeType;
|
||||
// jsx vnode 单选:全部, Java, SQL
|
||||
const h = () => (
|
||||
<el-form>
|
||||
<el-form-item prop="downloadArg">
|
||||
<el-radio-group v-model={downloadArg.value}>
|
||||
<el-radio label="all">全部</el-radio>
|
||||
<el-radio label="vue">vue</el-radio>
|
||||
<el-radio label="java">Java</el-radio>
|
||||
<el-radio label="sql">SQL</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
);
|
||||
ElMessageBox.confirm(h, "下载类型", {
|
||||
"custom-class": "gen-download-type",
|
||||
center: true,
|
||||
}).then(() => {
|
||||
useSettingsStore().setDownloadGenCodeType(downloadArg.value);
|
||||
proxy.$download.zip(
|
||||
`/tool/gen/download/${row.tableId}/${downloadArg.value}`,
|
||||
`${row.tableName}_${downloadArg.value}.zip`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/** 同步数据库操作 */
|
||||
function handleSynchDb(row) {
|
||||
const tableName = row.tableName;
|
||||
@ -307,27 +330,36 @@ function handleSynchDb(row) {
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 打开导入表弹窗 */
|
||||
function openImportTable() {
|
||||
proxy.$refs["importRef"].show();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 预览按钮 */
|
||||
function handlePreview(row) {
|
||||
previewTable(row.tableId).then((response) => {
|
||||
preview.value.data = response.data;
|
||||
preview.value.open = true;
|
||||
preview.value.activeName = "domain.java";
|
||||
const firstTab = Object.keys(response.data)[0];
|
||||
preview.value.activeName = firstTab.substring(
|
||||
firstTab.lastIndexOf("/") + 1,
|
||||
firstTab.indexOf(".vm")
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/** 复制代码成功 */
|
||||
function copyTextSuccess() {
|
||||
proxy.$modal.msgSuccess("复制成功");
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.tableId);
|
||||
@ -335,6 +367,7 @@ function handleSelectionChange(selection) {
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleEditTable(row) {
|
||||
const tableId = row.tableId || ids.value[0];
|
||||
@ -343,6 +376,7 @@ function handleEditTable(row) {
|
||||
query: { pageNum: queryParams.value.pageNum },
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const tableIds = row.tableId || ids.value;
|
||||
|
Reference in New Issue
Block a user