fix: 功能优化&小问题修复

This commit is contained in:
meilin.huang
2022-06-25 19:52:11 +08:00
parent edbbbca5f9
commit 64b49dae2e
9 changed files with 75 additions and 87 deletions

View File

@@ -13,7 +13,7 @@
"countup.js": "^2.0.7", "countup.js": "^2.0.7",
"cropperjs": "^1.5.11", "cropperjs": "^1.5.11",
"echarts": "^5.3.2", "echarts": "^5.3.2",
"element-plus": "^2.2.4", "element-plus": "^2.2.6",
"jsoneditor": "^9.8.0", "jsoneditor": "^9.8.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mitt": "^3.0.0", "mitt": "^3.0.0",

View File

@@ -239,16 +239,6 @@
color: set-color(primary); 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 滑块 /* Slider 滑块
------------------------------- */ ------------------------------- */
.el-slider__bar { .el-slider__bar {

View File

@@ -74,7 +74,7 @@
<el-row class="mb10"> <el-row class="mb10">
<el-button type="primary" size="small" @click="tableCreateDialog.visible = true">创建表</el-button> <el-button type="primary" size="small" @click="tableCreateDialog.visible = true">创建表</el-button>
</el-row> </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="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 property="tableComment" label="备注" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column <el-table-column
@@ -276,6 +276,7 @@ export default defineComponent({
}, },
chooseTableName: '', chooseTableName: '',
tableInfoDialog: { tableInfoDialog: {
loading: false,
visible: false, visible: false,
infos: [], infos: [],
}, },
@@ -434,10 +435,15 @@ export default defineComponent({
}; };
const showTableInfo = async (row: any, db: string) => { const showTableInfo = async (row: any, db: string) => {
state.tableInfoDialog.loading = true;
state.tableInfoDialog.visible = true;
try {
state.tableInfoDialog.infos = await dbApi.tableInfos.request({ id: row.id, db }); state.tableInfoDialog.infos = await dbApi.tableInfos.request({ id: row.id, db });
state.dbId = row.id; state.dbId = row.id;
state.db = db; state.db = db;
state.tableInfoDialog.visible = true; } finally {
state.tableInfoDialog.loading = false;
}
}; };
const closeTableInfo = () => { const closeTableInfo = () => {

View File

@@ -215,7 +215,6 @@
<template #header> <template #header>
<el-tooltip raw-content placement="top" effect="customized"> <el-tooltip raw-content placement="top" effect="customized">
<template #content> {{ getColumnTip(dt.name, item) }} </template> <template #content> {{ getColumnTip(dt.name, item) }} </template>
<!-- <el-icon><question-filled /></el-icon> -->
{{ item }} {{ item }}
</el-tooltip> </el-tooltip>
</template> </template>

View File

@@ -87,13 +87,19 @@ export default defineComponent({
try { try {
state.btnLoading = true; state.btnLoading = true;
await dbApi.sqlExec.request({ const res = await dbApi.sqlExec.request({
id: state.dbId, id: state.dbId,
db: state.db, db: state.db,
remark: state.remark, remark: state.remark,
sql: state.sqlValue.trim(), sql: state.sqlValue.trim(),
}); });
if (parseInt(res.res[0].影响条数) >= 1) {
ElMessage.success('执行成功');
runSuccess = true; runSuccess = true;
} else {
ElMessage.error('执行失败');
runSuccess = false;
}
} catch (e) { } catch (e) {
runSuccess = false; runSuccess = false;
} }

View File

@@ -89,15 +89,11 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-if="data.type == '-' && data.size < 1 * 1024 * 1024"> <el-dropdown-item
<el-link @click="getFileContent(tree.folder.id, data.path)"
@click.prevent="getFileContent(tree.folder.id, data.path)" v-if="data.type == '-' && data.size < 1 * 1024 * 1024"
type="info"
icon="view"
:underline="false"
> >
查看 <el-link type="info" icon="view" :underline="false">查看</el-link>
</el-link>
</el-dropdown-item> </el-dropdown-item>
<span v-auth="'machine:file:upload'"> <span v-auth="'machine:file:upload'">
@@ -118,28 +114,14 @@
</span> </span>
<span v-auth="'machine:file:write'"> <span v-auth="'machine:file:write'">
<el-dropdown-item v-if="data.type == '-'"> <el-dropdown-item @click="downloadFile(node, data)" v-if="data.type == '-'">
<el-link <el-link type="primary" icon="download" :underline="false" style="margin-left: 2px">下载</el-link>
@click.prevent="downloadFile(node, data)"
type="primary"
icon="download"
:underline="false"
style="margin-left: 2px"
>下载</el-link
>
</el-dropdown-item> </el-dropdown-item>
</span> </span>
<span v-auth="'machine:file:rm'"> <span v-auth="'machine:file:rm'">
<el-dropdown-item v-if="!dontOperate(data)"> <el-dropdown-item @click="deleteFile(node, data)" v-if="!dontOperate(data)">
<el-link <el-link type="danger" icon="delete" :underline="false" style="margin-left: 2px">删除</el-link>
@click.prevent="deleteFile(node, data)"
type="danger"
icon="delete"
:underline="false"
style="margin-left: 2px"
>删除
</el-link>
</el-dropdown-item> </el-dropdown-item>
</span> </span>
</el-dropdown-menu> </el-dropdown-menu>

View File

@@ -57,11 +57,10 @@
v-model="scope.row.status" v-model="scope.row.status"
:active-value="1" :active-value="1"
:inactive-value="-1" :inactive-value="-1"
active-color="#13ce66"
inactive-color="#ff4949"
inline-prompt inline-prompt
active-text="启用" active-text="启用"
inactive-text="停用" inactive-text="停用"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
@change="changeStatus(scope.row)" @change="changeStatus(scope.row)"
></el-switch> ></el-switch>
</template> </template>

View File

@@ -37,17 +37,17 @@
minimatch "^3.0.4" minimatch "^3.0.4"
strip-json-comments "^3.1.1" strip-json-comments "^3.1.1"
"@floating-ui/core@^0.7.2": "@floating-ui/core@^0.7.3":
version "0.7.2" version "0.7.3"
resolved "https://registry.npmmirror.com/@floating-ui/core/-/core-0.7.2.tgz#f7af9613d080dc29360e77c970965b79b524d45a" resolved "https://registry.npmmirror.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86"
integrity sha512-FRVAkSNU/vGXLIsgbggcs70GkXKEOXgBBbNpYPNHSaKsCAMMd00NrjbtKTesxkdv9xm9N3+XiDlcFGY6WnatBg== integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg==
"@floating-ui/dom@^0.5.0": "@floating-ui/dom@^0.5.3":
version "0.5.2" version "0.5.4"
resolved "https://registry.npmmirror.com/@floating-ui/dom/-/dom-0.5.2.tgz#908f3febbfc0d6696d70921616ec194fe07af183" resolved "https://registry.npmmirror.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1"
integrity sha512-z1DnEa7F3d8Fm/eXSbii8UEGpcjZGkQaYYUI0WpEVgD3vBfebDW8j/3ysusxonuMexoigA+A3b/fYH7sEqiwyg== integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg==
dependencies: dependencies:
"@floating-ui/core" "^0.7.2" "@floating-ui/core" "^0.7.3"
"@humanwhocodes/config-array@^0.9.2": "@humanwhocodes/config-array@^0.9.2":
version "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" resolved "https://registry.npmmirror.com/@types/sortablejs/download/@types/sortablejs-1.10.7.tgz#ab9039c85429f0516955ec6dbc0bb20139417b15"
integrity sha1-q5A5yFQp8FFpVextvAuyATlBexU= 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": "@typescript-eslint/eslint-plugin@^4.23.0":
version "4.33.0" version "4.33.0"
resolved "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" 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" resolved "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.37.tgz#8e6adc3f2759af52f0e85863dfb0b711ecc5c702"
integrity sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw== integrity sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==
"@vueuse/core@^8.5.0": "@vueuse/core@^8.6.0":
version "8.6.0" version "8.7.5"
resolved "https://registry.npmmirror.com/@vueuse/core/-/core-8.6.0.tgz#a8f80363cc63d17382423f16beae57696f376e67" resolved "https://registry.npmmirror.com/@vueuse/core/-/core-8.7.5.tgz#e74a888251ea11a9d432068ce18cbdfc4f810251"
integrity sha512-VirzExCm/N+QdrEWT7J4uSrvJ5hquKIAU9alQ37kUvIJk9XxCLxmfRnmekYc1kz2+6BnoyuKYXVmrMV351CB4w== integrity sha512-tqgzeZGoZcXzoit4kOGLWJibDMLp0vdm6ZO41SSUQhkhtrPhAg6dbIEPiahhUu6sZAmSYvVrZgEr5aKD51nrLA==
dependencies: dependencies:
"@vueuse/metadata" "8.6.0" "@types/web-bluetooth" "^0.0.14"
"@vueuse/shared" "8.6.0" "@vueuse/metadata" "8.7.5"
"@vueuse/shared" "8.7.5"
vue-demi "*" vue-demi "*"
"@vueuse/metadata@8.6.0": "@vueuse/metadata@8.7.5":
version "8.6.0" version "8.7.5"
resolved "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-8.6.0.tgz#34771443a72ee891ae001a70aa05dd9a1d799372" resolved "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-8.7.5.tgz#c7f2b21d873d1604a8860ed9c5728d8f3295f00a"
integrity sha512-F+CKPvaExsm7QgRr8y+ZNJFwXasn89rs5wth/HeX9lJ1q8XEt+HJ16Q5Sxh4rfG5YSKXrStveVge8TKvPjMjFA== integrity sha512-emJZKRQSaEnVqmlu39NpNp8iaW+bPC2kWykWoWOZMSlO/0QVEmO/rt8A5VhOEJTKLX3vwTevqbiRy9WJRwVOQg==
"@vueuse/shared@8.6.0": "@vueuse/shared@8.7.5":
version "8.6.0" version "8.7.5"
resolved "https://registry.npmmirror.com/@vueuse/shared/-/shared-8.6.0.tgz#63dad9fc4b73a7fccbe5d6b97adeacf73d4fec41" resolved "https://registry.npmmirror.com/@vueuse/shared/-/shared-8.7.5.tgz#06fb08f6f8fc9e90be9d1e033fa443de927172b0"
integrity sha512-Y/IVywZo7IfEoSSEtCYpkVEmPV7pU35mEIxV7PbD/D3ly18B3mEsBaPbtDkNM/QP3zAZ5mn4nEkOfddX4uwuIA== integrity sha512-THXPvMBFmg6Gf6AwRn/EdTh2mhqwjGsB2Yfp374LNQSQVKRHtnJ0I42bsZTn7nuEliBxqUrGQm/lN6qUHmhJLw==
dependencies: dependencies:
vue-demi "*" 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" 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== integrity sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==
dayjs@^1.11.2: dayjs@^1.11.3:
version "1.11.2" version "1.11.3"
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.2.tgz#fa0f5223ef0d6724b3d8327134890cfe3d72fbe5" resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.3.tgz#4754eb694a624057b9ad2224b67b15d552589258"
integrity sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw== integrity sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==
debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: debug@^4.1.1, debug@^4.3.1, debug@^4.3.2:
version "4.3.3" version "4.3.3"
@@ -632,20 +638,20 @@ echarts@^5.3.2:
tslib "2.3.0" tslib "2.3.0"
zrender "5.3.1" zrender "5.3.1"
element-plus@^2.2.4: element-plus@^2.2.6:
version "2.2.4" version "2.2.6"
resolved "https://registry.npmmirror.com/element-plus/-/element-plus-2.2.4.tgz#f07f400222a5b0ae93ee9a139155342604746813" resolved "https://registry.npmmirror.com/element-plus/-/element-plus-2.2.6.tgz#60b9e91a2159526123d1b950263de37947153433"
integrity sha512-jktZr0o3ARDxWNWPEaJZQm2BN7thTpQl0aIfCUo5eB5m+zEap2DEcojyGKMHSQsCULcPM32NFfu2sHlhbhOiGA== integrity sha512-N9G4yWSxDt1YtreCJgt7UaSsXKuR4Fzb3ThzlBjbGDYDhcHijsrLL3qkdLZgeoSB13LRyr9pgP1ljNXdaYGa+g==
dependencies: dependencies:
"@ctrl/tinycolor" "^3.4.1" "@ctrl/tinycolor" "^3.4.1"
"@element-plus/icons-vue" "^2.0.5" "@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" "@popperjs/core" "npm:@sxzz/popperjs-es@^2.11.7"
"@types/lodash" "^4.14.182" "@types/lodash" "^4.14.182"
"@types/lodash-es" "^4.17.6" "@types/lodash-es" "^4.17.6"
"@vueuse/core" "^8.5.0" "@vueuse/core" "^8.6.0"
async-validator "^4.1.1" async-validator "^4.1.1"
dayjs "^1.11.2" dayjs "^1.11.3"
escape-html "^1.0.3" escape-html "^1.0.3"
lodash "^4.17.21" lodash "^4.17.21"
lodash-es "^4.17.21" lodash-es "^4.17.21"

View File

@@ -352,19 +352,19 @@ const (
// mysql 表信息元数据 // mysql 表信息元数据
MYSQL_TABLE_MA = `SELECT table_name tableName, engine, table_comment tableComment, MYSQL_TABLE_MA = `SELECT table_name tableName, engine, table_comment tableComment,
create_time createTime from information_schema.tables create_time createTime from information_schema.tables
WHERE table_schema = (SELECT database())` WHERE table_schema = (SELECT database()) LIMIT 2000`
// mysql 表信息 // mysql 表信息
MYSQL_TABLE_INFO = `SELECT table_name tableName, table_comment tableComment, table_rows tableRows, MYSQL_TABLE_INFO = `SELECT table_name tableName, table_comment tableComment, table_rows tableRows,
data_length dataLength, index_length indexLength, create_time createTime data_length dataLength, index_length indexLength, create_time createTime
FROM information_schema.tables FROM information_schema.tables
WHERE table_schema = (SELECT database())` WHERE table_schema = (SELECT database()) LIMIT 2000`
// mysql 索引信息 // mysql 索引信息
MYSQL_INDEX_INFO = `SELECT index_name indexName, column_name columnName, index_type indexType, MYSQL_INDEX_INFO = `SELECT index_name indexName, column_name columnName, index_type indexType,
SEQ_IN_INDEX seqInIndex, INDEX_COMMENT indexComment SEQ_IN_INDEX seqInIndex, INDEX_COMMENT indexComment
FROM information_schema.STATISTICS 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 DEFAULT_COLUMN_SIZE = 2000
@@ -372,7 +372,7 @@ const (
// mysql 列信息元数据 // mysql 列信息元数据
MYSQL_COLOUMN_MA = `SELECT table_name tableName, column_name columnName, column_type columnType, 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 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 列信息元数据总数
MYSQL_COLOUMN_MA_COUNT = `SELECT COUNT(*) maNum from information_schema.columns MYSQL_COLOUMN_MA_COUNT = `SELECT COUNT(*) maNum from information_schema.columns