Commit 38d2a6bb by chenyu

update: update

parent b119f266
......@@ -15,7 +15,7 @@
<div class="bullshit">
<!-- <div class="bullshit__oops">404</div> -->
<div class="bullshit__headline">{{ message }}</div>
<a href="#/index" class="bullshit__return-home">返回首页</a>
<a href="#/module" class="bullshit__return-home">返回首页</a>
</div>
</div>
</div>
......
......@@ -10,7 +10,8 @@
<div class="unreview-wrap common-set-wrap">
<div class="right-content">
<div class="right-box" style="min-height: calc(100vh - 126px)">
<div class="m-b-20 flex">
<div class="m-b-20 flex flex-space-between">
<div class="flex">
<div class="search-items">
<p class="search-items-label">是否处理:</p>
<el-select style="width:140px;" v-model="searchParams.dealFlag" placeholder="请选择是否处理" clearable @change="searchPage">
......@@ -21,26 +22,37 @@
</div>
<div class="search-items">
<p class="search-items-label">库地址:</p>
<el-select style="width:140px;" v-model="searchParams.dataSourceId" placeholder="请选择库地址" clearable @change="searchPage">
<el-select style="width:140px;" v-model="searchParams.dataSourceId" placeholder="请选择库地址" clearable>
<el-option v-for="item in sqlUrlOpts" :label="item.name" :value="item.key" :key="item.key"></el-option>
</el-select>
</div>
<div class="search-items">
<p class="search-items-label">库名:</p>
<el-input style="width:140px;" placeholder="请输入库名" v-model="searchParams.scame" clearable @change="searchPage"> </el-input>
<el-input style="width:140px;" placeholder="请输入库名" v-model="searchParams.scame" clearable> </el-input>
</div>
<div class="search-items">
<p class="search-items-label">表名:</p>
<el-input style="width:140px;" placeholder="请输入表名" v-model="searchParams.tableName" clearable @change="searchPage"> </el-input>
<el-input style="width:140px;" placeholder="请输入表名" v-model="searchParams.tableName" clearable> </el-input>
</div>
<el-button type="primary" @click="getTableList">筛选</el-button>
</div>
<el-button type="primary" @click="download">下载</el-button>
</div>
<div class="reviewed-body-content">
<el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column label="uuid" prop="uuid" show-overflow-tooltip></el-table-column>
<el-table-column label="时间" prop="updateTime" show-overflow-tooltip></el-table-column>
<el-table-column label="sql内容" prop="sqlContent" show-overflow-tooltip></el-table-column>
<el-table-column label="sql内容" prop="sqlContent" min-width="200">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.sqlContent" placement="top"
><span class="ellipsis">{{ scope.row.sqlContent }}</span>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="复制" placement="top"><i class="copy el-icon-copy-document" @click="copy(scope.row.sqlContent)"></i> </el-tooltip>
<!-- el-icon-copy-document -->
</template>
</el-table-column>
<el-table-column label="处理后的索引" prop="useIndex" show-overflow-tooltip></el-table-column>
<el-table-column label="是否处理所有" prop="sureFlag" show-overflow-tooltip>
<el-table-column label="是否处理索引" width="120" prop="sureFlag" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.sureFlag === 0 ? '否' : '是' }}
</template>
......@@ -84,9 +96,9 @@ export default {
tableData: [],
sqlUrlOpts: [],
searchParams: {
tableName: '', // 表名 必填
tableName: 'tab_gic_store', // 表名 必填
dataSourceId: '', // 库地址 必填
scame: '', // 库名 必填
scame: 'gic3_test', // 库名 必填
dealFlag: -1 // 是否处理索引默认-1 1已处理 0未处理
},
showDailog: false,
......@@ -107,7 +119,7 @@ export default {
const that = this;
console.log(item);
that.ruleForm = {
indexName: item.sureUseIndex,
indexName: item.useIndex || item.sureUseIndex || '',
uuid: item.uuid
};
that.showDailog = true;
......@@ -117,6 +129,27 @@ export default {
that.showDailog = false;
that.$refs['ruleForm'].resetFields();
},
download() {
const that = this;
that.loading = true;
let para = { ...this.searchParams };
getRequest('/redis-limiter-web/sql/sql-download', para)
.then(res => {
let resData = res.data;
that.loading = false;
if (resData.errorCode == 1) {
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
})
.finally(_ => (that.loading = false));
},
submitForm() {
const that = this;
let para = { ...this.ruleForm };
......@@ -185,6 +218,18 @@ export default {
message: error.message
});
});
},
copy(value) {
let newInput = document.createElement('input');
newInput.value = value;
document.body.appendChild(newInput);
newInput.select();
document.execCommand('Copy');
newInput.remove();
this.$message({
message: '复制成功',
type: 'success'
});
}
},
mounted() {
......@@ -205,4 +250,17 @@ export default {
color: #303133;
}
}
.ellipsis {
display: inline-block;
width: 80%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.copy.el-icon-copy-document {
cursor: pointer;
&:hover {
color: #2f54ed;
}
}
</style>
......@@ -124,7 +124,7 @@ export default {
*/
toNext(row) {
const that = this;
that.$router.push(`/third?rateId=${row.rateId}&moudleId=${that.$route.query.moudleId}`);
that.$router.push(`/module/third?rateId=${row.rateId}&moudleId=${that.$route.query.moudleId}`);
},
/**
* 弹窗操作
......
......@@ -104,7 +104,7 @@ export default {
*/
toNext(row) {
const that = this;
that.$router.push(`/second?moudleId=${row.moudleId}`);
that.$router.push(`/module/second?moudleId=${row.moudleId}`);
},
/**
* 弹窗操作
......
......@@ -85,7 +85,7 @@ export default {
navpath: [
{
name: '模块',
path: '/index'
path: '/module/first'
},
{
name: '限流',
......@@ -124,7 +124,7 @@ export default {
*/
toNext(row) {
const that = this;
that.$router.push(`/third?rateId=${row.rateId}&moudleId=${that.$route.query.moudleId}`);
that.$router.push(`/module/third?rateId=${row.rateId}&moudleId=${that.$route.query.moudleId}`);
},
/**
* 弹窗操作
......
......@@ -118,11 +118,11 @@ export default {
navpath: [
{
name: '模块',
path: '/index'
path: '/module/first'
},
{
name: '限流',
path: `/second?moudleId=${this.$route.query.moudleId}`
path: `/module/second?moudleId=${this.$route.query.moudleId}`
},
{
name: '企业关系',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment