db模块tab页面增加右键菜单
This commit is contained in:
File diff suppressed because one or more lines are too long
1
zyplayer-doc-db/src/main/resources/dist/css/index.acbccf83.css
vendored
Normal file
1
zyplayer-doc-db/src/main/resources/dist/css/index.acbccf83.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon-db.png"><title>数据库文档管理</title><link href="css/chunk-vendors.2fa4c9b3.css" rel="preload" as="style"><link href="css/index.108f40b4.css" rel="preload" as="style"><link href="js/chunk-vendors.6270548d.js" rel="preload" as="script"><link href="js/index.ddad9e6e.js" rel="preload" as="script"><link href="css/chunk-vendors.2fa4c9b3.css" rel="stylesheet"><link href="css/index.108f40b4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but zyplayer-db-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.6270548d.js"></script><script src="js/index.ddad9e6e.js"></script></body></html>
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon-db.png"><title>数据库文档管理</title><link href="css/chunk-vendors.2fa4c9b3.css" rel="preload" as="style"><link href="css/index.acbccf83.css" rel="preload" as="style"><link href="js/chunk-vendors.6270548d.js" rel="preload" as="script"><link href="js/index.790e04cd.js" rel="preload" as="script"><link href="css/chunk-vendors.2fa4c9b3.css" rel="stylesheet"><link href="css/index.acbccf83.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but zyplayer-db-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.6270548d.js"></script><script src="js/index.790e04cd.js"></script></body></html>
|
||||||
1
zyplayer-doc-db/src/main/resources/dist/js/index.790e04cd.js
vendored
Normal file
1
zyplayer-doc-db/src/main/resources/dist/js/index.790e04cd.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-tabs v-model="activePage" type="card" closable @tab-click="changePage" @tab-remove="removePageTab" style="padding: 5px 10px 0;">
|
<el-tabs v-model="activePage" type="card" closable @tab-click="changePage" @tab-remove="removePageTab"
|
||||||
<el-tab-pane :label="pageTabNameMap[item.fullPath]||item.name" :name="getRouteRealPath(item)" :fullPath="item.fullPath" :key="item.fullPath" v-for="item in pageList"/>
|
@contextmenu.prevent.native="openContextMenu($event)" style="padding: 5px 10px 0;">
|
||||||
|
<el-tab-pane :label="pageTabNameMap[item.fullPath]||item.name" :name="getRouteRealPath(item)"
|
||||||
|
:fullPath="item.fullPath" :key="item.fullPath" v-for="item in pageList"/>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<router-view v-on:listenToChildEvent = "getDatafromChild" :key="$route.fullPath" @initLoadDataList="initLoadDataList" @loadDatasourceList="loadDatasourceList"/>
|
<router-view v-on:listenToChildEvent="getDatafromChild" :key="$route.fullPath"
|
||||||
|
@initLoadDataList="initLoadDataList" @loadDatasourceList="loadDatasourceList"/>
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
|
|
||||||
|
<ul v-show="contextMenuVisible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
||||||
|
<!--<li @click="curTabReload()"><el-button type="text" size="mini">重新加载</el-button></li>-->
|
||||||
|
<li @click="closeAllTabs()">
|
||||||
|
<el-button type="text" size="mini">关闭所有</el-button>
|
||||||
|
</li>
|
||||||
|
<li @click="closeOtherTabs('left')">
|
||||||
|
<el-button type="text" size="mini">关闭左边</el-button>
|
||||||
|
</li>
|
||||||
|
<li @click="closeOtherTabs('right')">
|
||||||
|
<el-button type="text" size="mini">关闭右边</el-button>
|
||||||
|
</li>
|
||||||
|
<li @click="closeOtherTabs('other')">
|
||||||
|
<el-button type="text" size="mini">关闭其他</el-button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -25,6 +45,9 @@
|
|||||||
ignoreParamPath: [
|
ignoreParamPath: [
|
||||||
"/data/export",
|
"/data/export",
|
||||||
],
|
],
|
||||||
|
contextMenuVisible: false,
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -67,7 +90,12 @@
|
|||||||
if (dataname && choiceDatabase) {
|
if (dataname && choiceDatabase) {
|
||||||
name = name + "( " + dataname + "[" + choiceDatabase + "] )"
|
name = name + "( " + dataname + "[" + choiceDatabase + "] )"
|
||||||
}
|
}
|
||||||
this.$router.replace({ query: { datasourceId: this.datasourceList[0].id,database:choiceDatabase } })
|
this.$router.replace({
|
||||||
|
query: {
|
||||||
|
datasourceId: this.datasourceList[0].id,
|
||||||
|
database: choiceDatabase
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -121,11 +149,14 @@
|
|||||||
if (dataname && choiceDatabase) {
|
if (dataname && choiceDatabase) {
|
||||||
name = name + "( " + dataname + "[" + choiceDatabase + "] )"
|
name = name + "( " + dataname + "[" + choiceDatabase + "] )"
|
||||||
}
|
}
|
||||||
console.log("this.pageList+++++++++"+JSON.stringify(this.pageList))
|
|
||||||
this.pageList.splice(this.pageList.findIndex(item => item.fullPath === path), 1);
|
this.pageList.splice(this.pageList.findIndex(item => item.fullPath === path), 1);
|
||||||
this.linkList.splice(this.linkList.findIndex(item => item === path), 1);
|
this.linkList.splice(this.linkList.findIndex(item => item === path), 1);
|
||||||
console.log("this.pageList+++++++++"+JSON.stringify(this.pageList))
|
this.$router.replace({
|
||||||
this.$router.replace({ query: { datasourceId: this.datasourceList[0].id,database:choiceDatabase } })
|
query: {
|
||||||
|
datasourceId: this.datasourceList[0].id,
|
||||||
|
database: choiceDatabase
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -138,6 +169,13 @@
|
|||||||
//let pageRoute = this.pageList.find(item => this.getRouteRealPath(item) === activePage);
|
//let pageRoute = this.pageList.find(item => this.getRouteRealPath(item) === activePage);
|
||||||
//pageRoute.fullPath = newRoute.fullPath;
|
//pageRoute.fullPath = newRoute.fullPath;
|
||||||
},
|
},
|
||||||
|
contextMenuVisible(value) {
|
||||||
|
if (value) {
|
||||||
|
document.body.addEventListener('click', this.closeContextMenu)
|
||||||
|
} else {
|
||||||
|
document.body.removeEventListener('click', this.closeContextMenu)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDatafromChild(data) {
|
getDatafromChild(data) {
|
||||||
@@ -177,6 +215,84 @@
|
|||||||
this.$router.push(this.activePage);
|
this.$router.push(this.activePage);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//tab栏右键菜单
|
||||||
|
openContextMenu(e) {
|
||||||
|
let obj = e.srcElement ? e.srcElement : e.target;
|
||||||
|
if (obj.id) {
|
||||||
|
let currentContextTabId = obj.id.split("-")[1];
|
||||||
|
this.contextMenuVisible = true;
|
||||||
|
this.$store.commit("saveCurContextTabId", currentContextTabId);
|
||||||
|
this.left = e.clientX;
|
||||||
|
this.top = e.clientY + 10;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//刷新当前页
|
||||||
|
curTabReload() {
|
||||||
|
let currTabIndex = 0;
|
||||||
|
let curContextTabId = this.$store.state.tagsView.curContextTabId;
|
||||||
|
for (let i = 0; i < this.pageList.length; i++) {
|
||||||
|
if (curContextTabId === this.pageList[i].fullPath) {
|
||||||
|
currTabIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.activePage = this.linkList[currTabIndex];
|
||||||
|
this.$router.push(this.activePage);
|
||||||
|
this.closeContextMenu()
|
||||||
|
},
|
||||||
|
// 关闭所有标签页
|
||||||
|
closeAllTabs() {
|
||||||
|
//删除所有tab标签
|
||||||
|
this.linkList.splice(0, this.linkList.length)
|
||||||
|
this.pageList.splice(0, this.pageList.length)
|
||||||
|
this.$router.replace({query: {}})
|
||||||
|
this.closeContextMenu()
|
||||||
|
},
|
||||||
|
// 关闭其它标签页
|
||||||
|
closeOtherTabs(par) {
|
||||||
|
let currTabIndex = 0;
|
||||||
|
let curContextTabId = this.$store.state.tagsView.curContextTabId;
|
||||||
|
for (let i = 0; i < this.pageList.length; i++) {
|
||||||
|
if (curContextTabId === this.pageList[i].fullPath) {
|
||||||
|
currTabIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (par) {
|
||||||
|
case "left": {
|
||||||
|
//删除左侧tab标签
|
||||||
|
this.pageList.splice(0, currTabIndex);
|
||||||
|
this.linkList.splice(0, currTabIndex);
|
||||||
|
this.activePage = this.linkList[0];
|
||||||
|
this.$router.push(this.activePage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "right": {
|
||||||
|
//删除右侧tab标签
|
||||||
|
this.pageList.splice(currTabIndex + 1, this.pageList.length);
|
||||||
|
this.linkList.splice(currTabIndex + 1, this.linkList.length);
|
||||||
|
this.activePage = this.linkList[currTabIndex];
|
||||||
|
this.$router.push(this.activePage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "other": {
|
||||||
|
//删除其他所有tab标签
|
||||||
|
this.pageList.splice(0, currTabIndex);
|
||||||
|
this.linkList.splice(0, currTabIndex);
|
||||||
|
this.pageList.splice(currTabIndex + 1, this.pageList.length);
|
||||||
|
this.linkList.splice(currTabIndex + 1, this.linkList.length);
|
||||||
|
this.activePage = this.linkList[0];
|
||||||
|
this.$router.push(this.activePage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.closeContextMenu()
|
||||||
|
},
|
||||||
|
// 关闭contextMenu
|
||||||
|
closeContextMenu() {
|
||||||
|
this.contextMenuVisible = false;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -185,16 +301,50 @@
|
|||||||
/deep/ .el-tabs--card > .el-tabs__header {
|
/deep/ .el-tabs--card > .el-tabs__header {
|
||||||
margin: 0 0 5px;
|
margin: 0 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .el-tabs--card > .el-tabs__header .el-tabs__item {
|
/deep/ .el-tabs--card > .el-tabs__header .el-tabs__item {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .el-tabs__nav-next {
|
/deep/ .el-tabs__nav-next {
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .el-tabs__nav-prev {
|
/deep/ .el-tabs__nav-prev {
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.contextmenu {
|
||||||
|
width: 100px;
|
||||||
|
margin: 0;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 3000;
|
||||||
|
position: absolute;
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 5px 0;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextmenu li {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0px 22px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextmenu li:hover {
|
||||||
|
background: #f2f2f2;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextmenu li button {
|
||||||
|
color: #2c3e50;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import global from './modules/global'
|
import global from './modules/global'
|
||||||
|
import tagsView from './modules/tagsView'
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
modules: {
|
modules: {
|
||||||
global,
|
global,
|
||||||
|
tagsView
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
15
zyplayer-doc-ui/db-ui/src/store/modules/tagsView.js
Normal file
15
zyplayer-doc-ui/db-ui/src/store/modules/tagsView.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
const state = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const mutations = {
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Ҽ<EFBFBD><D2BC><EFBFBD><EFBFBD><EFBFBD>tab<61><62>id
|
||||||
|
saveCurContextTabId(state, curContextTabId) {
|
||||||
|
state.curContextTabId = curContextTabId
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
state,
|
||||||
|
mutations
|
||||||
|
}
|
||||||
@@ -9,7 +9,8 @@
|
|||||||
:description="executorDesc"
|
:description="executorDesc"
|
||||||
show-icon>
|
show-icon>
|
||||||
</el-alert>
|
</el-alert>
|
||||||
<ace-editor v-model="sqlExecutorContent" @init="sqlExecutorInit" lang="sql" theme="monokai" width="100%"
|
<ace-editor v-model="sqlExecutorContent" @init="sqlExecutorInit" lang="sql" theme="monokai"
|
||||||
|
width="100%"
|
||||||
height="60" :options="sqlEditorConfig" :source="executorSource"
|
height="60" :options="sqlEditorConfig" :source="executorSource"
|
||||||
style="margin-bottom: 10px;">
|
style="margin-bottom: 10px;">
|
||||||
</ace-editor>
|
</ace-editor>
|
||||||
@@ -35,10 +36,13 @@
|
|||||||
<el-card>
|
<el-card>
|
||||||
<div v-if="!!executeError" style="color: #f00;">{{ executeError }}</div>
|
<div v-if="!!executeError" style="color: #f00;">{{ executeError }}</div>
|
||||||
<div v-else-if="sqlExecuting" v-loading="sqlExecuting" style="padding: 20px 0;">数据加载中...</div>
|
<div v-else-if="sqlExecuting" v-loading="sqlExecuting" style="padding: 20px 0;">数据加载中...</div>
|
||||||
<div v-else-if="executeResultList.length <= 0" v-loading="sqlExecuting" style="padding: 20px 0;">暂无数据</div>
|
<div v-else-if="executeResultList.length <= 0" v-loading="sqlExecuting" style="padding: 20px 0;">
|
||||||
|
暂无数据
|
||||||
|
</div>
|
||||||
<div v-else style="position: relative;">
|
<div v-else style="position: relative;">
|
||||||
<div style="position: absolute;right: 0;z-index: 1;" v-show="executeShowTable !== 'table0'">
|
<div style="position: absolute;right: 0;z-index: 1;" v-show="executeShowTable !== 'table0'">
|
||||||
<span v-show="choiceResultObj[executeShowTable] && choiceResultObj[executeShowTable].length > 0">
|
<span
|
||||||
|
v-show="choiceResultObj[executeShowTable] && choiceResultObj[executeShowTable].length > 0">
|
||||||
<el-button icon="el-icon-delete" size="small" @click="deleteCheckLine" type="danger" plain
|
<el-button icon="el-icon-delete" size="small" @click="deleteCheckLine" type="danger" plain
|
||||||
style="margin-right: 10px;">删除</el-button>
|
style="margin-right: 10px;">删除</el-button>
|
||||||
<!-- 复制选中行 -->
|
<!-- 复制选中行 -->
|
||||||
@@ -63,7 +67,8 @@
|
|||||||
<pre class="xxpre">{{ executeResultInfo }}</pre>
|
<pre class="xxpre">{{ executeResultInfo }}</pre>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="'结果'+resultItem.index" :name="resultItem.name"
|
<el-tab-pane :label="'结果'+resultItem.index" :name="resultItem.name"
|
||||||
v-for="(resultItem,index) in executeResultList" :key="index" v-if="!!resultItem.index">
|
v-for="(resultItem,index) in executeResultList" :key="index"
|
||||||
|
v-if="!!resultItem.index">
|
||||||
<div v-if="!!resultItem.errMsg" style="color: #f00;">{{ resultItem.errMsg }}</div>
|
<div v-if="!!resultItem.errMsg" style="color: #f00;">{{ resultItem.errMsg }}</div>
|
||||||
<div v-else-if="resultItem.dataList.length <= 0"
|
<div v-else-if="resultItem.dataList.length <= 0"
|
||||||
style="text-align: center; color: #aaa; padding: 20px 0;">暂无数据
|
style="text-align: center; color: #aaa; padding: 20px 0;">暂无数据
|
||||||
@@ -75,7 +80,8 @@
|
|||||||
stripe
|
stripe
|
||||||
border
|
border
|
||||||
:height="height"
|
:height="height"
|
||||||
style="width: 100%; margin-bottom: 5px;" class="execute-result-table" :max-height="tableMaxHeight"
|
style="width: 100%; margin-bottom: 5px;" class="execute-result-table"
|
||||||
|
:max-height="tableMaxHeight"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
@cell-click="mouseOnFocus"
|
@cell-click="mouseOnFocus"
|
||||||
@cell-mouse-leave="mouseLeave"
|
@cell-mouse-leave="mouseLeave"
|
||||||
@@ -83,7 +89,8 @@
|
|||||||
:default-sort="tableSort">
|
:default-sort="tableSort">
|
||||||
<ux-table-column type="checkbox" width="55"></ux-table-column>
|
<ux-table-column type="checkbox" width="55"></ux-table-column>
|
||||||
<ux-table-column type="index" width="50" title=" "></ux-table-column>
|
<ux-table-column type="index" width="50" title=" "></ux-table-column>
|
||||||
<ux-table-column v-for="(item,index) in resultItem.dataCols" :key="index" :prop="item.prop" :title="item.prop"
|
<ux-table-column v-for="(item,index) in resultItem.dataCols" :key="index"
|
||||||
|
:prop="item.prop" :title="item.prop"
|
||||||
:width="item.width" sortable>
|
:width="item.width" sortable>
|
||||||
<template slot="header" slot-scope="scope">
|
<template slot="header" slot-scope="scope">
|
||||||
<el-tooltip effect="dark" :content="item.desc" placement="top">
|
<el-tooltip effect="dark" :content="item.desc" placement="top">
|
||||||
@@ -91,7 +98,8 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<textarea readonly :value="scope.row[item.prop]" class="el-textarea__inner" rows="1"></textarea>
|
<textarea readonly :value="scope.row[item.prop]" class="el-textarea__inner"
|
||||||
|
rows="1"></textarea>
|
||||||
</template>
|
</template>
|
||||||
</ux-table-column>
|
</ux-table-column>
|
||||||
</ux-grid>
|
</ux-grid>
|
||||||
@@ -139,14 +147,17 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数据表:" v-if="downloadDataParam.downloadType === 'insert'">
|
<el-form-item label="数据表:" v-if="downloadDataParam.downloadType === 'insert'">
|
||||||
<el-checkbox :true-label="1" :false-label="0" v-model="downloadDataParam.dropTableFlag"
|
<el-checkbox :true-label="1" :false-label="0" v-model="downloadDataParam.dropTableFlag"
|
||||||
@change="dropTableFlagChange">删除表{{ downloadDataParam.dropTableFlag == 1 ? '!!' : '' }}
|
@change="dropTableFlagChange">删除表{{
|
||||||
|
downloadDataParam.dropTableFlag == 1 ? '!!' : ''
|
||||||
|
}}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
<el-checkbox :true-label="1" :false-label="0" v-model="downloadDataParam.createTableFlag"
|
<el-checkbox :true-label="1" :false-label="0" v-model="downloadDataParam.createTableFlag"
|
||||||
@change="createTableFlagChange">创建表
|
@change="createTableFlagChange">创建表
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="更新条件列:" v-if="downloadDataParam.downloadType === 'update'">
|
<el-form-item label="更新条件列:" v-if="downloadDataParam.downloadType === 'update'">
|
||||||
<el-select v-model="downloadDataParam.conditionColumnArr" multiple placeholder="不选则是没有条件的更新"
|
<el-select v-model="downloadDataParam.conditionColumnArr" multiple
|
||||||
|
placeholder="不选则是没有条件的更新"
|
||||||
style="width: 370px;">
|
style="width: 370px;">
|
||||||
<el-option v-for="item in conditionDataCols" :key="item.prop" :label="item.prop"
|
<el-option v-for="item in conditionDataCols" :key="item.prop" :label="item.prop"
|
||||||
:value="item.prop"></el-option>
|
:value="item.prop"></el-option>
|
||||||
@@ -168,7 +179,8 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">选择展示列</el-col>
|
<el-col :span="12">选择展示列</el-col>
|
||||||
<el-col :span="12" style="text-align: right;">
|
<el-col :span="12" style="text-align: right;">
|
||||||
<el-checkbox v-model="choiceShowColumnAll" @change="choiceShowColumnAllChange">全选</el-checkbox>
|
<el-checkbox v-model="choiceShowColumnAll" @change="choiceShowColumnAllChange">全选
|
||||||
|
</el-checkbox>
|
||||||
<el-button type="primary" size="mini" @click="choiceShowColumnOk" style="margin-left: 10px;">确定
|
<el-button type="primary" size="mini" @click="choiceShowColumnOk" style="margin-left: 10px;">确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -692,10 +704,12 @@ export default {
|
|||||||
.xxpre {
|
.xxpre {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-textarea__inner {
|
.el-textarea__inner {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #f0f8ff00;
|
background-color: #f0f8ff00;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-textarea__inner::-webkit-scrollbar {
|
.el-textarea__inner::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<div class="data-executor-vue">
|
<div class="data-executor-vue">
|
||||||
<div style="padding: 0 10px 10px;height: 100%;box-sizing: border-box;">
|
<div style="padding: 0 10px 10px;height: 100%;box-sizing: border-box;">
|
||||||
<el-card style="margin-bottom: 5px;">
|
<el-card style="margin-bottom: 5px;">
|
||||||
<ace-editor v-model="sqlExecutorContent" ref="sqlEditor" @init="sqlExecutorInit" lang="sql" theme="monokai"
|
<ace-editor v-model="sqlExecutorContent" ref="sqlEditor" @init="sqlExecutorInit" lang="sql"
|
||||||
|
theme="monokai"
|
||||||
width="100%" height="20" :options="sqlEditorConfig" :source="executorSource"
|
width="100%" height="20" :options="sqlEditorConfig" :source="executorSource"
|
||||||
@cursorSelection="cursorSelection" style="margin-bottom: 5px;"></ace-editor>
|
@cursorSelection="cursorSelection" style="margin-bottom: 5px;"></ace-editor>
|
||||||
<div>
|
<div>
|
||||||
@@ -10,7 +11,8 @@
|
|||||||
icon="el-icon-video-pause">取消执行
|
icon="el-icon-video-pause">取消执行
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-tooltip v-else effect="dark" content="Ctrl+R、Ctrl+Enter" placement="top">
|
<el-tooltip v-else effect="dark" content="Ctrl+R、Ctrl+Enter" placement="top">
|
||||||
<el-button v-on:click="doExecutorSql" type="primary" plain size="mini" icon="el-icon-video-play">{{executeButtonText}}
|
<el-button v-on:click="doExecutorSql" type="primary" plain size="mini"
|
||||||
|
icon="el-icon-video-play">{{ executeButtonText }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button icon="el-icon-brush" size="mini" @click="formatterSql">SQL美化</el-button>
|
<el-button icon="el-icon-brush" size="mini" @click="formatterSql">SQL美化</el-button>
|
||||||
@@ -29,7 +31,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="sqlParams.length > 0" class="sql-params">
|
<div v-if="sqlParams.length > 0" class="sql-params">
|
||||||
<el-input :placeholder="'请输入'+param.key+'的值'" v-model="param.value" v-for="(param,index) in sqlParams" :key="index">
|
<el-input :placeholder="'请输入'+param.key+'的值'" v-model="param.value"
|
||||||
|
v-for="(param,index) in sqlParams" :key="index">
|
||||||
<template slot="prepend">{{ param.key }}</template>
|
<template slot="prepend">{{ param.key }}</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,7 +65,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="160px">
|
<el-table-column label="操作" width="160px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="primary" @click="inputFavoriteSql(scope.row)">输入</el-button>
|
<el-button size="mini" type="primary" @click="inputFavoriteSql(scope.row)">
|
||||||
|
输入
|
||||||
|
</el-button>
|
||||||
<el-button size="mini" type="success" @click="addFavorite(scope.row.content)"
|
<el-button size="mini" type="success" @click="addFavorite(scope.row.content)"
|
||||||
style="margin-left: 10px;">收藏
|
style="margin-left: 10px;">收藏
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -71,7 +76,8 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="我的收藏" name="tabFavorite">
|
<el-tab-pane label="我的收藏" name="tabFavorite">
|
||||||
<el-table :data="myFavoriteList" stripe border style="width: 100%; margin-bottom: 5px;" v-infinite-scroll>
|
<el-table :data="myFavoriteList" stripe border style="width: 100%; margin-bottom: 5px;"
|
||||||
|
v-infinite-scroll>
|
||||||
<el-table-column prop="createTime" label="执行时间" width="160px"></el-table-column>
|
<el-table-column prop="createTime" label="执行时间" width="160px"></el-table-column>
|
||||||
<el-table-column prop="content" label="SQL">
|
<el-table-column prop="content" label="SQL">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -81,8 +87,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="160px">
|
<el-table-column label="操作" width="160px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="primary" v-on:click="inputFavoriteSql(scope.row)">输入</el-button>
|
<el-button size="mini" type="primary" v-on:click="inputFavoriteSql(scope.row)">
|
||||||
<el-button size="mini" type="danger" v-on:click="delFavorite(scope.row)" style="margin-left: 10px;">
|
输入
|
||||||
|
</el-button>
|
||||||
|
<el-button size="mini" type="danger" v-on:click="delFavorite(scope.row)"
|
||||||
|
style="margin-left: 10px;">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -96,7 +105,8 @@
|
|||||||
<div style="color: #f00;">{{ executeError }}</div>
|
<div style="color: #f00;">{{ executeError }}</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-tab-pane :label="resultItem.label" :name="resultItem.name" v-for="(resultItem,index) in executeResultList" :key="index"
|
<el-tab-pane :label="resultItem.label" :name="resultItem.name"
|
||||||
|
v-for="(resultItem,index) in executeResultList" :key="index"
|
||||||
lazy>
|
lazy>
|
||||||
<div v-if="!!resultItem.errMsg" style="color: #f00;">{{ resultItem.errMsg }}</div>
|
<div v-if="!!resultItem.errMsg" style="color: #f00;">{{ resultItem.errMsg }}</div>
|
||||||
<ux-grid v-else
|
<ux-grid v-else
|
||||||
@@ -111,10 +121,17 @@
|
|||||||
style="width: 100%; margin-bottom: 5px;" class="execute-result-table">
|
style="width: 100%; margin-bottom: 5px;" class="execute-result-table">
|
||||||
<ux-table-column type="checkbox" width="55"></ux-table-column>
|
<ux-table-column type="checkbox" width="55"></ux-table-column>
|
||||||
<ux-table-column type="index" width="55" title=" "></ux-table-column>
|
<ux-table-column type="index" width="55" title=" "></ux-table-column>
|
||||||
<ux-table-column v-for="(item,index) in resultItem.dataCols" :key="index" :prop="item.prop" :title="item.label"
|
<ux-table-column v-for="(item,index) in resultItem.dataCols" :key="index"
|
||||||
|
:prop="item.prop" :title="item.label"
|
||||||
:width="item.width">
|
:width="item.width">
|
||||||
|
<template slot="header" slot-scope="scope">
|
||||||
|
<el-tooltip effect="dark" :content="item.desc" placement="top">
|
||||||
|
<span>{{ item.label }}</span>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<textarea readonly :value="scope.row[item.prop]" class="el-textarea__inner" rows="1"></textarea>
|
<textarea readonly :value="scope.row[item.prop]" class="el-textarea__inner"
|
||||||
|
rows="1"></textarea>
|
||||||
</template>
|
</template>
|
||||||
</ux-table-column>
|
</ux-table-column>
|
||||||
</ux-grid>
|
</ux-grid>
|
||||||
@@ -130,7 +147,8 @@
|
|||||||
<div v-if="resultItem.selectCount" style="position: absolute;right: 5px;bottom: 5px;">
|
<div v-if="resultItem.selectCount" style="position: absolute;right: 5px;bottom: 5px;">
|
||||||
<el-button type="primary" plain v-on:click="viewAllData()">查看所有</el-button>
|
<el-button type="primary" plain v-on:click="viewAllData()">查看所有</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!resultItem.selectCount" style="height: 20px;font-size: 13px;font-weight: 400;color: #606266;padding-left: 5px;">
|
<div v-if="!resultItem.selectCount"
|
||||||
|
style="height: 20px;font-size: 13px;font-weight: 400;color: #606266;padding-left: 5px;">
|
||||||
共 {{ resultItem.totalCount }} 条
|
共 {{ resultItem.totalCount }} 条
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -418,7 +436,7 @@ export default {
|
|||||||
headerList.forEach(item => {
|
headerList.forEach(item => {
|
||||||
let key = 'value_' + (headerIndex++);
|
let key = 'value_' + (headerIndex++);
|
||||||
columnSet[key] = item;
|
columnSet[key] = item;
|
||||||
previewColumns.push({prop: key, label: item});
|
previewColumns.push({prop: key, label: item, desc: item});
|
||||||
});
|
});
|
||||||
dataListTemp.forEach(item => {
|
dataListTemp.forEach(item => {
|
||||||
let dataItem = {}, dataIndex = 0;
|
let dataItem = {}, dataIndex = 0;
|
||||||
@@ -619,7 +637,12 @@ export default {
|
|||||||
// 非初次加载,动态改变url参数
|
// 非初次加载,动态改变url参数
|
||||||
if (!initFlag) {
|
if (!initFlag) {
|
||||||
this.choiceDatabase = (!!notSysDbItem) ? notSysDbItem.dbName : this.databaseList[0].dbName;
|
this.choiceDatabase = (!!notSysDbItem) ? notSysDbItem.dbName : this.databaseList[0].dbName;
|
||||||
this.$router.replace({ query: { datasourceId: this.choiceDatasourceId,database:this.choiceDatabase } })
|
this.$router.replace({
|
||||||
|
query: {
|
||||||
|
datasourceId: this.choiceDatasourceId,
|
||||||
|
database: this.choiceDatabase
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.executorSource = {sourceId: this.choiceDatasourceId, dbName: this.choiceDatabase};
|
this.executorSource = {sourceId: this.choiceDatasourceId, dbName: this.choiceDatabase};
|
||||||
}
|
}
|
||||||
@@ -839,22 +862,27 @@ export default {
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
//padding-left: 5px;
|
//padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-textarea__inner {
|
.el-textarea__inner {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #f0f8ff00;
|
background-color: #f0f8ff00;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-textarea__inner::-webkit-scrollbar {
|
.el-textarea__inner::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .el-tabs--border-card > .el-tabs__content {
|
/deep/ .el-tabs--border-card > .el-tabs__content {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .elx-table .elx-body--column.col--ellipsis > .elx-cell,
|
/deep/ .elx-table .elx-body--column.col--ellipsis > .elx-cell,
|
||||||
.elx-table .elx-footer--column.col--ellipsis > .elx-cell,
|
.elx-table .elx-footer--column.col--ellipsis > .elx-cell,
|
||||||
.elx-table .elx-header--column.col--ellipsis > .elx-cell {
|
.elx-table .elx-header--column.col--ellipsis > .elx-cell {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
text-overflow: unset;
|
text-overflow: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .elx-table .elx-body--column.col--ellipsis > .elx-cell::-webkit-scrollbar {
|
/deep/ .elx-table .elx-body--column.col--ellipsis > .elx-cell::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user