mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-02 15:30:25 +08:00
fix: 功能优化&小问题修复
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"countup.js": "^2.0.7",
|
||||
"cropperjs": "^1.5.11",
|
||||
"echarts": "^5.3.2",
|
||||
"element-plus": "^2.2.4",
|
||||
"element-plus": "^2.2.6",
|
||||
"jsoneditor": "^9.8.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mitt": "^3.0.0",
|
||||
|
||||
@@ -239,16 +239,6 @@
|
||||
color: set-color(primary);
|
||||
}
|
||||
|
||||
/* Switch 开关
|
||||
------------------------------- */
|
||||
.el-switch.is-checked .el-switch__core {
|
||||
border-color: set-color(primary);
|
||||
background-color: set-color(primary);
|
||||
}
|
||||
.el-switch__label.is-active {
|
||||
color: set-color(primary);
|
||||
}
|
||||
|
||||
/* Slider 滑块
|
||||
------------------------------- */
|
||||
.el-slider__bar {
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<el-row class="mb10">
|
||||
<el-button type="primary" size="small" @click="tableCreateDialog.visible = true">创建表</el-button>
|
||||
</el-row>
|
||||
<el-table border stripe :data="tableInfoDialog.infos" size="small">
|
||||
<el-table v-loading="tableInfoDialog.loading" border stripe :data="tableInfoDialog.infos" size="small">
|
||||
<el-table-column property="tableName" label="表名" min-width="150" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column property="tableComment" label="备注" min-width="150" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column
|
||||
@@ -276,6 +276,7 @@ export default defineComponent({
|
||||
},
|
||||
chooseTableName: '',
|
||||
tableInfoDialog: {
|
||||
loading: false,
|
||||
visible: false,
|
||||
infos: [],
|
||||
},
|
||||
@@ -434,10 +435,15 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
const showTableInfo = async (row: any, db: string) => {
|
||||
state.tableInfoDialog.infos = await dbApi.tableInfos.request({ id: row.id, db });
|
||||
state.dbId = row.id;
|
||||
state.db = db;
|
||||
state.tableInfoDialog.loading = true;
|
||||
state.tableInfoDialog.visible = true;
|
||||
try {
|
||||
state.tableInfoDialog.infos = await dbApi.tableInfos.request({ id: row.id, db });
|
||||
state.dbId = row.id;
|
||||
state.db = db;
|
||||
} finally {
|
||||
state.tableInfoDialog.loading = false;
|
||||
}
|
||||
};
|
||||
|
||||
const closeTableInfo = () => {
|
||||
|
||||
@@ -215,7 +215,6 @@
|
||||
<template #header>
|
||||
<el-tooltip raw-content placement="top" effect="customized">
|
||||
<template #content> {{ getColumnTip(dt.name, item) }} </template>
|
||||
<!-- <el-icon><question-filled /></el-icon> -->
|
||||
{{ item }}
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
@@ -84,16 +84,22 @@ export default defineComponent({
|
||||
ElMessage.error('请输入执行的备注信息');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
state.btnLoading = true;
|
||||
await dbApi.sqlExec.request({
|
||||
const res = await dbApi.sqlExec.request({
|
||||
id: state.dbId,
|
||||
db: state.db,
|
||||
remark: state.remark,
|
||||
sql: state.sqlValue.trim(),
|
||||
});
|
||||
runSuccess = true;
|
||||
if (parseInt(res.res[0].影响条数) >= 1) {
|
||||
ElMessage.success('执行成功');
|
||||
runSuccess = true;
|
||||
} else {
|
||||
ElMessage.error('执行失败');
|
||||
runSuccess = false;
|
||||
}
|
||||
} catch (e) {
|
||||
runSuccess = false;
|
||||
}
|
||||
|
||||
@@ -89,15 +89,11 @@
|
||||
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-if="data.type == '-' && data.size < 1 * 1024 * 1024">
|
||||
<el-link
|
||||
@click.prevent="getFileContent(tree.folder.id, data.path)"
|
||||
type="info"
|
||||
icon="view"
|
||||
:underline="false"
|
||||
>
|
||||
查看
|
||||
</el-link>
|
||||
<el-dropdown-item
|
||||
@click="getFileContent(tree.folder.id, data.path)"
|
||||
v-if="data.type == '-' && data.size < 1 * 1024 * 1024"
|
||||
>
|
||||
<el-link type="info" icon="view" :underline="false">查看</el-link>
|
||||
</el-dropdown-item>
|
||||
|
||||
<span v-auth="'machine:file:upload'">
|
||||
@@ -112,34 +108,20 @@
|
||||
name="file"
|
||||
style="display: inline-block; margin-left: 2px"
|
||||
>
|
||||
<el-link icon="upload" :underline="false"> 上传 </el-link>
|
||||
<el-link icon="upload" :underline="false">上传</el-link>
|
||||
</el-upload>
|
||||
</el-dropdown-item>
|
||||
</span>
|
||||
|
||||
<span v-auth="'machine:file:write'">
|
||||
<el-dropdown-item v-if="data.type == '-'">
|
||||
<el-link
|
||||
@click.prevent="downloadFile(node, data)"
|
||||
type="primary"
|
||||
icon="download"
|
||||
:underline="false"
|
||||
style="margin-left: 2px"
|
||||
>下载</el-link
|
||||
>
|
||||
<el-dropdown-item @click="downloadFile(node, data)" v-if="data.type == '-'">
|
||||
<el-link type="primary" icon="download" :underline="false" style="margin-left: 2px">下载</el-link>
|
||||
</el-dropdown-item>
|
||||
</span>
|
||||
|
||||
<span v-auth="'machine:file:rm'">
|
||||
<el-dropdown-item v-if="!dontOperate(data)">
|
||||
<el-link
|
||||
@click.prevent="deleteFile(node, data)"
|
||||
type="danger"
|
||||
icon="delete"
|
||||
:underline="false"
|
||||
style="margin-left: 2px"
|
||||
>删除
|
||||
</el-link>
|
||||
<el-dropdown-item @click="deleteFile(node, data)" v-if="!dontOperate(data)">
|
||||
<el-link type="danger" icon="delete" :underline="false" style="margin-left: 2px">删除</el-link>
|
||||
</el-dropdown-item>
|
||||
</span>
|
||||
</el-dropdown-menu>
|
||||
|
||||
@@ -57,11 +57,10 @@
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="-1"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
inline-prompt
|
||||
active-text="启用"
|
||||
inactive-text="停用"
|
||||
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
||||
@change="changeStatus(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
|
||||
@@ -37,17 +37,17 @@
|
||||
minimatch "^3.0.4"
|
||||
strip-json-comments "^3.1.1"
|
||||
|
||||
"@floating-ui/core@^0.7.2":
|
||||
version "0.7.2"
|
||||
resolved "https://registry.npmmirror.com/@floating-ui/core/-/core-0.7.2.tgz#f7af9613d080dc29360e77c970965b79b524d45a"
|
||||
integrity sha512-FRVAkSNU/vGXLIsgbggcs70GkXKEOXgBBbNpYPNHSaKsCAMMd00NrjbtKTesxkdv9xm9N3+XiDlcFGY6WnatBg==
|
||||
"@floating-ui/core@^0.7.3":
|
||||
version "0.7.3"
|
||||
resolved "https://registry.npmmirror.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86"
|
||||
integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg==
|
||||
|
||||
"@floating-ui/dom@^0.5.0":
|
||||
version "0.5.2"
|
||||
resolved "https://registry.npmmirror.com/@floating-ui/dom/-/dom-0.5.2.tgz#908f3febbfc0d6696d70921616ec194fe07af183"
|
||||
integrity sha512-z1DnEa7F3d8Fm/eXSbii8UEGpcjZGkQaYYUI0WpEVgD3vBfebDW8j/3ysusxonuMexoigA+A3b/fYH7sEqiwyg==
|
||||
"@floating-ui/dom@^0.5.3":
|
||||
version "0.5.4"
|
||||
resolved "https://registry.npmmirror.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1"
|
||||
integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg==
|
||||
dependencies:
|
||||
"@floating-ui/core" "^0.7.2"
|
||||
"@floating-ui/core" "^0.7.3"
|
||||
|
||||
"@humanwhocodes/config-array@^0.9.2":
|
||||
version "0.9.2"
|
||||
@@ -131,6 +131,11 @@
|
||||
resolved "https://registry.npmmirror.com/@types/sortablejs/download/@types/sortablejs-1.10.7.tgz#ab9039c85429f0516955ec6dbc0bb20139417b15"
|
||||
integrity sha1-q5A5yFQp8FFpVextvAuyATlBexU=
|
||||
|
||||
"@types/web-bluetooth@^0.0.14":
|
||||
version "0.0.14"
|
||||
resolved "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.14.tgz#94e175b53623384bff1f354cdb3197a8d63cdbe5"
|
||||
integrity sha512-5d2RhCard1nQUC3aHcq/gHzWYO6K0WJmAbjO7mQJgCQKtZpgXxv1rOM6O/dBDhDYYVutk1sciOgNSe+5YyfM8A==
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^4.23.0":
|
||||
version "4.33.0"
|
||||
resolved "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276"
|
||||
@@ -364,24 +369,25 @@
|
||||
resolved "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.37.tgz#8e6adc3f2759af52f0e85863dfb0b711ecc5c702"
|
||||
integrity sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==
|
||||
|
||||
"@vueuse/core@^8.5.0":
|
||||
version "8.6.0"
|
||||
resolved "https://registry.npmmirror.com/@vueuse/core/-/core-8.6.0.tgz#a8f80363cc63d17382423f16beae57696f376e67"
|
||||
integrity sha512-VirzExCm/N+QdrEWT7J4uSrvJ5hquKIAU9alQ37kUvIJk9XxCLxmfRnmekYc1kz2+6BnoyuKYXVmrMV351CB4w==
|
||||
"@vueuse/core@^8.6.0":
|
||||
version "8.7.5"
|
||||
resolved "https://registry.npmmirror.com/@vueuse/core/-/core-8.7.5.tgz#e74a888251ea11a9d432068ce18cbdfc4f810251"
|
||||
integrity sha512-tqgzeZGoZcXzoit4kOGLWJibDMLp0vdm6ZO41SSUQhkhtrPhAg6dbIEPiahhUu6sZAmSYvVrZgEr5aKD51nrLA==
|
||||
dependencies:
|
||||
"@vueuse/metadata" "8.6.0"
|
||||
"@vueuse/shared" "8.6.0"
|
||||
"@types/web-bluetooth" "^0.0.14"
|
||||
"@vueuse/metadata" "8.7.5"
|
||||
"@vueuse/shared" "8.7.5"
|
||||
vue-demi "*"
|
||||
|
||||
"@vueuse/metadata@8.6.0":
|
||||
version "8.6.0"
|
||||
resolved "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-8.6.0.tgz#34771443a72ee891ae001a70aa05dd9a1d799372"
|
||||
integrity sha512-F+CKPvaExsm7QgRr8y+ZNJFwXasn89rs5wth/HeX9lJ1q8XEt+HJ16Q5Sxh4rfG5YSKXrStveVge8TKvPjMjFA==
|
||||
"@vueuse/metadata@8.7.5":
|
||||
version "8.7.5"
|
||||
resolved "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-8.7.5.tgz#c7f2b21d873d1604a8860ed9c5728d8f3295f00a"
|
||||
integrity sha512-emJZKRQSaEnVqmlu39NpNp8iaW+bPC2kWykWoWOZMSlO/0QVEmO/rt8A5VhOEJTKLX3vwTevqbiRy9WJRwVOQg==
|
||||
|
||||
"@vueuse/shared@8.6.0":
|
||||
version "8.6.0"
|
||||
resolved "https://registry.npmmirror.com/@vueuse/shared/-/shared-8.6.0.tgz#63dad9fc4b73a7fccbe5d6b97adeacf73d4fec41"
|
||||
integrity sha512-Y/IVywZo7IfEoSSEtCYpkVEmPV7pU35mEIxV7PbD/D3ly18B3mEsBaPbtDkNM/QP3zAZ5mn4nEkOfddX4uwuIA==
|
||||
"@vueuse/shared@8.7.5":
|
||||
version "8.7.5"
|
||||
resolved "https://registry.npmmirror.com/@vueuse/shared/-/shared-8.7.5.tgz#06fb08f6f8fc9e90be9d1e033fa443de927172b0"
|
||||
integrity sha512-THXPvMBFmg6Gf6AwRn/EdTh2mhqwjGsB2Yfp374LNQSQVKRHtnJ0I42bsZTn7nuEliBxqUrGQm/lN6qUHmhJLw==
|
||||
dependencies:
|
||||
vue-demi "*"
|
||||
|
||||
@@ -578,10 +584,10 @@ csstype@^2.6.8:
|
||||
resolved "https://registry.npmmirror.com/csstype/download/csstype-2.6.19.tgz?cache=0&sync_timestamp=1637224514674&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcsstype%2Fdownload%2Fcsstype-2.6.19.tgz#feeb5aae89020bb389e1f63669a5ed490e391caa"
|
||||
integrity sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==
|
||||
|
||||
dayjs@^1.11.2:
|
||||
version "1.11.2"
|
||||
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.2.tgz#fa0f5223ef0d6724b3d8327134890cfe3d72fbe5"
|
||||
integrity sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==
|
||||
dayjs@^1.11.3:
|
||||
version "1.11.3"
|
||||
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.3.tgz#4754eb694a624057b9ad2224b67b15d552589258"
|
||||
integrity sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==
|
||||
|
||||
debug@^4.1.1, debug@^4.3.1, debug@^4.3.2:
|
||||
version "4.3.3"
|
||||
@@ -632,20 +638,20 @@ echarts@^5.3.2:
|
||||
tslib "2.3.0"
|
||||
zrender "5.3.1"
|
||||
|
||||
element-plus@^2.2.4:
|
||||
version "2.2.4"
|
||||
resolved "https://registry.npmmirror.com/element-plus/-/element-plus-2.2.4.tgz#f07f400222a5b0ae93ee9a139155342604746813"
|
||||
integrity sha512-jktZr0o3ARDxWNWPEaJZQm2BN7thTpQl0aIfCUo5eB5m+zEap2DEcojyGKMHSQsCULcPM32NFfu2sHlhbhOiGA==
|
||||
element-plus@^2.2.6:
|
||||
version "2.2.6"
|
||||
resolved "https://registry.npmmirror.com/element-plus/-/element-plus-2.2.6.tgz#60b9e91a2159526123d1b950263de37947153433"
|
||||
integrity sha512-N9G4yWSxDt1YtreCJgt7UaSsXKuR4Fzb3ThzlBjbGDYDhcHijsrLL3qkdLZgeoSB13LRyr9pgP1ljNXdaYGa+g==
|
||||
dependencies:
|
||||
"@ctrl/tinycolor" "^3.4.1"
|
||||
"@element-plus/icons-vue" "^2.0.5"
|
||||
"@floating-ui/dom" "^0.5.0"
|
||||
"@floating-ui/dom" "^0.5.3"
|
||||
"@popperjs/core" "npm:@sxzz/popperjs-es@^2.11.7"
|
||||
"@types/lodash" "^4.14.182"
|
||||
"@types/lodash-es" "^4.17.6"
|
||||
"@vueuse/core" "^8.5.0"
|
||||
"@vueuse/core" "^8.6.0"
|
||||
async-validator "^4.1.1"
|
||||
dayjs "^1.11.2"
|
||||
dayjs "^1.11.3"
|
||||
escape-html "^1.0.3"
|
||||
lodash "^4.17.21"
|
||||
lodash-es "^4.17.21"
|
||||
|
||||
@@ -352,19 +352,19 @@ const (
|
||||
// mysql 表信息元数据
|
||||
MYSQL_TABLE_MA = `SELECT table_name tableName, engine, table_comment tableComment,
|
||||
create_time createTime from information_schema.tables
|
||||
WHERE table_schema = (SELECT database())`
|
||||
WHERE table_schema = (SELECT database()) LIMIT 2000`
|
||||
|
||||
// mysql 表信息
|
||||
MYSQL_TABLE_INFO = `SELECT table_name tableName, table_comment tableComment, table_rows tableRows,
|
||||
data_length dataLength, index_length indexLength, create_time createTime
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = (SELECT database())`
|
||||
WHERE table_schema = (SELECT database()) LIMIT 2000`
|
||||
|
||||
// mysql 索引信息
|
||||
MYSQL_INDEX_INFO = `SELECT index_name indexName, column_name columnName, index_type indexType,
|
||||
SEQ_IN_INDEX seqInIndex, INDEX_COMMENT indexComment
|
||||
FROM information_schema.STATISTICS
|
||||
WHERE table_schema = (SELECT database()) AND table_name = '%s'`
|
||||
WHERE table_schema = (SELECT database()) AND table_name = '%s' LIMIT 500`
|
||||
|
||||
// 默认每次查询列元信息数量
|
||||
DEFAULT_COLUMN_SIZE = 2000
|
||||
@@ -372,7 +372,7 @@ const (
|
||||
// mysql 列信息元数据
|
||||
MYSQL_COLOUMN_MA = `SELECT table_name tableName, column_name columnName, column_type columnType,
|
||||
column_comment columnComment, column_key columnKey, extra, is_nullable nullable from information_schema.columns
|
||||
WHERE table_name in (%s) AND table_schema = (SELECT database()) ORDER BY tableName, ordinal_position limit %d, %d`
|
||||
WHERE table_name in (%s) AND table_schema = (SELECT database()) ORDER BY tableName, ordinal_position LIMIT %d, %d`
|
||||
|
||||
// mysql 列信息元数据总数
|
||||
MYSQL_COLOUMN_MA_COUNT = `SELECT COUNT(*) maNum from information_schema.columns
|
||||
|
||||
Reference in New Issue
Block a user